复制应用

基本信息

该接口主要用于复制应用

请求路径

  1. POST /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/copy

Body 请求体示例

  1. {
  2. "services": [
  3. {
  4. "service_id": "string"
  5. }
  6. ],
  7. "target_team_name": "string",
  8. "target_region_name": "string",
  9. "target_app_id": 3
  10. }

此处 target_team_name 指定目标团队名称,对应 tenant_nameteam_name,值类似于 o19p6wen,非用户自定义团队名称

此处 target_region_name 指定目标集群名称,对应集群列表接口返回的数据 region_name

此处 target_app_id 指定目标应用名称

请求参数

名称位置类型必选中文名说明
team_idpathstringnone
region_namepathstringnone
app_idpathstringnone
bodybodyAppCopyCnone

返回结果

状态码状态码含义说明数据模型
200OK成功AppCopyCRes

返回数据结构

响应示例

  1. {
  2. "services": [
  3. {
  4. "status": "",
  5. "access_infos": [
  6. "string"
  7. ],
  8. "service_id": "string",
  9. "tenant_id": "string",
  10. "service_key": "string",
  11. "service_alias": "string",
  12. "service_cname": "string",
  13. "service_region": "string",
  14. "desc": "string",
  15. "category": "string",
  16. "version": "string",
  17. "update_version": 3,
  18. "image": "string",
  19. "cmd": "string",
  20. "min_node": 3,
  21. "min_cpu": 3,
  22. "container_gpu": 3,
  23. "min_memory": 3,
  24. "extend_method": "string",
  25. "code_from": "string",
  26. "git_url": "string",
  27. "git_project_id": 3,
  28. "code_version": "string",
  29. "service_type": "string",
  30. "creater": 3,
  31. "language": "string",
  32. "total_memory": 3,
  33. "is_service": true,
  34. "service_origin": "string",
  35. "tenant_service_group_id": 3,
  36. "open_webhooks": true,
  37. "service_source": "string",
  38. "create_status": "string",
  39. "check_uuid": "string",
  40. "check_event_id": "string",
  41. "docker_cmd": "string",
  42. "server_type": "string",
  43. "is_upgrate": true,
  44. "build_upgrade": true,
  45. "oauth_service_id": 3,
  46. "k8s_component_name": "string"
  47. }
  48. ]
  49. }

模型

AppPostInfo

  1. {
  2. "services": [
  3. {
  4. "status": "",
  5. "access_infos": [],
  6. "service_id": "string",
  7. "tenant_id": "string",
  8. "service_key": "string",
  9. "service_alias": "string",
  10. "service_cname": "string",
  11. "service_region": "string",
  12. "desc": "string",
  13. "category": "string",
  14. "version": "string",
  15. "update_version": -2147483648,
  16. "image": "string",
  17. "cmd": "string",
  18. "min_node": -2147483648,
  19. "min_cpu": -2147483648,
  20. "container_gpu": -2147483648,
  21. "min_memory": -2147483648,
  22. "extend_method": "string",
  23. "code_from": "string",
  24. "git_url": "string",
  25. "git_project_id": -2147483648,
  26. "code_version": "string",
  27. "service_type": "string",
  28. "creater": -2147483648,
  29. "language": "string",
  30. "total_memory": -2147483648,
  31. "is_service": true,
  32. "service_origin": "string",
  33. "tenant_service_group_id": -2147483648,
  34. "open_webhooks": true,
  35. "service_source": "string",
  36. "create_status": "string",
  37. "check_uuid": "string",
  38. "check_event_id": "string",
  39. "docker_cmd": "string",
  40. "server_type": "strin",
  41. "is_upgrate": true,
  42. "build_upgrade": true,
  43. "oauth_service_id": -2147483648,
  44. "k8s_component_name": "string"
  45. }
  46. ]
  47. }

属性

名称类型必选约束中文名说明
services[ServiceBaseInfo]truenonenone

ServiceBaseInfo

  1. {
  2. "status": "",
  3. "access_infos": [],
  4. "service_id": "string",
  5. "tenant_id": "string",
  6. "service_key": "string",
  7. "service_alias": "string",
  8. "service_cname": "string",
  9. "service_region": "string",
  10. "desc": "string",
  11. "category": "string",
  12. "version": "string",
  13. "update_version": -2147483648,
  14. "image": "string",
  15. "cmd": "string",
  16. "min_node": -2147483648,
  17. "min_cpu": -2147483648,
  18. "container_gpu": -2147483648,
  19. "min_memory": -2147483648,
  20. "extend_method": "string",
  21. "code_from": "string",
  22. "git_url": "string",
  23. "git_project_id": -2147483648,
  24. "code_version": "string",
  25. "service_type": "string",
  26. "creater": -2147483648,
  27. "language": "string",
  28. "total_memory": -2147483648,
  29. "is_service": true,
  30. "service_origin": "string",
  31. "tenant_service_group_id": -2147483648,
  32. "open_webhooks": true,
  33. "service_source": "string",
  34. "create_status": "string",
  35. "check_uuid": "string",
  36. "check_event_id": "string",
  37. "docker_cmd": "string",
  38. "server_type": "strin",
  39. "is_upgrate": true,
  40. "build_upgrade": true,
  41. "oauth_service_id": -2147483648,
  42. "k8s_component_name": "string"
  43. }

