REST Resources

/api/info

The following operation is supported on this resource:

  • GET - Return discovery information on a resource URL or a media type

GET /api/info

Return discovery information on a resource URL or a media type.

This API produces the following content types:

application/xrd+xml

Sample Usage

GET /api/info?uri=<uri> - Get information on a URI.

GET /api/info?type=<media-type-path> - Get information on a media type.

GET /api/info?type-v=<media-type-path> - Get information on a media type version.


  • Parameters:
    NameTypeURI TypeDescriptionRequired
    uri string Query URI path for this resource. Path must start with /api (see example below). Do not prefix the path with FQDN. Y
    type string Query Media-type path for this resource. Version is not included in the media-type-path (see example below). Y
    type-v string Query Media-type path for this resource. Version must be included with the type-v parameter (see example below). Y
  • Sample Output
    The uri= query parameter is used to retrieve the information about all the HTTP methods available on that valid URL, and indicates whether the HTTP method is synchronous or asynchronous. If the HTTP method is asynchronous, the http-method tag includes the attribute async="true". Info service returns a list of all accept and content-type media types for the passed valid URL.

    Info service also returns information about the query parameters of the passed valid URI. The query parameter information contains the name of the query parameters, their types, and whether they are optional or required. If a query parameter is required, the query-parameter tag includes the attribute required="true".

    Note: For each asynchronous API, the queue parameter is shown as required and the schedule parameter as optional.

    HTTP Request /api/info?uri=/api/space/configuration-management/change-requests

    The output of the URI invocation results in the data being represented in the Extensible Resource Descriptor (XRD) format. The sample output consists of the following XML tags or nodes.

    Note: Elements are shown in bold text. Required elements and attributes are listed with a shaded table entry.

    Nodes Description
    Subject This element represents the resource URI for which the information is requested.
    Link This element is used by Junos Space to consume a data change notification message. This message is finally read by the Junos Space GUI to refresh its view.
    rel This attribute specifies the relation between the URI being accessed or invoked and its corresponding media type.
    type This attribute specifies the data representation (media type) returned by the URI and described by the "href" attribute.
    href This attribute specifies the hyperlink to fetch the type of information related to the URI being accessed.
    http-methods This element is a collection of "http-method" elements.
    http-method This element represents the following information:
    type This attribute specifies the HTTP operation supported on the URI being accessed. This is a required attribute.
    async This attribute specifies whether or not the corresponding HTTP operation is asynchronous. If the operation is asynchronous, this attribute is set to the value "true". Otherwise, this attribute is not present. This attribute is optional .
    primary-uri This element specifies the URI for the corresponding "http-method."
    query-parameters This element is a collection of different query parameters supported by the Query String of the URI being accessed. It contains the following elements:
    query-parameter This element specifies a single query parameter supported by the URI. It contains the following elements and attributes:
    required This attribute indicates if the corresponding parameter is required. If the parameter is required, this attribute is present with the value "true."
    name This element specifies the name of the attribute.
    type This element specifies the type of the attribute. The type is represented as the data type supported by XML Schema.
    headers
    header This element is a collection of different HTTP headers required to access the URI. It contains the following attribute and elements:
    type This is a required attribute that specifies the type of the header as Accept or Content-Type.
    representations This element is a collection of representation elements.
    representation This element specifies the media type supported by the URL corresponding to a specific HTTP operation and the HTTP header.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XRD>
      <Subject>/api/space/configuration-management/change-requests</Subject>
      <Link rel="describedBy" type="application/xrd+xml"
        href="/api/info?type=vnd.net.juniper.space.configuration-management.change-requests" />
      <http-methods>
        <http-method type="POST">
          <primary-uri>/api/space/configuration-management/change-requests
          </primary-uri>
          <query-parameters />
          <headers>
            <header type="Accept">
              <Link rel="describedBy" type="application/xrd+xml"
                href="/api/info?type=vnd.net.juniper.space.configuration-management.change-request" />
              <representations>
                <representation>application/vnd.net.juniper.space.configuration-management.change-request+xml;version=2;q=.02
                </representation>
                <representation>application/vnd.net.juniper.space.configuration-management.change-request+json;version=2;q=.02
                </representation>
              </representations>
            </header>
            <header type="Content-Type">
              <Link rel="describedBy" type="application/xrd+xml"
                href="/api/info?type=vnd.net.juniper.space.configuration-management.change-request" />
              <representations>
                <representation>application/vnd.net.juniper.space.configuration-management.change-request+json;version=2;charset=UTF-8
                </representation>
                <representation>application/vnd.net.juniper.space.configuration-management.change-request+xml;version=2;charset=UTF-8
                </representation>
              </representations>
            </header>
          </headers>
        </http-method>
        <http-method type="POST" async="true">
          <primary-uri>/api/space/configuration-management/change-requests
          </primary-uri>
          <query-parameters>
            <query-parameter required="true">
              <name>queue</name>
              <type>string</type>
            </query-parameter>
            <query-parameter>
              <name>schedule</name>
              <type>string</type>
            </query-parameter>
          </query-parameters>
          <headers>
            <header type="Accept">
              <Link rel="describedBy" type="application/xrd+xml"
                href="/api/info?type=vnd.net.juniper.space.job-management.task" />
              <representations>
                <representation>application/vnd.net.juniper.space.job-management.task+json;version=1;q=.01
                </representation>
                <representation>application/vnd.net.juniper.space.job-management.task+xml;version=1;q=.01
                </representation>
              </representations>
            </header>
            <header type="Content-Type">
              <Link rel="describedBy" type="application/xrd+xml"
                href="/api/info?type=vnd.net.juniper.space.configuration-management.change-requests" />
              <representations>
                <representation>application/vnd.net.juniper.space.configuration-management.change-requests+json;version=2;charset=UTF-8
                </representation>
                <representation>application/vnd.net.juniper.space.configuration-management.change-requests+xml;version=2;charset=UTF-8
                </representation>
              </representations>
            </header>
          </headers>
        </http-method>
      </http-methods>
    </XRD>


  • Sample Output XML
    The type= query parameter is used to retrieve information about a media type. The Info service returns a list of all versions and their representations of passed valid media types and links to their schema.

    HTTP Request /api/info?type=vnd.net.juniper.space.user-management.users

    The sample output consists of the following XML tags or nodes:


    Nodes Description
    type-descriptor This is a wrapper element that encapsulates information about the different versions corresponding to the media type being accessed.
    name This element specifies the name of the media type.
    versions This element specifies the collection of the versions corresponding to the media type.
    version This element specifies the single version entry corresponding to the media type.
    num This attribute specifies the version number.
    representation This specifies the representation corresponding to the specific version of the media type.
    type-v This element specifies the media type along with its version information.
    schema This element specifies the schema URI for the versioned media type.
    href This attribute points to the relative URL to retrieve the schema information.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <XRD>
    <type-descriptor>
    <name>vnd.net.juniper.space.user-management.users</name>
      <versions>
        <version num="1">
          <representation>xml</representation>
          <representation>json</representation>
          <type-v>vnd.net.juniper.space.user-management.users;version=1 </type-v>
          <schema href="/api/info?type-v=vnd.net.juniper.space.user-management.users;version=1" />
        </version>
      </versions>
    </type-descriptor>
    </XRD>


  • Sample Output XML:
    The type-v= query parameter is used to retrieve the schema of a particular version of a media type.

    HTTP Request /api/info?type-v=vnd.net.juniper.space.user-management.users;version=1

    <xs:schema version="1.0">
    <xs:element name="user-management" type="user-management"/>
      <xs:complexType name="user-management">
        <xs:sequence>
          <xs:element name="method" type="hateoasMethodObject" minOccurs="0"/>
          <xs:element name="collection" type="hateoasMethodObject" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
    <xs:complexType name="hateoasMethodObject">
      <xs:sequence/>
        <xs:attribute name="rel" type="xs:string"/>
        <xs:attribute name="href" type="xs:string"/>
      </xs:complexType>
    </xs:schema>


  • Sample Output XML:

    To retrieve schema corresponding to the configuration settings for an application, pass the application name as a choice query parameter.

    For example, to retrieve configuration setting schema for the WorldCities application:

    HTTP Request /api/info?type-v=vnd.net.juniper.space.application-management.settings-config;version=2&choice=WorldCities

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <xs:schema xmlns:adm="http://juniper.net/nsm/ADMSchema" xmlns:dmi="http://xml.juniper.net/dmi" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified" >
    <xs:element name="WorldCities-settings">
    <xs:complexType>
      <xs:sequence>
       <xs:element maxOccurs="1" minOccurs="0" name="configuration">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="1" minOccurs="0" name="World-Cities-Configuration">
             <xs:complexType>
              <xs:sequence>
                <xs:element default="0" name="Schedule-After">
                 <xs:simpleType>
                  <xs:restriction base="xs:long">
                    <xs:maxInclusive value="60"/>
                    <xs:minInclusive value="0"/>
                  </xs:restriction>
                 </xs:simpleType>
                </xs:element>
              </xs:sequence>
             </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
       </xs:element>
      </xs:sequence>
     </xs:complexType>
    </xs:element>
    </xs:schema>

Access Control

The following capabilities are required to access this API: DefaultRead