Executing a Scenario
Function
This API is used to execute all jobs and services in a scenario.
URI
POST /v2.0/{project_id}/workspaces/{workspace_id}/resources/{resource_id}/schedule-scene
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. |
| resource_id | Yes | String | Resource ID (data source ID or scenario ID) |
| workspace_id | Yes | String | Workspace ID |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| action | No | String | Action type. The options are: START: A job starts running. STOP: A job stops running. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Content type. The value is application/json. |
| X-Auth-Token | Yes | String | User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| is_success | Boolean | Whether the request is successful |
| message | String | Response message |
| error_code | String | Error code (This parameter is not returned when the request is successful.) |
Example Requests
This API is used to schedule a specified scenario.
/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/resources/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/schedule-scene?action=START -
Example Responses
Status code: 200
OK
{
"is_success" : true,
"message" : "Succeed to schedule scene jobs."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
See Error Codes.
Last Article: Executing a Job
Next Article: Scenario
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.