Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation  Back up to About Overview 
ContentIndex
  
[+] Expand All
[-] Collapse All

Edge Services Director REST API Overview

The Juniper Networks Edge Services Director 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.

You use standard HTTP methods to access the Edge Services Director 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. Edge Services Director APIs return data in XML or JavaScript Object Notation (JSON).

The following RESTful Web Services are exposed under the Junos Space Edge Services Director root URI:

  • Dashboard
  • Discovery
  • KPI templates
  • SDG groups
  • Manage devices
  • Inventory
  • Service Designer
  • Monitoring

URI: /api/juniper/sgd

Edge Services Director RESTful Web Services provide programmatic access to the resources that are defined in Junos Space Edge Services Director. Edge Services Director RESTful Web Services follow the same standards and conventions as the Junos Space Network Application Platform RESTful Web Services. The Edge Services Director RESTful Web Services are exposed under the Juniper Networks Junos Space RESTful Web Services root URI (/api). Edge Services Director-related RESTful Web Services are exposed under the /api/juniper/sgd URI.

Example resource returned in XML format

 <kpiGroupTrendData>
     <kpiNames>kpiName1</kpiNames>
     <kpiNames>kpiName2</kpiNames>
     <trendData>
       <date>2014-04-21T17:41:54.892+05:30</date>
       <values>3</values>
       <values>2</values>
     </trendData>
     <trendData>
       <date>2014-04-21T17:26:54.893+05:30</date>
       <values>3</values>
       <values>2</values>
     </trendData>
     <trendData>
       <date>2014-04-21T17:11:54.893+05:30</date>
       <values>1</values>
       <values>3</values>
     </trendData>
     <trendData>
       <date>2014-04-21T16:56:54.893+05:30</date>
       <values>1</values>
       <values>3</values>
     </trendData>
     <trendData>
       <date>2014-04-21T16:41:54.893+05:30</date>
       <values>2</values>
       <values>3</values>
     </trendData>
     <trendData>
       <date>2014-04-21T16:26:54.893+05:30</date>
       <values>2</values>
       <values>3</values>
     </trendData>
     <trendData>
       <date>2014-04-21T16:11:54.893+05:30</date>
       <values>3</values>
       <values>1</values>
     </trendData>
     <trendData>
       <date>2014-04-21T15:56:54.893+05:30</date>
       <values>3</values>
       <values>1</values>
     </trendData>
     <trendData>
       <date>2014-04-21T15:41:54.893+05:30</date>
       <values>3</values>
       <values>2</values>
     </trendData>
   </kpiGroupTrendData>
 

Example resource returned in JSON format

{
    "kpiGroupTrendData":
    {
        "kpiNames":
        [
            "kpiName1",
            "kpiName2"
        ],
        "trendData":
        [
            {
                "date": "2014-04-21T17:44:49.434+05:30",
                "values":
                [
                    3,
                    2
                ]
            },
            {
                "date": "2014-04-21T17:29:49.434+05:30",
                "values":
                [
                    3,
                    2
                ]
            },
            {
                "date": "2014-04-21T17:14:49.434+05:30",
                "values":
                [
                    1,
                    3
                ]
            },
            {
                "date": "2014-04-21T16:59:49.434+05:30",
                "values":
                [
                    1,
                    3
                ]
            },
            {
                "date": "2014-04-21T16:44:49.434+05:30",
                "values":
                [
                    2,
                    3
                ]
            },
            {
                "date": "2014-04-21T16:29:49.434+05:30",
                "values":
                [
                    2,
                    3
                ]
            },
            {
                "date": "2014-04-21T16:14:49.434+05:30",
                "values":
                [
                    3,
                    1
                ]
            },
            {
                "date": "2014-04-21T15:59:49.434+05:30",
                "values":
                [
                    3,
                    1
                ]
            },
            {
                "date": "2014-04-21T15:44:49.434+05:30",
                "values":
                [
                    3,
                    2
                ]
            }
        ]
    }
}

Format and Conventions of RESTful Web Services

The media type for the Edge Services Director application must have the following format:

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

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

For example, application/vnd.net.juniper.space.monitoring.alarmscount+json;version=1

Table 1 describes these parameters.

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 with hyphen separators; for example, device-management, incident-management.

type

Type of resource. Types are all lowercase alphanumeric tokens with hyphen separators; for example, device, incident.

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 Edge Services Director.

For information about Junos Space SDK, refer to Junos Space SDK .

Modified: 2016-08-02