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

The following operations are supported on this resource:

  • GET - Get Raw configuration of device
  • POST - Filter raw configuration of device
GET /devices/{id}/configurations/rawVersion 3

This API is used to access raw configuration content of a device without expanding configuration groups.

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/raw


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

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <raw-configuration>
      <configuration>
    <![CDATA[<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"
         xmlns:junos="http://xml.juniper.net/junos/9.1R1/junos"
         junos:commit-localtime="2014-03-21 03:38:01 UTC" junos:commit-seconds="1200370044"
         junos:commit-user="regress">
       <system>
         <syslog>
            < file operation="replace">
               <name<default-log-messages>/name>
                 <contents>
                   <name>any</name>
                     <info/>
                 </contents>
                 <match>(requested 'commit' operation)|
                 (copying configuration to juniper.save)|(commit complete)|
                 ifAdminStatus|(FRU power)|(FRU removal)|(FRU insertion)|
                 (link UP)|transitioned|Transferred|transfer-file|(license add)|
                 (license delete)|(package -X update)|(package -X delete) |
                 CFMD_CCM_DEFECT| LFMD_3AH | RPD_MPLS_PATH_BFD |
                 (AIS_DATA_AVAILABLE)</match>
               <structured-data/>
            </file>
         </syslog>
       </system>
       <snmp>
         <trap-group>
          <name>space</name>
          <targets>
            <name>10.155.78.239</name>
          </targets>
          <version active="active">v2</version>
        </trap-group>
      </snmp>
     </configuration>]]>
    </configuration>
    <method rel="match device configuration"
      href="/api/space/device-management/devices/131095/configurations/raw/match-content" />
    </raw-configuration>

  • Sample Output JSON:

    {
      "raw-configuration":{
        "configuration":"{
        <![CDATA[<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"
         xmlns:junos="http://xml.juniper.net/junos/9.1R1/junos"
         junos:commit-localtime="2014-03-21 03:38:01 UTC" junos:commit-seconds="1200370044"
         junos:commit-user="regress">
       <system>
         <syslog>
            < file operation="replace">
               <name<default-log-messages>/name>
                 <contents>
                   <name>any</name>
                     <info/>
                 </contents>
                 <match>(requested 'commit' operation)|
                 (copying configuration to juniper.save)|(commit complete)|
                 ifAdminStatus|(FRU power)|(FRU removal)|(FRU insertion)|
                 (link UP)|transitioned|Transferred|transfer-file|(license add)|
                 (license delete)|(package -X update)|(package -X delete) |
                 CFMD_CCM_DEFECT| LFMD_3AH | RPD_MPLS_PATH_BFD |
                 (AIS_DATA_AVAILABLE)</match>
               <structured-data/>
            </file>
         </syslog>
       </system>
       <snmp>
         <trap-group>
          <name>space</name>
          <targets>
            <name>10.155.78.239</name>
          </targets>
          <version active="active">v2</version>
        </trap-group>
      </snmp>
     </configuration>]]
        }
      }

  • Access Control

    The following capabilities are required to access this API: ReadDevices

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

    This API is used to filter raw configuration content of a device using an XPath expression without expanding the configuration groups. Also, an XPath filter expression is passed in the HTTP body to filter the XML data futher.

    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.)

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

    .

    Sample Usage

    POST /devices/{id}/configurations/raw


    • Parameters:
      NameTypeURI TypeDescriptionRequired
      device-idIntegerPathThe ID of the device whose raw 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"?>
    <raw-configuration>
       <configuration><![CDATA[<version>10.0R2.10</ version>
       <name>fxp0</name>
    ]]></configuration>
       <method href= "/api/space/device-management/devices/229377/configurations/raw/match-content" rel="match device configuration"/>
    </raw-configuration>

  • Sample Input JSON:

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

  • Sample Output JSON:

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


  • Access Control

    The following capabilities are required to access this API: ReadDevices