发布计划

本文主要介绍如何使用 Open API 来操作 Zadig 的发布计划。

发布计划

获取发布计划列表

请求

  1. GET /openapi/release_plan/v1

Query

参数名类型描述是否必须默认值
pageNumint分页参数-当前页数
pageSizeint分页参数-当前页展示条数

返回说明

参数名类型描述
idstring发布计划主键
namestring发布计划名称
indexint发布计划序号
managerstring发布负责人
descriptionstring需求关联
create_timeint发布计划创建时间
created_bystring创建人

正常返回

  1. {
  2. "list": [
  3. {
  4. "id": "64f58a7ac573f7325c2744b6",
  5. "index": 31,
  6. "name": "test-workflow-0904",
  7. "manager": "admin",
  8. "description": "",
  9. "created_by": "admin",
  10. "create_time": 1693813370
  11. }
  12. ],
  13. "total": 26
  14. }

获取发布计划详情

请求

  1. GET /openapi/release_plan/v1/:id

路径参数说明

参数名类型描述是否必须默认值
idstring发布计划主键

正常返回

  1. {
  2. "id": "64f1a7cd1b7bd46ec353b50c",
  3. "index": 21,
  4. "name": "plan-A",
  5. "manager": "admin",
  6. "manager_id": "c565c7eb-e273-11ed-bef9-a659ed9f1ed1",
  7. "start_time": 1693558721, // 发布窗口期
  8. "end_time": 1694016000, // 发布窗口期
  9. "description": "",
  10. "created_by": "admin",
  11. "create_time": 1693558733,
  12. "updated_by": "admin",
  13. "update_time": 1693558750,
  14. "approval": { // 审批配置
  15. "enabled": true,
  16. "status": "",
  17. "type": "native",
  18. "description": "",
  19. "native_approval": {
  20. "timeout": 5,
  21. "approve_users": [
  22. {
  23. "user_id": "c565c7eb-e273-11ed-bef9-a659ed9f1ed1",
  24. "user_name": "admin",
  25. "reject_or_approve": "",
  26. "comment": "",
  27. "operation_time": 0
  28. }
  29. ],
  30. "needed_approvers": 1,
  31. "reject_or_approve": "",
  32. "instance_code": ""
  33. },
  34. "lark_approval": {
  35. "timeout": 5,
  36. "approval_id": "",
  37. "default_approval_initiator": null,
  38. "approve_users": [],
  39. "approval_nodes": [
  40. {
  41. "approve_users": [],
  42. "type": "AND",
  43. "reject_or_approve": ""
  44. }
  45. ],
  46. "instance_code": ""
  47. },
  48. "dingtalk_approval": {
  49. "timeout": 5,
  50. "approval_id": "",
  51. "default_approval_initiator": null,
  52. "approval_nodes": [
  53. {
  54. "approve_users": [],
  55. "type": "AND",
  56. "reject_or_approve": ""
  57. }
  58. ],
  59. "instance_code": ""
  60. }
  61. },
  62. "jobs": [
  63. {
  64. "id": "0b655ad6-5d08-4f1c-8ff6-7eb004c7c7bd",
  65. "name": "中间件变更",
  66. "type": "text",
  67. "spec": {
  68. "content": "<p>2222</p><p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;\">Powered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>"
  69. },
  70. "status": "",
  71. "last_status": "",
  72. "updated": true,
  73. "executed_by": "",
  74. "executed_time": 0
  75. }
  76. ],
  77. "status": "planning",
  78. "planning_time": 0, // 完成规划状态的时间
  79. "approval_time": 0, // 完成审批状态的时间
  80. "executing_time": 0, // 完成执行状态的时间
  81. "success_time": 0 // 成功时间
  82. }

创建发布计划

请求

  1. POST /openapi/release_plan/v1

body 参数说明

参数名类型描述是否必须默认值
namestring发布计划名称
managerstring发布负责人用户名
manager_identity_typestring发布负责人用户类型, system(默认类型)、ldap、oauth 等
descriptionstring需求关联
start_timeint发布窗口期-开始时间
end_timeint发布窗口期-结束时间
approvalapproval审批配置,具体字段可参考创建自定义工作流一节

body 参数示例

  1. {
  2. "name": "plan-example",
  3. "manager": "admin",
  4. "manager_identity_type": "system",
  5. "start_time": 1693558721, // 发布窗口期
  6. "end_time": 1694016000, // 发布窗口期
  7. "description": "",
  8. "approval": { // 审批配置
  9. "enabled": true,
  10. "status": "",
  11. "type": "native",
  12. "description": "",
  13. "native_approval": {
  14. "timeout": 5,
  15. "approve_users": [
  16. {
  17. "user_id": "c565c7eb-e273-11ed-bef9-a659ed9f1ed1",
  18. "user_name": "admin",
  19. "reject_or_approve": "",
  20. "comment": "",
  21. "operation_time": 0
  22. }
  23. ],
  24. "needed_approvers": 1,
  25. "reject_or_approve": "",
  26. "instance_code": ""
  27. }
  28. }
  29. }