bmc atrium orchestrator - custom hp ucmdb v8.01 adapter … · 2020-03-06 · 2 chapter 2. module...
TRANSCRIPT
BMC Atrium Orchestrator - CustomHP uCMDB v8.01 Adapter Module
Robin Elliott
BMC Atrium Orchestrator - Custom HP uCMDB v8.01 Adapter ModuleRobin ElliottCopyright © 2010 BMC Software, Inc.
iii
Table of ContentsPreface ............................................................................................................................ vi1. Module Setup and Usage ................................................................................................. 1
Module Setup ............................................................................................................ 1Module usage ............................................................................................................ 1
2. Module Configuration ...................................................................................................... 2HP_uCMDB:CREDENTIALS ...................................................................................... 2HP_uCMDB:PROPERTIES_LIST ................................................................................. 2HP_uCMDB:ADAPTERS ............................................................................................ 3HP_uCMDB:ACTIONS ............................................................................................... 3
3. Schedules ...................................................................................................................... 4Load uCMDB Class .................................................................................................... 4
4. HP_uCMDB .................................................................................................................. 5getCINeighbours ......................................................................................................... 5
Description ........................................................................................................ 5Parameters ......................................................................................................... 5
getCIsById ................................................................................................................ 6Description ........................................................................................................ 6Parameters ......................................................................................................... 6
getCIsByType ............................................................................................................ 7Description ........................................................................................................ 7Parameters ......................................................................................................... 7
getClassAncestors ....................................................................................................... 8Description ........................................................................................................ 8Parameters ......................................................................................................... 8
getCmdbClassDefinition .............................................................................................. 9Description ........................................................................................................ 9Parameters ....................................................................................................... 10
getFilteredCIsByType ................................................................................................ 12Description ...................................................................................................... 12Parameters ....................................................................................................... 12
pullTopologyMapChunks ........................................................................................... 13Description ...................................................................................................... 13Parameters ....................................................................................................... 13
releaseChunks .......................................................................................................... 14Description ...................................................................................................... 14Parameters ....................................................................................................... 14
5. HP_uCMDB:Utilities ..................................................................................................... 15AddCIsFilterCondition ............................................................................................... 15
Description ...................................................................................................... 15Parameters ....................................................................................................... 15
ExtractCmdbClassProperties ....................................................................................... 16Description ...................................................................................................... 16Parameters ....................................................................................................... 16
ExtractCmdbClassPropertiesAncestors .......................................................................... 17Description ...................................................................................................... 17Parameters ....................................................................................................... 17
LoadGlobalClassProperties ......................................................................................... 18Description ...................................................................................................... 18Global Context Item: uCMDB_all_properties ......................................................... 19Parameters ....................................................................................................... 21
ProcessChunks ......................................................................................................... 21
BMC Atrium Orchestrator - CustomHP uCMDB v8.01 Adapter Module
iv
Description ...................................................................................................... 21Example: Chunked Adapter Response ................................................................... 22Example: Non-Chunked Adapter Response ............................................................ 22Parameters ....................................................................................................... 24
RestructureCIsXML .................................................................................................. 24Description ...................................................................................................... 24Parameters ....................................................................................................... 25
ReturnGlobalClassProperty ......................................................................................... 25Description ...................................................................................................... 25Parameters ....................................................................................................... 26
StripNamespaces ....................................................................................................... 27Description ...................................................................................................... 27Parameters ....................................................................................................... 27
6. Additional Module Notes ................................................................................................ 30Unfinished Items ...................................................................................................... 30
v
List of Tables2.1. CREDENTIALS ........................................................................................................... 22.2. PROPERTIES_LIST ..................................................................................................... 22.3. ADAPTERS ................................................................................................................ 32.4. ACTIONS ................................................................................................................... 33.1. Job Details .................................................................................................................. 44.1. Input Parameters .......................................................................................................... 54.2. Output Parameters ........................................................................................................ 54.3. Input Parameters .......................................................................................................... 64.4. Output Parameters ........................................................................................................ 64.5. Input Parameters .......................................................................................................... 74.6. Output Parameters ........................................................................................................ 74.7. Input Parameters .......................................................................................................... 84.8. Output Parameters ........................................................................................................ 84.9. Input Parameters ......................................................................................................... 104.10. Output Parameters ..................................................................................................... 104.11. Input Parameters ....................................................................................................... 124.12. Output Parameters ..................................................................................................... 134.13. Input Parameters ....................................................................................................... 134.14. Output Parameters ..................................................................................................... 144.15. Input Parameters ....................................................................................................... 144.16. Output Parameters ..................................................................................................... 145.1. Input Parameters ......................................................................................................... 155.2. Output Parameters ...................................................................................................... 155.3. Input Parameters ......................................................................................................... 165.4. Output Parameters ...................................................................................................... 165.5. Input Parameters ......................................................................................................... 175.6. Output Parameters ...................................................................................................... 175.7. uCMDB_all_properties XML Example ........................................................................... 195.8. Input Parameters ......................................................................................................... 215.9. Output Parameters ...................................................................................................... 215.10. Chunked Adapter Response XML ................................................................................ 225.11. Regular Adapter Response XML .................................................................................. 225.12. Input Parameters ....................................................................................................... 245.13. Output Parameters ..................................................................................................... 245.14. Input Parameters ....................................................................................................... 255.15. Output Parameters ..................................................................................................... 255.16. Input Parameters ....................................................................................................... 265.17. Output Parameters ..................................................................................................... 265.18. Input Parameters ....................................................................................................... 275.19. Output Parameters ..................................................................................................... 28
vi
PrefaceThis document introduces the reader to the custom BMC Atrium Orchestrator Actor Adapter for the HPUniversal CMDB product v8.01
This document does assume that the reader has a working knowledge of the BMC Atrium Orchestratorproduct, and can relate to general CMDB and Configuration Items concepts.
It should be noted that the contents of this document and the Adapter Module that it introduces are notdirect products of BMC Software. As such they come with no specific warranty or fitness for purpose.The intent of this Adapter Module is to allow for BAO Customers and or Employees to prove integrationsto the HP uCMDB both in Pre and Post Sales scenarios. However usage in a Post Sales scenario by acustomer indicates that they will take on the responsiblity of maintaing their copy of the Adapter Modulemoving forward, or engange BMC Professional Services to aid them in their efforts.
1
Chapter 1. Module Setup and UsageModule Setup
1. Ensure that a SOAP Adapter is configured and enabled on the grid
2. Update the module configuration HP_uCMDB:ADAPTERS:SOAPAdapter with the correct name.
3. Update the module configuration HP_uCMDB:CREDENTIALS section with the correct uCMDBinformation. Note that the default URL for the Web Service API is http://<server>:<port>/axis2/services/UcmdbService.
4. Review the module configuration HP_uCMDB:PROPERTIES_LIST:global_list and add or removeclasses as appropriate to your intended usage of this Module and the uCMDB.
Module usage1. Execute the work flow Utilities:LoadGlobalClassProperties before running anything else.
2. If the LoadGlobalClassProperties work flow runs correctly and caches class properties, you can nowstart executing the lookup and query calls in the root of this Module.
a. getCINeighbours
b. getCIsById
c. getCIsByType
d. getFilteredCIsByType
2
Chapter 2. Module Configuration
HP_uCMDB:CREDENTIALS
Table 2.1. CREDENTIALS
Name / Description Type Value
username Text admin
A valid username with appropriate access rights for the HP uCMDB Instance that you are trying to utilize.
password Text xxxxxxxx
The password that matches the username. Note for BAO v7.6 moving forward this type can be changedto a secure setting.
soap_url Text http://w2k3-ucmdb:8080/axis2/services/UcmdbService
The URL path to the HP uCMDB Server and its Web Services. Check with your HP uCMDBAdministrator to determine the correct path to use within your environment. The standard default portand path are shown in this example.
HP_uCMDB:PROPERTIES_LIST
Table 2.2. PROPERTIES_LIST
Name / Description Type Value
global_list XML <classes> <classname levels="4">nt</classname> <classname levels="4">unix</classname> <classname levels="4">logical_application</classname> <classname levels="2">j2eeserver</classname> <classname levels="2">jdbcdatasource</classname> <classname levels="2">host</classname> <classname levels="2">database</classname> <classname levels="2">application</classname> <classname levels="3">sqlserver</classname> <classname levels="3">jbossas</classname> <classname levels="1">object</classname></classes>
A formated XML list of the CI class types that we want to pre-cache properties for on a scheduled basis.This list should be kept relatively short, and only include the main CI class types that will be utilizedin the BAO use cases.
At runtime additional class types outside of this list can still be utlized (but on their first usage within aGridtime that they are utilized within a Grid and minor delay will occur as their specific class propertiesare loaded).
Module Configuration
3
Name / Description Type Value
The @level attribute setting indicates the number of inheritance levels deep to go when dynamicallybuilding a classes properties list.
add_additional_levels Text 3
At runtime when additional class types outside of the global_list are utlized for the first time, this settingindicates the number of inheritance levels deep to go when dynamically building the classes propertieslist.
HP_uCMDB:ADAPTERSTable 2.3. ADAPTERS
Name / Description Type Value
SOAPAdapter Text HP_uCMDB_SOAPAdapter
A valid basic BAO SOAP Adapter enabled on the Grid.
HP_uCMDB:ACTIONSTable 2.4. ACTIONS
Name / Description Type Value
retrieve_all_chunks Text true
The HP uCMDB API sets a limit on the maximum number of CIs that it will return in an initial query.When this number is exceeded, an API response is sent back indicating that the CI data has been splitinto chunks and will need special processing to retrieve.
Setting this retrieve_all_chunks configuration item to true will automatically retrieve all CI data even ifthe initial uCMDB API response is to chunk data.
This is basically a convienience switch that removes the complexity of the BAO developer having tohandle chunking themselves.
If you know you will be retrieving large CI numbers then set this switch to false and review the processespullTopologyMapChunks and releaseChunks on how to manually handle chunked data to limit the sizeof XML documents being handled by both the uCMDB and BAO.
4
Chapter 3. SchedulesLoad uCMDB Class
Table 3.1. Job Details
Field Name Field Value
Description Loads the uCMDB Class Property lists from the HP uCMDB into Globalmemory when the Module is Activated, when the Grid is Restarted, andsubsequently Once every Day.
Start As soon as Module is activated
Frequency Run once every day
Stop Run forever
Job Name Load uCMDB Class Properties
Peer Location any
Process :HP_uCMDB:Utilities:LoadGlobalClassProperties
5
Chapter 4. HP_uCMDBgetCINeighbours
DescriptionThe getCINeighbours method returns the immediate neighbors of the specified CI.
The search is further restricted to CIs that either match a specific class or who inherit from that class.
An example would be that sqlserver inherits from the class database, so if database is used in the filter thensqlserver and other database children will be returned as long as they are direct neighbours of the given CI.
Parameters
Table 4.1. Input Parameters
Name Req. Description
ci id true The CI to look for neighbours for, an example CI ID value would look likethis 86d8361a01ac51c7f4f744e9a359506c
class name true The class name to further filter the neighbours returned by.
Table 4.2. Output Parameters
Name Req. Description
output xml true The output XML either converted into an easy to use structure, or potentiala Chunked adapter response format. An example of the CIs format is shownbelow.
<CIs> <CI> <ID>82f6be995115c14a34ef3a69ba965aab</ID> <type>sqlserver</type> <application_timeout type="intProp">20000</application_timeout> <application_port type="intProp">1433</application_port> <data_name type="strProp">MSSQL DB</data_name> <database_dbport type="strProp">1433</database_dbport> <application_ip type="strProp">192.168.100.129</application_ip> <display_label type="strProp">BMC-W2K3-ITSM</display_label> <application_username type="strProp">sa</application_username>
HP_uCMDB
6
Name Req. Description
<application_version type="strProp">Microsoft SQL Server 2005 SP3</application_version> <database_dbtype type="strProp">MicrosoftSQLServer</database_dbtype> <database_dbsid type="strProp">BMC-W2K3-ITSM</database_dbsid> <database_dbversion type="strProp">9.00.4035.00</database_dbversion> <has_config_files type="booleanProp">false</has_config_files> </CI></CIs>
output xml still chunked true A boolean true false value indicating if the output XML is Chunked.
getCIsById
DescriptionThe getCIsById method returns the CI or CIs that match the provided input IDs.
Either a single CI ID can be provided or multiple IDs.
Parameters
Table 4.3. Input Parameters
Name Req. Description
ci id false The CI to look for, an example CI ID value would look like this86d8361a01ac51c7f4f744e9a359506c
cis id false XML document of the IDs of the CIs for example
<CIs> <ID>86d8361a01ac51c7f4f744e9a359506c</ID> <ID>...</ID></CIs>
Table 4.4. Output Parameters
Name Req. Description
output xml true The output XML either converted into an easy to use structure, or potentiala Chunked adapter response format. An example of the CIs format is shownbelow.
<CIs> <CI>
HP_uCMDB
7
Name Req. Description
<ID>82f6be995115c14a34ef3a69ba965aab</ID> <type>sqlserver</type> <application_timeout type="intProp">20000</application_timeout> <application_port type="intProp">1433</application_port> <data_name type="strProp">MSSQL DB</data_name> <database_dbport type="strProp">1433</database_dbport> <application_ip type="strProp">192.168.100.129</application_ip> <display_label type="strProp">BMC-W2K3-ITSM</display_label> <application_username type="strProp">sa</application_username> <application_version type="strProp">Microsoft SQL Server 2005 SP3</application_version> <database_dbtype type="strProp">MicrosoftSQLServer</database_dbtype> <database_dbsid type="strProp">BMC-W2K3-ITSM</database_dbsid> <database_dbversion type="strProp">9.00.4035.00</database_dbversion> <has_config_files type="booleanProp">false</has_config_files> </CI></CIs>
output xml still chunked true A boolean true false value indicating if the output XML is Chunked.
getCIsByType
DescriptionThe getCIsByType method returns the collection of configuration items of the specified type and of alltypes that inherit from the specified type.
Parameters
Table 4.5. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
Table 4.6. Output Parameters
Name Req. Description
output xml true The output XML either converted into an easy to use CIs structure, or potentiala Chunked adapter response format. An example of the Chunked format isshown below.
<CIs><soap-response>
HP_uCMDB
8
Name Req. Description
<metadata> <status>success</status> </metadata> <response> <soap-header-content /> <soap-body-content> <getCIsByTypeResponse> <CIs /> <chunkInfo> <numberOfChunks>12</numberOfChunks> <chunksKey> <key1>getObjectsByCondition</key1> <key2>getObjectsByCondition5bfa24f6658eeb7640be44ae1711c565</key2> </chunksKey> </chunkInfo> </getCIsByTypeResponse> </soap-body-content> </response></soap-response>
output xml still chunked false A boolean true false value indicating if the output XML is Chunked.
getClassAncestors
DescriptionThe getClassAncestors method retrieves the full inherited class information between the given class nameand its root, including the root class.
Parameters
Table 4.7. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
Table 4.8. Output Parameters
Name Req. Description
class ancestors true An XML document listing the class inheritance in chronological order. Anexample output for the class application is shown below.
HP_uCMDB
9
Name Req. Description
<getClassAncestorsResponse> <classHierarchyNode level="0"> <className>application</className> <displayName>Software Element</displayName> <classParentName>system</classParentName> </classHierarchyNode> <classHierarchyNode level="1"> <className>system</className> <displayName>System</displayName> <classParentName>it_world</classParentName> </classHierarchyNode> <classHierarchyNode level="2"> <className>it_world</className> <displayName>IT Universe</displayName> <classParentName>object</classParentName> </classHierarchyNode> <classHierarchyNode level="3"> <className>object</className> <displayName>Object</displayName> <classParentName>data</classParentName> </classHierarchyNode> <classHierarchyNode level="4"> <className>data</className> <displayName>Data</displayName> <classParentName>root</classParentName> </classHierarchyNode> <classHierarchyNode level="5"> <className>root</className> <displayName>Root</displayName> <classParentName>none</classParentName> </classHierarchyNode></getClassAncestorsResponse>
getCmdbClassDefinition
DescriptionThe getCmdbClassDefinition method retrieves information about the specified class.
NOTE: It does not provide property information for parent classes of the current class.
HP_uCMDB
10
Parameters
Table 4.9. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
Table 4.10. Output Parameters
Name Req. Description
adapter response true The adapter repsonse XML document showing properties of the class. As anexample the following is the output for the class j2eeapplication.
<soap-response> <metadata> <status>success</status> </metadata> <response> <soap-header-content /> <soap-body-content> <getCmdbClassDefinitionResponse xmlns="http://schemas.hp.com/ucmdb/1/params/classmodel"> <UcmdbClass xmlns="http://schemas.hp.com/ucmdb/1/types/classmodel"> <name>j2eeapplication</name> <classType>CI</classType> <displayLabel>J2EE Application</displayLabel> <description>J2EE application - is a deployable unit of J2EE functionality Key Attributes: 1. Name (data_name) - A unique name that identifies application in the J2EE domain. 2. Container (root_container) - The relevant J2EE Domain</description> <parentName>j2eedeployedobject</parentName> <qualifiers> <qualifier> <name>DOCUMENTED</name> <qualifierProps> <dateProps /> <doubleProps /> <floatProps /> <intListProps /> <intProps /> <strProps /> <strListProps /> <longProps /> <bytesProps /> <xmlProps /> <booleanProps /> </qualifierProps> </qualifier> </qualifiers> <attributes> <attribute> <name>j2eeapplication_isear</name> <attrType>BOOLEAN</attrType>
HP_uCMDB
11
Name Req. Description
<displayLabel>J2EE Application Is EAR File</displayLabel> <description>Wherher application deployed as an ear</description> <qualifiers> <qualifier> <name>DOCUMENTED</name> <qualifierProps> <dateProps /> <doubleProps /> <floatProps /> <intListProps /> <intProps /> <strProps /> <strListProps /> <longProps /> <bytesProps /> <xmlProps /> <booleanProps /> </qualifierProps> </qualifier> </qualifiers> <defaultValue>false</defaultValue> </attribute> <attribute> <name>j2eeapplication_fullpath</name> <attrType>STRING</attrType> <displayLabel>J2EE Application Full Path</displayLabel> <description>The path to the source of the application unit on the Administration Server.</description> <qualifiers> <qualifier> <name>DOCUMENTED</name> <qualifierProps> <dateProps /> <doubleProps /> <floatProps /> <intListProps /> <intProps /> <strProps /> <strListProps /> <longProps /> <bytesProps /> <xmlProps /> <booleanProps /> </qualifierProps> </qualifier> </qualifiers> <defaultValue /> </attribute> </attributes> </UcmdbClass> <comments> <comments xmlns="http://schemas.hp.com/ucmdb/1/types">no comment</comments> </comments>
HP_uCMDB
12
Name Req. Description
</getCmdbClassDefinitionResponse> </soap-body-content> </response></soap-response>
getFilteredCIsByType
DescriptionThe getFilteredCIsByType method retrieves the CIs of the specified type that meet the conditions used bythe method. A condition is comprised of:
1. a name field containing the name of a property
2. an operator field containing a comparison operator
3. an optional value field containing a value or list of values
Parameters
Table 4.11. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
ci filter true A filter to apply for the call. utilize the HP-uCMDB:Utilities:AddCIsFilterCondition process to aid in building filters.An example filter value is shown below where the display_label is beingevaluated;
<quer:conditions xmlns:quer="http://schemas.hp.com/ucmdb/1/params/query"> <typ:booleanConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:dateConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:doubleConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:floatConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:intConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:intListConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:strConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types"> <typ:strCondition> <typ:condition> <typ:name>display_label</typ:name>
HP_uCMDB
13
Name Req. Description
<typ:value>w2k3-ucmdb</typ:value> </typ:condition> <typ:strOperator>Equal</typ:strOperator> </typ:strCondition> </typ:strConditions> <typ:strListConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:xmlConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:longConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /></quer:conditions>
Table 4.12. Output Parameters
Name Req. Description
output xml true The output XML either converted into an easy to use CIs structure, or potentiala Chunked adapter response format.
output xml still chunked false A boolean true false value indicating if the output XML is Chunked.
pullTopologyMapChunks
Description
This process pulls 1 or more chunks of information from the Chunked query.
Parameters
Table 4.13. Input Parameters
Name Req. Description
chunk key 1 true The "key 1" value for the Chunked query response, for example
getObjectsByCondition
chunk key 2 true The "key 2" value for the Chunked query response, for example
getObjectsByCondition5bfa24f6658eeb7640be44ae1711c565
number of chunks true The number of the chunk to retrieve.
start chunk number true The chunk number to start at.
HP_uCMDB
14
Table 4.14. Output Parameters
Name Req. Description
adapter response true The raw adapter response that should contain CIs information in the nativeuCMDB API XML format.
releaseChunks
DescriptionFrees up the memory on the uCMDB server for a Chunked query result set by telling the uCMDB it cannow destroy the results.
If you don't release the chunks from a large query then the uCMDB will do it automatically after 10minutes , but best practice states that you should release the Chunks as soon as you are finished with theChunked result set.
Parameters
Table 4.15. Input Parameters
Name Req. Description
chunk key 1 true The "key 1" value for the Chunked query response, for example
getObjectsByCondition
chunk key 2 true The "key 2" value for the Chunked query response, for example
getObjectsByCondition5bfa24f6658eeb7640be44ae1711c565
Table 4.16. Output Parameters
Name Req. Description
None
15
Chapter 5. HP_uCMDB:UtilitiesAddCIsFilterCondition
DescriptionCreate a new single filter condition, or adds another filter condition to a pre-existing filter that is passed in.
Parameters
Table 5.1. Input Parameters
Name Req. Description
type true Valid types values are boolean, date, double, float, int, intList, str, strList, xml,long.
property name true CI property name to compare value on
value true The value to compare.
condition true Condition dependant on type for example Str conditions are Equal, NotEqual,Like, LikeIgnoreCase, In, IsNull, EqualIgnoreCase.
existing filter false Exisiting filter to add condition to, or pass empty if its a new filter.
Table 5.2. Output Parameters
Name Req. Description
ci filter true The finished filter XML fragment. An example is shown below.
<quer:conditions xmlns:quer="http://schemas.hp.com/ucmdb/1/params/query"> <typ:booleanConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:dateConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:doubleConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:floatConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" />
HP_uCMDB:Utilities
16
Name Req. Description
<typ:intConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:intListConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:strConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types"> <typ:strCondition> <typ:condition> <typ:name>display_label</typ:name> <typ:value>w2k3-ucmdb</typ:value> </typ:condition> <typ:strOperator>Equal</typ:strOperator> </typ:strCondition> </typ:strConditions> <typ:strListConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:xmlConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> <typ:longConditions xmlns:typ="http://schemas.hp.com/ucmdb/1/types" /> </quer:conditions>
ExtractCmdbClassProperties
DescriptionGet the properties for a particular class and formats them into the XML required when querying CIs andspecifying the properties to retrieve.
Parameters
Table 5.3. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
Table 5.4. Output Parameters
Name Req. Description
properties XML true Formated properties XML fragement, for example the class nt is shown below;
HP_uCMDB:Utilities
17
Name Req. Description
<prop:propertiesList xmlns:prop="http://schemas.hp.com/ucmdb/1/types/props"> <prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName></prop:propertiesList>
ExtractCmdbClassPropertiesAncestors
DescriptionGet the properties for a particular class and its ancestors for a given number of levels and formats theminto the XML required when querying CIs and specifying the properties to retrieve.
Parameters
Table 5.5. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
levels true The number of levels of class ancenstors to include properties for.
Table 5.6. Output Parameters
Name Req. Description
properties XML true Formated properties XML fragement, for example the class nt is shown belowwith 3 levels of ancestor properties loaded;
<prop:propertiesList xmlns:prop="http://schemas.hp.com/ucmdb/1/types/props">
HP_uCMDB:Utilities
18
Name Req. Description
<prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName> <prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName> <prop:propertyName>host_systemassettag</prop:propertyName> <prop:propertyName>host_isroute</prop:propertyName> <prop:propertyName>host_key</prop:propertyName> <prop:propertyName>host_osinstalltype</prop:propertyName> <prop:propertyName>host_osdomain</prop:propertyName> <prop:propertyName>host_iscomplete</prop:propertyName> <prop:propertyName>host_hostname</prop:propertyName> <prop:propertyName>host_isdesktop</prop:propertyName> <prop:propertyName>internal_name</prop:propertyName> <prop:propertyName>host_model</prop:propertyName> <prop:propertyName>host_snmpsysname</prop:propertyName> <prop:propertyName>host_serialnumber</prop:propertyName> <prop:propertyName>host_nnm_uid</prop:propertyName> <prop:propertyName>host_vendor</prop:propertyName> <prop:propertyName>host_isvirtual</prop:propertyName> <prop:propertyName>host_osaccuracy</prop:propertyName> <prop:propertyName>host_dnsname</prop:propertyName> <prop:propertyName>host_osversion</prop:propertyName> <prop:propertyName>host_manufacturer</prop:propertyName> <prop:propertyName>host_osrelease</prop:propertyName> <prop:propertyName>host_servertype</prop:propertyName> <prop:propertyName>host_last_boot_time</prop:propertyName> <prop:propertyName>host_os</prop:propertyName></prop:propertiesList>
LoadGlobalClassProperties
DescriptionGet the properties for the initial classes list specified in the configuration itemPROPERTIES_LIST:global_list. The resulting class properties XML is then stored into a global contextitem uCMDB_all_properties. This global context item allows us to dynamically cache any number of classproperties that the uCMDB may have.
HP_uCMDB:Utilities
19
Global Context Item: uCMDB_all_properties
Table 5.7. uCMDB_all_properties XML Example
Example Value after execution for input class list of nt and application
<classes> <class name="nt" levels="3"> <prop:propertiesList xmlns:prop="http://schemas.hp.com/ucmdb/1/types/props"> <prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName> <prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName> <prop:propertyName>host_systemassettag</prop:propertyName> <prop:propertyName>host_isroute</prop:propertyName> <prop:propertyName>host_key</prop:propertyName> <prop:propertyName>host_osinstalltype</prop:propertyName> <prop:propertyName>host_osdomain</prop:propertyName> <prop:propertyName>host_iscomplete</prop:propertyName> <prop:propertyName>host_hostname</prop:propertyName> <prop:propertyName>host_isdesktop</prop:propertyName> <prop:propertyName>internal_name</prop:propertyName> <prop:propertyName>host_model</prop:propertyName> <prop:propertyName>host_snmpsysname</prop:propertyName>
HP_uCMDB:Utilities
20
Example Value after execution for input class list of nt and application
<prop:propertyName>host_serialnumber</prop:propertyName> <prop:propertyName>host_nnm_uid</prop:propertyName> <prop:propertyName>host_vendor</prop:propertyName> <prop:propertyName>host_isvirtual</prop:propertyName> <prop:propertyName>host_osaccuracy</prop:propertyName> <prop:propertyName>host_dnsname</prop:propertyName> <prop:propertyName>host_osversion</prop:propertyName> <prop:propertyName>host_manufacturer</prop:propertyName> <prop:propertyName>host_osrelease</prop:propertyName> <prop:propertyName>host_servertype</prop:propertyName> <prop:propertyName>host_last_boot_time</prop:propertyName> <prop:propertyName>host_os</prop:propertyName> </prop:propertiesList> </class> <class name="application" levels="3"> <prop:propertiesList xmlns:prop="http://schemas.hp.com/ucmdb/1/types/props"> <prop:propertyName>application_password</prop:propertyName> <prop:propertyName>application_username</prop:propertyName> <prop:propertyName>application_timeout</prop:propertyName> <prop:propertyName>application_category</prop:propertyName> <prop:propertyName>vendor</prop:propertyName> <prop:propertyName>application_version</prop:propertyName> <prop:propertyName>root_container_name</prop:propertyName> <prop:propertyName>application_port</prop:propertyName> <prop:propertyName>application_path</prop:propertyName> <prop:propertyName>has_config_files</prop:propertyName> <prop:propertyName>application_ip</prop:propertyName> <prop:propertyName>application_password</prop:propertyName> <prop:propertyName>application_username</prop:propertyName> <prop:propertyName>application_timeout</prop:propertyName> <prop:propertyName>application_category</prop:propertyName> <prop:propertyName>vendor</prop:propertyName> <prop:propertyName>application_version</prop:propertyName> <prop:propertyName>root_container_name</prop:propertyName> <prop:propertyName>application_port</prop:propertyName> <prop:propertyName>application_path</prop:propertyName> <prop:propertyName>has_config_files</prop:propertyName> <prop:propertyName>application_ip</prop:propertyName> <prop:propertyName>language</prop:propertyName> <prop:propertyName>credentials_id</prop:propertyName> <prop:propertyName>codepage</prop:propertyName> <prop:propertyName>latitude</prop:propertyName> <prop:propertyName>ack_cleared_time</prop:propertyName> <prop:propertyName>city</prop:propertyName> <prop:propertyName>is_save_persistency</prop:propertyName> <prop:propertyName>state</prop:propertyName> <prop:propertyName>contextmenu</prop:propertyName> <prop:propertyName>track_changes</prop:propertyName> <prop:propertyName>longitude</prop:propertyName> <prop:propertyName>ack_id</prop:propertyName> <prop:propertyName>country</prop:propertyName> </prop:propertiesList>
HP_uCMDB:Utilities
21
Example Value after execution for input class list of nt and application
</class></classes>
Parameters
Table 5.8. Input Parameters
Name Req. Description
None
Table 5.9. Output Parameters
Name Req. Description
None
ProcessChunks
DescriptionTakes an adapter response from the HP uCMDB API that contains either CIs or Chunk information. ForChunk information the configuration item HP_uCMDB:ACTIONS:retrieve_all_chunks determines if wewill retrieve all Chunk information right now, or allow the Chunk information to pass through this workflow with no modification.
HP_uCMDB:Utilities
22
Example: Chunked Adapter Response
Table 5.10. Chunked Adapter Response XML
Example value of a Chunked adapter response.
<soap-response> <metadata> <status>success</status> </metadata> <response> <soap-header-content /> <soap-body-content> <getCIsByTypeResponse xmlns="http://schemas.hp.com/ucmdb/1/params/query"> <CIs /> <chunkInfo> <numberOfChunks xmlns="http://schemas.hp.com/ucmdb/1/types">695</numberOfChunks> <chunksKey xmlns="http://schemas.hp.com/ucmdb/1/types"> <key1>getObjectsByCondition</key1> <key2>getObjectsByCondition57a30457b7419dac89617268a8b8d963</key2> </chunksKey> </chunkInfo> </getCIsByTypeResponse> </soap-body-content> </response></soap-response>
Example: Non-Chunked Adapter Response
Table 5.11. Regular Adapter Response XML
Example value of a Non-Chunked adapter response.
<soap-response> <metadata> <status>success</status> </metadata> <response> <soap-header-content /> <soap-body-content> <getCIsByTypeResponse xmlns="http://schemas.hp.com/ucmdb/1/params/query"> <CIs> <CI xmlns="http://schemas.hp.com/ucmdb/1/types"> <ID>82f6be995115c14a34ef3a69ba965aab</ID> <type>sqlserver</type> <props> <intProps> <intProp> <name>application_timeout</name> <value>20000</value> </intProp> <intProp> <name>application_port</name> <value>1433</value>
HP_uCMDB:Utilities
23
Example value of a Non-Chunked adapter response.
</intProp> </intProps> <strProps> <strProp> <name>data_name</name> <value>MSSQL DB</value> </strProp> <strProp> <name>database_dbport</name> <value>1433</value> </strProp> <strProp> <name>application_ip</name> <value>192.168.100.129</value> </strProp> <strProp> <name>display_label</name> <value>BMC-W2K3-ITSM</value> </strProp> <strProp> <name>application_username</name> <value>sa</value> </strProp> <strProp> <name>application_version</name> <value>Microsoft SQL Server 2005 SP3</value> </strProp> <strProp> <name>database_dbtype</name> <value>MicrosoftSQLServer</value> </strProp> <strProp> <name>database_dbsid</name> <value>BMC-W2K3-ITSM</value> </strProp> <strProp> <name>database_dbversion</name> <value>9.00.4035.00</value> </strProp> </strProps> <bytesProps /> <booleanProps> <booleanProp> <name>has_config_files</name> <value>false</value> </booleanProp> </booleanProps> </props> </CI> </CIs> <chunkInfo> <numberOfChunks xmlns="http://schemas.hp.com/ucmdb/1/types">0</numberOfChunks>
HP_uCMDB:Utilities
24
Example value of a Non-Chunked adapter response.
<chunksKey xmlns="http://schemas.hp.com/ucmdb/1/types"> <key1 /> <key2 /> </chunksKey> </chunkInfo> </getCIsByTypeResponse> </soap-body-content> </response></soap-response>
Parameters
Table 5.12. Input Parameters
Name Req. Description
adapter response true The adapter response that may contain 0 to many CI elements, or if a largenumber of CIs are returned that exceed the HP uCMDBs internal thresholdfor an initial response, then Chunk information (where the HP uCMDB hasbroken the CI information into multi pages).
Table 5.13. Output Parameters
Name Req. Description
adapter response true The updated adapter response.
adapter response stillchunked
false A boolean indicator that states if the adapter response still contains chunkedinformation.
RestructureCIsXML
Description
Flattens and puts CI information into a more friendly format of:
<CIs> <CI> <property_name>value</property_name> ... </CI> <CI> ... </CI></CIs>
If the chunk information indicates chunks then it just passes through the adapter response as no CIinformation will be present.
HP_uCMDB:Utilities
25
Parameters
Table 5.14. Input Parameters
Name Req. Description
input cis xml true The adapter request that may contain CI information.
Table 5.15. Output Parameters
Name Req. Description
properties XML true The output XML, either a document of <CIs> or the original adapter responseif chunking is still present. An example of a single CI response is shown below;
<CIs> <CI> <ID>82f6be995115c14a34ef3a69ba965aab</ID> <type>sqlserver</type> <application_timeout type="intProp">20000</application_timeout> <application_port type="intProp">1433</application_port> <data_name type="strProp">MSSQL DB</data_name> <database_dbport type="strProp">1433</database_dbport> <application_ip type="strProp">192.168.100.129</application_ip> <display_label type="strProp">BMC-W2K3-ITSM</display_label> <application_username type="strProp">sa</application_username> <application_version type="strProp">Microsoft SQL Server 2005 SP3</application_version> <database_dbtype type="strProp">MicrosoftSQLServer</database_dbtype> <database_dbsid type="strProp">BMC-W2K3-ITSM</database_dbsid> <database_dbversion type="strProp">9.00.4035.00</database_dbversion> <has_config_files type="booleanProp">false</has_config_files> </CI></CIs>
ReturnGlobalClassProperty
DescriptionReturns the properties XML for a uCMDB class for usage in quering for CIs. If no class is specifiedthen the default class object is used. If the class is not yet in the global context properties XML then itis researched and added.
HP_uCMDB:Utilities
26
Parameters
Table 5.16. Input Parameters
Name Req. Description
class name true The uCMDB class name such as nt, host, or application.
Table 5.17. Output Parameters
Name Req. Description
class properties true Returns the properties for a specific class from the global context itemuCMDB_all_properties. For example the class nt is shown below with 3 levelsof ancestor properties loaded;
<prop:propertiesList xmlns:prop="http://schemas.hp.com/ucmdb/1/types/props"> <prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName> <prop:propertyName>nt_ieversion</prop:propertyName> <prop:propertyName>nt_mainprocessortype</prop:propertyName> <prop:propertyName>nt_registeredowner</prop:propertyName> <prop:propertyName>nt_mainprocessorspeed</prop:propertyName> <prop:propertyName>nt_physicalmemory</prop:propertyName> <prop:propertyName>nt_kernel</prop:propertyName> <prop:propertyName>nt_processorsnumber</prop:propertyName> <prop:propertyName>nt_registrationorg</prop:propertyName> <prop:propertyName>nt_servicepack</prop:propertyName> <prop:propertyName>host_systemassettag</prop:propertyName> <prop:propertyName>host_isroute</prop:propertyName> <prop:propertyName>host_key</prop:propertyName> <prop:propertyName>host_osinstalltype</prop:propertyName> <prop:propertyName>host_osdomain</prop:propertyName> <prop:propertyName>host_iscomplete</prop:propertyName>
HP_uCMDB:Utilities
27
Name Req. Description
<prop:propertyName>host_hostname</prop:propertyName> <prop:propertyName>host_isdesktop</prop:propertyName> <prop:propertyName>internal_name</prop:propertyName> <prop:propertyName>host_model</prop:propertyName> <prop:propertyName>host_snmpsysname</prop:propertyName> <prop:propertyName>host_serialnumber</prop:propertyName> <prop:propertyName>host_nnm_uid</prop:propertyName> <prop:propertyName>host_vendor</prop:propertyName> <prop:propertyName>host_isvirtual</prop:propertyName> <prop:propertyName>host_osaccuracy</prop:propertyName> <prop:propertyName>host_dnsname</prop:propertyName> <prop:propertyName>host_osversion</prop:propertyName> <prop:propertyName>host_manufacturer</prop:propertyName> <prop:propertyName>host_osrelease</prop:propertyName> <prop:propertyName>host_servertype</prop:propertyName> <prop:propertyName>host_last_boot_time</prop:propertyName> <prop:propertyName>host_os</prop:propertyName></prop:propertiesList>
class name true The class name is also returned in case it was not provided and was defaultedto object.
StripNamespaces
DescriptionA generic process that takes an input XML document and rebuilds it from scratch omitting all names spacedeclarations. Unless a BAO developer understands intermediate to advanced XPATH statements, dealingwith namespaces can be a daunting task. This process removes this barrier to working with the input XMLdocument, allowing for the Basic Transform editor to be used on the outputted XML document.
Parameters
Table 5.18. Input Parameters
Name Req. Description
input xml document true The input XML document with the namespace information to remove. Anexample is shown below;
<soap-response> <metadata> <status>success</status>
HP_uCMDB:Utilities
28
Name Req. Description
</metadata> <response> <soap-header-content /> <soap-body-content> <getCIsByTypeResponse xmlns="http://schemas.hp.com/ucmdb/1/params/query"> <CIs> <CI xmlns="http://schemas.hp.com/ucmdb/1/types"> <ID>82f6be995115c14a34ef3a69ba965aab</ID> <type>sqlserver</type> <props> <strProps> <strProp> <name>database_dbtype</name> <value>MicrosoftSQLServer</value> </strProp> <strProp> <name>database_dbsid</name> <value>BMC-W2K3-ITSM</value> </strProp> </strProps> <bytesProps /> <booleanProps /> </props> </CI> </CIs> <chunkInfo> <numberOfChunks xmlns="http://schemas.hp.com/ucmdb/1/types">0</numberOfChunks> <chunksKey xmlns="http://schemas.hp.com/ucmdb/1/types"> <key1 /> <key2 /> </chunksKey> </chunkInfo> </getCIsByTypeResponse> </soap-body-content> </response></soap-response>
Table 5.19. Output Parameters
Name Req. Description
output xml document true The transformed XML document with namespace information removed. Anexample is shown below where the following namespaces have been removed.
1. "http://schemas.hp.com/ucmdb/1/params/query"
2. "http://schemas.hp.com/ucmdb/1/types"
<soap-response> <metadata> <status>success</status> </metadata> <response>
HP_uCMDB:Utilities
29
Name Req. Description
<soap-header-content /> <soap-body-content> <getCIsByTypeResponse> <CIs> <CI> <ID>82f6be995115c14a34ef3a69ba965aab</ID> <type>sqlserver</type> <props> <strProps> <strProp> <name>database_dbtype</name> <value>MicrosoftSQLServer</value> </strProp> <strProp> <name>database_dbsid</name> <value>BMC-W2K3-ITSM</value> </strProp> </strProps> <bytesProps /> <booleanProps /> </props> </CI> </CIs> <chunkInfo> <numberOfChunks>0</numberOfChunks> <chunksKey> <key1 /> <key2 /> </chunksKey> </chunkInfo> </getCIsByTypeResponse> </soap-body-content> </response></soap-response>
30
Chapter 6. Additional Module NotesUnfinished Items
The following is a list of unfinished or missing items within this Adapter Module
1. No update to CIs has been implemented yet. At some point in the future the uCMDB API methodupdateCIsAndRelations needs to be implemented.
2. The concept of String Lists or strList within the uCMDB and its API have not been fully implementedwithin this module.