// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag package manager import ( "bytes" "encoding/json" "strings" "github.com/alecthomas/template" "github.com/swaggo/swag" ) var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{.Description}}", "title": "{{.Title}}", "contact": {}, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/cdn/clusters": { "get": { "description": "List by object", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNCluster" ], "summary": "List cdn clusters", "parameters": [ { "type": "integer", "default": 0, "description": "begin marker of current page", "name": "marker", "in": "query", "required": true }, { "maximum": 50, "minimum": 10, "type": "integer", "default": 10, "description": "return max item count, default 10, max 50", "name": "maxItemCount", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.ListCDNClustersResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "add by json config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNCluster" ], "summary": "Add cdn cluster", "parameters": [ { "description": "Cdn cluster", "name": "cluster", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.CDNCluster" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.CDNCluster" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/cdn/clusters/{id}": { "get": { "description": "Get cdn cluster by ClusterID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNCluster" ], "summary": "Get cdn cluster", "parameters": [ { "type": "string", "description": "ClusterID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.CDNCluster" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "Update by json cdn cluster", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNCluster" ], "summary": "Update cdn cluster", "parameters": [ { "type": "string", "description": "ClusterID", "name": "id", "in": "path", "required": true }, { "description": "CDNCluster", "name": "Cluster", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.CDNCluster" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "delete": { "description": "Delete by clusterId", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNCluster" ], "summary": "Delete cdn cluster", "parameters": [ { "type": "string", "description": "ClusterID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/cdn/instances": { "get": { "description": "List by object", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNInstance" ], "summary": "List cdn instances", "parameters": [ { "type": "integer", "default": 0, "description": "begin marker of current page", "name": "marker", "in": "query", "required": true }, { "maximum": 50, "minimum": 10, "type": "integer", "default": 10, "description": "return max item count, default 10, max 50", "name": "maxItemCount", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.ListCDNInstancesResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "add by json config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNInstance" ], "summary": "Add cdn instance", "parameters": [ { "description": "Cdn instance", "name": "instance", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.CDNInstance" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.CDNInstance" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/cdn/instances/{id}": { "get": { "description": "Get cdn instance by InstanceID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNInstance" ], "summary": "Get cdn instance", "parameters": [ { "type": "string", "description": "InstanceID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.CDNInstance" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "Update by json cdn instance", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNInstance" ], "summary": "Update cdn instance", "parameters": [ { "type": "string", "description": "InstanceID", "name": "id", "in": "path", "required": true }, { "description": "CDNInstance", "name": "Instance", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.CDNInstance" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "delete": { "description": "Delete by instanceId", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "CDNInstance" ], "summary": "Delete cdn instance", "parameters": [ { "type": "string", "description": "InstanceID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/scheduler/clusters": { "get": { "description": "List by object", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerCluster" ], "summary": "List scheduler clusters", "parameters": [ { "type": "integer", "default": 0, "description": "begin marker of current page", "name": "marker", "in": "query", "required": true }, { "maximum": 50, "minimum": 10, "type": "integer", "default": 10, "description": "return max item count, default 10, max 50", "name": "maxItemCount", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.ListSchedulerClustersResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "add by json config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerCluster" ], "summary": "Add scheduler cluster", "parameters": [ { "description": "Scheduler cluster", "name": "cluster", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.SchedulerCluster" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.SchedulerCluster" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/scheduler/clusters/{id}": { "get": { "description": "Get scheduler cluster by ClusterID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerCluster" ], "summary": "Get scheduler cluster", "parameters": [ { "type": "string", "description": "ClusterID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.SchedulerCluster" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "Update by json scheduler cluster", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerCluster" ], "summary": "Update scheduler cluster", "parameters": [ { "type": "string", "description": "ClusterID", "name": "id", "in": "path", "required": true }, { "description": "SchedulerCluster", "name": "Cluster", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.SchedulerCluster" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "delete": { "description": "Delete by clusterId", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerCluster" ], "summary": "Delete scheduler cluster", "parameters": [ { "type": "string", "description": "ClusterID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/scheduler/instances": { "get": { "description": "List by object", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerInstance" ], "summary": "List scheduler instances", "parameters": [ { "type": "integer", "default": 0, "description": "begin marker of current page", "name": "marker", "in": "query", "required": true }, { "maximum": 50, "minimum": 10, "type": "integer", "default": 10, "description": "return max item count, default 10, max 50", "name": "maxItemCount", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.ListSchedulerInstancesResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "add by json config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerInstance" ], "summary": "Add scheduler instance", "parameters": [ { "description": "Scheduler instance", "name": "instance", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.SchedulerInstance" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.SchedulerInstance" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } }, "/scheduler/instances/{id}": { "get": { "description": "Get scheduler instance by InstanceID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerInstance" ], "summary": "Get scheduler instance", "parameters": [ { "type": "string", "description": "InstanceID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/types.SchedulerInstance" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "post": { "description": "Update by json scheduler instance", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerInstance" ], "summary": "Update scheduler instance", "parameters": [ { "type": "string", "description": "InstanceID", "name": "id", "in": "path", "required": true }, { "description": "SchedulerInstance", "name": "Instance", "in": "body", "required": true, "schema": { "$ref": "#/definitions/types.SchedulerInstance" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } }, "delete": { "description": "Delete by instanceId", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "SchedulerInstance" ], "summary": "Delete scheduler instance", "parameters": [ { "type": "string", "description": "InstanceID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handler.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handler.HTTPError" } } } } } }, "definitions": { "handler.HTTPError": { "type": "object", "properties": { "code": { "type": "integer", "example": 400 }, "message": { "type": "string", "example": "status bad request" } } }, "types.CDNCluster": { "type": "object", "required": [ "config" ], "properties": { "cluster_id": { "type": "string" }, "config": { "type": "string" }, "created_at": { "type": "string" }, "creator": { "type": "string" }, "modifier": { "type": "string" }, "updated_at": { "type": "string" }, "version": { "type": "integer" } } }, "types.CDNInstance": { "type": "object", "required": [ "cluster_id", "down_port", "host_name", "idc", "ip", "port", "rpc_port" ], "properties": { "cluster_id": { "type": "string" }, "created_at": { "type": "string" }, "down_port": { "type": "integer" }, "host_name": { "type": "string" }, "idc": { "type": "string" }, "instance_id": { "type": "string" }, "ip": { "type": "string" }, "location": { "type": "string" }, "port": { "type": "integer" }, "rpc_port": { "type": "integer" }, "state": { "type": "string" }, "updated_at": { "type": "string" }, "version": { "type": "integer" } } }, "types.ListCDNClustersResponse": { "type": "object", "properties": { "clusters": { "type": "array", "items": { "$ref": "#/definitions/types.CDNCluster" } } } }, "types.ListCDNInstancesResponse": { "type": "object", "properties": { "instances": { "type": "array", "items": { "$ref": "#/definitions/types.CDNInstance" } } } }, "types.ListSchedulerClustersResponse": { "type": "object", "properties": { "clusters": { "type": "array", "items": { "$ref": "#/definitions/types.SchedulerCluster" } } } }, "types.ListSchedulerInstancesResponse": { "type": "object", "properties": { "instances": { "type": "array", "items": { "$ref": "#/definitions/types.SchedulerInstance" } } } }, "types.SchedulerCluster": { "type": "object", "required": [ "client_config", "config" ], "properties": { "client_config": { "type": "string" }, "cluster_id": { "type": "string" }, "config": { "type": "string" }, "created_at": { "type": "string" }, "creator": { "type": "string" }, "modifier": { "type": "string" }, "updated_at": { "type": "string" }, "version": { "type": "integer" } } }, "types.SchedulerInstance": { "type": "object", "required": [ "cluster_id", "host_name", "idc", "ip", "port", "security_domain" ], "properties": { "cluster_id": { "type": "string" }, "created_at": { "type": "string" }, "host_name": { "type": "string" }, "idc": { "type": "string" }, "instance_id": { "type": "string" }, "ip": { "type": "string" }, "location": { "type": "string" }, "net_config": { "type": "string" }, "port": { "type": "integer" }, "security_domain": { "type": "string" }, "state": { "type": "string" }, "updated_at": { "type": "string" }, "version": { "type": "integer" }, "vips": { "type": "string" } } } } }` type swaggerInfo struct { Version string Host string BasePath string Schemes []string Title string Description string } // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = swaggerInfo{ Version: "", Host: "", BasePath: "", Schemes: []string{}, Title: "", Description: "", } type s struct{} func (s *s) ReadDoc() string { sInfo := SwaggerInfo sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) t, err := template.New("swagger_info").Funcs(template.FuncMap{ "marshal": func(v interface{}) string { a, _ := json.Marshal(v) return string(a) }, }).Parse(doc) if err != nil { return doc } var tpl bytes.Buffer if err := t.Execute(&tpl, sInfo); err != nil { return doc } return tpl.String() } func init() { swag.Register(swag.Name, &s{}) }