Creating an Application Component
Function
This API is used to create an application component.
Authorization Information
Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the permission listed below is required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
servicestage:app:createComponent
write
app *
servicestage:app:create
- aom:discoveryRule:list
- aom:discoveryRule:set
- as:scalingConfig:create
- as:scalingConfig:get
- as:scalingConfig:list
- as:scalingPolicy:create
- as:scalingPolicy:get
- as:scalingPolicy:list
- cce:cluster:get
- dcs:instance:get
- dns:recordset:create
- dns:recordset:get
- ecs:cloudServers:get
- elb:l7policies:create
- elb:l7policies:get
- elb:l7policies:list
- elb:listeners:create
- elb:listeners:get
- elb:listeners:list
- elb:members:create
- elb:members:get
- elb:members:list
- ims:dataImages:create
- ims:images:create
- ims:images:get
- ims:images:list
- ims:wholeImages:create
- rds:instance:get
- servicestage:assembling:create
- servicestage:assembling:getInfo
- vpc:addressGroups:get
- vpc:networks:get
- vpc:routeTables:get
- vpc:securityGroupRules:get
- vpc:securityGroups:get
- vpc:subnets:get
- vpc:subnets:get
- vpc:vpcs:get
URI
POST /v3/{project_id}/cas/applications/{application_id}/components
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Tenant's project ID. See Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
| application_id | Yes | String | Definition Application ID. See Obtaining All Applications. Constraints N/A Range N/A Default Value N/A |
Request
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Definition Message body type (or format). Constraints N/A Range application/json;charset=utf8 Default Value N/A |
| X-Auth-Token | Yes | String | Definition API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Authentication. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Component name. Range The value contains 2 to 64 characters consisting of letters, digits, hyphens (-), or underscores (_). It starts with a letter and ends with a letter or digit. Default Value N/A |
| workload_name | No | String | Definition Workload name. Range N/A Default Value N/A |
| labels | No | Array of objects | Definition Label. For container-deployed components, you can query a workload by label. For VM-deployed components, you can configure a label of the corresponding microservice name to use graceful startup and shutdown. See Table 4. |
| create_mode | No | String | Definition Component creation mode. Range
Default Value N/A |
| runtime_stack | Yes | Object | Definition Runtime. See Table 30. The value can be obtained from the response of the API for Querying a Technology Stack. |
| environment_id | No | String | Definition Environment ID, which can be obtained from the information returned by Obtaining All Environments. Range N/A Default Value N/A |
| description | No | String | Definition Component description. Range The value can contain up to 128 characters. Default Value N/A |
| source | Yes | Object | Definition Source of the code or software package. See Table 31. This parameter is optional when create_mode is set to drafts. |
| build | No | Object | Definition Component building. This parameter is mandatory when the component is deployed in containers and no image is used. For details, see Table 32. |
| limit_cpu | No | Number | Definition Maximum CPU limit. Unit: core. Range N/A Default Value N/A |
| limit_memory | No | Number | Definition Maximum memory size. Unit: GiB. Range N/A Default Value N/A |
| request_cpu | No | Number | Definition Requested CPU resources. Unit: core. Range N/A Default Value N/A |
| request_memory | No | Number | Definition Requested memory. Unit: GiB. Range N/A Default Value N/A |
| version | Yes | String | Definition Component version. This parameter is optional when create_mode is set to drafts. Range The value can contain up to 32 characters. It needs to meet the following rule: ^([0-9]+)(\.[0-9]+){2,3}$ Default Value N/A |
| envs | No | Array of objects | Definition Environment variable list. See Table 28. |
| replica | Yes | Integer | Definition Number of instances. This parameter is optional when create_mode is set to drafts. Range N/A Default Value N/A |
| storages | No | Array of objects | Definition Storage. See Table 5. |
| deploy_strategy | No | Object | Definition Component deployment. See Table 8. |
| command | No | Object | Definition Startup command. See Table 12. |
| post_start | No | Object | Definition Post-start processing. See Table 13. |
| pre_stop | No | Object | Definition Pre-stop processing. See Table 13. |
| mesher | No | Object | Definition Multi-language access service mesh. This parameter is mandatory when Node.js is selected for the technology stack and the microservice engine is bound. See Table 14. |
| timezone | No | String | Definition Time zone where the component runs. Range N/A Default Value N/A |
| jvm_opts | No | String | Definition JVM parameter. Example: -Xms256m -Xmx1024m. If there are multiple parameters, separate them by spaces. If the parameter is left blank, the default value is used. Range N/A Default Value N/A |
| tomcat_opts | No | Object | Definition Tomcat parameter. This parameter is valid when you use the Tomcat technology stack. See Table 15. |
| host_aliases | No | Array of objects | Definition Host alias. See Table 16. |
| dns_policy | No | String | Definition DNS policy. Range
Default Value N/A |
| dns_config | No | Object | Definition DNS configuration. See Table 17. |
| workload_kind | No | String | Definition Workload type. Range
Default Value N/A |
| security_context | No | Object | Definition Security policy. See Table 19. |
| logs | No | Array of objects | Definition Log collection. See Table 21. |
| custom_metric | No | Object | Definition Custom metrics. See Table 22. |
| affinity | No | Array of objects | Definition Affinity. See Table 23. |
| anti_affinity | No | Array of objects | Definition Anti-affinity. See Table 23. |
| liveness_probe | No | Object | Definition Component liveness probe. See Table 25. |
| readiness_probe | No | Object | Definition Component service probe. See Table 25. |
| refer_resources | Yes | Array of objects | Definition Associated resource. See Table 26. |
| external_accesses | No | Array of objects | Definition External access. See Table 34. |
| tolerations | No | Array of objects | Definition Tolerance policy. See Table 35. |
| container_name | No | String | Definition Container name. Range N/A Default Value N/A |
| update_strategy | No | Object | Definition Component upgrade strategy. See Table 38. |
| multi_containers | No | Array of objects | Definition Multi-container configuration. See Table 36. |
| service_name | No | String | Definition Service name configured for the inter-instance discovery of a StatefulSet. Range N/A Default Value N/A |
| ports | No | Array of objects | Definition Port configured for the inter-instance discovery of a StatefulSet. For details, see Table 37. |
| workload_content | No | String | Definition Workload content. Range N/A Default Value N/A |
| configs | No | Array of objects | Definition Unified component configuration. See Table 39. |
| config_mode | No | String | Definition Workload configuration mode. Range
Default Value N/A |
| enable_sermant_injection | No | Boolean | Definition Whether to enable Sermant. Range
Default Value N/A |
| enable_sermant_spring_register | No | Boolean | Definition Whether Spring Cloud Huawei microservices need to be registered with registry centers through Sermant. Range
Default Value N/A |
| enable_sermant_dubbo_register | No | Boolean | Definition Whether Dubbo microservices need to be registered with registry centers through Sermant. Range
Default Value N/A |
| enable_sermant_config | No | Boolean | Definition Whether to enable the Sermant dynamic configuration plug-in. Range
Default Value N/A |
| enable_sermant_mq_gray | No | Boolean | Definition Whether to enable Sermant dark launch. Range
Default Value N/A |
| cell_id | No | String | Definition Deployment cell ID. Range N/A Default Value N/A |
| swimlane_id | No | String | Definition Lane ID. Range N/A Default Value N/A |
| base_lane_instance_id | No | String | Definition ID of the baseline component associated with the baseline lane, which is used to identify the association between the baseline component and the dark launch component. Range N/A Default Value N/A |
| sermantAgentInjectActionFlag | No | Boolean | Definition Whether JDK 17 and JDK 21 automatically add the following JVM environment variables: JDK 17: --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED JDK 21: --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -Dnet.bytebuddy.experimental=true Range N/A Default Value N/A |
| sys_config | No | Map<String, String> | Definition Uses a compressed package to deploy component configuration items in the VM environment. |
| image_pull_secrets | No | Array of strings | Definition List of image pull secrets. Range N/A Default Value N/A |
| auto_lts_config | No | Object | Definition Automatic LTS configuration. See Table 40. |
| config_encryption | No | Object | Definition This parameter is mandatory when the encryption key is configured for a single-container component. See Table 41. |
| task_setting | No | Object | Definition Task settings for a job workload. See Table 42. |
| vmapp_config_mode | No | String | Definition Directory type of a VM-deployed component. Range
Default Value N/A |
| vmapp_config | No | Object | Definition Directory settings of a VM-deployed component. See Table 43. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Definition Label name. Range The value contains 1 to 36 characters, including digits, letters, underscores (_), or hyphens (-). NOTE: The value of Key cannot be the built-in app, casid, or version of the system. Otherwise, an error will be reported during component creation and deployment. Default Value N/A |
| value | Yes | String | Definition Label value. Range The value contains 0 to 43 characters, including digits, letters, underscores (_), periods (.), or hyphens (-). Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Definition Data storage type. Range
Default Value N/A |
| name | Yes | String | Definition Name of the storage disk. Range N/A Default Value N/A |
| parameters | Yes | Object | Definition For details about the parameters of each data storage type, see Table 6. |
| mounts | Yes | Array of objects | Definition Mount path of data storage. See Table 7. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| path | No | String | Definition Host path. This parameter is applicable to the HostPath storage type. This parameter is mandatory when type is set to HostPath. Range N/A Default Value N/A |
| name | No | String | Definition Name of a configuration item, secret, or PVC, which is applicable to ConfigMap, Secret, or PersistentVolumeClaim storage, respectively. This parameter is mandatory when type is set to ConfigMap, Secret, or PersistentVolumeClaim. Range N/A Default Value N/A |
| default_mode | No | Integer | Definition Mounting permission. The value is in decimal format. Example: 384. This parameter is applicable to ConfigMap and secret storage. Range N/A Default Value N/A |
| medium | No | String | Definition This parameter is applicable to EmptyDir storage. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| path | Yes | String | Definition Application path to which the data storage is mounted. Example: /tmp. Range N/A Default Value N/A |
| sub_path | Yes | String | Definition Subpath of the mount path. Range N/A Default Value N/A |
| read_only | Yes | Boolean | Definition Read-only or not. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Definition Deployment type. Range
Default Value N/A |
| rolling_release | No | Object | Definition Rolling deployment parameter, which is mandatory when type is set to RollingRelease. For details, see Table 9. |
| gray_release | No | Object | Definition Dark launch upgrade parameter, which is mandatory when type is set to GrayRelease. For details, see Table 10. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| batches | Yes | Integer | Definition Deployment batches. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Definition Dark launch policy. Range
Default Value N/A |
| first_batch_weight | Yes | Integer | Definition Proportion of first-batch dark launch traffic. This parameter is mandatory when type is set to WEIGHT. Range N/A Default Value N/A |
| first_batch_replica | Yes | Integer | Definition Number of first-batch dark launch instances. This parameter is mandatory when type is set to WEIGHT. Range N/A Default Value N/A |
| remaining_batch | Yes | Integer | Definition Number of batches for remaining instance deployment. After the first batch is completed, the remaining instances will be deployed in specified batches. Example: If there are 5 instances remaining to be deployed in 3 batches, these 5 instances will be upgraded based on 2:2:1. This parameter is mandatory when type is set to WEIGHT. Range N/A Default Value N/A |
| deployment_mode | No | Integer | Definition Deployment mode. Range
Default Value N/A |
| replica_surge_mode | No | String | Definition Mode of adding a dark launch instance. This parameter is mandatory when type is set to CONTENT. Range
Default Value N/A |
| rule_match_mode | No | String | Definition Effective mode of a dark launch rule. This parameter is mandatory when type is set to CONTENT. Range
Default Value N/A |
| rules | No | Object | Definition Dark launch rule. See Table 11. This parameter is mandatory when type is set to CONTENT. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Definition Match type. Range HEADER: request header Default Value N/A |
| key | Yes | String | Definition Parameter name. Range N/A Default Value N/A |
| value | Yes | String | Definition Condition value. Range N/A Default Value N/A |
| condition | Yes | String | Definition Condition type. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| command | No | Array of strings | Definition Command for controlling container running. Range N/A Default Value N/A |
| args | No | Array of strings | Definition Parameter for controlling container running. Example: -port=8080. If there are multiple parameters, separate them by line breaks. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Definition Processing method. Range
Default Value N/A |
| scheme | No | String | Definition HTTP request type. This parameter is valid only when type is set to http. Range
Default Value N/A |
| host | No | String | Definition User-defined IP address. This parameter is valid only when type is set to http. Range N/A Default Value Pod IP address. |
| port | No | Integer | Definition Port number. This parameter is valid only when type is set to http. Range N/A Default Value N/A |
| path | No | String | Definition Request path. This parameter is valid only when type is set to http. Range N/A Default Value N/A |
| command | No | Array of strings | Definition Command list. This parameter is valid only when type is set to command. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| port | Yes | Integer | Definition Process listening port. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| server_xml | Yes | String | Definition
Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| ip | Yes | String | Definition IP address. Range N/A Default Value N/A |
| hostnames | Yes | Array of strings | Definition Host alias. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| nameservers | No | Array of strings | Definition IP address list of the DNS server of the pod. Range N/A Default Value N/A |
| searches | No | Array of strings | Definition List of DNS search domains used to search for host names in the pod. Range N/A Default Value N/A |
| options | No | Array of objects | Definition Object list. Each object may have a name (mandatory) and a value (optional). The contents of the objects here will be merged into the options generated from the specified DNS policy. Duplicate entries will be deleted. See Table 18. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Operation name. Range N/A Default Value N/A |
| value | No | String | Definition Operation value. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| run_as_user | No | Integer | Definition User for running containers. Example: To run containers as user root, set the user ID to 0. Range N/A Default Value N/A |
| run_as_group | No | Integer | Definition Owner group specified for running container processes. Range N/A Default Value N/A |
| capabilities | No | Object | Definition Capability set. See Table 20. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| add | No | Array of strings | Definition Grant the Linux permission to the running user. Range N/A Default Value N/A |
| drop | No | Array of strings | Definition Remove the Linux permission of the running user. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| log_path | Yes | String | Definition Container log path. Range N/A Default Value N/A |
| rotate | Yes | String | Definition Interval for dumping logs. Range N/A Default Value N/A |
| host_path | Yes | String | Definition Mounted host path. Range N/A Default Value N/A |
| host_extend_path | Yes | String | Definition Host extension path. By extending the host path, you can distinguish mounting from different containers in the same host path. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| path | Yes | String | Definition Collection path. Example: /metrics. Range N/A Default Value N/A |
| port | Yes | Integer | Definition Collection port. Example: 9090. Range N/A Default Value N/A |
| dimensions | Yes | String | Definition Monitoring dimension. Example: cpu_usage,mem_usage. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| kind | No | String | Definition Object kind. Range
Default Value N/A |
| condition | No | String | Definition Policy type. Range
Default Value N/A |
| match_expressions | No | Array of objects | Definition Scheduling policy rule. See Table 24. |
| weight | No | String | Definition Weight. Range
Default Value N/A |
| topology_key | No | String | Definition Topology key. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Definition Key of the match tag. Range N/A Default Value N/A |
| operation | Yes | String | Definition Match condition. Range N/A Default Value N/A |
| value | Yes | String | Definition Value of the match tag. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Definition Type. Range
Default Value N/A |
| delay | Yes | Integer | Definition Interval between the startup and detection. Range N/A Default Value N/A |
| timeout | Yes | Integer | Definition Detection timeout interval. Range N/A Default Value N/A |
| scheme | No | String | Definition Request type. This parameter is valid only when type is set to http. Range
Default Value N/A |
| host | No | String | Definition User-defined IP address. This parameter is valid only when type is set to http. Range N/A Default Value Pod IP address. |
| port | No | Integer | Definition Port number. This parameter is valid only when type is set to http or tcp. Range N/A Default Value N/A |
| path | No | String | Definition Request path. This parameter is valid only when type is set to http. Range N/A Default Value N/A |
| command | No | Array of strings | Definition Command list. This parameter is valid only when type is set to command. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Definition Resource ID. Range N/A Default Value N/A |
| type | Yes | String | Definition Resource type. Range
Default Value N/A |
| parameters | No | Object | Definition Resource parameters. See Table 27. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| namespace | No | String | Definition Namespace. Range N/A Default Value N/A |
| name | No | String | Definition Resource name. Range N/A Default Value N/A |
| capacity | No | Integer | Definition Storage capacity, in GiB. Range N/A Default Value N/A |
| type | No | String | Definition Volume declaration type. Range
Default Value N/A |
| class | No | String | Definition Volume declaration subtype. Range
Default Value N/A |
| obs_volume_type | No | String | Definition OBS volume type. Range
Default Value STANDARD |
| access_mode | No | String | Definition Storage volume access mode. Range
Default Value N/A |
| availableZone | No | String | Definition AZ. Range N/A Default Value N/A |
| volume_type | No | String | Definition Volume type. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Variable name. Range N/A Default Value N/A |
| value | No | String | Definition Variable value. Range N/A Default Value N/A |
| value_from | No | Object | Definition Variable reference. See Table 29. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| reference_type | Yes | String | Definition Reference type. Range
Default Value N/A |
| name | Yes | String | Definition Name of the configuration item or secret. Range N/A Default Value N/A |
| key | No | String | Definition Key of the configuration item or secret. Range N/A Default Value N/A |
| optional | No | Boolean | Definition Whether the key of the configuration item or secret is mandatory. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Technology stack name. Range N/A Default Value N/A |
| type | Yes | String | Definition Technology stack type. Range
Default Value N/A |
| version | Yes | String | Definition Technology stack version. Range N/A Default Value N/A |
| deploy_mode | Yes | String | Definition Deployment mode. Range
Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| kind | Yes | String | Definition Component source kind. Range
Default Value N/A |
| version | No | String | Definition Version number. Range N/A Default Value N/A |
| url | No | String | Definition Package address. This parameter is mandatory when kind is set to package or image. Range N/A Default Value N/A |
| storage | No | String | Definition Storage mode. This parameter is mandatory when kind is set to package or image. Range
Default Value N/A |
| http_username | No | String | Definition Username. This parameter is mandatory when storage is set to http. Username and password authentication is supported. Range N/A Default Value N/A |
| http_password | No | String | Definition Password. This parameter is mandatory when storage is set to http. Username and password authentication is supported. Range N/A Default Value N/A |
| http_command | No | String | Definition Address of the custom software package. This parameter is mandatory when storage is set to http. Range N/A Default Value N/A |
| http_headers | No | Map<String, String> | Definition This parameter is mandatory when storage is set to http. You can customize request headers as key-value pairs, for example, {"key":"xx","value":"xx""}. |
| auth | No | String | Definition Authentication mode. Range
Default Value iam |
| repo_auth | No | String | Definition Authorization name, which can be obtained from the authorization list. For details, see Obtaining a Git Repository Authorization List. Range N/A Default Value N/A |
| repo_namespace | No | String | Definition Namespace of the code repository. Range N/A Default Value N/A |
| repo_ref | No | String | Definition Code branch or tag Range N/A Default Value master |
| repo_type | No | String | Definition Code repository. Range
Default Value N/A |
| web_url | No | String | Definition Code redirection URL. Example: https://github.com/example/demo.git. Range N/A Default Value N/A |
| repo_url | No | String | Definition Code repository URL. Example: https://github.com/example/demo.git. Range N/A Default Value N/A |
| commit_id | No | String | Definition In the code repository, commit ID is the unique identifier of each commit and is used to identify and reference a commit. Range The value contains 8 to 40 characters and starts with a lowercase letter or digit. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| parameters | No | Object | Definition This parameter is provided only when no ID is available during build creation. See Table 33. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| build_cmd | No | String | Definition Compilation command. Range N/A Default Value
|
| dockerfile_path | No | String | Definition Address of the Docker file. Range N/A Default Value root directory (./) |
| artifact_namespace | No | String | Definition Build archive organization. Range N/A Default Value cas_{project_id} |
| cluster_id | Yes | String | Definition ID of the cluster to be built. Range N/A Default Value N/A |
| node_label_selector | No | Map<String, String> | Definition key: label key. value: label value. |
| environment_id | No | String | Definition Environment ID. See Obtaining All Environments. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| protocol | No | String | Definition External access type. Range
Default Value N/A |
| address | No | String | Definition External access address. Range N/A Default Value N/A |
| forward_port | No | Integer | Definition External access port. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | No | String | Definition Taint key. Range N/A Default Value N/A |
| operator | No | String | Definition Operator. Range
Default Value N/A |
| value | No | String | Definition Taint value. This parameter is mandatory when operator is set to Equal. Range N/A Default Value N/A |
| effect | No | String | Definition Taint policy. Range
Default Value N/A |
| toleration_seconds | No | Integer | Definition Tolerance time window. This parameter can be set only when effect is set to NoExecute. Within the tolerance time window, pods still run on the node with taints. After the time expires, the pods will be evicted. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| container_name | Yes | String | Definition Container name. Range N/A Default Value N/A |
| source | Yes | Object | Definition Source of the code or software package. See Table 31. Constraints In multi-container mode, only images are supported. |
| limit_cpu | No | Number | Definition Maximum CPU limit. Unit: core. Range N/A Default Value N/A |
| limit_memory | No | Number | Definition Maximum memory size. Unit: GiB. Range N/A Default Value N/A |
| request_cpu | No | Number | Definition Requested CPU resources. Unit: core. Range N/A Default Value N/A |
| request_memory | No | Number | Definition Requested memory. Unit: GiB. Range N/A Default Value N/A |
| envs | No | Array of objects | Definition Environment variable list. See Table 28. |
| liveness_probe | No | Object | Definition Container liveness probe. See Table 25. |
| readiness_probe | No | Object | Definition Container service probe. See Table 25. |
| startup_probe | No | Object | Definition Container startup probe. See Table 25. |
| command | No | Object | Definition Startup command. See Table 12. |
| post_start | No | Object | Definition Post-start processing. See Table 13. |
| pre_stop | No | Object | Definition Pre-stop processing. See Table 13. |
| logs | No | Array of objects | Definition Log collection. See Table 21. |
| storages | No | Array of objects | Definition Storage. See Table 5. |
| security_context | No | Object | Definition Security policy. See Table 19. |
| config_encryption | No | Object | Definition Encryption configuration. This parameter is mandatory when the encryption key is configured for a multi-container component. See Table 41. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Port name. Range N/A Default Value N/A |
| port | Yes | String | Definition Access port. Range N/A Default Value N/A |
| target_port | Yes | String | Definition Container port. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | No | String | Definition Component upgrade policy. Range
Default Value RollingUpdate |
| max_unavailable | No |
| Definition Maximum number of unavailable pods. That is, the number or percentage of pods that can be deleted based on the value of replica.
Constraints This parameter can be set only when workload_kind is set to deployment. Range N/A Default Value 25% |
| max_surge | No |
| Definition Maximum surge. That is, the number or percentage of pods allowed based on the value of replica.
Constraints This parameter can be set only when workload_kind is set to deployment. Range N/A Default Value 25% |
| termination_period_seconds | No | Integer | Definition Scale-in time window. That is, the time window for executing commands before a workload stops. Range N/A Default Value 30 |
| min_ready_seconds | No | Integer | Definition Minimum ready time of a pod. That is, the minimum ready time of a new pod without any container crash. A pod is considered available only after the minimum ready time is exceeded. Range N/A Default Value 0 |
| progress_deadline_seconds | No | Integer | Definition Maximum upgrade duration. That is, the time (in seconds) the system waits for before reporting a component upgrade failure. Constraints If this parameter is specified, the value of this parameter must be greater than that of min_ready_seconds. Range N/A Default Value N/A |
| revision_history_limit | No | Integer | Definition Maximum number of pods to retain. That is, the number of old pods to retain to allow rollback. Range N/A Default Value 10 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| config_id | Yes | String | Definition Unified configuration ID. Range N/A Default Value N/A |
| mount_path | Yes | String | Definition Mount path. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| enable | Yes | Boolean | Definition Whether to enable automatic LTS configuration. Range
Default Value N/A |
| lts_log_path | No | Array of strings | Definition Access configuration log path. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key_id | Yes | String | Definition User key ID in DEW. Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| parallelism | Yes | Integer | Definition Number of parallel jobs. Range N/A Default Value N/A |
| active_deadline_seconds | No | Integer | Definition Timeout interval, in seconds. Range N/A Default Value N/A |
| completion_mode | Yes | String | Definition Completion mode. Range
Default Value N/A |
| suspend | Yes | Boolean | Definition Whether to suspend a job. The job's execution will be suspended if you enable this option, and resumed after you disable it. Range
Default Value false (The task is executed immediately after being created by default.) |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| run_as_user | Yes | String | Definition Running user. Range N/A Default Value N/A |
| app_home | Yes | Object | Definition Deployment directory settings. See Table 44. |
| log_home | Yes | Object | Definition Log directory settings. See Table 44. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| path | Yes | String | Definition Directory setting path. Range N/A Default Value N/A |
| user | Yes | String | Definition User to which the directory setting path belongs. Range N/A Default Value N/A |
| group | Yes | String | Definition User group to which the directory setting path belongs. Range N/A Default Value N/A |
| mode | Yes | String | Definition Permission on the directory setting path. Range N/A Default Value N/A |
Response
| Parameter | Type | Description |
|---|---|---|
| job_id | String | Definition Job ID. Range N/A |
| component_id | String | Definition Application component ID. Range N/A |
Example Request
- Scenario 1: Create a component in the CCE container environment Create a component named mycomponent. The technology stack is Java 1.2.0. The component source is the weather-1.0.0.jar package stored in the bucket00001 bucket of OBS. The resource used for deployment is the CCE whose ID is fd92bfab-73b3-11ee-90f0-0255ac1001b3.
{ "name": "mycomponent", "description": "", "labels": [ { "key": "com-key", "value": "com-value" } ], "version": "2023.1102.17105", "environment_id": "b489f7b4-2539-45a1-ba71-4728961434ca", "runtime_stack": { "name": "OpenJDK8", "version": "1.2.0", "type": "Java", "deploy_mode": "container" }, "source": { "kind": "package", "url": "obs://bucket0001/weather-1.0.0.jar", "version": "", "storage": "obs" }, "tomcat_opts": { "server_xml": "" }, "refer_resources": [ { "id": "fd92bfab-73b3-11ee-90f0-0255ac1001b3", "type": "cce", } ], "replica": 1, "limit_cpu": 0.25, "limit_memory": 0.5, "request_cpu": 0.25, "request_memory": 0.5 } - Scenario 2: Create a component in the ECS VM environment
Create a component named mycomponent. The technology stack is Java 1.2.0. The component source is the weather-1.0.0.jar package stored in the bucket00001 bucket of OBS. The resource used for deployment is the ECS whose ID is 67835bb3-1235-4cc9-be71-becbb2b4ca0d.
{ "name": "mycomponent", "description": "", "labels": [ { "key": "com-key", "value": "com-value" } ], "version": "2023.1102.17540", "environment_id": "9a075df5-104f-4e21-9dbf-ffc3572effdf", "runtime_stack": { "name": "OpenJDK8", "version": "1.2.0", "type": "Java", "deploy_mode": "virtualmachine" }, "source": { "kind": "package", "url": "obs://bucket0001/weather-1.0.0.jar", "version": "", "storage": "obs" }, "tomcat_opts": { "server_xml": "" }, "refer_resources": [ { "id": "23598aa9-7a6b-43c7-a53a-39ca5e7290fb", "type": "ecs" } ], "replica": 1, "external_accesses": [ { "protocol": "http", "address": "192.168.0.169", "forward_port": 80 } ] }
Example Response
{
"job_id": "JOB8be53b2a-af9a-4e2b-8505-096688a52237",
"component_id": "b8702b0f-94d3-4822-98a1-56815632a0a0"
} Status Code
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error Code
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot