Using SOAPUI and REST Web Services to create a CI Object

book

Article ID: 10574

calendar_today

Updated On:

Products

SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service CA Service Desk Manager CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/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 17.1 or higher

Resolution

First, you will need to create a project and establish a connection to REST Web Services.\

The following document describes how to do this:

Is there a tool I can use to test CA Service Desk Manager REST Web Service functions?
 

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"


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.

- 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.




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://SERVER1:8050/caisd-rest/nr/U'551625F971D7B84FAD8DA806535917E8'" rel="self"/>
   <name>TEST CI via REST API</name>
</nr>


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

Attachments