HTTP GET for /service/{service-id}/workitem/{workitem-id}

When the NSM user requests the /service/{service-id}/workitem/{workitem-id} URI using the GET method, a description of the work item that matches the work item ID entered for a specific service that matches the service ID entered is returned.

Input parameters

{service-id} and {workitem-id}

Available HTTP Headers

Accept: application/json

Accept: text/xml

Sample request

http://www.example.com:16310/nsm/service/11/workitem/25

Sample response

XML
<workItem status="FINISHED_SUCCESS" id="36518">
<workItemResults>
<workItemResult/>
</workItemResults>
<workItemLog>
2012-11-05 15:56:30.731373 : Task Start Time: 2012/11/05 15:56:25.846 GMT+00:00 
******************************************************* 
Task: Work submitted by service UOW 36517 Device: emulcli4-17 Command Set: Declan1 
*******************************************************2012-11-05 15:56:30.731373 : 
Allocating 25MB of task memory (100% of the default task memory)...
2012-11-05 15:56:30.731373 : >>> Operation Started on Worker Server 'taraz4'... 
(constants): 2012/11/05 15:56:25.856 GMT+00:002012-11-05 15:56:30.731373 : 
<<< Operation Finished in 0 seconds (constants): 
2012/11/05 15:56:25.856 GMT+00:002012-11-05 15:56:30.731373 : 
>>> Operation Started on Worker Server 'taraz4'... (checkCommandSet): 
2012/11/05 15:56:25.856 GMT+00:002012-11-05 15:56:30.731373 : 
<<< Operation Finished in 0 seconds  15:56:30.731373 : 
Task End Time: 2012/11/05 15:56:28.58 GMT+00:00
</workItemLog>
</workItem>
JSON
{
  "status": "FINISHED_SUCCESS",
  "workItemId": 36518,
  "workItemResults": [
    {}
  ],
  "2012-11-05 15:56:30.731373 : Task Start Time: 2012/11/05 15:56:25.846 GMT+00:00 
******************************************************* 
Task: Work submitted by service UOW 36517 Device: emulcli4-17 Command Set: Declan1 
*******************************************************2012-11-05 15:56:30.731373 : 
Allocating 25MB of task memory (100% of the default task memory)...
2012-11-05 15:56:30.731373 : 
>>> Operation Started on Worker Server 'taraz4'... (constants): 
2012/11/05 15:56:25.856 GMT+00:002012-11-05 15:56:30.731373 : 
<<< Operation Finished in 0 seconds (constants): 
2012/11/05 15:56:25.856 GMT+00:002012-11-05 15:56:30.731373 : 
>>> Operation Started on Worker Server 'taraz4'... (checkCommandSet): 
2012/11/05 15:56:25.856 GMT+00:002012-11-05 15:56:30.731373 : 
<<< Operation Finished in 0 seconds  15:56:30.731373 : 
Task End Time: 2012/11/05 15:56:28.58 GMT+00:00"
}

XML response details

The additional parameters listed in the Sample response that are not explained in HTTP GET for /service are described in Table 1.

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

The <workItem> element represents an operation that is or has been run against a device from Netcool Configuration Manager. It gives the state of the operation as it executes. It also reports the final status of the operations after execution. The <workItem> element includes the following information about 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.
<workItemResults> String

Specifies the service work item results. Depending on the type of service work item, the result content varies. For example, when a service work item is for an operation whose type is EXTRACTION, the result content includes the result of the extraction. When a service work item is for an operation whose type is COMMANDSET or DEVICESYNC, no result content is produced in the workItemResult element, as show in the Sample response.

<workItemLog> String

Specifies the contents of the service work item log.