Act on a specific Task
/api/v2/tasks/{task_id}/{action}
Performs an action against a specific task that was scheduled by the Container Cloud Service. In this release you can perform the "cancel" action on a task.
Request
-
action: string
action
-
task_id: string
task_id
-
Authorization: apiKey
Type:
apiKey
Response
- application/json
200 Response
Default Response
Examples
The following example shows how to perform an action (cancel) on a specific task.You perform this task by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.
Note: The command in this example uses the URL structure https://rest_server_url/resource-path
, where rest_server_url
is the manager node for the Oracle Cloud Container instance. See Send Requests for the appropriate URL structure to use for Oracle Public Cloud.
cURL Command
curl -sk
-X "POST"
-H "Authorization: Bearer b39f09c71c297f1d"
"https://rest_server_url/api/v2/tasks/eed24579-a992-4640-be18-436f4f20f227/cancel"
{
In this example, eed24579-a992-4640-be18-436f4f20f227 is the task_id.
Example of Response Body
{
"Task": {
"ID": "eed24579-a992-4640-be18-436f4f20f227",
"Name": "kill container: e60b0b93b8ac4578c10a256cf058532a3bcc1144b438f41e86e8a15afc11e81d",
"User": "admin",
"Subsystem": "API",
"CreatedAt": {
"seconds": 1477543217,
"nanos": 1307622651
},
"ClosedAt": {
"seconds": 1477543217,
"nanos": 1773773063
},
"Percent": 100,
"Status": 4,
"HostID": "demomgr",
"HostStartedAt": {
"seconds": 1477382723,
"nanos": 1684699321
},
"Generation": 14
}
}