Returns a single host asset by ID. This API returns additional EC2 metadata of Amazon EC2 hosts when inventoried using the Qualys EC2 Connector.
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”
API request
curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/hostasset/84021"
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>1</count>
<hasMoreRecords>false</hasMoreRecords>
<data>
<HostAsset>
<id>84021</id>
<name>10.10.23.245</name>
<created>2018-09-12T06:21:54Z</created>
<modified>2018-09-13T01:14:34Z</modified>
<type>HOST</type>
<tags>
<list>
<TagSimple>
<id>7539414</id>
<name>Cloud Agent</name>
</TagSimple>
</list>
</tags>
<sourceInfo>
<list>
<AssetSource/>
</list>
</sourceInfo>
<qwebHostId>18903</qwebHostId>
<os>Microsoft Windows XP Professional 5.1.2600 Service Pack 3 Build 2600</os>
<dnsHostName>XPSP2-32-27-145</dnsHostName>
<netbiosName>XPSP2-32-27-145</netbiosName>
<address>10.10.23.245</address>
<trackingMethod>QAGENT</trackingMethod>
<manufacturer>VMware, Inc.</manufacturer>
<model>VMware Virtual Platform</model>
<totalMemory>2047</totalMemory>
<timezone>-07:00</timezone>
<biosDescription>INTEL - 6040000</biosDescription>
<openPort>
<list>
<HostAssetOpenPort>
<port>1900</port>
<protocol>UDP</protocol>
</HostAssetOpenPort>
<HostAssetOpenPort>
<port>7055</port>
<protocol>TCP</protocol>
</HostAssetOpenPort>
</list>
</openPort>
<software>
<list>
<HostAssetSoftware>
<name>Security Update for Windows XP (KB2347290)</name>
<version>1</version>
</HostAssetSoftware>
<HostAssetSoftware>
<name>Security Update for Windows XP (KB950974)</name>
<version>1</version>
</HostAssetSoftware>
</list>
</software>
<vuln>
<list>
<HostAssetVuln>
<qid>118956</qid>
<hostInstanceVulnId>296963</hostInstanceVulnId>
<firstFound>2016-02-12T08:42:43Z</firstFound>
<lastFound>2016-02-13T01:13:04Z</lastFound>
</HostAssetVuln>
<HostAssetVuln>
<qid>119053</qid>
<hostInstanceVulnId>296965</hostInstanceVulnId>
<firstFound>2016-02-12T08:42:43Z</firstFound>
<lastFound>2016-02-13T01:13:04Z</lastFound>
</HostAssetVuln>
</list>
</vuln>
<processor>
<list>
<HostAssetProcessor>
<name>Intel Celeron processor</name>
<speed>2799</speed>
</HostAssetProcessor>
</list>
</processor>
<volume>
<list>
<HostAssetVolume>
<name>A:</name>
<size>0</size>
<free>0</free>
</HostAssetVolume>
<HostAssetVolume>
<name>C:</name>
<size>16106090496</size>
<free>2418925568</free>
</HostAssetVolume>
</list>
</volume>
<account>
<list>
<HostAssetAccount>
<username>Administrator</username>
</HostAssetAccount>
<HostAssetAccount>
<username>Guest</username>
</HostAssetAccount>
</list>
</account>
<networkInterface>
<list>
<HostAssetInterface>
<hostname>XPSP2-32-27-145</hostname>
<interfaceName>VMware Accelerated AMD PCNet Adapter - Packet Scheduler Miniport</interfaceName>
<macAddress>00:50:56:A9:46:72</macAddress>
<type>LOCAL</type>
<address>10.10.23.245</address>
<gatewayAddress>10.10.23.1</gatewayAddress>
</HostAssetInterface>
</list>
</networkInterface>
</HostAsset>
</data>
</ServiceResponse>
Tags for the EC2 asset appear in the <Ec2AssetSourceSimple> element.
API request
curl -n -u "USERNAME:PASSWORD"
"<qualys_base_url>/qps/rest/2.0/get/am/hostasset/709838"
XML output
<?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>1</count>
<data>
<HostAsset>
<id>709838</id>
<name>my-ec2-target</name>
<created>2017-07-27T18:14:28Z</created>
<modified>2017-07-27T18:21:31Z</modified>
<type>HOST</type>
<tags>
<list/>
</tags>
<sourceInfo>
<list>
<Ec2AssetSourceSimple>
<firstDiscovered>2017-07-27T18:14:28Z</firstDiscovered>
<lastUpdated>2017-07-27T19:51:03Z</lastUpdated>
<assetId>709838</assetId>
<ec2InstanceTags>
<tags>
<list>
<EC2Tags>
<key>Department</key>
<value>Security</value>
</EC2Tags>
<EC2Tags>
<key>Owner</key>
<value>Jason Kim</value>
</EC2Tags>
<EC2Tags>
<key>Email</key>
<value>[email protected]</value>
</EC2Tags>
<EC2Tags>
<key>JIRA</key>
<value>POR-6719</value>
</EC2Tags>
<EC2Tags>
<key>Name</key>
<value>my-ec2-target</value>
</EC2Tags>
<EC2Tags>
<key>Lifecycle</key>
<value>20171231</value>
</EC2Tags>
</list>
</tags>
</ec2InstanceTags>
<availabilityZone>us-east-1e</availabilityZone>
<instanceId>i-023b166432b1c7afc</instanceId>
<instanceType>t2.medium</instanceType>
<createdDate>2017-07-27T19:58:34Z</createdDate>
<instanceState>STOPPED</instanceState>
<groupId>sg-6b619117</groupId>
<groupName>default</groupName>
<spotInstance>true</spotInstance>
<accountId>205767712438</accountId>
<subnetId>subnet-7bbbcd56</subnetId>
<vpcId>vpc-2da7154b</vpcId>
<region>us-east-1</region>
<zone>VPC</zone>
<imageId>ami-22ce4934</imageId>
<publicIpAddress>127.0.0.1</publicIpAddress>
<privateIpAddress>10.97.15.117</privateIpAddress>
<monitoringEnabled>false</monitoringEnabled>
</Ec2AssetSourceSimple>
</list>
</sourceInfo>
<qwebHostId>12864</qwebHostId>
<os>Linux</os>
<address>10.97.15.117</address>
<trackingMethod>INSTANCE_ID</trackingMethod>
<openPort>
<list/>
</openPort>
<software>
<list/>
</software>
<vuln>
<list/>
</vuln>
<processor>
<list/>
</processor>
<volume>
<list/>
</volume>
<account>
<list/>
</account>
<networkInterface>
<list>
<HostAssetInterface>
<interfaceId>eni-09f901fe</interfaceId>
<interfaceName>Primary network interface</interfaceName>
<type>PRIVATE</type>
<address>10.97.15.117</address>
</HostAssetInterface>
</list>
</networkInterface>
</HostAsset>
</data>
</ServiceResponse>
Tags for the docker information appear in the <dockerInfo> element.
API request
curl -n -u "USERNAME:PASSWORD"
"<qualys_base_url>/qps/rest/2.0/get/am/hostasset/7727721"
XML output
<?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>1</count>
<data>
<HostAsset>
<id>7727721</id>
<name>10.113.198.121</name>
<created>2018-06-15T11:51:26Z</created>
<modified>2018-06-15T11:51:26Z</modified>
<type>HOST</type>
<tags>
<list>
<TagSimple>
<id>8910214</id>
<name>SSD27701</name>
</TagSimple>
<TagSimple>
<id>9252992</id>
<name>All_data1</name>
</TagSimple>
</list>
</tags>
<qwebHostId>707520</qwebHostId>
<lastVulnScan>2018-06-15T11:48:58Z</lastVulnScan>
<os>CentOS Linux 7.2.1511</os>
<address>10.113.198.121</address>
<trackingMethod>IP</trackingMethod>
<openPort>
<list>
<HostAssetOpenPort>
<port>8080</port>
<protocol>TCP</protocol>
<serviceId>1180</serviceId>
<serviceName>HyperText Transport
Protocol</serviceName>
</HostAssetOpenPort>
</list>
</openPort>
<vuln>
<list>
<HostAssetVuln>
<qid>45038</qid>
<hostInstanceVulnId>151189845</hostInstanceVulnId>
<firstFound>2018-06-15T11:48:58Z</firstFound>
<lastFound>2018-06-15T11:48:58Z</lastFound>
</HostAssetVuln>
</list>
</vuln>
<networkInterface>
<list>
<HostAssetInterface>
<type>LOCAL</type>
<address>10.113.198.121</address>
</HostAssetInterface>
</list>
</networkInterface>
<isDockerHost>true</isDockerHost>
<dockerInfo>
<dockerVersion>18.06.0-ce-rc1</dockerVersion>
<noOfContainers>1</noOfContainers>
<noOfImages>2</noOfImages>
</dockerInfo>
</HostAsset>
</data>
</ServiceResponse>
API request
curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/hostasset/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/hostasset.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>
API request
curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/hostasset/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/hostasset.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>
<azureVmTags>
<tags>
<list>
<AzureTags>
<key>Owner</key>
<value>John Doe</value>
</AzureTags>
<AzureTags>
<key>Department</key>
<value>Engineering</value>
</AzureTags>
</list>
</tags>
</azureVmTags>
<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>
<state>SUCCEEDED</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>
<virtualNetwork>CV-VirtualMachines-RG-vnet</virtualNetwork>
</AzureAssetSourceSimple>
</list>
</sourceInfo>
</Asset>
</data>
</ServiceResponse>
API request
curl -n -u "USERNAME:PASSWORD" "<qualys_base_url>/qps/rest/2.0/get/am/hostasset/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/hostasset.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>
<imageId>projects/centoscloud/global/images/centos-6-v20191014</imageId>
<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>
API request
curl -n -u "USERNAME:PASSWORD" -H "content-type: text/xml"-X "GET" --
"<qualys_base_url>/rest/2.0/get/am/hostasset/3052446"
XML output
<?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/hostasset">
<responseCode>SUCCESS</responseCode>
<count>1</count>
<data>
<HostAsset>
<id>3052446</id>
<name>hkencrtest</name>
<created>2020-02-06T09:29:23Z</created>
<modified>2020-10-27T11:56:50Z</modified>
<type>HOST</type>
<tags>
...
</sourceInfo>
<criticalityScore>2</criticalityScore>
<os>Linux</os>
<dnsHostName>hkencrtest</dnsHostName>
<address>13.71.5.220</address>
<trackingMethod>VIRTUAL_MACHINE_ID</trackingMethod>
<networkInterface>
...
</networkInterface>
<isDockerHost>false</isDockerHost>
</HostAsset>
</data>
</ServiceResponse>
<platform API server>/qps/xsd/2.0/am/hostasset.xsd