HTTP GET for /service

When the NSM client user requests the /service URI using the GET method, a list of services is returned. The sample response shows a list of services and information about them.

Input parameters

None

Available HTTP Headers

Accept: application/json

Accept: text/xml

Sample request

http://www.example.com:16310/nsm/service

Sample response

XML
<services>
	<service id="311" createdByUser="administrator"
createDate="2012-10-26 10:59:19.313 GMT+00:00" 
lastUpdatedDate="2012-11-05 15:45:47.19 GMT+00:00" serviceWorkKey="29975">
		<status>Success</status>
		<devices>
			<device>
				<id>2</id>
			</device>
		</devices>
		<appliedServiceTemplates>
			<serviceTemplate version="1" serviceTemplateId="2">
				<deviceID>2</deviceID>
			</serviceTemplate>
		</appliedServiceTemplates>
		<serviceWorkItems>
			<workItem status="FINISHED_SUCCESS" id="30083" type="COMMANDSET"
name="ITNCM/CommandSet1" deviceId="2"/>
			<workItem status="FINISHED_SUCCESS" id="30084" type="COMMANDSET"
name="ITNCM/CommandSet2" deviceId="2"/>
		</serviceWorkItems>
	</service>
</services>
JSON
{
  "services": [
{
  "id": 311,
  "referenceId": "311",
  "status": "SUCCESS",
  "createDate": 1351249159313,
  "devices": [
    {
      "id": 2
    }
  ],
  "appliedServiceTemplates": [
    {
      "version": 2,
      "deviceID": 2,
      "id": 1
    }
  ],
  "serviceWorkItems": [
    {
      "status": "FINISHED_SUCCESS",
      "workItemId": 30083,
      "workType": "COMMANDSET",
      "deviceId": 2,
      "name": "ITNCM/command1"
    },
    {
      "status": "FINISHED_SUCCESS",
      "workItemId": 30084,
      "workType": "COMMANDSET",
      "deviceId": 2,
      "name": "ITNCM/command2"
    }
  ],
  "createdByUser": "administrator",
  "lastUpdatedDate": 1352130347019,
  "serviceWorkKey": 29975
}
  ]
}

XML response details

Table 1. Response details
Tag Type Description
<services> Container

Specifies a container that includes the list of services. The list of services are encapsulated within the <services> and </services> element pair.

<service> List of strings

The <service> element includes the following information about the service:

  • The id attribute specifies the unique identifier of the service.
  • If it is present, the referenceid attribute specifies the reference ID that is supplied by the NSM client user when they are posting a service.
  • The createdByUser attribute specifies the identifier (name) of the user who created the service.
  • The createDate attribute specifies the date and time when the service was created.
  • The lastUpdateDate attribute specifies the date and time when the service was last updated.
  • The serviceWorkKey attribute specifies the unit of work (UOW) ID that can be found in Netcool Configuration Manager. This allows a user to link the service execution with the UOW item that was run on Netcool Configuration Manager.
<status> String

Specifies the status of the service, for example, Success, Submitted, In Progress, Failed.

<devices> Container Specifies a container that includes the list of devices affected by the service. The list of devices are encapsulated within the <devices> and </devices> element pair.
<device> String, integer Specifies the list of devices affected by the service. Each device is identified by its <id> tag. For example, in the Sample response a device is defined by its associated <id> tag (2).
<appliedServiceTemplates> Container Specifies a container that includes the list of applied NSM service templates. The list of supplied NSM service templates are encapsulated within the <appliedServiceTemplates> and </appliedServiceTemplates> element pair.
<appliedServiceTemplate> Strings, integer

Specifies the list of applied NSM service templates that are submitted for the service. Each applied NSM service template includes the following information:

  • The version attribute specifies the NSM service template version.
  • The serviceTemplateId attribute specifies the NSM service template identifier.
    Note: In version Netcool Configuration Manager version 6.4.2.2 and later, use id for JSON input, instead of the previous name serviceTemplateId. XML input is unchanged.
  • The <deviceID> tag specifies the device that the NSM service template is applied.
<serviceWorkItems> Container

Specifies a container that includes the list of service work item entries. The list of service work item entries are encapsulated within the <serviceWorkItems> and </serviceWorkItems> element pair.

<workItem> Strings, integer

Specifies the list of work item entries that are submitted for the service. Each service work item includes the following information:

  • The description attribute includes a description of the service work item.
  • The status attribute specifies the status of the service work item. The statuses include: CANCELLED, EXPIRED, PENDING_APPROVAL, READY_FOR_EXECUTION, EXECUTING, FINISHED_SUCCESS, and FINISHED_FAILED.
  • The id attribute specifies the unique service work item identifier.
  • The type attribute specifies the operation type. The operation types are: COMMANDSET, DEVICESYNC, and EXTRACTION.
  • The name attribute contains the name of the operation that the service work item represents.
  • The deviceId attribute specifies the device to which the service work item is applied.