Use this API to bulk cancel registry schedules.
You can provide a “filter” or a list of “scheduleIds” as part of the API request to identify the schedules you want to cancel. When both are provided in the same request, then only the scheduleIds specified will be canceled.
Note that scan jobs with a status of Finished, Unknown, and Error cannot be canceled and will be ignored automatically.
With this API, you can:
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
registryId |
Mandatory |
string |
ID/UUID of the registry you want to cancel the schedule for. |
scheduleIds |
Optional |
array[string] |
ID/UUID of the schedules you want to cancel. When specifying multiple scheduleIds in the same request, enter them in this way: scheduleIds=value1&scheduleIds=value2&scheduleIds=value3, and so on. The scan jobs with a status of Finished, Unknown and Error cannot be canceled and will be ignored automatically when included in the request. |
filter |
Optional |
string |
Filter the schedules list by providing a query using Qualys syntax. Refer to the “How to Search” topic in the online help for assistance with creating your query. |
In this sample, we’ll cancel two schedules by specifying the schedule IDs.
API request
curl -X POST
"http://gateway.qg2.apps.qualys.com/csapi/v1.3/registry/0a1d9b9a-3bab-42ec-a894-4d5969a47616/schedule/cancel?scheduleIds=0a1d9b9a-3bab-42ec-a894-4d5969a47616&scheduleIds=0a1d9b9a-3bab-42ec-a894-4d5969a47616" --header "Authorization: Bearer <token>"
Response
{
"CancelJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
In this sample, we’ll use a filter to cancel all schedules with a status of Running.
API request
curl -X POST
"http://gateway.qg2.apps.qualys.com/csapi/v1.3/registry/0a1d9b9a-3bab-42ec-a894-4d5969a47616/schedule/cancel?filter=status%3ARunning" --header 'Authorization: Bearer <token>'
Response
{
"CancelJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
In this sample, we’ll cancel all schedules by using a filter with scheduleUuid equal to * (%2A) in order to match all schedule IDs. (Scans with certain status levels will be skipped from this action.)
API request
curl -X POST
"http://gateway.qg2.apps.qualys.com/csapi/v1.3/registry/ea1e91f1-2686-45af-827f-2ec9ee4/schedule/cancel?scheduleIds=&filter=scheduleUuid%3A%2A" --header 'Authorization: Bearer <token>'
Response
{
"deletionJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
Was this topic helpful?