Duplicate the app

Basic Information

This interface is mainly used for replication applications

请求路径

  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. }

Here target_team_name specifies the target team name, corresponding to tenant_name or team_name, the value is similar to o19p6wen, not user-defined team name

Here target_region_name specifies the target cluster name, corresponding to the data returned by the cluster list interface region_name

Here target_app_id specifies the target app name

request parameters

nameLocationtyperequiredChinese nameillustrate
team_idpathstringYesnone
region_namepathstringYesnone
app_idpathstringYesnone
bodybodyAppCopyCnonone

return result

status codeStatus code meaningillustratedata model
200OKsuccessAppCopyCRes

return data structure

响应示例

  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. "buil d_upgrade": true,
  45. "oauth_service_id": 3,
  46. "k8s_component_name": "string"
  47. }
  48. ]
  49. }

Model

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_c md": "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. }

Attributes

nametyperequiredconstraintChinese nameillustrate
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. "ser ver_type": "strin",
  39. "is_upgrate": true,
  40. "build_upgrade": true,
  41. "oauth_service_id": -2147483648,
  42. "k8s_component_name": "string"
  43. }

Attributes

nametyperequiredconstraintChinese nameillustrate
statusstringfalsenoneStatuscomponent status
access_infos[string]falsenonecomponent access address
service_idstringtruenoneService idcomponent id
tenant_idstringtruenoneTenant idtenant id
service_keystringtruenoneService keycomponent key
service_aliasstringtruenoneService aliascomponent alias
service_cnamestringfalsenoneService cnamecomponent name
service_regionstringtruenoneService regionThe area to which the component belongs
descstring¦nullfalsenoneDescdescribe
categorystringtruenoneCategoryComponent classification:application, cache, store
versionstringtruenoneVersionVersion
update_versionintegerfalsenoneUpdate versionInternal Releases
imagestringtruenoneImagemirror
cmdstring¦nullfalsenoneCmdstartup parameters
min_nodeintegerfalsenoneMin nodenumber of instances
min_cpuintegerfalsenoneMin cpuCPU allocation 1000=1core
container_gpuintegerfalsenoneContainer GPUsAmount of GPU memory
min_memoryintegerfalsenoneMin memoryMemory size unit (M)
extend_methodstringfalsenoneExtend methodComponent deployment type, stateless or state
code_fromstring¦nullfalsenoneCode fromCode source: gitlab, github
git_urlstring¦nullfalsenoneGit urlcode code repository
git_project_idintegerfalsenoneGit project idProject id in gitlab
code_versionstring¦nullfalsenoneCode versioncode version
service_typestring¦nullfalsenoneService typeComponent type: web, mysql, redis, mongodb, phpadmin
creatorintegerfalsenoneCreatercomponent creator
languagestring¦nullfalsenoneLanguagecode language
total_memoryintegerfalsenoneTotal memoryMemory usage M
is_servicebooleanfalsenoneIs serviceWhether the inner component
service_originstringfalsenoneService originComponent creation type cloud cloud city component, assistant cloud help component
tenant_service_group_idintegerfalsenoneTenant service group idThe component group id to which the component belongs. For components installed from the application template, this field needs to be assigned a value
open_webhooksbooleanfalsenoneOpen webhooksWhether to enable the automatic trigger deployment function (compatible with older version components)
service_sourcestring¦nullfalsenoneService sourceComponent sources (source_code, market, docker_run, docker_compose)
create_statusstring¦nullfalsenoneCreate statusComponent creation state creating
check_uuidstring¦nullfalsenoneCheck uuidComponent detection ID
check_event_idstring¦nullfalsenoneCheck event idComponent detection event ID
docker_cmdstring¦nullfalsenoneDocker-cmdImage creation command
server_typestringfalsenoneServer typeSource repository type
is_upgratebooleanfalsenoneIs upgradeIs it possible to update
build_upgradebooleanfalsenoneBuild upgradeWhether to upgrade components after building
oauth_service_idinteger¦nullfalsenoneOauth service idThe OAuth service id used to pull the source code
k8s_component_namestringtruenoneK8s component nameCluster 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. }

Attributes

nametyperequiredconstraintChinese nameillustrate
services[AppCopyModify]truenonenone
target_team_namestringtruenoneTarget team nameTeam Name
target_region_namestringtruenoneTarget region namedata center name
target_app_idintegertruenoneTarget app idapp 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_c md": "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. }

Attributes

nametyperequiredconstraintChinese nameillustrate
services[ServiceBaseInfo]truenonenone

AppCopyModify

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

Attributes

nametyperequiredconstraintChinese nameillustrate
service_idstringtruenoneService idcomponent ID
changestringfalseread-onlyChangenone