ExecuteJobAction - Execute a job action
Applicable editions | Central Edition, Region Edition |
Service endpoint and authorization
- Obtain the service endpoint and replace
{domain}in the request syntax. - Obtain a personal access token.
- Obtain the organization ID. Required for the Central Edition only. You can find it on the Basic Information page in the Organization Management console.
Product | Resource | Required permissions |
Application Delivery | change order | Read/write |
Request syntax
Central Edition
PUT https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/changeOrders/{changeOrderSn}/jobs/{jobSn}:execute
Region Edition
PUT https://{domain}/oapi/v1/appstack/apps/{appName}/changeOrders/{changeOrderSn}/jobs/{jobSn}:execute
Request headers
Parameter | Type | Required | Description | Example |
x-yunxiao-token | string | Yes | Your personal access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Location | Required | Description | Example |
appName | string | path | Yes | The application name. | my-web-service |
changeOrderSn | string | path | Yes | The unique identifier of the change order. This corresponds to | 42945838eec54c86b56cfad3e99ef9fe |
jobSn | string | path | Yes | The unique identifier of the job. This corresponds to | 40bfa492838047ce91870f52f6017ca6 |
organizationId | string | path |
| The organization ID. | ec766e63aee3437d9a51f334d6exe671 |
| - | object | body | No | The request body. | |
| actionType | string | body | Yes | Specifies the action to perform on the job. Valid values: 'SUSPEND', 'RESUME', 'ROLLBACK', and 'STOP'. | SUSPEND |
| context | object | body | No | The context for the action. | |
| reason | string | body | No | The reason for performing the action. |
Request examples
Central Edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/changeOrders/42945838eec54c86b56cfad3e99ef9fe/jobs/40bfa492838047ce91870f52f6017ca6:execute' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"actionType": "SUSPEND",
"context": {
"reason": ""
}
}'
Region Edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/appstack/apps/my-web-service/changeOrders/42945838eec54c86b56cfad3e99ef9fe/jobs/40bfa492838047ce91870f52f6017ca6:execute' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"actionType": "SUSPEND",
"context": {
"reason": ""
}
}'
Response parameters
Parameter | Type | Description | Example |
| - | object | The response body. | |
| creator | string | The user who created the change order. | 10df6011-2837-4fdb-ad92-356a679a60ca |
| description | string | The description of the change order. | Release a routine change |
| endedAt | string | The time the change order was completed. | 2024-10-08T09:11:38Z |
| gmtCreate | string | The time the change order was created. | 2024-10-08T09:11:38Z |
| jobs | array | A list of jobs within the change order. | |
| - | object | A summary of a job. | |
| envName | string | The name of the environment. | |
| sn | string | The unique identifier of the job. | |
| state | string | The status of the job. | |
| name | string | The name of the change order. | 20241008171130-Deploy |
| sn | string | The unique identifier of the change order. | bc62b3e953714aa8be431f47b9c9b72a |
| startedAt | string | The time the change order started. | 2024-10-08T09:11:38Z |
| state | string | The status of the change order. Valid values: 'INIT', 'PREPARING', 'RUNNING', 'SUSPENDED', 'CANCELED', 'SUCCESS', and 'FAILED'. | RUNNING |
| type | string | The type of the change order. Valid values: 'Deploy', 'Scale', 'Rollback', and 'Destroy'. | Deploy |
| version | string | The version used for the change order. | 20241008171130-762 |
Response example
{
"creator": "10df6011-2837-4fdb-ad92-356a679a60ca",
"description": "Release a routine change",
"endedAt": "2024-10-08T09:11:38Z",
"gmtCreate": "2024-10-08T09:11:38Z",
"jobs": [
{
"envName": "",
"sn": "",
"state": ""
}
],
"name": "20241008171130-Deploy",
"sn": "bc62b3e953714aa8be431f47b9c9b72a",
"startedAt": "2024-10-08T09:11:38Z",
"state": "RUNNING",
"type": "Deploy",
"version": "20241008171130-762"
}
Error codes
See the Error Code Center for a list of API error codes.