/api/space/device-management/devices/{id}/configurations/expanded

The following operations are supported on this resource:

  • GET - Get expanded configuration of device
  • POST - Filter expanded device configuration
GET /devices/{id}/configurations/expandedVersion 3

This API is used to access configuration data with configuration groups expanded (using the inherit="inherit" option on the Junos OS "get-configuration" RPC).

Fields Selection

A particular section of a configuration can be fetched using the 'fields' criteria. For example:

    fields=(version,system:(login:(user)))

These fields should be nested properly to get the required configuration content. For example, a 'fields' selection passed as fields=(version) will fetch only version information. (See the sample output below.)

.

Sample Usage

GET /devices/{id}/configurations/expanded


  • Parameters:
    NameTypeURI TypeDescriptionRequired
    device-idIntegerPathThe ID of the device whose configuration data will be accessed. Y
  • Sample Output XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <expanded-configuration>
      <configuration>
        <configuration>
          <version>10.0R2.10</version>
        </configuration>
      </configuration>
      <method href= "/api/space/device-management/devices/229377/configurations/raw/match-content" rel="match device configuration"/>
    </expanded-configuration>

  • Sample Output JSON:

    {
      "expanded-configuration":{
        "configuration": "{\"configuration\": {\"version\": \"10.1R2.8122\"}}",
        "method":{
          "@href": "/api/space/device-management/devices/229377/configurations/expanded/match-content" ,
          "@rel":"match device configuration"
        }
      }

  • Access Control

    The following capabilities are required to access this API: ReadDevices

    POST /devices/{id}/configurations/expandedVersion 1

    This API is used to filter expanded configuration content of a device using an XPath expression. Configuration groups are expanded (using the inherit="inherit" option on the Junos "get-configuration" RPC). Also, an XPath filter expression is passed in the HTPP body to filter the XML datafurther.

    Fields Selection

    A particular section of the configuration can be fetched using the 'fields' criteria. For example:

        fields=(version,system:(login:(user)))

    These fields should be nested properly to get the required configuration content. For example, the 'fields' selection passed as fields=(version) will fetch only version information. (See the sample output below.)

    An additional XPath filter expression can be supplied in the HTTP body.

    In the case of XML, configuration is returned wrapped in a CDATA section.

    .

    Sample Usage

    POST /devices/{id}/configurations/expanded


    • Parameters:
      NameTypeURI TypeDescriptionRequired
      device-idIntegerPathThe ID of the device whose expanded configuration content will be filtered. Y
  • Sample Input XML:

     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <xpaths>
       <xpath>/configuration/version</xpath>
       <xpath>/configuration/interfaces/interface[name= 'fxp0']</xpath>
     </xpaths>

  • Sample Output XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <expanded-configuration>
       <configuration><![CDATA[<version>10.0R2.10</ version><name junos:group="rel1">fxp0</name>
    ]]></configuration>
       <method href= "/api/space/device-management/devices/229377/configurations/raw/match-content" rel="match device configuration"/>
    </expanded-configuration>

  • Sample Input JSON:

    {
     "xpaths":{
      "xpath":[
       "/configuration/version",
       "/configuration/interfaces/interface[name=\"fxp0\"]"
      ]
     }
    }

  • Sample Output JSON:

    {
    "expanded-configuration":
    {
       "configuration": "<version>10.0R2.10</version><name junos:group=\"re1\">fxp0</name>" ,
       "method":
       {
          "@href": "/api/space/device-management/devices/229377/configurations/expanded/match-content" ,
          "@rel":"match device configuration"
       }



  • Access Control

    The following capabilities are required to access this API: ReadDevices