uCMDB Java API Retrieving CI by ID
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?
Re: uCMDB Java API Retrieving CI by ID
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.