Adding CI instances via SOAP Request

Hi,

 

    I am new in SOAP and trying to make what I expect to be simple, create an instance in a existing CI like "Node" programmatically. I do have SOAP UI configured (WSDL loaded) and I can make create using for example, getClassAncestors, this is pretty striaght forward, but I cannot find my way with addCIsAndRelations. If someone have a XML example of such things to add a new node to CI type Node or even something else in infrastructure Elements that will save me a lot of time. 

 

  I am confused but the fact you have to provide an ID while it is a creation then it does not exist yet??

 

thanks for your help, and sorry for the dummy questions but we have all to start one day..

 

Loic

  • Hi ,

    No sure which environment or Version you are working on but ok to avoid any confusion please ustilise article KM1431407 from http://support.openview.hp.com/selfsolve

    Its Very Good Reference material if you want avoid any further confusion

    Cheers :)
  • I am running version 10.10 on Linux Redhat.  I don't need to be an expert on uCMDB, I just need to provide an integration a simple example how to create a CI instances in an existing CI Clast in SOAP will do it.

     

    Thanks a lot

    Loic

  • Hi Loic ,

    Agreed you dont need to be expert on UCMDB to upload the data but we need to know the ecosystem of the tool first to form an integration .

    If you are trying to create a Ci in UCMDB i would advice you to have a look at below location for statndard Webservices methods even sample code is dicumented here

    root directory\UCMDB\UCMDBServer\deploy\ucmdb-docs\docs\eng\APIs\CMDB_Schema\webframe.html

    Just to let you know

    This is also possible from JAVA API

    rootfolder\\UCMDB\UCMDBServer\deploy\ucmdb-docs\docs\eng\APIs\JavaSDK_Samples\Ucmdb_JSdk_DataInSampleExample.html

     

    To work with JAVA API you will have to go thorugh lot of other settings like setting up an User for integration with valid permission and then you to download the ucmdb-api.jar from application http://localhost:8080/API Client Downaload and save in classpath before compiling or running your application

     

     

    From you querry point of view i believe you need to create the CI first use a Method to populate the CI's using a method

     

    CI Complex Type then the corresponding properties values(all are documented with Code in the above mentioned location)

    Hope this helps you to move forward

    Cheers :)

  • Thanks a lot for all the information, I made good progress today and I am able to create an Intances to a new create CI I named VM  for Virtual Machine,  mthe y XML is included here, it does work fine, my only question is how to create a ID because here I am giving it to the XML, is there any magic trick like parsing a "?" or "new" and UCMDB will understand there is a need to create a new ID...

     

    Because I am creating these instances, they do not exist.

     

    Thanks

     

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:upd="http://schemas.hp.com/ucmdb/1/params/update" xmlns:typ="http://schemas.hp.com/ucmdb/1/types" xmlns:upd1="http://schemas.hp.com/ucmdb/1/types/update">
    <soap:Header/>
    <soap:Body>
    <upd:addCIsAndRelations>
    <upd:cmdbContext>
    <typ:callerApplication>CFME</typ:callerApplication>
    </upd:cmdbContext>
    <upd:updateExisting>true</upd:updateExisting>
    <upd:CIsAndRelationsUpdates>
    <upd1:CIsForUpdate>
    <typ:CI>
    <typ:ID temp="false">a3ff45a859e106fe35c3920a843c946b</typ:ID>
    <typ:type>vm</typ:type>
    <typ:props>
    <typ:strProps>
    <typ:strProp>
    <typ:name>name</typ:name>
    <typ:value>loic3</typ:value>
    </typ:strProp>
    </typ:strProps>
    </typ:props>
    </typ:CI>
    </upd1:CIsForUpdate>
    </upd:CIsAndRelationsUpdates>
    <upd:ignoreValidation>false</upd:ignoreValidation>
    </upd:addCIsAndRelations>
    </soap:Body>
    </soap:Envelope>

  • Thanks a lot for all the information, I made good progress today and I am able to create an Intances to a new create CI I named VM  for Virtual Machine,  mthe y XML is included here, it does work fine, my only question is how to create a ID because here I am giving it to the XML, is there any magic trick like parsing a "?" or "new" and UCMDB will understand there is a need to create a new ID...

     

    Because I am creating these instances, they do not exist.

     

    Thanks

     

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:upd="http://schemas.hp.com/ucmdb/1/params/update" xmlns:typ="http://schemas.hp.com/ucmdb/1/types" xmlns:upd1="http://schemas.hp.com/ucmdb/1/types/update">
    <soap:Header/>
    <soap:Body>
    <upd:addCIsAndRelations>
    <upd:cmdbContext>
    <typ:callerApplication>CFME</typ:callerApplication>
    </upd:cmdbContext>
    <upd:updateExisting>true</upd:updateExisting>
    <upd:CIsAndRelationsUpdates>
    <upd1:CIsForUpdate>
    <typ:CI>
    <typ:ID temp="false">a3ff45a859e106fe35c3920a843c946b</typ:ID>
    <typ:type>vm</typ:type>
    <typ:props>
    <typ:strProps>
    <typ:strProp>
    <typ:name>name</typ:name>
    <typ:value>loic3</typ:value>
    </typ:strProp>
    </typ:strProps>
    </typ:props>
    </typ:CI>
    </upd1:CIsForUpdate>
    </upd:CIsAndRelationsUpdates>
    <upd:ignoreValidation>false</upd:ignoreValidation>
    </upd:addCIsAndRelations>
    </soap:Body>
    </soap:Envelope>

  • Thanks a lot for all the information, I made good progress today and I am able to create an Intances to a new create CI I named VM  for Virtual Machine,  mthe y XML is included here, it does work fine, my only question is how to create a ID because here I am giving it to the XML, is there any magic trick like parsing a "?" or "new" and UCMDB will understand there is a need to create a new ID...

     

    Because I am creating these instances, they do not exist.

     

    Thanks

     

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:upd="http://schemas.hp.com/ucmdb/1/params/update" xmlns:typ="http://schemas.hp.com/ucmdb/1/types" xmlns:upd1="http://schemas.hp.com/ucmdb/1/types/update">
    <soap:Header/>
    <soap:Body>
    <upd:addCIsAndRelations>
    <upd:cmdbContext>
    <typ:callerApplication>CFME</typ:callerApplication>
    </upd:cmdbContext>
    <upd:updateExisting>true</upd:updateExisting>
    <upd:CIsAndRelationsUpdates>
    <upd1:CIsForUpdate>
    <typ:CI>
    <typ:ID temp="false">a3ff45a859e106fe35c3920a843c946b</typ:ID>
    <typ:type>vm</typ:type>
    <typ:props>
    <typ:strProps>
    <typ:strProp>
    <typ:name>name</typ:name>
    <typ:value>loic3</typ:value>
    </typ:strProp>
    </typ:strProps>
    </typ:props>
    </typ:CI>
    </upd1:CIsForUpdate>
    </upd:CIsAndRelationsUpdates>
    <upd:ignoreValidation>false</upd:ignoreValidation>
    </upd:addCIsAndRelations>
    </soap:Body>
    </soap:Envelope>

  • Hey Loic ,

    Dont worry about the UCMDB ID this tool is designed in such a way that it creates new ID which is in hexadecimal number whenever any new data has been populated by any means Just think of a New CI with UCMDB ID once its registered in the system.

    If You really interested to know more about this you will have read a bit about HP UCMDB DATAIN opreation and also understand Reconciliation Engine


    Cheers :)