HTTP POST for /service/{reference-id}
When the NSM client user requests the /service/{reference-id}
URI using
the POST
method, a service is created for one device by using one applied NSM service
template and a reference
ID that is supplied by the NSM client user.
NSM creates a service instance using the <serviceOperation>
element
with a service operation of type CREATE
defined in
the NSM service
template.
Note: The
NSM client user must supply the reference ID, which can be used once
per service POST and it must be unique. This reference ID supports
the following characters:
- Alphanumeric characters that are not case-sensitive
- Numeric characters
- Underscores: "_"
- Dashes: "-"
Input parameters
{reference-id}
Sample input XML
Service URIs that use the
XML
POST
method require XML to be posted into the request
body. Enter the following input XML when you are running the POST
/service/{reference-id}
URI: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>
</value>
</values>
</clientParameterList>
</clientParameterLists>
</serviceTemplate></service>
JSON
{
"deviceID": 2,
"clientParameters": [
{
"name": "CP02",
"value": "B",
"description": "description cpd"
}
],
"clientParameterLists": [
{
"name": "CP01",
"clientParameterLists": [
{
"name": "CP083",
"values": [
{
"value": "P9"
},
{
"value": "P10"
}
]
}
]
}
],
"id": 202
}
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/ServiceTicket-1
Sample response
XML<service id="801" referenceid="ServiceTicket-1" 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>
</serviceTemplate>
</appliedServiceTemplates>
<serviceWorkItems/>
</service>
JSON{
"id": 801,
"referenceId": "ServiceTicket-1",
"status": "SUBMITTED",
"createDate": 1353502667046,
"devices": [
{
"id": 2
}
],
"appliedServiceTemplates": [
{
"version": 1,
"deviceID": 2,
"id": 202
}
],
"serviceWorkItems": [],
"createdByUser": "administrator"
}