Skip to content

CMDB

An asset is a structure used to track a computer upon which situate can operate. An Asset has an ID that is used to uniquely identify it and a name that is used to as a conventient display name. It also has other data that can be used to identfy the operating system and version as well as other interesting pieces of information.

Instance Methods

load(id) → Ci

Return the Ci (configuration item) identified by the given id.

Returns: Ci - The resulting configuration item

Parameters:

ParameterTypeDescription
idStringthe unique id of the Ci to load.

load(schema, properties)

Return the Ci (configuration item) identified by the given schema and key properties.

Parameters:

ParameterTypeDescription
schemaStringThe schema name of the object to lookup.
propertiesMapThe set of key properties that uniquely identify the Ci

save(ci) → Ci

Save changes to the given CI.

Returns: Ci - The Ci that was saved. The returned Ci may be adjusted upon save based on the schema.

Parameters:

ParameterTypeDescription
ciCiThe modified Ci object.

create(ci) → Ci

Create a new Ci from data in the Ci object. The newly created Ci is returned. The returned Ci will have a new unique id and may have additional fields created as defaults from the schema.

Returns: Ci - The Ci that was created. The returned Ci may be adjusted upon save based on the schema and will have a new guid assigned by the CMDB.

Parameters:

ParameterTypeDescription
ciCiThe Ci to create.

saveOrCreate(ci) → Ci

If the Ci exists (based upon the id in the passed ci), save changes. Otherwise create a new Ci from data in the Ci object. The newly created Ci is returned. The returned Ci will have a new unique id and may have additional fields created as defaults from the schema. The ci passed should have its id set to null for creation.

Returns: Ci - The Ci that was created. The returned Ci may be adjusted upon save based on the schema and may have a new guid assigned by the CMDB.

Parameters:

ParameterTypeDescription
ciCiThe Ci to save or create.

delete(id)

Delete the Ci indicated by id.

Parameters:

ParameterTypeDescription
idStringThe unique id of the Ci to delete

delete(schema, properties)

Delete the Ci indicated by its schema and key properties.

Parameters:

ParameterTypeDescription
schemaStringThe schema name of the object to delete.
propertiesMapThe key properties of the Ci to delete.

query(query, constraints) → Array

Perform a query against the CMDB.

Returns: Array - An array of matching Ci objects

Parameters:

ParameterTypeDescription
queryStringThe query to perform.
constraintsMapConstraints used by the query.

export(path)

Export the contents of the CMDB to the specified path.

Parameters:

ParameterTypeDescription
pathStringThe file name to save the export.

query(query) → Array

Perform a query against the CMDB.

Returns: Array - An array of matching Ci objects

Parameters:

ParameterTypeDescription
queryStringThe query to perform.

Workload Automation and Orchestration