REST Resources
-
/ -
/acknowledge-device-fingerprint -
/change-device-credentials -
/devices -
/devices /{device-id} /activate-modeled-device -
/devices /{device-id} /applicable-configlets -
/devices /{device-id} /apply-cli-configlet -
/devices /{device-id} /associated-softwares -
/devices /{device-id} /clone -
/devices /{device-id} /compute-configlet-parameter-values -
/devices /{device-id} /configlet -
/devices /{device-id} /configurations /expanded -
/devices /{device-id} /configurations /raw -
/devices /{device-id} /validate-cli-configlet -
/devices /{id} -
/devices /{id} /associated-scripts -
/devices /{id} /change-requests -
/devices /{id} /configurations -
/devices /{id} /configurations /expanded /match-content -
/devices /{id} /configurations /raw /match-content -
/devices /{id} /connection-status -
/devices /{id} /exec-resync -
/devices /{id} /exec-rpc -
/devices /{id} /managed-elements -
/devices /{id} /managed-status -
/devices /{id} /modify-device-target-ip -
/devices /{id} /view-customized-attributes -
/discover-devices -
/discoveryresult /{id} -
/get-syslog-events -
/stop-syslog-events -
/stop-syslog-events /{id}
/api/space/device-management/devices/{device-id}/configurations/raw
The following operations are supported on this resource:
GET /devices/{device-id}/configurations/raw | Version 5 |
This API is used to access raw configuration content of a device without expanding configuration groups and results will be displayed in xml format.
sample configuration:
<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm" xmlns:junos="http://xml.juniper.net/junos/12.3R3/junos" junos:commit-localtime="2013-06-17 04:32:17 UTC" junos:commit-seconds="1371443537" junos:commit-user="root"> <version>12.3R3.4</version> <system> <root-authentication> <encrypted-password>$1$nTfQePCG$paMKOkFTfjGLjK9K7DGkJ0</encrypted-password> </root-authentication> <scripts> <op> <file> <name>MyscriptlogicalinterfaceScript.slax</name> </file> </op> </scripts> <login> <user> <name>String</name> <uid>2077</uid> <class>super-user</class> <authentication> <encrypted-password>$1$dbopsnyN$PVDcL2aAuh2uaP.j.q7U0.</encrypted-password> </authentication> </user> </login> </system> <interfaces> <interface> <name>ge-0/0/0</name> <unit> <name>0</name> <family> <ethernet-switching> </ethernet-switching> </family> </unit> </interface> ... ... </configuration>.
Sample Usage
GET /devices/{device-id}/configurations/raw
-
Parameters:
Name Type URI Type Description Required device-id Integer Path Device ID Y
-
Accept Headers:
application/vnd.net.juniper.space.device-management.raw-xml-configuration+xml;version=5
application/vnd.net.juniper.space.device-management.raw-xml-configuration+json;version=5
<raw-xml-configuration uri="/api/space/device-management/devices/{device-id}/configurations/raw">
<id>Integer</id>
<configuration><![CDATA[String]]></configuration>
</raw-xml-configuration>
{
"raw-xml-configuration" : {
"@uri" :
"/api/space/device-management/devices/{device-id}/configurations/raw" ,
"id" : "Integer" ,
"configuration" : "String"
}
}
Access Control
The following capabilities are required to access this API: DeviceConfiguration
GET /devices/{device-id}/configurations/raw | Version 5 |
This API is used to access raw configuration content of a device without expanding configuration groups and results will be displayed in CLI format
Sample configuration :
version 12.3R3.4; system { root-authentication { encrypted-password $1$nTfQePCG$paMKOkFTfjGLjK9K7DGkJ0; } scripts { op { file MyscriptPhysicalinterfaceScript.slax ; } } login { user String { uid 2077; class super-user; authentication { encrypted-password $1$dbopsnyN$PVDcL2aAuh2uaP.j.q7U0.; } } } services { ssh { protocol-version v2; max-sessions-per-connection 32; } netconf { ssh ; } outbound-ssh { client 192.168.27.171 { device-id C233F9; secret $9$cklrKWNdsJGiLxGik.zFcyl; services netconf; 192.168.27.171 { port 7804; } } } web-management { http ; } } syslog { user * { any { emergency ; } } file messages { any { notice ; } authorization { info ; } } file interactive-commands { interactive-commands { any ; } } } } interfaces { ge-0/0/0 { unit 0 { family ethernet-switching ; } } ge-0/0/1 { description mydescription; mtu 554; unit 0 { family ethernet-switching ; } } } protocols { igmp-snooping { vlan all ; } rstp ; lldp { interface all ; } lldp-med { interface all ; } } poe { interface all ; }.
Sample Usage
GET /devices/{device-id}/configurations/raw
-
Parameters:
Name Type URI Type Description Required device-id Integer Path Device ID Y
-
Accept Headers:
application/vnd.net.juniper.space.device-management.raw-cli-configuration+xml;version=5
application/vnd.net.juniper.space.device-management.raw-cli-configuration+json;version=5
<raw-cli-configuration uri="/api/space/device-management/devices/{device-id}/configurations/raw">
<id>Integer</id>
<configuration><![CDATA[String]]></configuration>
</raw-cli-configuration>
{
"raw-cli-configuration" : {
"@uri" :
"/api/space/device-management/devices/{device-id}/configurations/raw" ,
"id" : "Integer" ,
"configuration" : "String"
}
}
Access Control
The following capabilities are required to access this API: DeviceConfiguration
GET /devices/{device-id}/configurations/raw | Version 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/{device-id}/configurations/raw
-
Parameters:
Name Type URI Type Description Required device-id Integer Path The ID of the device whose raw configuration content will be accessed. Y
-
Accept Headers:
application/vnd.net.juniper.space.device-management.raw-configuration+xml;version=3
application/vnd.net.juniper.space.device-management.raw-configuration+json;version=3
<?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>
{
"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: DeviceConfiguration
POST /devices/{device-id}/configurations/raw | Version 5 |
This API is used to filter raw configuration content of a device using an XPath expression without expanding the configuration groups and results will be displayed in xml format
sample xpath : "/configuration"
sample configuration:
<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm" xmlns:junos="http://xml.juniper.net/junos/12.3R3/junos" junos:commit-localtime="2013-06-17 04:32:17 UTC" junos:commit-seconds="1371443537" junos:commit-user="root"> <version>12.3R3.4</version> <system> <root-authentication> <encrypted-password>$1$nTfQePCG$paMKOkFTfjGLjK9K7DGkJ0</encrypted-password> </root-authentication> <scripts> <op> <file> <name>MyscriptlogicalinterfaceScript.slax</name> </file> </op> </scripts> <login> <user> <name>String</name> <uid>2077</uid> <class>super-user</class> <authentication> <encrypted-password>$1$dbopsnyN$PVDcL2aAuh2uaP.j.q7U0.</encrypted-password> </authentication> </user> </login> </system> <interfaces> <interface> <name>ge-0/0/0</name> <unit> <name>0</name> <family> <ethernet-switching> </ethernet-switching> </family> </unit> </interface> ... ... </configuration>.
Sample Usage
POST /devices/{device-id}/configurations/raw
-
Parameters:
Name Type URI Type Description Required device-id Integer Path Device ID Y
-
Content-Type Headers:
application/vnd.net.juniper.space.device-management.raw-xml-configuration-request+xml;version=5;charset=UTF-8
application/vnd.net.juniper.space.device-management.raw-xml-configuration-request+json;version=5;charset=UTF-8 -
Accept Headers:
application/vnd.net.juniper.space.device-management.raw-xml-configuration+xml;version=5
application/vnd.net.juniper.space.device-management.raw-xml-configuration+json;version=5
<raw-xml-configuration-request>
<xpath-list>
<xpath>String</xpath>
</xpath-list>
</raw-xml-configuration-request>
<raw-xml-configuration uri="/api/space/device-management/devices/{device-id}/configurations/raw">
<id>Integer</id>
<configuration><![CDATA[String]]></configuration>
</raw-xml-configuration>
{
"raw-xml-configuration-request" : {
"xpath-list" : {
"xpath" : "String"
}
}
}
{
"raw-xml-configuration" : {
"@uri" :
"/api/space/device-management/devices/{device-id}/configurations/raw" ,
"id" : "Integer" ,
"configuration" : "String"
}
}
POST /devices/{device-id}/configurations/raw | Version 5 |
This API is used to filter raw configuration content of a device using an XPath expression without expanding the configuration groups and results will be displayed in CLI format
Sample xpath : /configuration
Sample configuration :
version 12.3R3.4; system { root-authentication { encrypted-password $1$nTfQePCG$paMKOkFTfjGLjK9K7DGkJ0; } scripts { op { file MyscriptPhysicalinterfaceScript.slax ; } } login { user String { uid 2077; class super-user; authentication { encrypted-password $1$dbopsnyN$PVDcL2aAuh2uaP.j.q7U0.; } } } services { ssh { protocol-version v2; max-sessions-per-connection 32; } netconf { ssh ; } outbound-ssh { client 192.168.27.171 { device-id C233F9; secret $9$cklrKWNdsJGiLxGik.zFcyl; services netconf; 192.168.27.171 { port 7804; } } } web-management { http ; } } syslog { user * { any { emergency ; } } file messages { any { notice ; } authorization { info ; } } file interactive-commands { interactive-commands { any ; } } } } interfaces { ge-0/0/0 { unit 0 { family ethernet-switching ; } } ge-0/0/1 { description mydescription; mtu 554; unit 0 { family ethernet-switching ; } } } protocols { igmp-snooping { vlan all ; } rstp ; lldp { interface all ; } lldp-med { interface all ; } } poe { interface all ; }.
Sample Usage
POST /devices/{device-id}/configurations/raw
-
Parameters:
Name Type URI Type Description Required device-id Integer Path Device ID Y
-
Content-Type Headers:
application/vnd.net.juniper.space.device-management.raw-cli-configuration-request+xml;version=5;charset=UTF-8
application/vnd.net.juniper.space.device-management.raw-cli-configuration-request+json;version=5;charset=UTF-8 -
Accept Headers:
application/vnd.net.juniper.space.device-management.raw-cli-configuration+xml;version=5
application/vnd.net.juniper.space.device-management.raw-cli-configuration+json;version=5
<raw-cli-configuration-request>
<xpath-list>
<xpath>String</xpath>
</xpath-list>
</raw-cli-configuration-request>
<raw-cli-configuration uri="/api/space/device-management/devices/{device-id}/configurations/raw">
<id>Integer</id>
<configuration><![CDATA[String]]></configuration>
</raw-cli-configuration>
{
"raw-cli-configuration-request" : {
"xpath-list" : {
"xpath" : "String"
}
}
}
{
"raw-cli-configuration" : {
"@uri" :
"/api/space/device-management/devices/{device-id}/configurations/raw" ,
"id" : "Integer" ,
"configuration" : "String"
}
}
Access Control
The following capabilities are required to access this API: DeviceConfiguration
POST /devices/{device-id}/configurations/raw | Version 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.)
.Sample Usage
POST /devices/{device-id}/configurations/raw
-
Parameters:
Name Type URI Type Description Required device-id Integer Path The ID of the device whose raw configuration content will be filtered. Y
-
Content-Type Headers:
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 -
Accept Headers:
application/vnd.net.juniper.space.device-management.raw-configuration+xml;version=1
application/vnd.net.juniper.space.device-management.raw-configuration+json;version=1
<?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>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<raw-configuration>
<configuration><version>10.0R2.10</version></
configuration>
<method href=
"/api/space/device-management/devices/229377/configurations/raw/match-content"
rel="match device configuration"/>
</raw-configuration>
{ "xpaths":{
"xpath":[
"/configuration/version",
"/configuration/interfaces/interface[name=\"ge-0/0/0\"]"
]
}
}
{ < br/>
"raw-configuration":
{
"configuration":
"10.0R2.10 ", < br/>
"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: DeviceConfiguration