I need build query to find a IC by name, how to do this?
I am using the ..../axis/services/QueryPort
I found example to list all ICs but I didnt found other examples.
Your SOAP request should look something like this:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk"> <soapenv:Header/> <soapenv:Body> <ser:doSelect> <sid>123456789</sid> <objectType>nr</objectType> <whereClause>name='put the right name here'</whereClause> <maxRows>-1</maxRows> <attributes> <!--1 or more repetitions:--> </attributes> </ser:doSelect> </soapenv:Body></soapenv:Envelope>
As you can see, the object type is "nr" which refers to the Configuration Item object in Service Desk. This is the raw SOAP request, so if you are writing a program to make this call, then that would look a little bit different, but the attributes (sid, objectType, whereClause, and maxRows) should be the same.
Please let me know if you have any more questions!
I would recommend a SOAP web services call to perform this action. You can find the documentation on SOAP here: Web Services Management - CA Service Management - 14.1 - CA Technologies Documentation, and I would specifically recommend using the doSelect() method with a WHERE clause to specify exactly which Configuration Items you would like.
If this is not what you are trying to accomplish, please let me know and I will try to provide a better answer.
I know this service, and to perform doSelect it is necessary to specify objectType. What object type related to IC?
Marty.Malecki Thanks by the tips.
I've found another way, I need to interact with my cmdb, getting the relationships, so I'm exploring the / axis / services / QueryPort.
Below I have an example of how I searched for the IC by name through this service:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <sec:securityHeader sec:actor="http://schemas.xmlsoap.org/soap/actor/next" sec:mustUnderstand="0" xmlns:sec="http://schemas.xmlsoap.org/soap/envelope/"> <sec:username>USERNAME</sec:username> <sec:password>PASSWORD</sec:password> </sec:securityHeader> </soapenv:Header> <soapenv:Body> <query xmlns="http://cmdbf.org/schema/1-0-0/datamodel"> <itemTemplate id="TestIt">
<recordConstraint> <recordType localName="[Type of IC]"/> <propertyValue localName="name"> <!--Zero or more repetitions:--> <equal>HOSTNAME</equal> </propertyValue>
</itemTemplate> </query> </soapenv:Body> </soapenv:Envelope>
Can I get therelationships of an IC?
It is possible, but I haven't created a query to do this before, and it will be more complicated than just looking for a CI. Jon_Israel Alex_Perretti Do either of you know of any good way to get CI relationships via a web services call?
Typically we only support doing this via GRLoader.
Thanks for your anwser.
I found this doc(CA CMDB Technical Reference Guide r12.6 ) but I did not find how to get the relationships of ICs
Marty.Malecki Jon_Israel Alex_Perretti,
Do any of you know this getLrelValue operation?It returns relationships of CIs?
Ci relations are not Lrel but Qrel against the bmhier object.
May you just read those value you can do a doselect on this table with the necessary but don't update directly without knowing exactly what you do as you can breack up your CMDB here.
The best way to update CI and/or their relation ship is (as John mention) to use GR loader to ensure that the CORA rules are applied and integrity of your CMDB keep safe.
Hope this help.
I'd already found the kind of CI relationships (bmhier).
I do not need to update my CMDB, only query to retrieve information needed to open calls.
Example to get CI relations:
<sid>1385320598</sid> <objectType>bmhier</objectType> <whereClause>child = U'7B0A50242A6D4C49BD727CC70709338C'</whereClause> <maxRows>10</maxRows> <attributes>
Retrieving data ...