版本管理

列出版本

请求

  1. GET /openapi/delivery/releases?projectKey=<projectKey>&pageNum=<pageNum>&pageSize=<pageSize>

Query 参数说明

参数名类型描述必填
projectKeystring项目标识
pageNumint指定页数
pageSizeint每页数量

成功返回说明

参数名类型描述
list[]DeliveryVersionInfo版本列表
totalint版本总数

DeliveryVersionInfo 参数说明

参数名类型说明
idstring版本ID
version_namestring版本名称
typestring类型,K8SYaml 或 HelmChart
statusstring状态,success、failed、creating、retrying
labels[]string标签
descriptionstring描述
progressDeliveryVersionProgress进度,仅在获取版本详情接口中返回该数据
created_bystring创建人
created_timeint64创建时间

DeliveryVersionProgress 参数说明

参数名类型说明
success_countint成功数量
total_countint总数
upload_statusstring上传状态,success、failed、waiting、uploading
errorstring错误信息

成功返回示例

点击查看

  1. {
  2. "list": [
  3. {
  4. "id": "66287b110b8b8a631910f5ae",
  5. "version_name": "v13",
  6. "type": "K8SYaml",
  7. "status": "success",
  8. "labels": [],
  9. "description": "labore id amet",
  10. "progress": null,
  11. "created_by": "patrick",
  12. "create_time": 1713928977
  13. },
  14. {
  15. "id": "662751047ac26dae6a3a1472",
  16. "version_name": "v12",
  17. "type": "K8SYaml",
  18. "status": "failed",
  19. "labels": [],
  20. "description": "labore id amet",
  21. "progress": null,
  22. "created_by": "patrick",
  23. "create_time": 1713852676
  24. }
  25. ],
  26. "total": 12
  27. }

获取版本详情

请求

  1. GET /openapi/delivery/releases/:id

路径参数说明

参数名类型描述必填
idstring版本ID

成功返回说明

参数名说类型明
version_infoDeliveryVersionInfo版本详情
deploy_infos[]DeliveryDeployInfoK8s 交付物详情,仅当 type 为 K8SYaml 时使用
distribute_infos[]DeliveryDistributeInfoHelm 交付物详情,仅当 type 为 HelmChart 时使用

DeliveryDeployInfo 参数说明

参数名类型说明
idstringK8s 交付物 ID
service_namestring服务名称
service_modulestring服务组件名称
imagestring完整镜像地址
image_namestring镜像名称
registry_idstring镜像仓库 ID
created_timeint64创建时间

DeliveryDistributeInfo 参数说明

参数名类型说明
idstringHelm 交付物 ID
service_namestring服务名称
distribute_typestring交付物类型,chart 或 image
chart_namestringChart 名称,仅当 distribute_type 为 chart 时使用
chart_repo_namestringChart 仓库名称,仅当 distribute_type 为 chart 时使用
chart_versionstringChart 版本,仅当 distribute_type 为 chart 时使用
service_modulestring服务组件名称,仅当 distribute_type 为 image 时使用
imagestring完整镜像地址,仅当 distribute_type 为 image 时使用
image_namestring镜像名称,仅当 distribute_type 为 image 时使用
namespacestring镜像仓库 namespace,仅当 distribute_type 为 image 时使用
created_timeint64创建时间
sub_distributesDeliveryDistributeInfo子交付物,通常只嵌套一层,父交付物为 chart 类型,子交付物为 image 类型

成功返回示例

K8s YAML 项目

点击查看

  1. {
  2. "version_info": {
  3. "id": "66287b110b8b8a631910f5ae",
  4. "version_name": "v13",
  5. "type": "K8SYaml",
  6. "status": "success",
  7. "labels": [
  8. "cupidatat ullamco anim eiusmod"
  9. ],
  10. "description": "labore id amet",
  11. "progress": {
  12. "success_count": 2,
  13. "total_count": 2,
  14. "upload_status": "success",
  15. "error": ""
  16. },
  17. "created_by": "patrick",
  18. "create_time": 1713928977
  19. },
  20. "deploy_infos": [
  21. {
  22. "id": "66287b110b8b8a631910f5af",
  23. "service_name": "service1",
  24. "service_module": "service1",
  25. "image": "koderover.tencentcloudcr.com/test/service1:20240419133934-5-main",
  26. "image_name": "service1",
  27. "registry_id": "62ce6231e0281143de477e60",
  28. "create_time": 1713928977
  29. },
  30. {
  31. "id": "66287b110b8b8a631910f5b0",
  32. "service_name": "service2",
  33. "service_module": "service2",
  34. "image": "koderover.tencentcloudcr.com/test/service2:20240419133934-5-main",
  35. "image_name": "service2",
  36. "registry_id": "62ce6231e0281143de477e60",
  37. "create_time": 1713928977
  38. }
  39. ],
  40. "distribute_infos": []
  41. }

