Expose CI
ucmdb_rest.expose_ci.ExposeCI(server)
Initialize the service with a reference to the main level UCMDB server
Source code in ucmdb_rest\expose_ci.py
getInformation(json_to_expose)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_to_expose
|
dict
|
A dictionary defining the CI Type, attribute layout, sorting, and filtering conditions. { "type": "running_software", "layout": [ "display_label", "discovered_product_name", "global_id", "version", "mf_version" ], "includeSubtypes": "false", "sortBy": [ { "attribute": "version", "order": "DESC" } ], "filtering": { "logicalOperator": "and", "conditions": [ { "column": "discovered_product_name", "value": "name_to_get", "filteringAttributeCondOperator": "Like" } ] } } |
required |
Returns:
| Type | Description |
|---|---|
Response
|
Can be converted to a list of dictionaries where each dictionary is representative of an element requested. For example: [ { "ucmdbId": "4e8b850822c83fdb975dc2bf899c7686", "globalId": "4e8b850822c83fdb975dc2bf899c7686", "type": "running_software", "properties": { "display_label": "OpenText UCMDB Server (bra03ucm02)", "discovered_product_name": "OpenText UCMDB Server", "global_id": "4e8b850822c83fdb975dc2bf899c7686", "version": "10.22.CUP3" }, "attributesDisplayNames": null, "attributesQualifiers": null, "attributesType": null, "classDefinition": null, "displayLabel": null } ] |
Source code in ucmdb_rest\expose_ci.py
search_by_label(label_pattern, ci_type='node', operator='LIKE', layout=None)
A flexible helper to find CIs of any type based on their display label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label_pattern
|
str
|
The string to search for. |
required |
ci_type
|
str
|
The UCMDB CI Type (e.g., 'node', 'ip_address', 'business_service'). Default is 'node'. |
'node'
|
operator
|
str
|
The filtering operator (e.g., 'LIKE', 'EQUAL'). Default is 'LIKE'. |
'LIKE'
|
layout
|
list of str
|
Specific attributes to return. If None, defaults to ['display_label', 'name', 'global_id']. |
None
|