{ "swagger": "2.0", "info": { "title": "Linux Do CDK", "contact": {}, "version": "0.1.0" }, "paths": { "/api/v1/health": { "get": { "produces": [ "application/json" ], "tags": [ "health" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/health.HealthResponse" } } } } }, "/api/v1/oauth/callback": { "post": { "produces": [ "application/json" ], "tags": [ "oauth" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth.CallbackRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.CallbackResponse" } } } } }, "/api/v1/oauth/login": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.GetLoginURLResponse" } } } } }, "/api/v1/oauth/logout": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.LogoutResponse" } } } } }, "/api/v1/oauth/user-info": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.UserInfoResponse" } } } } }, "/api/v1/project": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "description": "项目信息", "name": "project", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project.CreateProjectRequestBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } } }, "/api/v1/project/{id}": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "description": "项目信息", "name": "project", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project.UpdateProjectRequestBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } } } }, "definitions": { "health.HealthResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "oauth.BasicUserInfo": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "id": { "type": "integer" }, "nickname": { "type": "string" }, "trust_level": { "$ref": "#/definitions/oauth.TrustLevel" }, "username": { "type": "string" } } }, "oauth.CallbackRequest": { "type": "object", "properties": { "code": { "type": "string" }, "state": { "type": "string" } } }, "oauth.CallbackResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "oauth.GetLoginURLResponse": { "type": "object", "properties": { "data": { "type": "string" }, "error_msg": { "type": "string" } } }, "oauth.LogoutResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "oauth.TrustLevel": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "x-enum-varnames": [ "TrustLevelNewUser", "TrustLevelBasicUser", "TrustLevelUser", "TrustLevelActiveUser", "TrustLevelLeader" ] }, "oauth.UserInfoResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" }, "error_msg": { "type": "string" } } }, "project.CreateProjectRequestBody": { "type": "object", "required": [ "end_time", "name", "project_items", "start_time" ], "properties": { "allow_same_ip": { "type": "boolean" }, "description": { "type": "string", "maxLength": 1024 }, "distribution_type": { "enum": [ 0, 1 ], "allOf": [ { "$ref": "#/definitions/project.DistributionType" } ] }, "end_time": { "type": "string" }, "minimum_trust_level": { "enum": [ 0, 1, 2, 3, 4 ], "allOf": [ { "$ref": "#/definitions/oauth.TrustLevel" } ] }, "name": { "type": "string", "maxLength": 32, "minLength": 1 }, "project_items": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "project_tags": { "type": "array", "items": { "type": "string" } }, "risk_level": { "type": "integer", "maximum": 100, "minimum": 0 }, "start_time": { "type": "string" } } }, "project.DistributionType": { "type": "integer", "enum": [ 0, 1 ], "x-enum-varnames": [ "DistributionTypeOneForEach", "DistributionTypeInvite" ] }, "project.ProjectResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "project.UpdateProjectRequestBody": { "type": "object", "required": [ "end_time", "name", "start_time" ], "properties": { "allow_same_ip": { "type": "boolean" }, "description": { "type": "string", "maxLength": 1024 }, "end_time": { "type": "string" }, "minimum_trust_level": { "enum": [ 0, 1, 2, 3, 4 ], "allOf": [ { "$ref": "#/definitions/oauth.TrustLevel" } ] }, "name": { "type": "string", "maxLength": 32, "minLength": 1 }, "project_items": { "type": "array", "items": { "type": "string" } }, "project_tags": { "type": "array", "items": { "type": "string" } }, "risk_level": { "type": "integer", "maximum": 100, "minimum": 0 }, "start_time": { "type": "string" } } } } }