获取交付中心版本列表
请求
GET /api/directory/dc/releases?productName=<productName>&workflowName=<workflowName>&taskId=<taskId>&perPage=<perPage>&page=<page>
Query
参数名 | 类型 | 描述 | 默认值 | 是否必须 |
---|
productName | string | 产品名称 | 为空时查询所有项目 | optional |
workflowName | string | 工作流的名称 | 为空时查询所有工作流 | optional |
taskId | integer | 工作流任务ID | 0,为0时查询所有task | optional |
perPage | integer | 分页大小 | 20 | optional |
page | integer | 分页index | 1 | optional |
正常返回
[{
"versionInfo": {
"id": "5d357d6c953ff70001b63678",
"version": "v0.1.4",
"orgId": 1,
"productName": "koderover-sample",
"workflowName": "koderover-sample",
"taskId": 53,
"desc": "",
"createdBy": "koderover",
"labels": [],
"productEnvInfo": {
"id": "",
"product_name": "koderover-sample",
"create_time": 0,
"update_time": 0,
"status": "",
"revision": 0,
"enabled": false,
"env_name": "dev",
"update_by": "",
"auth": [],
"visibility": "",
"enable_stcov": false,
"services": [
[{
"service_name": "nginx-sample",
"type": "k8s",
"revision": 7,
"containers": [{
"name": "nginx-sample",
"image": "docker-registy.example.com/customerdockernamespace/nginx-sample:20190710164653-50-master"
}],
"render": {
"name": "koderover-dev-koderover-sample",
"revision": 4,
"product_tmpl": "koderover-sample",
"description": ""
}
}],
[{
"service_name": "http",
"type": "k8s",
"revision": 1,
"containers": [{
"name": "nginx",
"image": "docker-registy.example.com/customerdockernamespace/nginx:20190722170829-53-master"
}],
"render": {
"name": "koderover-dev-koderover-sample",
"revision": 4,
"product_tmpl": "koderover-sample",
"description": ""
}
}]
],
"render": {
"name": "koderover-dev-koderover-sample",
"revision": 4,
"product_tmpl": "koderover-sample",
"description": ""
},
"error": "",
"vars": [{
"key": "nginxVersion",
"value": "1.5.0",
"alias": "{{.nginxVersion}}",
"state": "present",
"services": ["nginx-sample", "http"]
}],
"isPublic": false,
"roleIds": [],
"recycle_day": 0
},
"created_at": 1563786604,
"deleted_at": 0
},
"buildInfo": [{
"id": "5d357d6c953ff70001b63679",
"releaseId": "5d357d6c953ff70001b63678",
"serviceName": "nginx",
"imageInfo": {
"repoName": "customerdockernamespace/nginx",
"tagName": "20190722170829-53-master",
"imageSize": 44608016,
"imageDigest": "sha256:47b3acc3426fe07850974e63f16d11b02ffbf3bce8737e865608cea70937b762",
"author": "",
"architecture": "amd64",
"dockerVersion": "17.06.2-ce",
"os": "linux",
"creationTime": "2019-07-22 17:08:57 +0800 CST",
"updateTime": "2019-07-22 17:09:00 +0800 CST"
},
"imageName": "regist/customerdockernamespace/nginx:20190722170829-53-master",
"packageInfo": null,
"issues": [],
"commits": [{
"source": "gitlab",
"repo_owner": "customer-waimai",
"repo_name": "customer-o2o-shop",
"remote_name": "origin",
"branch": "master",
"commit_id": "7d9b1df316773d33ef7799008267f2b7ae16f6ba",
"is_primary": false,
"codehost_id": 24,
"oauth_token": "******",
"address": "http://172.16.3.240"
}],
"start_time": 1563786512,
"end_time": 1563786536,
"created_at": 1563786605,
"deleted_at": 0
}],
"deployInfo": [{
"id": "5d357d6d953ff70001b6367a",
"releaseId": "5d357d6c953ff70001b63678",
"serviceName": "http",
"containerName": "nginx",
"yamlContents": ["apiVersion: v1\nkind: Service\nmetadata:\n name: nginx\n labels:\n app: nginx\n tier: backend\n version: \"1.5.0\"\nspec:\n type: NodePort\n ports:\n # the port that this service should serve on\n - port: 80\n selector:\n app: nginx\n tier: backend\n---\napiVersion: extensions/v1beta1\nkind: Deployment\nmetadata:\n name: nginx\nspec:\n # modify it according to your case\n replicas: 2\n template:\n metadata:\n labels:\n app: nginx\n tier: backend\n version: \"1.5.0\"\n spec:\n containers:\n - name: nginx\n image: docker-registy.example.com/customerdockernamespace/nginx:20190722170829-53-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 \n---\napiVersion: extensions/v1beta1\nkind: Ingress\nmetadata:\n name: nginx-expose\nspec:\n rules:\n - host: dev-nginx-expose.app.example.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 \u003c!DOCTYPE html\u003e\n \u003chtml lang=\"en\"\u003e\n \u003chead\u003e\n \u003cmeta charset=\"UTF-8\"\u003e\n \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"\u003e\n \u003ctitle\u003eThis is an example site\u003c/title\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eService is running: namesapce=koderover-dev-koderover-sample envName=dev product=koderover-sample service=http\u003c/h1\u003e\n \u003cp\u003e\n Contact \u003ca href=\"mailto:support@koderover.com\"\u003esupport@koderover.com\u003c/a\u003e for more information\n \u003c/p\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n"],
"envs": [],
"orderedServices": [
["nginx-sample"],
["http"]
],
"start_time": 1563786536,
"end_time": 1563786542,
"created_at": 1563786605,
"deleted_at": 0
}],
"testInfo": [{
"id": "5d357d6d953ff70001b6367b",
"releaseId": "5d357d6c953ff70001b63678",
"testReports": [{
"testResultPath": "service_automation/report",
"workflowName": "koderover-sample",
"taskId": 53,
"testName": "service_automation_service_sample",
"testSuite": {
"tests": 0,
"failures": 0,
"skips": 0,
"errors": 0,
"time": 17.801,
"testcase": []
},
"performanceTestSuite": [],
"start_time": 1563786542,
"end_time": 1563786563
}],
"created_at": 1563786605,
"deleted_at": 0
}],
"distributeInfo": [{
"id": "5d357d6d953ff70001b6367c",
"releaseId": "5d357d6c953ff70001b63678",
"serviceName": "nginx",
"distributeType": "image",
"registryName": "docker-registy.example.com/customer-service-prod/nginx:20190722170829-53-master",
"namespace": "customer-service-prod",
"packageFile": "",
"remoteFileKey": "",
"destStorageUrl": "",
"srcStorageUrl": "",
"start_time": 1563786569,
"end_time": 1563786579,
"created_at": 1563786605,
"deleted_at": 0
}],
"securityStatsInfo": [{
"imageName": "docker-registy.example.com/customerdockernamespace/nginx:20190722170829-53-master",
"imageId": "47b3acc3426fe07850974e63f16d11b02ffbf3bce8737e865608cea70937b762",
"deliverySecurityStatsInfo": {
"total": 325,
"unkown": 0,
"negligible": 106,
"low": 45,
"medium": 112,
"high": 62,
"critical": 0
}
}]
}]
错误返回
{
"resultCode":400,"errorMsg":"taskId must be Integer!"
}