Creating an Application (Recommended)
Function
This API is used to create an application.
URI
POST /v1/applications
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Message body type (format). Possible values: application/json;charset=utf-8 application/json Default: application/json;charset=utf-8 Enumeration values:
|
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. Minimum: 0 Maximum: 20000 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
name |
Yes |
String |
Application name. Minimum: 3 Maximum: 128 |
description |
No |
String |
Description. |
is_draft |
Yes |
Boolean |
Whether the application is in draft status. |
create_type |
Yes |
String |
Creation type. There is only one creation type template, that is, creation based on the template. Enumeration values:
|
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 information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
trigger_source |
No |
String |
Scenario where a deployment task can be executed. 0 indicates that all execution requests can be triggered. 1 indicates that 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. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
status |
String |
Request success or failure status. |
result |
AppBaseResponse object |
Response body for creating or deleting an application |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Created application ID. |
name |
String |
This API is used to create an application name. |
region |
String |
Region to which the application belongs. |
arrange_infos |
Array of TaskBaseBody objects |
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" : "cn-north-7", "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.