Use this API to create a schedule to pull and scan a registry.
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
registryId |
Mandatory |
string |
The ID of the registry you want to scan. |
Request body |
Mandatory |
- |
Specify the request body parameters as explained under the Request Body Parameters section below. |
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
OnDemand |
Mandatory |
Boolean |
Specify true if you want to enable OnDemand scan. Otherwise, an Automatic scan will be triggered every day at a set time. The default value is true. |
repo |
Mandatory |
string |
Provide the name of the repository you want to scan. You can add one more repositories to a single scan schedule. |
tag |
Mandatory |
string |
For OnDemand scan, include image tags you want to include in the scan (comma-separated values). |
days |
Mandatory |
integer |
For OnDemand scan, include images created a certain number of days ago. Enter 1-7 days or 14 (for the last two weeks). Specify null if you do not want to filter images using this parameter. |
scheduleScanIntervalInDays |
Mandatory |
integer |
For an Automatic scan, specify how often the scan should run in days (1-365). For example, set to 1 to scan daily, set to 7 to scan every 7 days, set to 10 to scan every 10 days, etc. |
weekDay | Mandatory (for weekly automatic scan schedules) | string |
For an automatic registry scan schedule, specify a day on which the scan is triggered every week. The value is the name of a day. For example, MONDAY, TUESDAY, or WEDNESDAY. This field is valid only when the "scheduleIntervalInDays "parameter has a value of 7. |
schedule |
Mandatory |
string |
Valid only when scheduleScanIntervalInDays=1 For a daily Automatic scan, specify the scan start time in UTC (e.g., 19:30). |
forceScan |
Mandatory |
Boolean |
The Force Registry Image Scan feature must be enabled for your subscription. When enabled, this option is valid for OnDemand scans and for Automatic scans when scheduleScanIntervalInDays is 7 or greater. Specify "true" if you want to scan all images each time the registry scan is launched. This means each scan job will scan new images and rescan previously found images. The default value is "false". |
API request
curl -X POST
"<qualys_base_url>/csapi/v1.3/registry/fd05c5d5-7583-4e47-b538-c8b414bd9c86/schedule"
-H "accept: application/json"
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
Request Body
{
"filters": [
{
"days": 90,
"repoTags": [
{
"repo": "azuretest",
"tag": null
}
]
}
],
"name": "Automatic Scan Schedule",
"onDemand": false,
"schedule": "06:55",
"forceScan": true,
"registryType": "Azure",
"scheduleIntervalInDays": 7,
"additionalFilters": null,
"weekDay": "THURSDAY"
}
Response
{
"scheduleUuid": "889ea97d-5b9c-4e34-9783-a40eae8d8feb"
}
API request
curl -X POST
"<qualys_base_url>/csapi/v1.3/registry/fd05c5d5-7583-4e47-b538-c8b414bd9c86/schedule"
-H "accept: application/json"
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
Request Body
{
"filters": [
{
"days": null,
"repoTags": [
{
"repo": "azuretest",
"tag": null
}
]
}
],
"name": "Automatic Scan Schedule",
"onDemand": false,
"schedule": "09:30",
"forceScan": true,
"registryType": "Azure",
"scheduleIntervalInDays": 7,
"additionalFilters": {
"numberOfTags": 5,
"sortCriteria": "createdDate"
},
"weekDay": "THURSDAY"
}
Response
{
"scheduleUuid": "094ef321-e601-4fb3-b378-7a62f13249de"
}
Was this topic helpful?