Count Host Assets

[POST] /qps/rest/2.0/count/am/hostasset

Returns the number of host assets that match the provided criteria. A host asset is counted when the asset is visible to the user (i.e. it is in the user’s scope).



Permissions required - Managers with full scope. Other users must have these permissions: Access Permission “API Access” and Asset Management Permission “Read Asset”

Input ParametersInput Parameters

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

qwebHostId

Optional

integer

 

lastVulnScan

Optional

date

 

lastComplianceScan

Optional

date

 

informationGatheredUpdated

Optional

date

 

os

Optional

text

 

dnsHostName

Optional

text

 

address

Optional

text

 

vulnsUpdated

Optional

date

 

id

Optional

integer

 

name

Optional

text

 

created

Optional

date

 

type

 

text

 

netbiosName

 

string

 

netbiosNetworkID

 

text

 

networkGuid

 

text

 

trackingMethod

 

keyword

NONE, IP, DNSNAME, NETBIOS, INSTANCE_ID, QAGENT

port

 

integer

 

installedSoftware

 

text

 

tagName

 

text

 

tagId

 

integer

 

update

 

date

 

Sample - Count host assetsSample - Count host assets

API request

curl -u "USERNAME:PASSWORD" -X POST --data-binary @- <qualys_base_url>/qps/rest/2.0/count/am/hostasset -H vContent-Type: application/xml" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest>
    <filters>
        <Criteria field="os" operator="EQUALS">Windows</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/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>235</count>
</ServiceResponse>      
    

XSD

<platform API server>/qps/xsd/2.0/am/hostasset.xsd