获取交付中心版本列表

请求

  1. GET /api/directory/dc/releases?productName=<productName>&workflowName=<workflowName>&taskId=<taskId>&perPage=<perPage>&page=<page>

Query

参数名类型描述默认值是否必须
productNamestring产品名称为空时查询所有项目optional
workflowNamestring工作流的名称为空时查询所有工作流optional
taskIdinteger工作流任务ID0,为0时查询所有taskoptional
perPageinteger分页大小20optional
pageinteger分页index1optional

正常返回

  1. [{
  2. "versionInfo": {
  3. "id": "5d357d6c953ff70001b63678",
  4. "version": "v0.1.4",
  5. "orgId": 1,
  6. "productName": "koderover-sample",
  7. "workflowName": "koderover-sample",
  8. "taskId": 53,
  9. "desc": "",
  10. "createdBy": "koderover",
  11. "labels": [],
  12. "productEnvInfo": {
  13. "id": "",
  14. "product_name": "koderover-sample",
  15. "create_time": 0,
  16. "update_time": 0,
  17. "status": "",
  18. "revision": 0,
  19. "enabled": false,
  20. "env_name": "dev",
  21. "update_by": "",
  22. "auth": [],
  23. "visibility": "",
  24. "enable_stcov": false,
  25. "services": [
  26. [{
  27. "service_name": "nginx-sample",
  28. "type": "k8s",
  29. "revision": 7,
  30. "containers": [{
  31. "name": "nginx-sample",
  32. "image": "docker-registy.example.com/customerdockernamespace/nginx-sample:20190710164653-50-master"
  33. }],
  34. "render": {
  35. "name": "koderover-dev-koderover-sample",
  36. "revision": 4,
  37. "product_tmpl": "koderover-sample",
  38. "description": ""
  39. }
  40. }],
  41. [{
  42. "service_name": "http",
  43. "type": "k8s",
  44. "revision": 1,
  45. "containers": [{
  46. "name": "nginx",
  47. "image": "docker-registy.example.com/customerdockernamespace/nginx:20190722170829-53-master"
  48. }],
  49. "render": {
  50. "name": "koderover-dev-koderover-sample",
  51. "revision": 4,
  52. "product_tmpl": "koderover-sample",
  53. "description": ""
  54. }
  55. }]
  56. ],
  57. "render": {
  58. "name": "koderover-dev-koderover-sample",
  59. "revision": 4,
  60. "product_tmpl": "koderover-sample",
  61. "description": ""
  62. },
  63. "error": "",
  64. "vars": [{
  65. "key": "nginxVersion",
  66. "value": "1.5.0",
  67. "alias": "{{.nginxVersion}}",
  68. "state": "present",
  69. "services": ["nginx-sample", "http"]
  70. }],
  71. "isPublic": false,
  72. "roleIds": [],
  73. "recycle_day": 0
  74. },
  75. "created_at": 1563786604,
  76. "deleted_at": 0
  77. },
  78. "buildInfo": [{
  79. "id": "5d357d6c953ff70001b63679",
  80. "releaseId": "5d357d6c953ff70001b63678",
  81. "serviceName": "nginx",
  82. "imageInfo": {
  83. "repoName": "customerdockernamespace/nginx",
  84. "tagName": "20190722170829-53-master",
  85. "imageSize": 44608016,
  86. "imageDigest": "sha256:47b3acc3426fe07850974e63f16d11b02ffbf3bce8737e865608cea70937b762",
  87. "author": "",
  88. "architecture": "amd64",
  89. "dockerVersion": "17.06.2-ce",
  90. "os": "linux",
  91. "creationTime": "2019-07-22 17:08:57 +0800 CST",
  92. "updateTime": "2019-07-22 17:09:00 +0800 CST"
  93. },
  94. "imageName": "regist/customerdockernamespace/nginx:20190722170829-53-master",
  95. "packageInfo": null,
  96. "issues": [],
  97. "commits": [{
  98. "source": "gitlab",
  99. "repo_owner": "customer-waimai",
  100. "repo_name": "customer-o2o-shop",
  101. "remote_name": "origin",
  102. "branch": "master",
  103. "commit_id": "7d9b1df316773d33ef7799008267f2b7ae16f6ba",
  104. "is_primary": false,
  105. "codehost_id": 24,
  106. "oauth_token": "******",
  107. "address": "http://172.16.3.240"
  108. }],
  109. "start_time": 1563786512,
  110. "end_time": 1563786536,
  111. "created_at": 1563786605,
  112. "deleted_at": 0
  113. }],
  114. "deployInfo": [{
  115. "id": "5d357d6d953ff70001b6367a",
  116. "releaseId": "5d357d6c953ff70001b63678",
  117. "serviceName": "http",
  118. "containerName": "nginx",
  119. "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"],
  120. "envs": [],
  121. "orderedServices": [
  122. ["nginx-sample"],
  123. ["http"]
  124. ],
  125. "start_time": 1563786536,
  126. "end_time": 1563786542,
  127. "created_at": 1563786605,
  128. "deleted_at": 0
  129. }],
  130. "testInfo": [{
  131. "id": "5d357d6d953ff70001b6367b",
  132. "releaseId": "5d357d6c953ff70001b63678",
  133. "testReports": [{
  134. "testResultPath": "service_automation/report",
  135. "workflowName": "koderover-sample",
  136. "taskId": 53,
  137. "testName": "service_automation_service_sample",
  138. "testSuite": {
  139. "tests": 0,
  140. "failures": 0,
  141. "skips": 0,
  142. "errors": 0,
  143. "time": 17.801,
  144. "testcase": []
  145. },
  146. "performanceTestSuite": [],
  147. "start_time": 1563786542,
  148. "end_time": 1563786563
  149. }],
  150. "created_at": 1563786605,
  151. "deleted_at": 0
  152. }],
  153. "distributeInfo": [{
  154. "id": "5d357d6d953ff70001b6367c",
  155. "releaseId": "5d357d6c953ff70001b63678",
  156. "serviceName": "nginx",
  157. "distributeType": "image",
  158. "registryName": "docker-registy.example.com/customer-service-prod/nginx:20190722170829-53-master",
  159. "namespace": "customer-service-prod",
  160. "packageFile": "",
  161. "remoteFileKey": "",
  162. "destStorageUrl": "",
  163. "srcStorageUrl": "",
  164. "start_time": 1563786569,
  165. "end_time": 1563786579,
  166. "created_at": 1563786605,
  167. "deleted_at": 0
  168. }],
  169. "securityStatsInfo": [{
  170. "imageName": "docker-registy.example.com/customerdockernamespace/nginx:20190722170829-53-master",
  171. "imageId": "47b3acc3426fe07850974e63f16d11b02ffbf3bce8737e865608cea70937b762",
  172. "deliverySecurityStatsInfo": {
  173. "total": 325,
  174. "unkown": 0,
  175. "negligible": 106,
  176. "low": 45,
  177. "medium": 112,
  178. "high": 62,
  179. "critical": 0
  180. }
  181. }]
  182. }]

错误返回

  1. {
  2. "resultCode":400,"errorMsg":"taskId must be Integer!"
  3. }