Eric Perraudeau

Asset Management and Tagging API Now Available

Blog Post created by Eric Perraudeau Employee on Jun 11, 2013

A new API to manage assets and asset tags, including dynamic tags, in the Asset Management module is now available in production. Details are in the QualysGuard Asset Management and Tagging API User Guide.

 

With this new API, users can perform "Create", "Update", "Get", "Count", "Search" and "Delete" operations for the following objects:

  • Static Tags
  • Dynamic Tags
  • Host Assets
  • Amazon EC2 Assets

 

Example:  Create a dynamic asset tag

This example create a dynamic asset tags that will be applied to any asset which hostname starts with "hostname-corp"

 

curl -u "USERNAME:PASSWORD" -H "Content-type: text/xml" -X "POST" --data-binary @-
     "https://qualysapi.qualys.com/qps/rest/1.0/create/am/tag" < file.xml

 

 

<ServiceRequest>
  <data>
    <Tag>
      <scope>USER</scope>
      <name><![CDATA[create dynamic tag - test]]></name>
      <description><![CDATA[sample dynamic tag for asset name - test]]></description>
      <dynamicTagEngine>NAME_CONTAINS</dynamicTagEngine>
      <dynamicTagRule><![CDATA[hostname-corp.*]]></dynamicTagRule>
      <reindex>false</reindex>
      <display>
        <foregroundColor>-7197</foregroundColor>
        <backgroundColor>-3407872</backgroundColor>
      </display>
      <parent>
        <id>737931</id>
      </parent>
    </Tag>
  </data>
</ServiceRequest>

Outcomes