632 lines
16 KiB
JSON
632 lines
16 KiB
JSON
{
|
||
"swagger": "2.0",
|
||
"info": {
|
||
"title": "CNB OPENAPI",
|
||
"contact": {
|
||
"name": "Open API Support",
|
||
"url": "https://docs.cnb.cool/",
|
||
"email": "cnb@tencent.com"
|
||
},
|
||
"version": "1.0"
|
||
},
|
||
"paths": {
|
||
"/{mission}": {
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "删除指定任务集。Delete the specified mission.",
|
||
"operationId": "DeleteMission",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "mission path",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "微信身份验证票据,首次请求不传会返回新票据。WeChat auth ticket, will return new ticket if not provided in first request.",
|
||
"name": "x-cnb-identity-ticket",
|
||
"in": "header"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-delete:rw"
|
||
}
|
||
},
|
||
"/{mission}/-/mission/view": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "查询任务集视图配置信息。Get mission view config.",
|
||
"operationId": "GetMissionViewConfig",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Mission slug",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "View ID",
|
||
"name": "id",
|
||
"in": "query",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.MissionViewConfig"
|
||
}
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:r"
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "设置任务集视图配置信息。Set mission view config.",
|
||
"operationId": "PostMissionViewConfig",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Mission slug",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Params",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.MissionViewConfig"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
|
||
}
|
||
},
|
||
"/{mission}/-/mission/view-list": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "获取任务集视图列表。Get view list of a mission.",
|
||
"operationId": "GetMissionViewList",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "mission",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.MissionView"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:r"
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "添加、修改任务集视图。Update a mission view or add a new one.",
|
||
"operationId": "PutMissionViewList",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Mission slug",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Params",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.MissionView"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "排序任务集视图。Sort mission view list.",
|
||
"operationId": "PostMissionViewList",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Mission slug",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Params",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.MissionPostViewReq"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
|
||
}
|
||
},
|
||
"/{mission}/-/settings/set_visibility": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "改变任务集可见性。Update the visibility of a mission.",
|
||
"operationId": "SetMissionVisibility",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "mission path",
|
||
"name": "mission",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"enum": [
|
||
"Private",
|
||
"Public"
|
||
],
|
||
"type": "string",
|
||
"description": "任务集可见性",
|
||
"name": "visibility",
|
||
"in": "query",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
|
||
}
|
||
},
|
||
"/{slug}/-/missions": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "查询组织下面用户有权限查看到的任务集。Query all missions that the user has permission to see under the specific organization.",
|
||
"operationId": "GetGroupSubMissions",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "组织 slug",
|
||
"name": "slug",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"default": 1,
|
||
"description": "页码",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"default": 10,
|
||
"description": "每页数量",
|
||
"name": "page_size",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"enum": [
|
||
"private",
|
||
"public"
|
||
],
|
||
"type": "string",
|
||
"description": "任务集类型",
|
||
"name": "filter_type",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"enum": [
|
||
"created_at",
|
||
"name"
|
||
],
|
||
"type": "string",
|
||
"description": "排序类型,默认created_at",
|
||
"name": "order_by",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"default": false,
|
||
"description": "排序顺序",
|
||
"name": "desc",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"enum": [
|
||
"all",
|
||
"sub",
|
||
"grand"
|
||
],
|
||
"type": "string",
|
||
"description": "查全部/查询直接属于当前组织的仓库/查询子组织的仓库",
|
||
"name": "descendant",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "搜索关键字",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.Missions4User"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \ngroup-resource:r"
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/vnd.cnb.api+json"
|
||
],
|
||
"tags": [
|
||
"Missions"
|
||
],
|
||
"summary": "创建任务集。Create a mission.",
|
||
"operationId": "CreateMission",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Group slug",
|
||
"name": "slug",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "mission information",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.CreateMissionReq"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created"
|
||
}
|
||
},
|
||
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \ngroup-resource:rw"
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"dto.MissionViewConfig": {
|
||
"type": "object",
|
||
"properties": {
|
||
"fields": {
|
||
"description": "字段配置",
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.MissionViewFieldConfig"
|
||
}
|
||
},
|
||
"group": {
|
||
"description": "分组信息",
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/dto.MissionViewGroup"
|
||
}
|
||
]
|
||
},
|
||
"id": {
|
||
"description": "视图唯一标识",
|
||
"type": "string"
|
||
},
|
||
"selectors": {
|
||
"description": "筛选条件",
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.MissionViewSelector"
|
||
}
|
||
},
|
||
"sorts": {
|
||
"description": "排序条件",
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.MissionViewSort"
|
||
}
|
||
},
|
||
"type": {
|
||
"description": "视图类型",
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/dto.MissionViewType"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"dto.MissionView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"$ref": "#/definitions/dto.MissionViewType"
|
||
}
|
||
}
|
||
},
|
||
"dto.MissionPostViewReq": {
|
||
"type": "object",
|
||
"properties": {
|
||
"ids": {
|
||
"description": "视图唯一标识列表,按此顺序排序",
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"dto.Missions4User": {
|
||
"type": "object",
|
||
"properties": {
|
||
"access": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/constant.AccessRole"
|
||
}
|
||
],
|
||
"readOnly": true
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"freeze": {
|
||
"type": "boolean",
|
||
"readOnly": true
|
||
},
|
||
"id": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"path": {
|
||
"type": "string"
|
||
},
|
||
"pinned": {
|
||
"type": "boolean"
|
||
},
|
||
"pinned_time": {
|
||
"type": "string"
|
||
},
|
||
"star_time": {
|
||
"type": "string"
|
||
},
|
||
"stared": {
|
||
"type": "boolean"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"visibility_level": {
|
||
"$ref": "#/definitions/constant.Visibility"
|
||
}
|
||
}
|
||
},
|
||
"dto.CreateMissionReq": {
|
||
"type": "object",
|
||
"properties": {
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"repos": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"visibility": {
|
||
"type": "string",
|
||
"default": "public",
|
||
"enum": [
|
||
"public",
|
||
"private"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"dto.MissionViewType": {
|
||
"type": "string",
|
||
"enum": [
|
||
"table",
|
||
"board",
|
||
"gantt"
|
||
],
|
||
"x-enum-varnames": [
|
||
"MissionViewTypeTable",
|
||
"MissionViewTypeBoard",
|
||
"MissionViewTypeGantt"
|
||
]
|
||
},
|
||
"constant.Visibility": {
|
||
"type": "string",
|
||
"enum": [
|
||
"Private",
|
||
"Public",
|
||
"Secret"
|
||
],
|
||
"x-enum-comments": {
|
||
"VisibilityPrivate": "VisibilityPrivate 私有仓库 - 仓库的访问必须显式授予每个用户",
|
||
"VisibilityPublic": "VisibilityPublic 公共仓库 - 可以不经任何身份验证克隆该项目",
|
||
"VisibilitySecret": "VisibilitySecret 加密仓库 - 仓库特定角色身份才能读取解密"
|
||
},
|
||
"x-enum-descriptions": [
|
||
"VisibilityPrivate 私有仓库 - 仓库的访问必须显式授予每个用户",
|
||
"VisibilityPublic 公共仓库 - 可以不经任何身份验证克隆该项目",
|
||
"VisibilitySecret 加密仓库 - 仓库特定角色身份才能读取解密"
|
||
],
|
||
"x-enum-varnames": [
|
||
"VisibilityPrivate",
|
||
"VisibilityPublic",
|
||
"VisibilitySecret"
|
||
]
|
||
}
|
||
}
|
||
} |