Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
107 views

uCMDB Java API Retrieving CI by ID

Hi

I'm using the uCMDB Java API for various integrations within OMi/OBM. I have developed a few integrations so I am familiar with the API.

However I have a simple use case which I want to achieve but can't see how i can do this simply. All I need to do is retrieve a CI for a given CIID. I cannot see how i can do this without having to use all this code to establish all the necessary pieces, e.g:

ucmdbServiceAccess = ucmdbService.getCmdbService()
TopologyQueryService queryService = ucmdbServiceAccess.getTopologyQueryService()
TopologyQueryFactory queryFactory = queryService.getFactory()
QueryDefinition queryDefinition = queryFactory.createQueryDefinition(queryDef)
QueryNode node = queryDefinition.addNode(nodeDef).ofType(nodeDef).queryProperties(queryValues)
Topology topology = queryService.executeQuery(queryDefinition)
CIList = topology.getCIsByName(nodeDef)

 

Surely there is an easy way to do this?

Thanks

Mike

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: uCMDB Java API Retrieving CI by ID

Hello,

 

This is the approach. You have to create a tql where you mention the CITs and properties to fetch. Once you execute it you will iterate over the result.

 

Best Regards,

Gabi Medan

Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: uCMDB Java API Retrieving CI by ID

Ok thanks 🙂
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.