ON THIS PAGE
<get-configuration>
Usage
<rpc> <get-configuration [changed="changed"] [commit-scripts="( apply | apply-no-transients | view )"] [compare=("configuration-revision" [configuration-revision="revision-id"] | "rollback" [rollback="[0-49]"])] [database="(candidate | committed)"] [database-path=$junos-context/commit-context/database-path] [format="( json | set | text | xml )"] [inherit="( defaults | inherit )" [groups="groups"] [interface-ranges="interface-ranges"]] [(junos:key | key )="key"] > <!-- tag elements for the configuration element to display --> </get-configuration> </rpc>
Description
Request configuration data from the NETCONF or Junos XML protocol server. The attributes specify the source and formatting of the data to display.
If a client application issues the Junos XML protocol <open-configuration>
operation to open a specific
configuration database before executing the <get-configuration>
operation, the server returns the configuration data from the open
configuration database. Otherwise, the server returns the configuration
data from the candidate configuration, unless the active configuration
is explicitly requested by including the database="committed"
attribute.
A client application can request the entire configuration hierarchy or a subset of it.
To display the entire configuration hierarchy, emit the empty
<get-configuration/>
tag.To display a configuration element (hierarchy level or configuration object), emit tag elements within the
<get-configuration>
tag element to represent all levels of the configuration hierarchy from the root (represented by the<configuration>
tag element) down to the level or object to display. To represent a hierarchy level or a configuration object that does not have an identifier, emit it as an empty tag. To represent an object that has one or more identifiers, emit its container tag element and identifier tag elements only, not any tag elements that represent other characteristics.
To retrieve configuration data from an instance of the
ephemeral configuration database, a client application must first
open the ephemeral instance using the <open-configuration>
operation with the appropriate child tags before emitting the <get-configuration>
operation. When retrieving ephemeral
configuration data using the <get-configuration>
operation, the only supported attributes are format
and key
.
Starting in Junos OS Release 13.1, within a NETCONF or
Junos XML protocol session, a logical system user can use the Junos
XML <get-configuration>
operation to request specific
logical system configuration hierarchies using child configuration
tags as well as request the entire logical system configuration. When
requesting the entire logical system configuration, the RPC reply
includes the <configuration>
root tag. Prior to Junos
OS Release 13.1, the <configuration>
root tag is omitted.
Attributes
changed |
Specify that the The attribute appears in the opening tag of every parent tag
element in the path to the changed configuration element, including
the top-level opening The
An example of a commit-time warning is the message explaining
that a configuration element will not actually apply until the device
is rebooted. The warning appears in the tag string that the server
returns to confirm the success of the commit, enclosed in an To remove the |
commit-scripts |
Request that the NETCONF or Junos XML protocol server display commit-script-style XML data. The value of the attribute determines the output. Acceptable values are:
|
compare |
Request that the NETCONF or Junos XML protocol server display the differences between the active or candidate configuration and a previously committed configuration (the comparison configuration). The The
If you include the When you compare the candidate configuration to the active configuration,
the Note:
Starting in Junos OS Release 16.2R2, when you compare the candidate
and active configurations and display the differences in XML or JSON
format, the device omits the |
database |
Specify the configuration from which to display data as one of the following:
The |
database-path |
Within a commit script, this attribute specifies the
path to the session’ s pre-inheritance candidate configuration.
The only acceptable value is For normal configuration sessions, the commit script retrieves the normal, pre-inheritance candidate configuration. For private configuration sessions, the commit script retrieves the private, pre-inheritance candidate configuration. If you include both the |
format |
Specify the format in which the NETCONF or Junos XML protocol server returns the configuration data. Acceptable values are:
Note:
Starting in Junos OS Release 21.1R1 and Junos OS Evolved Release
22.3R1, NETCONF sessions additionally support the
|
groups |
Specify that the The only acceptable value for the |
inherit |
Specify how the NETCONF or Junos XML protocol server displays statements that are defined in
configuration groups and interface ranges. If the
The acceptable values are:
|
interface-ranges |
Specify that the The only acceptable value for the |
junos:key | key |
Specify that the |
Release Information
This is a Junos XML management protocol operation. It is supported in Junos XML protocol sessions, and it is supported as a Juniper Networks proprietary extension in NETCONF sessions on devices running Junos OS that identify the URI http://xml.juniper.net/netconf/junos/1.0 in the capabilities exchange.
interface-ranges
attribute added
in Junos OS Release 10.3R1.
commit-scripts
attribute values apply
and apply-no-transients
added in Junos OS Release 12.1
database-path
attribute added in
Junos OS Release 12.2.
format
attribute value json
added in Junos OS Release 14.2.
format
attribute value set
added in Junos OS Release 15.1.
Starting in Junos OS Release 16.1, devices running Junos OS emit JSON-formatted configuration data using a new default implementation for serialization.
Starting in Junos OS Releases 16.1R4, 16.2R2, and 17.1R1, integers in Junos OS configuration data emitted in JSON format are not enclosed in quotation marks.
compare
attribute value configuration-revision
added in Junos OS Release 20.4R1
and Junos OS Evolved Release 20.4R1.
format
attribute values json-minified
and
xml-minified
added for NETCONF sessions only in Junos OS
Release 21.1R1 and Junos OS Evolved Release 22.3R1.