Get Asset Info

[GET] /qps/rest/2.0/get/am/asset/<id>

Returns a single asset by ID.

Limit your results - Use the optional “fields” parameter to limit the amount of information returned for the host asset. 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”

Sample - Fetch asset ID and list detailsSample - Fetch asset ID and list details

API request

curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/asset/12345"      
    

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/asset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>12345</id>
            <name>My Windows Asset</name>
            <created>2014-02-06T19:16:35Z</created>
            <modified>2014-02-06T19:16:35Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>12345</id>
                        <name>Tag 1</name>
                    </TagSimple>
                    <TagSimple>
                        <id>54321</id>
                        <name>Tag 2</name>
                    </TagSimple>
                </list>
            </tags>
        </Asset>
    </data>      
    

Sample - Get information for assets in your AWS CloudSample - Get information for assets in your AWS Cloud

API request

curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/asset/13236173"      
    

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/asset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>13236173</id>
            <name>MHCSTRHEL6-2</name>
            <created>2019-11-12T10:46:30Z</created>
            <modified>2020-01-07T06:26:41Z</modified>
            <type>HOST</type>
            <sourceInfo>
                <list>
                    <Ec2AssetSourceSimple>
                        <assetId>13236173</assetId>
                        <type>EC_2</type>
                        <firstDiscovered>2019-11-12T10:46:30Z</firstDiscovered>
                        <lastUpdated>2020-01-07T06:20:12Z</lastUpdated>
                        <reservationId>r-03ca004864372ef32</reservationId>
                        <availabilityZone>us-west-2a</availabilityZone>
                        <instanceId>i-0edf6a42bb540f885</instanceId>
                        <instanceType>t1.micro</instanceType>
                        <createdDate>2020-01-07T09:09:21Z</createdDate>
                        <instanceState>STOPPED</instanceState>
                        <groupId>sg-7493f147</groupId>
                        <groupName>Red Hat Enterprise Linux -RHEL- 6-6-5_GA-AutogenByAWSMP-1</groupName>
                        <spotInstance>false</spotInstance>
                        <accountId>XXXXXXXXXXXX</accountId>
                        <region>us-west-2</region>
                        <zone>Classic</zone>
                        <imageId>ami-7df0bd4d</imageId>
                        <monitoringEnabled>false</monitoringEnabled>
                    </Ec2AssetSourceSimple>
                </list>
            </sourceInfo>
        </Asset>
    </data>
</ServiceResponse>  

Sample - Get information for assets in your Azure CloudSample - Get information for assets in your Azure Cloud

API request

curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/asset/13511567"       
    

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/asset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>13511567</id>
            <name>VJ-WIndows</name>
            <created>2019-11-27T06:07:16Z</created>
            <modified>2020-01-07T06:21:29Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>107258219</id>
                        <name>Azure</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AzureAssetSourceSimple>
                        <assetId>13511567</assetId>
                        <type>AZURE</type>
                        <firstDiscovered>2019-11-27T06:07:20Z</firstDiscovered>
                        <lastUpdated>2020-01-07T06:21:29Z</lastUpdated>
                        <name>VJ-WIndows</name>
                        <location>centralindia</location>
                        <vmSize>Standard_A3</vmSize>
                        <vmId>b3fdb9ed-2564-4eaa-9e1b-7aeb6c196c92</vmId>
                        <offer>Windows-10</offer>
                        <state>RUNNING</state>
                        <publisher>MicrosoftWindowsDesktop</publisher>
                        <version>latest</version>
                        <osType>Windows</osType>
                        <subnet>default</subnet>
                        <subscriptionId>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</subscriptionId>
                        <resourceGroupName>DefaultResourceGroup-CIN</resourceGroupName>
                        <macAddress>00-0D-3A-F0-98-3F</macAddress>
                        <publicIpAddress>52.172.151.254</publicIpAddress>
                        <privateIpAddress>10.0.0.5</privateIpAddress>
                    </AzureAssetSourceSimple>
                </list>
            </sourceInfo>
        </Asset>
    </data>
</ServiceResponse> 

Sample - Get information for assets in your GCP CloudSample - Get information for assets in your GCP Cloud

API request

curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/asset/13511567"
      

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/asset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>13569298</id>
            <name>gcp-1-quays-aw8 0</name>
            <created>2019-12-02T09:32:45Z</created>
            <modified>2020-01-02T07:03:03Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>106777848</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                    <TagSimple>
                        <id>107007013</id>
                        <name>gcp</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <GcpAssetSourceSimple>
                        <assetId>13569298</assetId>
                        <type>GCP</type>
                        <firstDiscovered>2019-12-02T09:32:46Z</firstDiscovered>
                        <lastUpdated>2019-12-02T09:32:46Z</lastUpdated>
                        <instanceId>2152878541443265280</instanceId>
                        <hostname>gcp-1-quays-aw8.c.qvsa-dev.internal</hostname>
                        <machineType>n1-standard-1</machineType>
                        <zone>us-central1-a</zone>
                        <projectIdNo>1035365309337</projectIdNo>
                        <state>RUNNING</state>
                        <projectId>test_account</projectId>
                        <network>default</network>
                        <macAddress>42:01:0a:f0:00:a4</macAddress>
                        <publicIpAddress>34.67.172.38</publicIpAddress>
                        <privateIpAddress>10.240.0.164</privateIpAddress>
                    </GcpAssetSourceSimple>
                    <AssetSource/>
                </list>
            </sourceInfo>
        </Asset>
    </data>
</ServiceResponse>
 

Sample - Get asset API returns criticality score for an assetSample - Get asset API returns criticality score for an asset

API request

curl -n -u "USERNAME:PASSWORD" -H "content-type: text/xml"-X "GET" --
"<qualys_base_url>/rest/2.0/get/am/asset/3052446"      
    

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/rest/2.0/search/am/asset">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>3052446</id>
            <name>hkencrtest</name>
            <created>2020-02-06T09:29:23Z</created>
            <modified>2020-10-27T11:56:50Z</modified>
            <type>HOST</type>
            <tags>
                <list>
...
          
                </sourceInfo>
                <criticalityScore>2</criticalityScore>
            </Asset>
        </data>
    </ServiceResponse>      
    

Sample - Get Asset using Custom AttributesSample - Get Asset using Custom Attributes

API Request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml"-X "GET" --
"<qualys_base_url>/rest/2.0/get/am/asset/xxxxxx"      
    

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/rest/2.0/am/asset">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>xxxxxx</id>
            <name>test1</name>
            <created>2022-10-20T08:24:41Z</created>
            <modified>2023-01-16T22:18:58Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>xxxxxx</id>
                        <name>update-ats-847-specific-ag-bu</name>
                    </TagSimple>
                </list>
            </tags>
            <customAttributes>
                <list>
                    <CustomAttribute>
                        <key>department</key>
                        <value>Engineering
                        </key>
                    </CustomAttribute>
...
          
                </sourceInfo>
                <criticalityScore>5</criticalityScore>
            </Asset>
        </data>
    </ServiceResponse>      
    

XSD

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