UCMDB and UD Practitioners Forum (Previously CMS)
cancel

UCMDB, Update specific CI using ucmdb java api.

Highlighted
Ernest_Dipt
Valued Contributor.

UCMDB, Update specific CI using ucmdb java api.

Hi All.

 

I was reading the java API, and Im not be able to find any way to update properties for an specific CI.

I want to retrieve a CI using the global_id property (could be name or other) and modify their information, for example if I have a host CI type, I want to modify the ip_address, version, etc... and make this modification in UCMDB.

 

I found this kind of update action can be performed using ToplogyUpdateServices

 

http://consulting-and-services.de/BSM9/DevRef_guide/UCMDB_JavaAPI/com/hp/ucmdb/api/topology/Topolog...

 

But I didn't found the correct way to use it, it means, first I want to select the CI then modify it and put the changes back to ucmdb tool.

 

Any help here will be truly appreciate.

 

Regards.

 

 

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

2 REPLIES
Ernest_Dipt
Valued Contributor.

Re: UCMDB, Update specific CI using ucmdb java api.

UcmdbService service = ucmdb.getService();

 

TopologyUpdateService topologyUpdateService = service.getTopologyUpdateService();

TopologyUpdateFactory topologyUpdateFactory = topologyUpdateService.getFactory();

TopologyModificationData topologyModificationData = topologyUpdateFactory.createTopologyModificationData();

 

CI ipCI = topologyModificationData.addCI(

"unix");

ipCI.setPropertyValue(

"global_id", "a109ba4861d082b649a56c75ce3e33b8");  <-- You can select the CI you want to modify using the ID.

ipCI.setPropertyValue(

"name", "wavms0033");

ipCI.setPropertyValue(

"description", "wavms0033");

ipCI.setPropertyValue(

"ip_address", "3.239.41.63");

topologyUpdateService.create (topologyModificationData, CreateMode.

UPDATE_EXISTING);

 

That already make what I wanted.

Milap
Respected Contributor.

Re: UCMDB, Update specific CI using ucmdb java api.

Hi All,

 

I want to add relations to existing CIs with java Api.Please  help me its bit urgent.

 

Warm regards,

Milap