Creating an Application (Recommended)
Function
This API is used to create an application.
Calling Method
For details, see Calling APIs.
URI
POST /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 |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
name |
Yes |
String |
Application name |
description |
No |
String |
Description |
group_id |
No |
String |
Group ID |
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 |
Deployment task triggering scenarios |
arrange_infos |
No |
Array of TaskV2RequestBody 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 |
---|---|---|---|
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
This API is used to create an application.
https://{endpoint}/v1/applications { "name" : "deployenv20230822192953", "project_id" : "55837d272adf4eee90319800e2da6961", "description" : "This API is used to create an application using a blank template.", "trigger" : { "trigger_source" : 0, "artifact_source_system" : "", "artifact_type" : "" }, "slave_cluster_id" : "", "create_type" : "template", "is_draft" : true, "arrange_infos" : [ ] }
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.