List Agents

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

List cloud agents in the user's account.

Filter criteria required - To obtain a list of agent assets, it is mandatory to add this filter criteria in <ServiceRequest>:

<Criteria field="tagName" operator="EQUALS">Cloud Agent</Criteria>

Pagination - A maximum of 100 agent assets are returned by default. To customize this specify a “preferences” tag in the POST body of your request. Learn more about pagination

Limit your results - Use the optional “fields” parameter to limit the amount of information returned. Learn more about limiting your results

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

Input ParametersInput Parameters

Supported filter 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  

networdGuid

  text  

trackingMethod

  keyword

NONE, IP, DNSNAME, NETBIOS, INSTANCE_ID, QAGENT

port

  integer  

installedSoftware

  text  

tagName

 Mandatory text  

tagId

  integer  

update

  date  

Assets with cloud agents

   

 

activationKey

  string

Allowed operator: EQUALS

agentConfigurationName

  string

Allowed operators: EQUALS, CONTAINS

agentConfigurationId

  long

Allowed operator: EQUALS

agentVersion

  string

Allowed operators: EQUALS, LESSER, GREATER

lastCheckedIn

  date

Allowed operators: EQUALS, LESSER, GREATER

Sample - List agentsSample - List agents

API request

curl -u "USERNAME:PASSWORD" -X "POST" -H "Content-Type: text/xml"  -H "Cache-Control: no-cache" --data-binary @list_all_agents.xml
"<qualys_base_url>/qps/rest/2.0/search/am/hostasset/"
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="tagName" operator="EQUALS">Cloud Agent</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>2</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <HostAsset>
            <id>611872</id>
            <name>113080-T4</name>
            <created>2017-01-12T05:59:47Z</created>
            <modified>2017-05-04T18:41:59Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>8572212</id>
                        <name>mytag</name>
                    </TagSimple>
                    <TagSimple>
                        <id>7584632</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                    <TagSimple>
                        <id>7730634</id>
                        <name>qa</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AssetSource/>
                </list>
            </sourceInfo>
            <qwebHostId>90289</qwebHostId>
            <lastComplianceScan>2017-01-
             13T06:41:34Z</lastComplianceScan>
            <lastSystemBoot>2017-01-13T14:38:09Z</lastSystemBoot>
            <lastLoggedOnUser>CORP\rkumar</lastLoggedOnUser>
            <os>WINDOWS 95 11</os>
            <dnsHostName>113080-t450</dnsHostName>
            <agentInfo>
                <agentVersion>1.5.5.101</agentVersion>
                <agentId>25fdbafc-4b9d-403b-962c-601bac5a6b69</agentId>
                <status>STATUS_INACTIVE</status>
                <lastCheckedIn>2017-01-13T19:18:07Z</lastCheckedIn>
                <connectedFrom>64.39.96.133</connectedFrom>
                <location>Sunnyvale,California United
                 States</location>
                <locationGeoLatitude>37.3537</locationGeoLatitude>
                <locationGeoLongtitude>-
                 122.0307</locationGeoLongtitude>
                <chirpStatus>Manifest Downloaded</chirpStatus>
                <platform>Windows</platform>
                <activatedModule>AGENT_VM</activatedModule>
                <manifestVersion>VULNSIGS-VM-2.3.493-
                 4</manifestVersion>
                <agentConfiguration>
                    <id>203801</id>
                    <name>Config Created using api-isdefault
                     one149245571382344323</name>
                </agentConfiguration>
                <activationKey>
                    <activationId>dcfab7e9-38c2-4301-8da1-
                     d3ecab9555d5</activationId>
                    <title>1480630093818 key by api count limited to
                    unlimited vm/pv active</title>
                </activationKey>
            </agentInfo>
            <netbiosName>113080-T450</netbiosName>
...      
    

XSD

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