Helm Chart 项目

点击查看

  1. {
  2. "version_info": {
  3. "id": "66287c000b8b8a631910f5b8",
  4. "version_name": "v4",
  5. "type": "HelmChart",
  6. "status": "success",
  7. "labels": [
  8. "cupidatat ullamco anim eiusmod"
  9. ],
  10. "description": "labore id amet",
  11. "progress": {
  12. "success_count": 2,
  13. "total_count": 2,
  14. "upload_status": "success",
  15. "error": ""
  16. },
  17. "created_by": "patrick",
  18. "create_time": 1713929216
  19. },
  20. "deploy_infos": [],
  21. "distribute_infos": [
  22. {
  23. "id": "66287c080b8b8a631910f5bd",
  24. "service_name": "service2",
  25. "distribute_type": "chart",
  26. "chart_name": "service2",
  27. "chart_repo_name": "test",
  28. "chart_version": "1.76",
  29. "service_module": "",
  30. "image": "",
  31. "image_name": "",
  32. "namespace": "",
  33. "create_time": 1713929224,
  34. "sub_distributes": [
  35. {
  36. "id": "66287c080b8b8a631910f5bc",
  37. "service_name": "service2",
  38. "distribute_type": "image",
  39. "chart_name": "",
  40. "chart_repo_name": "",
  41. "chart_version": "",
  42. "service_module": "service2",
  43. "image": "koderover.tencentcloudcr.com/test/service2:20240419133934-5-main",
  44. "image_name": "service2",
  45. "namespace": "test",
  46. "create_time": 1713929224,
  47. "sub_distributes": []
  48. }
  49. ]
  50. },
  51. {
  52. "id": "66287c0f0b8b8a631910f5c0",
  53. "service_name": "service1",
  54. "distribute_type": "chart",
  55. "chart_name": "service1",
  56. "chart_repo_name": "test",
  57. "chart_version": "1.76",
  58. "service_module": "",
  59. "image": "",
  60. "image_name": "",
  61. "namespace": "",
  62. "create_time": 1713929231,
  63. "sub_distributes": [
  64. {
  65. "id": "66287c0f0b8b8a631910f5bf",
  66. "service_name": "service1",
  67. "distribute_type": "image",
  68. "chart_name": "",
  69. "chart_repo_name": "",
  70. "chart_version": "",
  71. "service_module": "service1",
  72. "image": "koderover.tencentcloudcr.com/test/service1:20240419133934-5-main",
  73. "image_name": "service1",
  74. "namespace": "test",
  75. "create_time": 1713929231,
  76. "sub_distributes": []
  77. }
  78. ]
  79. }
  80. ]
  81. }

删除版本

请求

  1. DELETE /openapi/delivery/releases/:id?projectKey=<projectKey>

路径参数说明

参数名类型描述必填
idstring版本ID

Query 参数说明

参数名类型描述必填
projectKeystring项目标识

成功返回示例

  1. {
  2. "message": "success"
  3. }

K8s YAML 项目创建版本

请求

  1. POST /openapi/delivery/releases/k8s

body 参数说明

参数名类型描述
project_keystring项目标识
version_namestring版本名称
retrybool是否为重试
env_namestring环境名称
productionbool是否为生产环境
descstring描述
labels[]string标签
image_registry_idstring镜像仓库 ID
yaml_datas[]DeliveryVersionYamlDataYaml 服务数据列表

DeliveryVersionYamlData 参数说明

参数名类型说明
service_namestring服务名称
image_datas[]DeliveryVersionImageDataReTag 镜像数据列表

DeliveryVersionImageData 参数说明

参数名类型说明
container_namestring容器名称
image_namestring镜像名称
image_tagstring镜像 tag

成功返回示例

  1. {
  2. "message": "success"
  3. }

Helm Chart 项目创建版本

请求

  1. POST /openapi/delivery/releases/helm

body 参数说明

参数名类型描述
project_keystring项目标识
version_namestring版本名称
retrybool是否为重试
env_namestring环境名称
productionbool是否为生产环境
descstring描述
labels[]string标签
image_registry_idstring镜像仓库 ID
chart_repo_namestringChart 仓库名称
chart_datas[]DeliveryVersionChartDataChart 服务数据列表

DeliveryVersionChartData 参数说明

参数名类型说明
service_namestring服务名称
versionstringChart 版本号
image_datas[]DeliveryVersionImageDataReTag 镜像数据列表

成功返回示例

  1. {
  2. "message": "success"
  3. }