Highlighted
Absent Member.
Absent Member.
1897 views

UCMDB- Web Service API for getting list of CIType from the UCMDB

Hello,

I am looking for a Java program to call web service API of UCMDB 8.02. If anyone has any inputs on this. Please share.

I am attaching my java program but this seems to be not working as it's not giving me any results.

Thanks
Varun Singh

 

P.S. This thread has been moved from Application Perf Mgmt (BAC / BSM) Support and News Forum to CMS and Discovery Support and News Forum. -HP Forum Moderator

Arguing with a fool, proves there are two
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Re: UCMDB- Web Service API for getting list of CIType from the UCMDB

Hi,

You have some examples related to query the CMDB class model (CI types and relations).

have a look at "Class Model Example" in the UCMDB web service API help,and at "Query the UCMDB Class Model"

From a quick look at your code, you are trying to get CI Instances by type, which means query the model, and not the class model. plus, the GetCIsByTypeResponse object should be returned from the stub and request, not created by new. example for this kind of operation also exist in the docs.

Hope this help,

Amit
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UCMDB- Web Service API for getting list of CIType from the UCMDB

Hi Amit,

following is an example of getCIsByType
-------------
public void getCIsByTypeDemo() {

GetCIsByType request = new GetCIsByType();

//set cmdbcontext

CmdbContext cmdbContext = getContext();

request.setCmdbContext(cmdbContext);

//set CIs type

request.setType("anyType");

//set CIs propeties to be retrieved

CustomProperties customProperties = new CustomProperties();

PredefinedProperties predefinedProperties =

new PredefinedProperties();

SimplePredefinedProperty simplePredefinedProperty =

new SimplePredefinedProperty();

simplePredefinedProperty.setName

(SimplePredefinedProperty.nameEnum.DERIVED);

SimplePredefinedPropertyCollection

simplePredefinedPropertyCollection =

new SimplePredefinedPropertyCollection();




simplePredefinedPropertyCollection.addSimplePredefinedProperty

(simplePredefinedProperty);

predefinedProperties.setSimplePredefinedProperties

(simplePredefinedPropertyCollection);

customProperties.setPredefinedProperties(predefinedProperties);

request.setProperties(customProperties);

try {

GetCIsByTypeResponse response =

getStub().getCIsByType(request);

TopologyMap map =

getTopologyMapResultFromCIs

(response.getCIs(), response.getChunkInfo());

} catch (RemoteException e) {

//handle exception

} catch (UcmdbFaultException e) {

//handle exception

}

}


It is an example of the getCIsByType usage.
---------------------------------------------

The following statment inside the TRY BLOCK doesn't evaluate to anything. There is no method in the client stubs which take the input as "request". like getCIsByType(request), also getstub doesn't have any method inside the defination to call this.

GetCIsByTypeResponse response =
getStub().getCIsByType(request);

--------------------------------------------

Did one have called the Web Service API for getCIsByType in HP UCMDB 8.02 cP5 version
Arguing with a fool, proves there are two
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UCMDB- Web Service API for getting list of CIType from the UCMDB

Hi,

Please attach the full code and the exception
0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

Re: UCMDB- Web Service API for getting list of CIType from the UCMDB

Hi Amit,

 

I am new to HP UCMDB web service integration. Could you please let me know how to call the TQL in side the Java code and also please share me if you have any detailed steps on this process. Thanks for your help and assistance on this one.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.