HTTP POST for /service
When the NSM client user requests the /service
URI
using the POST
method, a service is created for one
device and from one NSM service
template.
NSM creates a service instance using the <serviceOperation>
element
with a service operation of type CREATE
defined in
the NSM service
template.
Input parameters
None
Sample input XML
Service URIs that use the
POST
method require XML to be posted into the request body. Enter the following
input
XML:
XML
<serviceTemplate serviceTemplateId="202">
<deviceID>2</deviceID>
<clientParameters>
<clientParameter>
<name>CP02</name>
<value>B</value>
<description>description cpd</description>
</clientParameter>
</clientParameters>
<clientParameterLists>
<clientParameterList name="CP01">
<parameter name="CP083">
<values>
<value order="1">P9</value>
<value order="2">P10</value>
</values>
</parameter>
</clientParameterList>
</clientParameterLists>
</serviceTemplate>
JSON
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.{
"deviceID": 2,
"clientParameters": [
{
"name": "CP02",
"value": "B",
"description": "description cpd"
}
],
"clientParameterLists": [
{
"name": "CP01",
"clientParameterLists": [
{
"name": "CP083",
"values": [
{
"value": "P9"
},
{
"value": "P10"
}
]
}
]
}
],
"id": 202
}
After
entering the input XML, run the POST
/service
URI.Available HTTP Headers
Accept: application/json
Accept: text/xml
Content-Type: application/json
Content-Type: text/xml
Sample request
http://www.example.com:16310/nsm/service
Sample response
XML<service id="801" referenceId="801" createdByUser="administrator"
createDate="2012-11-21 12:56:53.472 GMT+00:00">
<status>Submitted</status>
<devices>
<device>
<id>2</id>
</device>
</devices>
<appliedServiceTemplates>
<serviceTemplate serviceTemplateId="202" version="1">
<deviceID>2</deviceID>
</ServiceTemplates>
</appliedServiceTemplates>
<serviceWorkItems/>
</service>
JSON{
"id": 801,
"referenceId": "801",
"status": "SUBMITTED",
"createDate": 1353502667046,
"devices": [
{
"id": 2
}
],
"appliedServiceTemplates": [
{
"version": 1,
"deviceID": 2,
"id": 202
}
],
"serviceWorkItems": [],
"createdByUser": "administrator"
}