Anup,
You made my day!
I havent looked in depth the Atrium core web services, but I am currently
working with CMDB Java API and its really simple to work with CI's using it.
Let me share the pseudo code for "Adding, updating and deleting CI's" with list
and you, so that nobody goes through the javadocs and research that I went
through :). There are more things that can be added..but this can be used as
starting point.
Here's pseudo code for adding/updating CI's.
boolean updateCMDB(ARServerUser context, String instanceId, Map<String,
String> attributeValues, String className, String nameSpace, String operation)
{
Map<String, CMDBAttributeValue> cmdbattribValues = new HashMap<String,
CMDBAttributeValue>();
for (Map.Entry<String, String> kv : attributeValues.entrySet())
{
//System.out.println(kv.getKey() + "=" + kv.getValue());
cmdbattribValues.put(kv.getKey(), new
CMDBAttributeValue(kv.getKey(), new Value(kv.getValue())));
}
CMDBClassNameKey classNameKey = new CMDBClassNameKey(className,
nameSpace);
CMDBInstance instance = new CMDBInstance(classNameKey,
cmdbattribValues);
if (operation.equalsIgnoreCase("update"))
{
instance.setId(instanceId);
try
{
instance.update(context, "BMC.ASSET");
return true;
} catch (ARException ex)
{
//print exception here.
return false;
}
} else
{
try
{
instance.create(context, "BMC.ASSET");
System.out.println("Instance ID: " + instance.getId());
return true;
} catch (ARException ex)
{
//print exception here
return false;
}
}
Here's pseudo code for Deleting CI's
public static boolean deleteFromCMDB(ARServerUser context, String className,
String nameSpace, String instanceId)
{
CMDBClassNameKey classNameKey = new CMDBClassNameKey(className,
nameSpace);
try
{
CMDBInstance.delete(context, classNameKey, "BMC.ASSET", instanceId,
CMDBInstance.CMDB_CASCADE_DELETE_FOLLOW_1TO1_1TOMANY_RELATIONSHIPS);
return true;
} catch (ARException ex)
{
//print exception
return false;
}
}
Hope this helps.
Thanks
Chintan.
--- On Wed, 5/1/13, Anup Garg <[email protected]> wrote:
From: Anup Garg <[email protected]>
Subject: Creating CI's using Atrium Core web services
To: [email protected]
Date: Wednesday, May 1, 2013, 7:18 AM
Hi,
I am working on remedy version 7.6.04 SP2 and trying to create a CI of bmc
atrium CMDB through atrium core web services from SOAP UI tool but not able to
do so.
Could anyone provide me the working soap request for creating a CI.
Or is there any other way for automatic CI's creation if it's not possible
through Atrium core web services.
Please suggest.
Thanks & Regards,
Anup
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"