Service Now and Service Insight REST API Reference – Technical Documentation – Support

The Juniper Networks Service Automation (Service Now and Service
Insight) APIs are based on the Representational State Transfer (REST)
standards. REST defines a set of principles for defining Web services,
including how a system’s resource states are transferred over
HTTP. Clients can be written in any language that sends HTTP requests.

Figure 1 provides an overview
of the interaction between higher-level applications and Junos Space
Network Management Platform using REST APIs.

Figure 1: Service Automation API Overview

Service Automation API Overview

You use standard HTTP methods to access the Service Now and
Service Insight APIs. For example, HTTP GET is used by a client application
to retrieve a resource, get data from a Web server or to execute a
query. Common HTTP methods for REST are:

  • GET – Retrieve a resource from the server.
  • POST – Update a resource on the server.
  • PUT – Create a resource state on the server.
  • DELETE – Remove a resource state on the server.

Retrieved resources are displayed in human-readable format.
Service Now APIs return data in XML or JavaScript Object Notation
(JSON) formats.

Example resource returned in XML format

<device uri=”/api/juniper/servicenow/device-managemetn/devices/163840”>
<hostName>mx480-2-re0</hostName>
<serialNumber>JN11AFF42AFB</serialNumber>
<product>MX480</product>
<softwareRelease>11.2B3</softwareRelease>

Example resource returned in JSON format

device:{
uri:’/api/juniper/servicenow/device-management/devices/163840′,
hostName:’mx480-2-re0′,
serialNumber:’JN11AFF42AFB’,
product:’MX480′,
softwareRelease:’11.2B3′,
}

The media type for the Service Now application must have the
following format:

vendor.servicenow.service.type+syntax;version=version number

For example, vnd.juniper.servicenow.device-management.device+xml;version=3

The media type for the Service Insight application must have
the following format:

application/vendor.serviceinsight.service.type+syntax;version=version number or

vendor.serviceinsight.service.type+syntax;version=version number

For example, application/vnd.juniper.serviceinsight.pbnreport-management+xml;version=1
or vnd.juniper.serviceinsight.exposureanalyzer.devices+json;version=1

Table 1: Media parameters

Parameter Description
vendor Vendor of the media type.

Media types defined by Juniper Networks use vnd.net.juniper.
Third-parties must use their own vendor string when they define their
own Web services in their applications that are deployed on Junos
Space.

service Name of the Junos Space-specific service.

Service names are all lowercase alphanumeric tokens separated
by a hyphen; for example, device-management and incident-management.

type Type of resource.

Types are all lowercase alphanumeric tokens separated by a hyphen.

syntax Representation of the resource, for example xml..
version Version of the API; versions begin with the numeral 1.

REST standards are well described in books and on the Internet.
It is not the intent of this guide to discuss the RESTful architecture.
This document deals with the REST APIs exposed by Service Now and
Service Insight.

 

Leave a comment

Your email address will not be published. Required fields are marked *