Updating an Application
Function
This API is used to update an application.
Calling Method
For details, see Calling APIs.
URI
PUT /v1/applications
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Message body type (format). |
| X-Auth-Token | Yes | String | User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Application ID |
| project_id | Yes | String | Project ID |
| name | Yes | String | Application name |
| description | No | String | Description |
| is_draft | Yes | Boolean | Whether the application is in draft status |
| create_type | Yes | String | Creation type. template: Create an application using a template. |
| slave_cluster_id | No | String | Custom slave resource pool ID |
| trigger | No | TaskTriggerVO object | Triggering settings for application deployment |
| arrange_infos | No | Array of UpdateTaskV2RequestBody objects | Deployment task list |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| trigger_source | No | String | Scenario where a deployment task can be executed. 0: All execution requests can be triggered. 1: Only pipeline can be triggered. |
| artifact_source_system | No | String | When a task can be triggered only by the pipeline, source information transferred by the pipeline only supports CodeArts Artifact. |
| artifact_type | No | String | When a task can be triggered only by the pipeline, the artifact type is generic and docker for the pipeline source. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Deployment task ID |
| deploy_system | No | String | Deployment system. deployTemplate: Deployment template. |
| template_id | No | String | Template ID |
| operation_list | No | Array of DeployV2OperationsDO objects | Deployment orchestration list information |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Step ID |
| name | No | String | Step name |
| description | No | String | Description |
| code | No | String | Download URL |
| params | No | String | Detailed definition of step |
| entrance | No | String | Entry function |
| version | No | String | Version |
| module_id | No | String | Module ID |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Request success or failure status |
| result | AppBaseResponse object | Parameter description: Response body for creating or deleting an application. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Parameter description: Application ID. Value range: The value consists of 32 characters. Letters and digits are allowed. |
| name | String | Parameter description: Application name. Value range: The value consists of 3-128 characters. Only letters, digits, hyphens (-) and underscores (_) are allowed. |
| region | String | Parameter description: Region to which the application belongs. Value range: N/A |
| arrange_infos | Array of TaskBaseBody objects | Parameter description: Deployment task list. |
Example Requests
Update an application.
https://{endpoint}/v1/applications
{
"id" : "e700f15965694253940502911220d76b",
"name" : "deployenv20230822192953",
"project_id" : "55837d272adf4eee90319800e2da6961",
"description" : "Update an application.",
"trigger" : {
"trigger_source" : 0,
"artifact_source_system" : "",
"artifact_type" : ""
},
"slave_cluster_id" : "",
"create_type" : "template",
"is_draft" : true,
"arrange_infos" : [ {
"id" : "e700f15965694253940502911220d76b",
"deploy_system" : "deployTemplate",
"template_id" : "ec939bdf63194aca9fad45b3ba05643e",
"operation_list" : [ ]
} ]
} Example Responses
Status code: 200
OK: The request is successful.
{
"result" : {
"id" : "e700f15965694253940502911220d76b",
"name" : "testApp",
"region" : "example",
"arrange_infos" : [ {
"id" : "e700f15965694253940502911220d76b"
} ]
},
"status" : "success"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK: The request is successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.