Asset Management Methods

This article contains the following topics:
casm172
This article contains the following topics:
It is possible for a client site to enhance the asset object using
extensions
. Asset extensions are separate tables that hold extra attribute information for an asset. The extension table is linked to a particular asset by using the asset ID as a foreign key. CA SDM Web Services ships two predefined extensions, Computer and Software. For more information, read the text executed by the following command:
/bopcfg/majic/assetx.maj
The asset’s family attribute determines if the asset has an extension. Setting the Class attribute generally sets the family at asset creation time. To determine if an asset has an extension, query the ‘extension_name’ attribute of the asset’s family (for example, “family.extension_name”).
To retrieve values from an extension object, query it like any other object by using the following method:
getObjectValues()
To get the handle for a particular extension object, use the following method:
getAssetExtensionInformation()
Update an extension object like you would any other object by using the following method:
updateObject()
We do not recommend that you create your own extension objects. One is created for you, if needed, when createAsset() is called. Because of this automatic creation, we recommend that you only use createAsset() to create asset objects.
If you are using the ITIL methodology, remember that Asset and Configuration Item are interchangeable in this context.
createAsset
The following parameters apply to the createAsset method:
Parameter
Type
Description
SID
Integer
Identifies the session retrieved from logging in.
attrVals
String
Identifies the array of name-value pairs used to set the initial attribute values for the new asset.
attributes
String Holder
Identifies the String Holder object for caputring returned data.
createAssetResult
String
Identifies the name for the new asset’s extension. If no extension was created, this field is empty.
 newAssetHandle
String Holder 
Identifies the String Holder object for capturing returned data. 
newExtensionHandle 
String Holder 
Identifies the String Holder object for capturing returned data.  
 newExtensionName
String Holder 
Identifies the String Holder object for capturing returned data. 
 
Description
Describes the recommend method for creating an asset. If you intend to create an asset with an extension, be sure to set the Asset Class attribute in the
attrVals
section.
If you are using the ITIL methodology, use this method to create a Configuration Item.
Returns
A <UDSObject> element containing the handle for the new object, with attribute values specified in the
attributes
parameter. If the
attributes
parameter is empty,
all
attribute values are returned. List and LREL types are also returned, but as empty elements.
XML Element
Type
Description
<createAssetResult>
N/A
Identifies the standard <UDSObject> element containing the handle and requested attribute values.
<newAssetHandle>
String
Identifies the new request’s handle.
<newExtensionHandle>
String
Identifies the handle for the new Asset’s extension. If no extension was created, this field is empty.
<newExtensionName>
String
Identifies the name for the new asset’s extension. If no extension was created, this field is empty.
 
getAssetExtensionInformation
The following parameters apply to the getAssetExtensionInformation method:
Parameter
Type
Description
SID
Integer
Identifies the session retrieved from logging in.
assetHandle
String
Identifies the asset to query.
attributes
String[]
Identifies the standard array of attributes from the asset extension object from which to request values. If this value is empty, all attributes are returned.
getAssetExtInfoResult
String Holder
Identifies the String Holder object for capturing returned data.
extensionHandle
String Holder
Identifies the String Holder object for capturing returned data.
extensionName
String Holder
Identifies the String Holder object for capturing returned data.
Description
Returns extension information for an asset. If the asset does not have an extension, nothing is returned.
An asset has an extension if a value exists for its “family.extension_name” property. This property is empty if the asset does not have an extension.
Returns
The following elements return with empty values when the asset does not have an extension:
XML Element
Type
Description
<getAssetExtInfoResult>
String
Identifies all the attribute values for the extension.
<extensionHandle>
String
Identifies the extensions handle.
<extensionName>
String
Identifies the name for the assets extension.
addAssetLog
The following parameters apply to the addAssetLog method:
Parameter
Type
Description
SID
Integer
Identifies the session retrieved from logging in.
assetHandle
String
Identifies the asset handle.
contactHandle
String
(Required) Identifies the handle of the contact used for the log’s author.
logText
String
Identifies the text for the new asset log.
Description
Adds a new log entry for an asset. The log’s author is the user associated with the SID.
Returns
Nothing.
createAssetParentChildRelationship
The following parameters apply to the createAssetParentChildRelationship method:
Parameter
Type
Description
SID
Integer
Identifies the session retrieved from logging in.
parentHandle
String
Identifies the asset handle for the parent.
childHandle
String
Identifies the asset handle for the child.
Description
Makes
assetParent
a parent of
assetHandle
. Web Services creates a separate object (the
hier
object, which is the
Assignment
table) for parent-child relationships between assets. These are stored in related lists,
child_hier
and
parent_hier,
in the Asset (nr) object.
Returns
Handle of the new hier (Assignment) object.