Creating an Environment for an Application
Function
This API is used to create an environment for an application.
Calling Method
For details, see Calling APIs.
URI
POST /v1/applications/{application_id}/environments
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
application_id |
Yes |
String |
Definition: Application ID. Constraints: N/A. Value range: 32 characters, including letters and digits. Default value: N/A. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-Type |
Yes |
String |
Definition: Type (or format) of the message body. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
X-Auth-Token |
Yes |
String |
Definition: User token. Obtain a token (the value of the X-Subject-Token response header) by calling the IAM API. Constraints: N/A. Value range: String. Max. 20,000 characters. Default value: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID. Constraints: N/A. Value range: 32 characters, including letters and digits. Default value: N/A. |
|
name |
Yes |
String |
Definition: Environment name. Constraints: N/A. Value range: 3 to 128 characters, including letters, digits, underscores (_), and hyphens (-). Default value: N/A. |
|
deploy_type |
Yes |
Integer |
Definition: Deployment type. Constraints: N/A. Value range: Default value: 0. |
|
os |
Yes |
String |
Definition: OSs. Constraints: N/A. Value range: Default value: N/A. |
|
description |
No |
String |
Definition: Environment description. Constraints: N/A. Value range: Max. 500 characters. Default value: N/A. |
Response Parameters
Status code: 200
Example Requests
https://{endpoint}/v1/applications/43943381f7764c52baae8e697720873f/environments
{
"project_id" : "55837d272adf4eee90319800e2da6961",
"name" : "EnvironmentName",
"deploy_type" : 0,
"description" : "Environment Description",
"os" : "linux"
}
Example Responses
Status code: 200
OK: The request is successful.
{
"status" : "success",
"id" : "140ca97e701d4c4c93c5932d5bdb32ec"
}
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot