[REV] Update service check routers

This commit is contained in:
pujielan 2018-01-22 18:08:31 +08:00
parent 247018bbcb
commit eef60dd80b
3 changed files with 68 additions and 68 deletions

View File

@ -1368,72 +1368,6 @@
}
}
},
"/v2/tenants/servicecheck": {
"post": {
"description": "service check",
"consumes": [
"application/json",
"application/x-protobuf"
],
"produces": [
"application/json",
"application/xml"
],
"tags": [
"v2"
],
"summary": "应用构建源检测支持docker run ,docker compose, source code",
"operationId": "serviceCheck",
"parameters": [
{
"type": "string",
"x-go-name": "TenantName",
"name": "tenant_name",
"in": "path",
"required": true
},
{
"name": "Body",
"in": "body",
"schema": {
"type": "object",
"required": [
"source_type",
"source_body"
],
"properties": {
"TenantID": {
"type": "string"
},
"source_body": {
"description": "检测来源定义,\n代码 https://github.com/shurcooL/githubql.git master\ndocker-run: docker run --name xxx nginx:latest nginx\ndocker-compose: compose全文\nin: body",
"type": "string",
"x-go-name": "SourceBody"
},
"source_type": {
"description": "检测来源类型\nin: body",
"type": "string",
"x-go-name": "SourceType"
},
"uuid": {
"description": "uuid\nin: body",
"type": "string",
"x-go-name": "CheckUUID"
}
}
}
}
],
"responses": {
"default": {
"description": "统一返回格式",
"schema": {
"$ref": "#/responses/commandResponse"
}
}
}
}
},
"/v2/tenants/{tenant_name}/cloud-share": {
"post": {
"description": "share cloud",
@ -2247,6 +2181,72 @@
}
}
},
"/v2/tenants/{tenant_name}/servicecheck": {
"post": {
"description": "service check",
"consumes": [
"application/json",
"application/x-protobuf"
],
"produces": [
"application/json",
"application/xml"
],
"tags": [
"v2"
],
"summary": "应用构建源检测支持docker run ,docker compose, source code",
"operationId": "serviceCheck",
"parameters": [
{
"type": "string",
"x-go-name": "TenantName",
"name": "tenant_name",
"in": "path",
"required": true
},
{
"name": "Body",
"in": "body",
"schema": {
"type": "object",
"required": [
"source_type",
"source_body"
],
"properties": {
"TenantID": {
"type": "string"
},
"source_body": {
"description": "检测来源定义,\n代码 https://github.com/shurcooL/githubql.git master\ndocker-run: docker run --name xxx nginx:latest nginx\ndocker-compose: compose全文\nin: body",
"type": "string",
"x-go-name": "SourceBody"
},
"source_type": {
"description": "检测来源类型\nin: body",
"type": "string",
"x-go-name": "SourceType"
},
"uuid": {
"description": "uuid\nin: body",
"type": "string",
"x-go-name": "CheckUUID"
}
}
}
}
],
"responses": {
"default": {
"description": "统一返回格式",
"schema": {
"$ref": "#/responses/commandResponse"
}
}
}
}
},
"/v2/tenants/{tenant_name}/services": {
"get": {
"description": "get services info in tenant",

View File

@ -49,7 +49,6 @@ func (v2 *V2) tenantRouter() chi.Router {
r := chi.NewRouter()
r.Post("/", controller.GetManager().Tenant)
r.Mount("/{tenant_name}", v2.tenantNameRouter())
r.Post("/servicecheck", controller.Check)
return r
}
@ -64,6 +63,7 @@ func (v2 *V2) tenantNameRouter() chi.Router {
r.Get("/protocols", controller.GetManager().GetSupportProtocols)
//代码检测
r.Post("/code-check", controller.GetManager().CheckCode)
r.Post("/servicecheck", controller.Check)
r.Post("/cloud-share", controller.GetManager().ShareCloud)
r.Get("/resources", controller.GetManager().SingleTenantResources)
r.Get("/certificates", controller.GetManager().Entrance)

View File

@ -28,7 +28,7 @@ import (
)
//Check service check
// swagger:operation POST /v2/tenants/servicecheck v2 serviceCheck
// swagger:operation POST /v2/tenants/{tenant_name}/servicecheck v2 serviceCheck
//
// 应用构建源检测支持docker run ,docker compose, source code
//