Wednesday, December 9, 2009

How can we integrate with HP CMDB - part 3

Here are some code to interact with HP SM7 Web Services. It uses an AXIS library generated from the WSDL file, available at iTunes or the following link: HP SM7 Axis Library.

ci = new Packages.com.hp.schemas.SM._7.Common.StringType (work.getString ("NAME"));

keys = new Packages.com.hp.schemas.SM._7.DeviceKeysType ();
keys.setConfigurationItem (ci);

instance = new Packages.com.hp.schemas.SM._7.DeviceInstanceType ();
status = new Packages.com.hp.schemas.SM._7.Common.StringType ("In use");
instance.setStatus (status);
computer = new Packages.com.hp.schemas.SM._7.Common.StringType ("computer");
instance.setConfigurationItemType(computer);
application = new Packages.com.hp.schemas.SM._7.Common.StringType ("application");
instance.setAssignmentGroup (application);

messageType = new Packages.com.hp.schemas.SM._7.Common.MessageType();
messageTypes = [messageType];

type = new Packages.com.hp.schemas.SM._7.DeviceModelType (keys, instance, messageTypes, "query");
booleanf = new java.lang.Boolean (false);
booleant = new java.lang.Boolean (true);

request = new Packages.com.hp.schemas.SM._7.CreateDeviceRequest (type, booleanf, booleanf, booleant);

task.logmsg ("request: " + request);

locator = new Packages.com.hp.schemas.SM._7.Device_ServiceLocator ();

device = locator.getDevice ();

device.setUsername ("falcon");

response = device.createDevice (request);

task.logmsg ("response: " + response + " message: " + response.getMessage());
messages = response.getMessages ();
for (message in messages) {
    task.logmsg ("messages: " + message);
}

Wednesday, December 2, 2009

How can we integrate with HP CMDB? - Part 2

 Nothing like having the opportunity to touch an HP Service Management 7 installation and see first hand what's possible and what's not.

The bottom line is that, like any 'modern' application, HP SM7 makes available Web Service for interacting with the module, like Change Management and Configuration Items.

So, forget what I said before, because it's possible to load data directly into HP SM7 using the Web Service interface.

I didn't find a way to reconcile the data coming from multiple data sources, but at least the parable of not being able to load data into HP SM7 is not true.