/api/space/device-management/devices/{id}/configurations/expanded
The following operations are supported on this resource:
GET /api/space/device-management/devices/{id}/configurations/expanded (v3)
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.)
.Access Control
The following capabilities are required to access this API:
"ReadDevices"
Example Usage
GET /api/space/device-management/devices/{id}/configurations/expandedParameters
Name | Type | URI Type | Description | Required |
device-id | Integer | Path | The ID of the device whose configuration data will be accessed. | Y |
Content Types
-
Produces content types:
application/vnd.net.juniper.space.device-management.expanded-configuration+xml;version=3;q=.02
application/vnd.net.juniper.space.device-management.expanded-configuration+json;version=3;q=.02 -
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"/> < br/> </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"
}
}
}
POST /api/space/device-management/devices/{id}/configurations/expanded (v1)
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.
Access Control
The following capabilities are required to access this API:
"ReadDevices"
Example Usage
POST /api/space/device-management/devices/{id}/configurations/expandedParameters
Name | Type | URI Type | Description | Required |
device-id | Integer | Path | The ID of the device whose expanded configuration content will be filtered. | Y |
Content Types
-
Consumes content types:
application/vnd.net.juniper.space.device-management.xpath+xml;version=1;charset=UTF-8
application/vnd.net.juniper.space.device-management.xpath+json;version=1;charset=UTF-8 -
Produces content types:
application/vnd.net.juniper.space.device-management.expanded-configuration+xml;version=1;q=.01
application/vnd.net.juniper.space.device-management.expanded-configuration+json;version=1;q=.01 -
Sample Input XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xpaths>
<xpath>/configuration/version</xpath>
<xpath>/configuration/interfaces/interface[name='ge-0/0/0']</xpath>
</xpaths> -
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 Input JSON:
{
"xpaths":{
"xpath":[
"/configuration/version",
"/configuration/interfaces/interface[name=\"ge-0/0/0\"]"
]
}
} -
Sample Output JSON:
{
"expanded-configuration":
{
"configuration":" ",10.0R2.10
"method":
{
"@href":"/api/space/device-management/devices/229377/configurations/expanded/match-content",
"@rel":"match device configuration"
}
}
}