Deletes images in your account.
Images with active containers (CREATED, RUNNING, STOPPED, PAUSED) associated with them, cannot be deleted.
You can choose to provide a request body without parameters or you can specify UUIDs or filter as input parameters in the API request.
When specifying the request body:
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
imageDeleteRequest |
Mandatory |
- |
The user filters to query images or provide one or more image UUIDs to delete. The filter can be applied by providing a query using Qualys syntax. Refer to the “How to Search” topic in the online help for assistance with creating your query. |
When specifying input parameters as part of the path:
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
imageIds |
Optional |
array[string] |
One or more image UUIDs for the images you want to delete. When specifying multiple images in the same request, enter them in this way: imageIds=value1&imageIds=value2&imageIds=value3, and so on. |
filter |
Optional |
string |
Filter the images 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, a request body is used as part of the API request.
API request
curl -X DELETE
"<qualys_api_server_url>/csapi/v1.3/images" -d "{"imageIds":["e3e4cca0-8305-3835-810a-b334dcb65a33"]}" --header "Authorization: Bearer <token>"
Response
Returns {
"deletionJobId": "980ce235-5677-4997-81ca-3905e63471bb"
}
response code 200
In this sample, we’ll delete a single image by specifying the image UUID.
API request
curl -X DELETE
"<qualys_api_server_url>/csapi/v1.3/images?imageIds=8b261e4e-47f3-3b6a-a5a7-668ff0d6e3eb" --header "Authorization: Bearer <token>"
Response
{
"deletionJobId": "ee295423-af59-4f5c-a4a1-7cb035dae61b"
}
In this sample, we’ll delete 2 images in the same request. Specify multiple images by entering imageIds=value1&imageIds=value2, and so on.
API request
curl -X DELETE
"<qualys_api_server_url>/csapi/v1.3/images?imageIds=8b261e4e-47f3-3b6a-a5a7-668ff0d6e3eb&imageIds=9b251e3e-52f3-2b6a-a6a7-678ff0d5e2eb" --header "Authorization: Bearer <token>"
Response
{
"deletionJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
In this sample, we’ll delete images based on the filter parameter.
API request
curl -X DELETE
"<qualys_api_server_url>/csapi/v1.3/images?filter=imageId%3Aec3b4a64d481" --header "Authorization: Bearer <token>"
Response
{
"deletionJobId": "ee295423-af59-4f5c-a4a1-7cb035dae61b"
}