Asset examples
You can browse assets and asset classes. Assets can be native (for example Windows Hotfix List) or can be based on custom objects (for example, VMware virtual machines).
When browsing assets, use the following keywords in the URI:
- Assets — for retrieving assets
- AssetAttributeValues — for retrieving attributes of an asset
- AssetClasses — for retrieving asset classes
The examples in the following sections provide details about how to browse assets:
- List the asset classes (type prefix)
- Get the root assets for a server (id prefix)
- Get a list-based asset (id prefix)
- Get the value of an asset's attribute (id prefix)
- Get a hierarchical asset — FileSystem (id prefix)
- Get assets using the group prefix
- Get assets based on a custom object
List the asset classes (type prefix)
Native asset classes, such as FileSystem, do not include a version attribute. Assets that are based on custom objects, such as BMC_VMware_VirtualInfrastructureManager, do include a version attribute.
Request URI: /type/AssetClasses/
XML response
<RESTXMLResponse>
<AssetClassChildrenResponse>
<AssetClassChildren>
<AssetClasses totalCount="39">
<AssetClass name="BMC_Citrix_Root" type="6032" version="801010" uri="/type/
AssetClasses/BMC_Citrix_Root/801010" />
<AssetClass name="BMC_UnixGroups" type="6032" version="801010" uri="/type/
AssetClasses/BMC_UnixGroups/801010" />
<AssetClass name="FileSystem" type="6032" uri="/type/AssetClasses/FileSystem" />
<AssetClass name="ActiveDirectoryRoot" type="6032" version="801010" uri="/type/
AssetClasses/ActiveDirectoryRoot/801010" />
<AssetClass name="RPM List" type="6032" uri="/type/AssetClasses/RPM List" />
<AssetClass name="BMC_UnixDaemons" type="6032" version="801010" uri="/type/
AssetClasses/BMC_UnixDaemons/801010" />
<AssetClass name="Registry" type="6032" uri="/type/AssetClasses/Registry" />
<AssetClass name="BMC_UnixProcesses" type="6032" version="801010" uri="/type/
AssetClasses/BMC_UnixProcesses/801010" />
<AssetClass name="Debian Packages" type="6032" uri="/type/AssetClasses/Debian Packages" />
<AssetClass name="Metabase" type="6032" uri="/type/AssetClasses/Metabase" />
<AssetClass name="Extended Objects" type="6032" uri="/type/
AssetClasses/Extended Objects" />
<AssetClass name="Security Settings Category" type="6032" uri="/type/
AssetClasses/Security Settings Category" />
<AssetClass name="Solaris Package List" type="6032" uri="/type/
AssetClasses/Solaris Package List" />
<AssetClass name="AIX Package List" type="6032" uri="/type/
AssetClasses/AIX Package List" />
<AssetClass name="SystemInfo" type="6032" version="801010" uri="/type/
AssetClasses/SystemInfo/801010" />
<AssetClass name="BMC_UnixUsers" type="6032" version="801010" uri="/type/
AssetClasses/BMC_UnixUsers/801010" />
<AssetClass name="BMC_IBM_VirtualSystemEnabler" type="6032" version="801010" uri="/type/
AssetClasses/BMC_IBM_VirtualSystemEnabler/801010" />
<AssetClass name="CaliforniaManager" type="6032" version="801010" uri="/type/
AssetClasses/CaliforniaManager/801010" />
<AssetClass name="BMC_VMware_VirtualInfrastructureManager" type="6032" version="801010"
uri="/type/AssetClasses/BMC_VMware_VirtualInfrastructureManager/801010" />
<AssetClass name="Solaris Patch List" type="6032" uri="/type/
AssetClasses/Solaris Patch List" />
<AssetClass name="AIX Patch List" type="6032" uri="/type/
AssetClasses/AIX Patch List" />
<AssetClass name="Windows Service List" type="6032" uri="/type/
AssetClasses/Windows Service List" />
<AssetClass name="PackageTrackingRoot" type="6032" version="801010" uri="/type/
AssetClasses/PackageTrackingRoot/801010" />
<AssetClass name=".NET Assemblies" type="6032" uri="/type/
AssetClasses/.NET Assemblies" />
<AssetClass name="Windows Hotfix List" type="6032" uri="/type/
AssetClasses/Windows Hotfix List" />
<AssetClass name="Solaris Patch Cluster List" type="6032" uri="/type/
AssetClasses/Solaris Patch Cluster List" />
<AssetClass name="Configuration" type="6032" uri="/type/AssetClasses/Configuration" />
<AssetClass name="Complus" type="6032" uri="/type/AssetClasses/Complus" />
<AssetClass name="Windows Application List" type="6032" uri="/type/
AssetClasses/Windows Application List" />
<AssetClass name="HP Bundle List" type="6032" uri="/type/AssetClasses/HP Bundle List" />
<AssetClass name="HP Patch List" type="6032" uri="/type/AssetClasses/HP Patch List" />
<AssetClass name="Windows User List" type="6032" uri="/type/AssetClasses/Windows User List" />
<AssetClass name="BMC_Solaris_VirtualSystemEnabler" type="6032" version="801010" uri="/type/
AssetClasses/BMC_Solaris_VirtualSystemEnabler/801010" />
<AssetClass name="BMC_RHEL_VirtualSystemEnabler" type="6032" version="801010" uri="/type/
AssetClasses/BMC_RHEL_VirtualSystemEnabler/801010" />
<AssetClass name="HP Product List" type="6032" uri="/type/AssetClasses/HP Product List" />
<AssetClass name="Event Logs" type="6032" uri="/type/AssetClasses/Event Logs" />
<AssetClass name="BMC_HyperV_Manager" type="6032" version="801010" uri="/type/
AssetClasses/BMC_HyperV_Manager/801010" />
<AssetClass name="System Info" type="6032" uri="/type/AssetClasses/System Info" />
<AssetClass name="Windows Group List" type="6032" uri="/type/AssetClasses/Windows Group List" />
</AssetClasses>
</AssetClassChildren>
</AssetClassChildrenResponse>
</RESTXMLResponse>
Get the root assets for a server (id prefix)
These include both native assets and assets that are based on custom objects.
For information about how to obtain a GUID, see Obtaining a GUID for use with id prefix.
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/
XML response
<RESTXMLResponse>
<AssetChildrenResponse>
<AssetChildren>
<Assets totalCount="16">
<Asset name="SystemInfo" type="SystemInfo" description="" version="801010" uri="/id/SystemObject/
Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/SystemInfo/801010"
modelType="GENERIC_OBJECT"
modelTypeId="6030">
<AssetAttributeValues totalCount="2">
<AssetAttributeValue name="Path" type="String" value="SystemInfo"
uri="/
id/SystemObject/Server/0d3a0f31-7185-4594-b326
26f3ecf463a5/Assets/SystemInfo/801010/AssetAttributeValues/Path" />
<AssetAttributeValue name="Name" type="String" value="SystemInfo"
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326
26f3ecf463a5/Assets/SystemInfo/801010/AssetAttributeValues/Name" />
</AssetAttributeValues>
</Asset>
<Asset name="PackageTrackingRoot" type="PackageTrackingRoot"
description="" version="801010" uri="/id/SystemObject/Server/
0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/PackageTrackingRoot/801010"
modelType="GENERIC_OBJECT" modelTypeId="6030">
<AssetAttributeValues totalCount="2">
<AssetAttributeValue name="Path" type="String" value="PackageTrackingRoot"
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/PackageTrackingRoot/801010/
AssetAttributeValues/Path" />
<AssetAttributeValue name="Name" type="String" value="PackageTrackingRoot"
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326
26f3ecf463a5/Assets/PackageTrackingRoot/801010/AssetAttributeValues/Name" />
</AssetAttributeValues>
</Asset>
<Asset name="Windows Hotfix List" type="/type/AssetClasses/Windows Hotfix List"
description=""
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/
Assets/Windows Hotfix List" modelType="HOTFIX_LIST" modelTypeId="25" />
...
OMITTED
...
</Assets>
</AssetChildren>
</AssetChildrenResponse>
</RESTXMLResponse>
Get a list-based asset (id prefix)
Assets can be list-based (for example, Windows User List), or they can be hierarchical (for example, FileSystem). The next two examples show you how to get a list based asset.
For information about how to obtain a GUID, see Obtaining a GUID for use with id prefix.
- First, get the list:
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/Windows%20User%20ListXML response
<?xml version="1.0" encoding="UTF-8" ?>
<RESTXMLResponse>
<AssetResponse>
<Asset name="Local Users" type="/type/AssetClasses/Windows User List"
description="" uri="/id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/
Assets/Windows User List" modelType="WIN_USERS" modelTypeId="140" />
</AssetResponse>
</RESTXMLResponse>
</RESTXMLResponse>
- Now get the children of the list. To get the children of an asset, add a trailing slash at the end of the URI, as shown in the following example:
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/Windows%20User%20List/
Note that each child has its attributes included in the response.XML response
<?xml version="1.0" encoding="UTF-8" ?>
<RESTXMLResponse>
<AssetChildrenResponse>
<AssetChildren>
<Assets totalCount="7">
<Asset name="Administrator" type="/type/AssetClasses/Windows User List/Windows User"
description="Built-in account for administering the computer/domain" uri="/id/SystemObject/
Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User List/Administrator"
modelType="WIN_USER" modelTypeId="141">
<AssetAttributeValues totalCount="19">
<AssetAttributeValue name="Full Name" type="String" value="" uri="/id/SystemObject/
Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User List/Administrator/
AssetAttributeValues/Full Name" />
<AssetAttributeValue name="Name" type="String" value="Administrator" uri="/id/
SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User
List/Administrator/AssetAttributeValues/Name" />
<AssetAttributeValue name="SID" type="String" value="S-1-5-21-2350083053-
834951339-2171930816-500"
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows
User List/Administrator/AssetAttributeValues/SID" />
<AssetAttributeValue
name="Description" type="String" value="Built-in account for
administering the computer/domain" uri="/id/SystemObject/Server/0d3a0f31-
7185-4594-b326-26f3ecf463a5/Assets/Windows User List/Administrator/AssetAttributeValues/
Description" />
<AssetAttributeValue name="Last Logon Date" type="Boolean" value="2011/04/15
14:26:30-0400" uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/
Assets/Windows User List/Administrator/AssetAttributeValues/Last Logon Date" />
<AssetAttributeValue name="Account Disabled" type="Boolean" value="false"
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/
Assets/Windows User List/Administrator/AssetAttributeValues/
Account Disabled" />
...
OMITTED
...
</Assets>
</AssetChildren>
</AssetChildrenResponse>
</RESTXMLResponse>
Get the value of an asset's attribute (id prefix)
- First, list all the attributes of a given asset. In this example the asset is a user with the name Administrator.
For information about how to obtain a GUID, see Obtaining a GUID for use with id prefix.
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/Windows%20User%20List/AdministratorXML response
<?xml version="1.0" encoding="UTF-8" ?>
<RESTXMLResponse>
<AssetResponse>
<Asset name="Administrator" type="/type/AssetClasses/Windows User List/Windows User"
description="Built-in account for administering the computer/domain" uri="/id/
SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User
List/Administrator" modelType="WIN_USER" modelTypeId="141">
<AssetAttributeValues totalCount="19">
<AssetAttributeValue name="Full Name" type="String" value=""
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/
Windows User List/Administrator/AssetAttributeValues/Full Name" />
<AssetAttributeValue name="Name" type="String" value="Administrator"
uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/
Windows User List/Administrator/AssetAttributeValues/Name" />
<AssetAttributeValue name="SID" type="String" value="S-1-5-21-
2350083053-834951339-2171930816-500" uri="/id/SystemObject/Server/
0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User List/Administrator/
AssetAttributeValues/SID" />
<AssetAttributeValue name="Description" type="String" value="Built-in account
for administering the computer/domain" uri="/id/SystemObject/Server/
0d3a0f31-7185-4594-b326-26f3ecf463a5/
Assets/Windows User List/Administrator/AssetAttributeValues/Description" />
<AssetAttributeValue name="Last Logon Date" type="Boolean"
value="2011/04/15 14:26:30-0400" uri="/id/SystemObject/Server/
0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User List/
Administrator/AssetAttributeValues/Last Logon Date" />
...
OMITTED
...
</AssetAttributeValues>
</Asset>
</AssetResponse>
</RESTXMLResponse>
- Now get the value of a particular attribute, in this case the Last Logon Date attribute. To do this, you use the keyword AssetAttributeValues, as shown below.
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/Windows%20User%20List/ajoy/AssetAttributeValues/Last%20Logon%20DateXML response
<?xml version="1.0" encoding="UTF-8" ?>
<RESTXMLResponse>
<AssetAttributeValueResponse>
<AssetAttributeValue name="Last Logon Date" type="Boolean"
value="2011/04/15 14:26:30-0400" uri="/id/SystemObject/Server/
0d3a0f31-7185-4594-b326-26f3ecf463a5/Assets/Windows User
List/Administrator/AssetAttributeValues/Last Logon Date" />
</AssetAttributeValueResponse>
</RESTXMLResponse>
</RESTXMLResponse>
Get a hierarchical asset — FileSystem (id prefix)
This example browses a hierarchical asset — FileSystem.
For information about how to obtain a GUID, see Obtaining a GUID for use with id prefix.
First, get the children of FileSystem:
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-
a7cb2ebb9363/Assets/FileSystem/XML response
<RESTXMLResponse>
<AssetChildrenResponse>
<AssetChildren>
<Assets totalCount="1">
<Asset name="/C" type="/type/AssetClasses/FileSystem/Directory"
description="" uri="/id/SystemObject/Server/
17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/FileSystem/C"
modelType="DIRECTORY" modelTypeId="8" />
</Assets>
</AssetChildren>
</AssetChildrenResponse>
</RESTXMLResponse>
</RESTXMLResponse>- The fileSystem has one child, the C drive.
Get the children of the C drive:
Request URI: /id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-
a7cb2ebb9363/Assets/FileSystem/C/XML response
<RESTXMLResponse>
<AssetChildrenResponse>
<AssetChildren>
<Assets totalCount="72">
<Asset name="apache-ant-1.7.0" type="/type/AssetClasses/
FileSystem/Directory" description="" uri="/id/SystemObject/Server/
17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/FileSystem/C/apache-ant-1.7.0"
modelType="DIRECTORY"
modelTypeId="8" />
...
OMITTED
...
<Asset name="Documents and Settings" type="/type/AssetClasses/
FileSystem/Directory" description="" uri="/id/SystemObject/Server/
17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/
FileSystem/C/Documents and Settings" modelType="DIRECTORY" modelTypeId="8" />
</Assets><AssetAttributeValues totalCount="16">
<AssetAttributeValue name="Name" type="String" value="C" uri="/id/
SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/
FileSystem/C/AssetAttributeValues/Name" />
<AssetAttributeValue name="Path" type="String" value="/C" uri="/id/
SystemObject/Server/17d8d5b5-156f-4ba4-
80d9-a7cb2ebb9363/Assets/FileSystem/C/AssetAttributeValues/Path" />
<AssetAttributeValue name="Date Created (Windows)" type="Date"
value="1980/01/01 00:00:00-0500" uri="/id/SystemObject/Server/
17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/FileSystem/C/
AssetAttributeValues/Date Created (Windows)" />
<AssetAttributeValue name="Permissions (Unix)" type="Unix Permission"
value="511" uri="/id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/
Assets/FileSystem/C/AssetAttributeValues/Permissions (Unix)" />
<AssetAttributeValue name="Group Owner (Unix)" type="Integer" value="0"
uri="/id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/FileSystem/
C/AssetAttributeValues/Group Owner (Unix)" />
<AssetAttributeValue name="Date Modified" type="Date" value="1980/01/01
00:00:00-0500" uri="/id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/
Assets/FileSystem/C/AssetAttributeValues/Date Modified" />
...
OMITTED
...
<AssetAttributeValue name="Symbolic Link Target Exists" type="Boolean" value=""
uri="/id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/FileSystem/C/
AssetAttributeValues/Symbolic Link Target Exists" />
<AssetAttributeValue name="Symbolic Link Target" type="String" value="" uri="/
id/SystemObject/Server/17d8d5b5-156f-4ba4-80d9-a7cb2ebb9363/Assets/FileSystem/C/
AssetAttributeValues/Symbolic Link Target" />
</AssetAttributeValues>
</AssetChildren>
</AssetChildrenResponse>
</RESTXMLResponse>
Syntax for accessing a UNIX file system
A file system for a Windows server has a C drive, D drive, and so forth, so you can fetch children using this syntax:
.../Assets/FileSystem/C/
But for UNIX-style servers, the file system is / , /root, /abc, and so on. The issue is how to get the children of "/" .You cannot use syntax like this: /Assets/FileSystem//. To get around this issue, you use encoding (double quotes) to surround the / that indicates the directory whose children you want. To get the children of /, use this syntax:
.../Assets/FileSystem/"/"/
Get assets using the group prefix
The previous examples show you how to browse assets by using the /id prefix and identifying targets by GUID. You can do the same tasks by using the /group prefix and identifying targets by group and name.
For example, the following request gets the root assets for a server that you identify by group and name:
Request URI: /group/Servers/myWindowsGroup/myWindowsServer/Assets/
XML response
<RESTXMLResponse>
<AssetChildrenResponse>
<AssetChildren>
<Assets totalCount="14">
<Asset name="Windows Hotfix List" type="/type/AssetClasses/Windows Hotfix List"
description="" uri="/group/Servers/RESTful.GET.Objects.windows.TESTTOOLWS-Group/engwin2k3x64vm6/
Assets/Windows Hotfix List" modelType="HOTFIX_LIST" modelTypeId="25" />
<Asset name="Windows Service List" type="/type/AssetClasses/Windows Service List"
description="" uri="/group/Servers/RESTful.GET.Objects.windows.TESTTOOLWS-Group/engwin2k3x64vm6/
Assets/Windows Service List" modelType="SERVICE_LIST" modelTypeId="27" />
...
OMITTED
...
<Asset name="Registry" type="/type/AssetClasses/Registry" description=""
uri="/group/Servers/RESTful.GET.Objects.windows.TESTTOOLWS-Group/engwin2k3x64vm6/Assets/
Registry" modelType="REGISTRY" modelTypeId="5" />
<Asset name="Complus" type="/type/AssetClasses/Complus" description="" uri="/group/Servers/
RESTful.GET.Objects.windows.TESTTOOLWS-Group/engwin2k3x64vm6/Assets/Complus" modelType="COMPLUS"
modelTypeId="29" />
<Asset name="FileSystem" type="/type/AssetClasses/FileSystem" description=""
uri="/group/Servers/RESTful.GET.Objects.windows.TESTTOOLWS-Group/engwin2k3x64vm6/Assets/FileSystem"
modelType="FILESYSTEM" modelTypeId="3" />
</Assets>
/AssetChildren>
</AssetChildrenResponse>
</RESTXMLResponse>
Get assets based on a custom object
The following example shows you how to retrieve a list of VMware clusters.
For information about how to obtain a GUID, see Obtaining a GUID for use with id prefix.
Request URI: /id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/Clusters/
XML response
<RESTXMLResponse>
<AssetChildrenResponse>
<AssetChildren>
<Assets totalCount="1">
<Asset name="ClusterA" type="BMC_VMware_Cluster" description="" version="802000"
uri="/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/
BMC_VMware_VirtualInfrastructureManager/Clusters/ClusterA" modelType="GENERIC_OBJECT"
modelTypeId="6030">
<AssetAttributeValues totalCount="3">
<AssetAttributeValue name="Name" type="String" value="ClusterA"
uri="/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/
BMC_VMware_VirtualInfrastructureManager/Clusters/ClusterA/AssetAttributeValues/Name" />
<AssetAttributeValue name="Internal Attribute 1" type="String"
value="domain-c54" uri="/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/
Assets/BMC_VMware_VirtualInfrastructureManager/Clusters/ClusterA/AssetAttributeValues/
Internal Attribute 1" />
<AssetAttributeValue name="Path" type="String" value="/Clusters/
ClusterA" uri="/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/
BMC_VMware_VirtualInfrastructureManager/Clusters/ClusterA/AssetAttributeValues/Path" />
</AssetAttributeValues>
</Asset>
</Assets>
<AssetAttributeValues totalCount="2">
<AssetAttributeValue name="Path" type="String" value="/Clusters"
uri="/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/
BMC_VMware_VirtualInfrastructureManager/Clusters/AssetAttributeValues/Path" />
<AssetAttributeValue name="Name" type="String" value="Clusters"
uri="/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/
BMC_VMware_VirtualInfrastructureManager/Clusters/AssetAttributeValues/Name" />
</AssetAttributeValues>
</AssetChildren>
</AssetChildrenResponse>
</RESTXMLResponse>