Creating a Pipeline Environment
Function
This API is used to modify the environment of a pipeline.
URI
POST /cpepipeline/v2/environments
Request
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Message body type (format). Default value: application/json;charset=utf8. |
| X-Auth-Token | Yes | String | API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Environment name. |
| displayName | Yes | String | Environment display name. If this parameter is left blank, the value is the same as the value of name. |
| description | No | String | Environment description. |
| tasks | Yes | Array of objects | Environment task. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Task name. |
| orderIndex | Yes | Integer | Task execution order. |
| taskTypeId | Yes | Object | Task type. For details, see Table 4. |
| input | Yes | Object | Task input. For details, see Table 5. |
Response
| Parameter | Type | Description |
|---|---|---|
| id | String | Environment ID. |
| name | String | Environment name. |
| creator | String | Environment creator. |
| revisor | String | Environment saver. |
| created_at | Integer | Creation time. |
| updated_at | Integer | Update time. |
| status | Integer | Environment status. |
| project_id | String | Project ID. |
| detail | String | Environment details. For details, see Table 7. |
| Parameter | Type | Description |
|---|---|---|
| name | String | Environment name. |
| tasks | String | Environment task. For details, see Table 8. |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Task ID. |
| name | String | Task name. |
| displayName | String | Display name of a task. |
| input | Object | Task input parameter. For details, see Table 10. |
| status | Integer | Task status. |
| errorDetails | String | Task error information. |
| stageName | String | Stage type. |
| taskTypeId | Object | Task type. For details, see Table 4. |
| Parameter | Type | Description |
|---|---|---|
| category | String | Task directory. |
| owner | String | Task owner. |
| provider | String | Task provider. |
| type | String | Task type. |
Example Request
{
"id": "805f7ec2-7c05-417b-bc3e-5f6035edb673",
"name": "Environment-894g",
"creator": "servicestage_iam5",
"revisor": "servicestage_iam5",
"created_at": 1753165301070,
"updated_at": 1753165301070,
"status": 0,
"project_id": "59336be373624a998b2527fdb9913266",
"detail": {
"name": "Environment-894g",
"tasks": [
{
"id": 0,
"name": "Deploy",
"display_name": "Deploy",
"task_type_id": {
"category": "Deploy",
"owner": "System",
"provider": "ENV-CAS",
"type": null
},
"input": {
"instanceId": "20acd377-0659-478c-b563-c2585166278e",
"appName": "ghy-test-0707-1-2",
"modifiedPath": "{\"ghy-test-0707-1-2\":\"${Artifacts_ghy-test-comp-0626-3-62e353_Output_release@PublishBuildImage}\"}",
"version": "1.0.0"
},
"output": {},
"status": null,
"order_index": 0,
"skipped": false,
"group_index": null,
"delay_time": 0,
"error_details": null,
"stage_name": null
}
]
}
} Example Response
{
"id": "805f7ec2-7c05-417b-bc3e-5f6035edb673",
"name": "Environment-894g",
"creator": "servicestage_iam5",
"revisor": "servicestage_iam5",
"created_at": 1753165301070,
"updated_at": 1753165301070,
"status": 0,
"project_id": "59336be373624a998b2527fdb9913266",
"detail": {
"name": "Environment-894g",
"tasks": [
{
"id": 0,
"name": "Deploy",
"displayName": "Deploy",
"taskTypeId": {
"category": "Deploy",
"owner": "System",
"provider": "ENV-CAS",
"type": null
},
"input": {
"instanceId": "20acd377-0659-478c-b563-c2585166278e",
"appName": "ghy-test-0707-1-2",
"modifiedPath": "{\"ghy-test-0707-1-2\":\"${Artifacts_ghy-test-comp-0626-3-62e353_Output_release@PublishBuildImage}\"}",
"version": "1.0.0"
},
"output": {},
"status": null,
"skipped": false
}
]
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error Codes
What is your overall rating for this page?
Thank 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