Appearance
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:
| Parameter | Type | Description |
|---|---|---|
| id | String | the unique id of the Ci to load. |
load(schema, properties)
Return the Ci (configuration item) identified by the given schema and key properties.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| schema | String | The schema name of the object to lookup. |
| properties | Map | The 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:
| Parameter | Type | Description |
|---|---|---|
| ci | Ci | The 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:
| Parameter | Type | Description |
|---|---|---|
| ci | Ci | The 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:
| Parameter | Type | Description |
|---|---|---|
| ci | Ci | The Ci to save or create. |
delete(id)
Delete the Ci indicated by id.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| id | String | The unique id of the Ci to delete |
delete(schema, properties)
Delete the Ci indicated by its schema and key properties.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| schema | String | The schema name of the object to delete. |
| properties | Map | The 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:
| Parameter | Type | Description |
|---|---|---|
| query | String | The query to perform. |
| constraints | Map | Constraints used by the query. |
export(path)
Export the contents of the CMDB to the specified path.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| path | String | The file name to save the export. |
query(query) → Array
Perform a query against the CMDB.
Returns: Array - An array of matching Ci objects
Parameters:
| Parameter | Type | Description |
|---|---|---|
| query | String | The query to perform. |