属性

名称类型必选约束中文名说明
statusstringfalsenoneStatus组件状态
access_infos[string]falsenone组件访问地址
service_idstringtruenoneService id组件id
tenant_idstringtruenoneTenant id租户id
service_keystringtruenoneService key组件key
service_aliasstringtruenoneService alias组件别名
service_cnamestringfalsenoneService cname组件名
service_regionstringtruenoneService region组件所属区
descstring¦nullfalsenoneDesc描述
categorystringtruenoneCategory组件分类:application,cache,store
versionstringtruenoneVersion版本
update_versionintegerfalsenoneUpdate version内部发布次数
imagestringtruenoneImage镜像
cmdstring¦nullfalsenoneCmd启动参数
min_nodeintegerfalsenoneMin node实例数量
min_cpuintegerfalsenoneMin cpucpu分配额 1000=1core
container_gpuintegerfalsenoneContainer gpugpu显存数量
min_memoryintegerfalsenoneMin memory内存大小单位(M)
extend_methodstringfalsenoneExtend method组件部署类型,stateless or state
code_fromstring¦nullfalsenoneCode from代码来源:gitlab,github
git_urlstring¦nullfalsenoneGit urlcode代码仓库
git_project_idintegerfalsenoneGit project idgitlab 中项目id
code_versionstring¦nullfalsenoneCode version代码版本
service_typestring¦nullfalsenoneService type组件类型:web,mysql,redis,mongodb,phpadmin
createrintegerfalsenoneCreater组件创建者
languagestring¦nullfalsenoneLanguage代码语言
total_memoryintegerfalsenoneTotal memory内存使用M
is_servicebooleanfalsenoneIs service是否inner组件
service_originstringfalsenoneService origin组件创建类型cloud云市组件,assistant云帮组件
tenant_service_group_idintegerfalsenoneTenant service group id组件归属的组件组id,从应用模版安装的组件该字段需要赋值
open_webhooksbooleanfalsenoneOpen webhooks是否开启自动触发部署功能(兼容老版本组件)
service_sourcestring¦nullfalsenoneService source组件来源(source_code, market, docker_run, docker_compose)
create_statusstring¦nullfalsenoneCreate status组件创建状态 creating
check_uuidstring¦nullfalsenoneCheck uuid组件检测ID
check_event_idstring¦nullfalsenoneCheck event id组件检测事件ID
docker_cmdstring¦nullfalsenoneDocker cmd镜像创建命令
server_typestringfalsenoneServer type源码仓库类型
is_upgratebooleanfalsenoneIs upgrate是否可以更新
build_upgradebooleanfalsenoneBuild upgrade组件构建后是否升级
oauth_service_idinteger¦nullfalsenoneOauth service id拉取源码所用的OAuth服务id
k8s_component_namestringtruenoneK8s component name集群组件名称

AppCopyC

  1. {
  2. "services": [
  3. {
  4. "service_id": "string",
  5. "change": "string"
  6. }
  7. ],
  8. "target_team_name": "string",
  9. "target_region_name": "string",
  10. "target_app_id": 0
  11. }

属性

名称类型必选约束中文名说明
services[AppCopyModify]truenonenone
target_team_namestringtruenoneTarget team name团队名称
target_region_namestringtruenoneTarget region name数据中心名称
target_app_idintegertruenoneTarget app id应用id

AppCopyCRes

  1. {
  2. "services": [
  3. {
  4. "status": "",
  5. "access_infos": [],
  6. "service_id": "string",
  7. "tenant_id": "string",
  8. "service_key": "string",
  9. "service_alias": "string",
  10. "service_cname": "string",
  11. "service_region": "string",
  12. "desc": "string",
  13. "category": "string",
  14. "version": "string",
  15. "update_version": -2147483648,
  16. "image": "string",
  17. "cmd": "string",
  18. "min_node": -2147483648,
  19. "min_cpu": -2147483648,
  20. "container_gpu": -2147483648,
  21. "min_memory": -2147483648,
  22. "extend_method": "string",
  23. "code_from": "string",
  24. "git_url": "string",
  25. "git_project_id": -2147483648,
  26. "code_version": "string",
  27. "service_type": "string",
  28. "creater": -2147483648,
  29. "language": "string",
  30. "total_memory": -2147483648,
  31. "is_service": true,
  32. "service_origin": "string",
  33. "tenant_service_group_id": -2147483648,
  34. "open_webhooks": true,
  35. "service_source": "string",
  36. "create_status": "string",
  37. "check_uuid": "string",
  38. "check_event_id": "string",
  39. "docker_cmd": "string",
  40. "server_type": "strin",
  41. "is_upgrate": true,
  42. "build_upgrade": true,
  43. "oauth_service_id": -2147483648,
  44. "k8s_component_name": "string"
  45. }
  46. ]
  47. }

属性

名称类型必选约束中文名说明
services[ServiceBaseInfo]truenonenone

AppCopyModify

  1. {
  2. "service_id": "string",
  3. "change": "string"
  4. }

属性

名称类型必选约束中文名说明
service_idstringtruenoneService id组件ID
changestringfalseread-onlyChangenone