Modifying Component Information Based on the Component ID
Function
This API is used to modify component information based on the component ID.
URI
PUT /v2/{project_id}/cas/applications/{application_id}/components/{component_id}
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Tenant's project ID. |
| application_id | String | Yes | Application ID. |
| component_id | String | Yes | Component ID. |
Request Parameters
Request parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| name | String | No | Application component name. |
| description | String | No | Description. |
| source | Object | No | Source of the code or software package. See Table 3. |
| build | Object | No | Build. See Table 6. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| kind | String | Yes | Type. Option: source code or artifact software package. |
| spec | Object | Yes | For details about the source code, see Table 4. For details about the artifact software package, see Table 5. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| repo_type | String | Yes | Code repository. Value: GitHub, GitLab, Gitee, or Bitbucket. |
| repo_url | String | Yes | Code repository URL. Example: https://github.com/example/demo.git. |
| repo_ref | String | No | Code branch or tag. Default value: master. |
| repo_auth | String | Yes | Authorization name, which can be obtained from the authorization list. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| storage | String | Yes | Storage mode. Value: swr or obs. |
| type | String | Yes | Type. Value: package. |
| url | String | Yes | Source code address of the software package. Example: https://{IP}:20202/xxx/xxx.jar. |
| auth | String | No | Authentication mode. Value: iam or none. Default value: iam. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| parameters | Map<String, Object> | No | See Table 7. This parameter is provided only when no ID is available during build creation. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| build_cmd | String | No | Compilation command. By default:
Java and Tomcat: mvn clean package Nodejs: npm build |
| dockerfile_path | String | No | Address of the Docker file. By default, the Docker file is in the root directory (./). |
| artifact_namespace | String | No | Build archive organization. Default value: cas_{project_id}. |
Response Parameters
Response parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | Application component ID. |
| name | String | Application component name. |
| status | Integer | Value: 0 or 1. 0: Normal. 1: Being deleted. |
| runtime | String | Runtime. |
| category | String | Application component type. Example: Webapp, Microservice, or Common. |
| sub_category | String | Application component sub-type. Webapp sub-types include Web, Magento, and Wordpress. Microservice sub-types include Java Chassis, Go Chassis, and Mesher. Common sub-type can be empty. |
| description | String | Description. |
| pipeline_ids | Array<String> | Pipeline ID list. A maximum of 10 pipeline IDs are supported. |
| project_id | String | Project ID. |
| application_id | String | Application ID. |
| source | Object | Source of the code or software package. See Table 9. |
| build | Object | Build. See Table 11. |
| creator | String | Creator. |
| create_time | Integer | Creation time. |
| update_time | Integer | Update time. |
| Parameter | Type | Description |
|---|---|---|
| storage | String | Storage mode. |
| type | String | Type |
| url | String | Source code address of the software package. |
| auth | String | Authentication mode. |
| Parameter | Type | Description |
|---|---|---|
| ID | String | Type |
| parameters | Map<String, Object> | See Table 12. |
Example
Example request
{
"name": "string",
"description": "string",
"source": {
"kind": "artifact",
"spec": {
"storage": "swr",
"type": "package",
"url": "{IP}:20202/xxx/xxx.jar",
"auth": "iam"
}
},
"build": {
"parameters": {
"build_cmd": "string",
"dockerfile_path": "string",
"artifact_namespace": "string"
}
}
}
Example response
{
"id": "string",
"name": "string",
"runtime": "Tomcat8",
"category": "Webapp",
"sub_category": "Web",
"description": "string",
"project_id": "string",
"application_id": "string",
"source": {
"kind": "artifact",
"spec": {
"storage": "swr",
"type": "package",
"url": "{IP}:20202/xxx/xxx.jar",
"auth": "iam"
}
},
"build": {
"id": "string",
"parameters": {
"build_cmd": "mvn clean package"
}
},
"create_time": 0,
"update_time": 0
} Status Code
| HTTP Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.
Last Article: Obtaining All Components of an Application
Next Article: Deleting an Application Component Based on the Component ID
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.