交付中心
获取交付中心版本列表
请求
GET /api/aslan/delivery/releases?projectName=<projectName>&workflowName=<workflowName>&taskId=<taskId>&serviceName=<serviceName>
Query
参数名 | 类型 | 描述 | 默认值 | 是否必须 |
---|
projectName | string | 项目标识 | 默认为空,查询所有项目 | optional |
workflowName | string | 工作流的名称 | 默认为空,查询所有工作流 | optional |
taskId | integer | 工作流任务 ID | 默认为空,查询所有 task | optional |
serviceName | string | 服务名称 | 默认为空,查询所有服务 | optional |
正常返回
[
{
"versionInfo": {
"id": "619dbaa8c528c2182225e8d9",
"version": "test",
"productName": "nginx2",
"workflowName": "nginx2-ops-workflow",
"taskId": 1,
"desc": "test",
"labels": [
"test"
],
"productEnvInfo": {
"id": "000000000000000000000000",
"product_name": "nginx2",
"create_time": 0,
"update_time": 0,
"namespace": "nginx2-env-dev",
"status": "",
"revision": 0,
"enabled": false,
"env_name": "dev",
"update_by": "",
"auth": [],
"visibility": "",
"services": [
[
{
"service_name": "nginx",
"product_name": "nginx2",
"type": "k8s",
"revision": 1,
"containers": [
{
"name": "nginx-test",
"image": "koderover.tencentcloudcr.com/koderover-demo/nginx-test:20211116230712-1-master"
}
],
"render": {
"name": "nginx2-env-dev",
"revision": 1,
"product_tmpl": "nginx2",
"description": ""
}
}
]
],
"render": {
"name": "nginx2-env-dev",
"revision": 1,
"product_tmpl": "nginx2",
"description": ""
},
"error": "",
"vars": [
{
"key": "NginxVersion",
"value": "",
"alias": "{{.NginxVersion}}",
"state": "present",
"services": [
"nginx"
]
},
{
"key": "customer",
"value": "",
"alias": "{{.customer}}",
"state": "present",
"services": [
"nginx"
]
}
],
"isPublic": false,
"roleIds": [],
"recycle_day": 0,
"source": "",
"is_opensource": false
},
"createdBy": "admin",
"created_at": 1637726888,
"deleted_at": 0
},
"buildInfo": [],
"deployInfo": [
{
"id": "619dbaa8c528c2182225e8da",
"releaseId": "619dbaa8c528c2182225e8d9",
"serviceName": "nginx/nginx-test",
"containerName": "nginx-test",
"image": "koderover.tencentcloudcr.com/koderover-demo/nginx-test:20211116230712-1-master",
"registry_id": "619dba6ac528c2182225e8d3",
"yamlContents": [
"---\napiVersion: v1\nkind: Service\nmetadata:\n name: nginx3\n labels:\n app: nginx3\n tier: backend\n version: \"\"\nspec:\n type: NodePort\n ports:\n - port: 80\n selector:\n app: nginx3\n tier: backend\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: nginx3\nspec:\n replicas: 1\n selector:\n matchLabels:\n app: nginx3\n tier: backend\n version: \"\"\n template:\n metadata:\n labels:\n app: nginx3\n tier: backend\n version: \"\"\n spec:\n containers:\n - name: nginx-test\n image: koderover.tencentcloudcr.com/koderover-demo/nginx-test:20211116230712-1-master\n ports:\n - containerPort: 80\n volumeMounts:\n - name: static-page\n mountPath: /usr/share/nginx/html\n volumes:\n - name: static-page\n configMap:\n name: static-page\n---\napiVersion: extensions/v1beta1\nkind: Ingress\nmetadata:\n name: nginx-expose\nspec:\n rules:\n - host: dev-nginx-expose.app.8slan.com\n http:\n paths:\n - backend:\n serviceName: nginx\n servicePort: 80\n path: /\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\n name: static-page\n labels:\n app.kubernetes.io/instance: poetry\n app.kubernetes.io/name: poetry-portal-config\ndata:\n index.html: |-\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <title> - Sliding Perspective</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <style>\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n background: #00ff00;\n overflow-y: hidden;\n }\n\n .bounce {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n color: white;\n height: 100%;\n font: normal bold 6rem 'Product Sans', sans-serif;\n white-space: nowrap;\n }\n\n .letter {\n animation: bounce 0.75s cubic-bezier(0.05, 0, 0.2, 1) infinite alternate;\n display: inline-block;\n transform: translate3d(0, 0, 0);\n margin-top: 0.5em;\n text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;\n font: normal 500 6rem 'Varela Round', sans-serif;\n color:#fff;\n color:#1989fa;\n\n }\n\n .letter:nth-of-type(1) {\n animation-delay: -0.083333333s;\n }\n .letter:nth-of-type(3) {\n animation-delay: 0.0833333333s;\n }\n .letter:nth-of-type(4) {\n animation-delay: 0.1666666667s;\n }\n .letter:nth-of-type(5) {\n animation-delay: 0.25s;\n }\n .letter:nth-of-type(6) {\n animation-delay: 0.3333333333s;\n }\n .letter:nth-of-type(7) {\n animation-delay: 0.4166666667s;\n }\n\n @keyframes bounce {\n 0% {\n transform: translate3d(0, 0, 0);\n text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;\n }\n 100% {\n transform: translate3d(0, -1em, 0);\n text-shadow: rgba(255, 255, 255, 0.4) 0 1em 0.35em;\n }\n }\n </style>\n </head>\n <body>\n <div class=\"bounce\">\n <span class=\"letter\">K</span><span class=\"letter\"></span><span class=\"letter\">o</span><span class=\"letter\">d</span><span class=\"letter\">e</span><span class=\"letter\">R</span\n ><span class=\"letter\">o</span><span class=\"letter\">v</span><span class=\"letter\">e</span><span class=\"letter\">r</span>\n </div>\n </body>\n </html>\n"
],
"envs": [],
"orderedServices": [
[
"nginx"
]
],
"start_time": 1637726884,
"end_time": 1637726888,
"created_at": 1637726888,
"deleted_at": 0
}
],
"testInfo": [],
"distributeInfo": [],
"securityStatsInfo": []
}
]
错误返回
{
"code": 400,
"description": "strconv.Atoi: parsing \"invalidTaskId\": invalid syntax",
"extra": {},
"message": "Bad Request",
"type": "error"
}
获取交付物追踪信息
请求
GET /api/directory/dc/artifact?image=<image>
Query
参数名 | 类型 | 描述 | 默认值 | 是否必须 |
---|
image | string | 镜像名称 | 无 | must |
正常返回
{
"id": "61b84bbcc19ba8cdb184cc53",
"name": "picket",
"type": "image",
"source": "workflow",
"image": "koderover.tencentcloudcr.com/koderover-demo/picket:20211214154446-70-main-pr-736",
"image_tag": "20211214154446-70-main-pr-736",
"image_digest": "sha256:1d9ddf94feb5ff9ca9d76248ad51dd2a95210895d0dbf1e87bd66cc471c41f0e",
"image_size": 22578466,
"architecture": "amd64",
"os": "linux",
"created_by": "user1",
"created_time": 1639467962,
"activities": [
{
"artifact_id": "61b84bbcc19ba8cdb184cc53",
"type": "build",
"url": "/v1/projects/detail/zadig/pipelines/multi/dev2/70",
"commits": [
{
"address": "https://github.com",
"source": "github",
"repo_owner": "koderover",
"repo_name": "zadig",
"branch": "main",
"pr": 736,
"commit_id": "4b15c43b012e7a4a901fdcfe33736ad1c3b53f48",
"commit_message": "test",
"author_name": "user1"
}
],
"start_time": 1639467890,
"end_time": 1639467944,
"created_by": "user1",
"created_time": 1639467964
}
],
"sortedActivities": {
"build": [
{
"artifact_id": "61b84bbcc19ba8cdb184cc53",
"type": "build",
"url": "/v1/projects/detail/zadig/pipelines/multi/dev2/70",
"commits": [
{
"address": "https://github.com",
"source": "github",
"repo_owner": "koderover",
"repo_name": "zadig",
"branch": "main",
"pr": 736,
"commit_id": "4b15c43b012e7a4a901fdcfe33736ad1c3b53f48",
"commit_message": "test",
"author_name": "user1"
}
],
"start_time": 1639467890,
"end_time": 1639467944,
"created_by": "user1",
"created_time": 1639467964
}
]
}
}