Launch On Demand Scan for Multiple Asset
Launches on-demand scan on multiple assets with the defined criteria, where Cloud Agent is installed. For bulk request, it is mandatory to add criteria in the service request. For example, <Criteria field="tagName" operator="EQUALS">Cloud Agent</Criteria>.
You must provide at least one criteria in a service request for launching on demand scan on multiple assets.
The on-demand scan helps you with the flexibility to initiate a scan without waiting for the next scheduled scan.
Input ParametersInput Parameters
Use these parameters to launch an on-demand scan.
Parameter |
Mandatory /Optional |
Data Type |
Description |
---|---|---|---|
scan |
Mandatory |
value |
Type of on-demand scan to be launched. Valid values are: Inventory_Scan, Vulnerability_Scan, PolicyCompliance_Scan, UDC_Scan, SCA_Scan, SWCA_scan Note: You can only launch one type of scan at one time. |
overrideConfigCpu |
Optional |
boolean |
Set this flag to define the CPU throttle limits that the on demand scan will use. - Set to true to override the CPU throttle limits set in the configuration profile. - Set to false to use the CPU throttle limit values set in the configuration profile. If you do not provide any value in the API request URL, the default value— false is considered. Note: By default, Cloud Agent for Windows uses a throttle value of 80, and Cloud Agent for Linux uses a value of 0 (no throttling). |
Sample - Launch on demand scan on multiple assetsSample - Launch on demand scan on multiple assets
API request
curl -X POST -H "Content-Type: text/xml" -H "Authorization: Basic AbcdAbcdAbcdAbcdAbcdAbcdAb" -H "Xurl" -H "Cache-Control: no-cache" -- data @Bulk_ODS.xml "<qualys_base_url>/qps/rest/1.0/ods/ca/agentasset?scan=Inventory_Scan&overrideConfigCpu =true"
Contents of Bulk_ODS.xml
<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest>
<filters>
<Criteria field="tagName" operator="EQUALS">Tag4</Criteria>
</filters>
</ServiceRequest>
Response
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/1.0/ca/agentasset.xsd"> >
<responseCode>SUCCESS</responseCode>
<count>4</count>
<data>
<SingleModuleResponse>
<module>SCA Scan</module>
<count>4</count>
<assetIds>[16873061, 17180531, 18901656, 18908888]</assetIds>
<responseCode>SUCCESS</responseCode>
</SingleModuleResponse>
</data>
</ServiceResponse>
XSD
<platform API server>/qps/xsd/1.0/ca/agentasset.xsd