Terminate task
Changed onStops the task, that is, cancels image pulling if in progress, stops the container if running, and sets the status to terminated. No-op if the task is already terminated
Request
- Base URL: http://localhost:10998/api
- URL: http://localhost:10998/api/tasks/{id}/terminate
- Auth: none declared
Path parameters
Unique task ID assigned by dstack server
Request body
Example request
{
"termination_reason": "TERMINATED_BY_USER"
}Response
Task info
Example response
{
"id": "23a2c7a0-6c88-48ee-8028-b9ad9f6f5c24",
"status": "terminated",
"ports": [
{
"host": 32770,
"container": 80
}
],
"container_name": "horrible-mule-1-0-0-44f7cb95",
"container_id": "a6bb8d4bb8af8ec72482ecd194ff92fac9974521aa5ad8a46abfc4f0ba858775",
"gpu_ids": [
"GPU-2b79666e-d81f-f3f8-fd47-9903f118c3f5"
]
}Changes
- info
api tag
Tasksadded
- info
- breaking
removed the enum value
CONTAINER_EXITED_WITH_ERRORof the request property//// - breaking
removed the enum value
CREATING_CONTAINER_ERRORof the request property//// - breaking
removed the enum value
DONE_BY_RUNNERof the request property//// - breaking
removed the enum value
EXECUTOR_ERRORof the request property//// - breaking
removed the enum value
TERMINATED_BY_SERVERof the request property//// - breaking
removed the enum value
TERMINATED_BY_USERof the request property//// - warning
added the new
container_exited_with_errorenum value to theresponse property for the response status - warning
added the new
creating_container_errorenum value to theresponse property for the response status - warning
added the new
done_by_runnerenum value to theresponse property for the response status - warning
added the new
executor_errorenum value to theresponse property for the response status - warning
added the new
max_duration_exceededenum value to theresponse property for the response status - warning
added the new
terminated_by_serverenum value to theresponse property for the response status - warning
added the new
terminated_by_userenum value to theresponse property for the response status - info
added the new
container_exited_with_errorenum value to the request property//// - info
added the new
creating_container_errorenum value to the request property//// - info
added the new
done_by_runnerenum value to the request property//// - info
added the new
executor_errorenum value to the request property//// - info
added the new
max_duration_exceededenum value to the request property//// - info
added the new
terminated_by_serverenum value to the request property//// - info
added the new
terminated_by_userenum value to the request property//// - info
removed the
CONTAINER_EXITED_WITH_ERRORenum value from theresponse property for the response status - info
removed the
CREATING_CONTAINER_ERRORenum value from theresponse property for the response status - info
removed the
DONE_BY_RUNNERenum value from theresponse property for the response status - info
removed the
EXECUTOR_ERRORenum value from theresponse property for the response status - info
removed the
TERMINATED_BY_SERVERenum value from theresponse property for the response status - info
removed the
TERMINATED_BY_USERenum value from theresponse property for the response status
- breaking