I was looking at the Qualys API guides and wanted to know if there is a way that i could list all the Asset ID's (not hostids)
YOu have to trick it though with a criteria in the XML like:
<ServiceRequest> <preferences> <limitResults>100</limitResults> </preferences> <filters> <Criteria field="lastVulnScan" operator="LESSER">1999-01-01</Criteria> </filters></ServiceRequest>
Chapter 4 does talk about Get Asset Info the parameter for the same is an asset id, the request was to know if there is a way i could all asset id's like the way we list the host ids.
curl -H "X-Requested-With: Curl Sample" -u "username:password" "https://qualysapi....com/api/2.0/fo/asset/host/?action=list&echo_request=1"
Is it possible to use criteria in the query with the Python API?
Thank you for the suggestion, i shall look at it and come back to you on the same.
Pass the XML data along with the requests like this:
postdata = """<ServiceRequest>
<Criteria field="instanceId" operator="EQUALS">i-012345abcde</Criteria>
<Criteria field="trackingMethod" operator="EQUALS">INSTANCE_ID</Criteria>
url = "https://qualysapi.qg2.apps.qualys.com/qps/rest/2.0/search/am/hostasset"
response = requests.post(url, auth=(username,password), data=postdata)
The above will search for the asset that matches above criteria
Retrieving data ...