Using SOAPUI and REST Web Services to create a CI Object

Document ID : KB000010574
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

One of the key elements of Service Desk is the ability to create new objects within the product via its various interfaces.  This document discusses the process via the REST Web Services and uses the CI object (Configuration Items or Network Resources) as an example.

Environment:
CA Service Desk Manager 14.1 or higher
Instructions:

First, you will need to create a project and establish a connection to REST Web Services.  The following document, TEC1828322, describes how to do just that:

https://support.ca.com/us/knowledge-base-articles.TEC1828322.html

01-login.jpg

Once a connection has been established, (make sure you take note of the access_key value, 1534147117 in this case!) you will then need to access the CI resource. 

To do this, scroll on the left pane until you locate the "nr" resource.  "nr" is the Network Resource object, or Configuration Item.

You will then need to create and configure a new POST Request.  On the POST entry under "/nr" right click and choose "New Request"

02-newreq.jpg

To configure the Request:

- On the lower left of the Request pane, access "Headers" and add the following entries:

Header:  X-Obj-Attrs
Value:  id,name

Header:  X-AccessKey
Value:  The Access Key integer string you had acquired when you initiated the connection.  In this case, it was 1534147117.

03-headers.jpg

- Just above the Header display, you will see the Media Type settings.  Change the drop down to read as "application/xml" and enter the following string sequence in the text below:

<nr>
  <name>TEST CI via REST API</name>
     <class COMMON_NAME="Discovered Hardware"/>
</nr>

The above content names the parameters that will be used to create the given CI.  This is a simple and basic CI that assumes all out of box functionality (ie:  no additional customisations to introduce required fields)

- Once the above has been entered, on the upper left of the Request display window is a green triangle "play" button.  Click on the button.

04-XML-parameters.jpg

A new CI is generated.  Output generated on the right hand XML tab should read something like:

<nr id="U'551625F971D7B84FAD8DA806535917E8'" REL_ATTR="U'551625F971D7B84FAD8DA806535917E8'" COMMON_NAME="TEST CI via REST API">
   <link href="http://ng-da01-E7015:8050/caisd-rest/nr/U'551625F971D7B84FAD8DA806535917E8'" rel="self"/>
   <name>TEST CI via REST API</name>
</nr>

05-response.jpg

Notice under "Headers" tab on the right hand side of the Request display that the "#status#" shows "HTTP/1.1 201 Created"