Manage VM Scans

/api/2.0/fo/scan/?action={action}

Various actions you can take on VM scans i.e. cancel, pause, resume, delete, fetch.

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

action={value}

Required

String

One of these actions

cancel - Stop a scan in progress (POST)

pause - Pause a scan in progress (POST)

resume - Restart a scan that has been paused (POST)

delete - Delete a scan (POST)

fetch - Download scan results when scan has status Finished, Canceled, Paused or Error (GET or POST)

echo_request={0|1}

Optional

Integer 

Specify 1 to view (echo) input parameters in the XML output. By default these are not included.

scan_ref={value}

Required

Integer 

The scan reference of a scan. The scan status of this scan must be Finished.

ips={value}

Optional for fetch request

Integer 

Show only certain IP addresses/ranges in the scan results. One or more IPs/ranges

may be specified. A range entry is specified using a hyphen (for example, 10.10.10.1-10.10.10.20). Multiple entries are comma separated.

mode={brief|extended}

Optional for fetch request

Boolean 

The verbosity of the scan results details. One verbosity mode may be specified: brief (the default) or extended. The brief output includes this information: IP address, DNS hostname, NetBIOS hostname, QID and scan test results if applicable. The extended output includes the brief output plus this extended information: protocol, port, an SSL flag ("yes" is returned when SSL was used for the detection, "no" is returned when SSL was not used), and FQDN if applicable.

output_format={csv|json|

csv_extended|json_extended}

Optional for fetch request

File 

The output format of the vulnerability scan results. A valid value is: csv (the default), json (for JavaScript Object Notation(), csv_extended, json_extended.

client_id={value}

Optional for fetch request

Integer 

Id assigned to the client (Consultant type subscription only). Parameter client_id or client_name may be specified for the same request.

client_name={value}

Optional for fetch request

String 

Name of the client (Consultant type subscription only). Parameter client_id or client_name may be specified for the same request.

Sample - Cancel VM ScanSample - Cancel VM Scan

API Request

curl -H "X-Requested-With: Curl Sample" -d "action=cancel&scan_ref=234234234.12345" -b "QualysSession=71e6cda2a35d2cd404cddaf305ea0208; path=/api; secure" "https://<qualys_base_url>/api/2.0/fo/scan/"

Sample - Pause VM ScanSample - Pause VM Scan

API Request

curl -H "X-Requested-With: Curl Sample" -d "action=pause&scan_ref=234234234.12345" -b "QualysSession=71e6cda2a35d2cd404cddaf305ea0208; path=/api; secure" "https://<qualys_base_url>/api/2.0/fo/scan/"

Sample 3 - Resume VM ScanSample 3 - Resume VM Scan

API Request

curl -H "X-Requested-With: Curl Sample" -d "action=resume&scan_ref=234234234.12345" -b "QualysSession=71e6cda2a35d2cd404cddaf305ea0208; path=/api; secure" "https://<qualys_base_url>/api/2.0/fo/scan/"

Sample 4 - Fetch/Download  Scan ResultSample 4 - Fetch/Download  Scan Result

API Request

curl -H "X-Requested-With: Curl Sample" -d "action=fetch&scan_ref=234234234.12345" -b "QualysSession=71e6cda2a35d2cd404cddaf305ea0208; path=/api; secure" "https://<qualys_base_url>/api/2.0/fo/scan/"

DTD

<platform API server>/api/2.0/simple_return.dtd