Uninstall Agent using Host Asset API
You can use the Host Asset API to uninstall a single cloud agent and remove the associated agent host from your subscription.
Where “id” (Required) is the asset ID of the agent you want to uninstall. This is the asset ID where the agent is installed.
Good to Know - A request to uninstall an agent makes a call to the Qualys Cloud Platform to purge the host scan data (findings) for the agent host and remove the agent host from your subscription.
Permissions required - Managers with full scope. Other users must have these permissions: Access Permission “API Access” and CA Agent Permission “Uninstall Agent".
Input ParametersInput Parameters
There are no input parameters.
Sample - Uninstall single agentSample - Uninstall single agent
API request
curl -u fo_username:password -X POST -H "Content-Type: text/xml" --data-binary @single_uninstall.xml
"<qualys_base_url>/qps/rest/2.0/uninstall/am/hostasset/6851120"
Contents of single_uninstall.xml
<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest></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>1</count>
<hasMoreRecords>false</hasMoreRecords>
<data>
<HostAsset>
<id>6851120</id>
<name>shwetas-Mac-mini.local</name>
<created>2018-03-07T11:43:26Z</created>
<modified>2018-03-08T06:49:56Z</modified>
<type>HOST</type>
<tags>
<list>
<TagSimple>
<id>8652821</id>
<name>Cloud Agent</name>
</TagSimple>
<TagSimple>
<id>8654616</id>
<name>DT_Port</name>
</TagSimple>
</list>
</tags>
<sourceInfo>
<list>
<AssetSource/>
</list>
</sourceInfo>
<qwebHostId>672160</qwebHostId>
<lastComplianceScan>2018-03-
08T01:20:28Z</lastComplianceScan>
<lastVulnScan>2018-03-08T06:20:10Z</lastVulnScan>
<lastSystemBoot>2018-02-06T06:00:24Z</lastSystemBoot>
<lastLoggedOnUser>root</lastLoggedOnUser>
<os>Mac OS X 10.11.6</os>
<dnsHostName>shwetas-Mac-mini.local</dnsHostName>
<agentInfo>
<agentVersion>1.7.0.64</agentVersion>
<agentId>2b79e576-201b-49b9-9d2a-
8e5cb70bfdcd</agentId>
<status>STATUS_ACTIVE</status>
<lastCheckedIn>2018-03-08T06:49:55Z</lastCheckedIn>
<connectedFrom>10.113.196.203</connectedFrom>
<chirpStatus>Inventory Scan Complete</chirpStatus>
<platform>MACOSX</platform>
<activatedModule>AGENT_VM,AGENT_PC</activatedModule>
<manifestVersion>VULNSIGS-2.4.281.2-
1</manifestVersion>
<agentConfiguration>
<id>432001</id>
<name>Test_abc</name>
</agentConfiguration>
<activationKey>
<activationId>fc8aa44e-6e6d-492d-ae06-
08e1676901ff</activationId>
<title>Test_abc</title>
</activationKey>
</agentInfo>
<netbiosName>MACMINI-3BFD26</netbiosName>
<address>10.113.196.203</address>
<trackingMethod>QAGENT</trackingMethod>
<manufacturer>Apple Inc.</manufacturer>
<model>Macmini7,1</model>
<totalMemory>8192</totalMemory>
<timezone>+05:30</timezone>
<biosDescription>Macmini7,1, MM71.0224.B00,
2.24f32</biosDescription>
<openPort>
<list>
<HostAssetOpenPort>
<port>49558</port>
<protocol>TCP</protocol>
</HostAssetOpenPort>
<HostAssetOpenPort>
<port>22</port>
<protocol>TCP</protocol>
</HostAssetOpenPort>
...
</list>
</software>
<vuln>
<list>
<HostAssetVuln>
<qid>105145</qid>
<hostInstanceVulnId>139552720</hostInstanceVulnId>
<firstFound>2018-03-
07T12:18:20Z</firstFound>
<lastFound>2018-03-08T06:20:10Z</lastFound>
</HostAssetVuln>
<HostAssetVuln>
<qid>124557</qid>
<hostInstanceVulnId>139552721</hostInstanceVulnId>
<firstFound>2018-03-
07T12:18:20Z</firstFound>
<lastFound>2018-03-08T06:20:10Z</lastFound>
</HostAssetVuln>
...
</list>
</vuln>
<processor>
<list>
<HostAssetProcessor>
<name>Intel Core i5</name>
<speed>2600</speed>
</HostAssetProcessor>
</list>
</processor>
<volume>
<list>
<HostAssetVolume>
<name>/</name>
<size>975312896</size>
<free>104348560</free>
</HostAssetVolume>
</list>
</volume>
<account>
<list>
<HostAssetAccount>
<username>_mbsetupuser</username>
</HostAssetAccount>
<HostAssetAccount>
<username>_uucp</username>
</HostAssetAccount>
...
</list>
</account>
<networkInterface>
<list>
<HostAssetInterface>
<interfaceName>en0</interfaceName>
<macAddress>38:c9:86:3b:fd:26</macAddress>
<type>LOCAL</type>
<address>fe80:0:0:0:0:0:0:1</address>
<gatewayAddress>10.113.196.1</gatewayAddress>
</HostAssetInterface>
<HostAssetInterface>
<hostname>shwetas-Mac-mini.local</hostname>
<interfaceName>en0</interfaceName>
<macAddress>38:c9:86:3b:fd:26</macAddress>
<type>LOCAL</type>
<address>10.113.196.203</address>
<gatewayAddress>10.113.196.1</gatewayAddress>
</HostAssetInterface>
...
</list>
</networkInterface>
</HostAsset>
</data>
</ServiceResponse>
XSD
<platform API server>/qps/xsd/2.0/am/hostasset.xsd