Delete Asynchronous Jobs Matching Filters
/r-scripts/v2/jobs
Request
-
commentsPattern: string
Optional regex pattern filter for the job comments column.
-
createdOlderThanSeconds: integer(int64)
Optional age filter. Delete jobs created more than this many seconds ago. Must be at least 1800 seconds.
-
finishedOlderThanSeconds: integer(int64)
Optional age filter. Delete jobs finished more than this many seconds ago. Must be at least 1800 seconds.
-
status: string
Optional job status filter, for example FINISH, ERROR, CANCELLED, TIMEOUT, or RUNNING.
There's no request body for this operation.
Back to TopResponse
- application/json
200 Response
400 Response
401 Response
500 Response
Examples
Use the asynchronous job deletion endpoint to delete jobs that match specified filters. The examples show deletion by status, comments pattern, and job age. Each request is independent. You can combine one or more filters for bulk job deletion.
The filters demonstrated are:
- Jobs with cancelled status
- Jobs whose comments match a pattern
- Jobs created more than 1,800 seconds ago
- Jobs with completion time status
Each example includes the request and a sample response.
Delete jobs with cancelled status
To delete jobs with cancelled status, set status to cancelled.
curl -i -k -X DELETE \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?status=cancelled"
The response reports the number of deleted jobs.
{
"result": "Successfully deleted 1 jobs"
}
Delete jobs matching a comments pattern
To delete jobs whose comments match a pattern, set commentsPattern to that
pattern. This example uses random.
curl -i -k -X DELETE \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?commentsPattern=random"
The response reports the number of deleted jobs.
{
"result": "Successfully deleted 1 jobs"
}
Delete jobs created more than 1,800 seconds ago
To delete jobs created more than 1,800 seconds ago, set
createdOlderThanSeconds to 1800.
curl -i -k -X DELETE \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?createdOlderThanSeconds=1800"
The response reports the number of deleted jobs.
{
"result": "Successfully deleted 1 jobs"
}
Delete jobs finished more than 1,800 seconds ago
To delete jobs finished more than 1,800 seconds ago, set
finishedOlderThanSeconds to 1800.
curl -i -k -X DELETE \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?finishedOlderThanSeconds=1800"
The response reports the number of deleted jobs.
{
"result": "Successfully deleted 3 jobs"
}
Delete jobs matching two filters: status and comments pattern
To delete jobs with a FINISH status and comments that match a pattern, set
status and commentsPattern. This example deletes jobs
whose status is FINISH and whose comments match random:
curl -i -k -X DELETE \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?commentsPattern=random&status=FINISH"
The response reports the number of deleted jobs:
{
"result": "Successfully deleted 2 jobs"
}