<get-configuration>
Usage
<rpc>
<get-configuration [changed="changed"]
[commit-scripts="( apply | apply-no-transients | view )"]
[compare="rollback" [rollback="[0-49]"]]
[database="(candidate | committed)"]
[database-path=$junos-context/commit-context/database-path]
[format="( 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>
Release Information
This is a Junos XML management protocol operation. It is a Juniper Networks proprietary extension to NETCONF and is identified in the capabilities exchange by the URI http://xml.juniper.net/netconf/junos/1.0 . This operation is only supported in NETCONF sessions on Juniper Networks devices running the Junos OS.
Description
Request configuration data from the NETCONF server. The attributes specify the source and formatting of the data to display. Either the entire configuration hierarchy or a section can be displayed:
- 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.
![]() | Note: Starting with Junos OS Release 13.1, within a NETCONF 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 was omitted. |
Attributes
For detailed information on the attributes, see the Junos XML Management Protocol Developer Guide
changed | — | Specifies that the junos:changed="changed" attribute should appear in the opening tag of each changed configuration element. 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 <configuration> tag. If the changed configuration element is represented by a single (empty) tag, the junos:changed="changed" attribute appears in the tag. If the changed element is represented by a container tag element, the junos:changed="changed" attribute appears in the opening container tag and also in each child tag element enclosed in the container tag element. The database attribute can be combined with the changed="changed" attribute to request either the candidate or active configuration:
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 NETCONF server returns to confirm the success of the commit, enclosed in an <xnm:warning> tag element. To remove the junos:changed="changed" attribute from elements that changed before the commit, take the action necessary to eliminate the cause of the warning, and commit the configuration again. |
commit-scripts | — | Requests that the Junos XML protocol server display commit-script-style XML data. The value of the attribute determines the output. Acceptable values are:
|
compare | — | Requests that the NETCONF server display the differences between the active or candidate configuration and a previously committed configuration. The only acceptable value for the compare attribute is rollback. The compare attribute is combined with the rollback="rollback-number" to specify which previously committed configuration should be used in the comparison. If the rollback attribute is omitted, the comparison uses rollback number 0, which is the active configuration. The database attribute can be combined with the compare="rollback" attribute to request either the candidate or active configuration. If the database attribute is omitted, the candidate configuration is used. When the compare attribute is used, the default format for the output is text. If the client application attempts to include the format="xml" attribute when the compare="rollback" attribute is present, the protocol server will return an <xnm:error> element indicating an error. |
database | — | Specifies the version of the configuration from which to display data. There are two acceptable values:
The database attribute takes precedence over the database-path attribute, if both are included. |
database-path | — | Within a commit script, this attribute specifies the path to the session’s pre-inheritance candidate configuration. The only acceptable value is $junos-context/commit-context/database-path. 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. This attribute is available starting with Junos OS Release 12.2. If you include both the database and the database-path attributes, the database attribute takes precedence. |
format | — | Specifies the format in which the NETCONF server returns the configuration data. There are two acceptable values:
|
groups | — | Specifies that the junos:group="group-name" attribute appears in the opening tag for each configuration element that is inherited from a configuration group. The group-name variable specifies the name of the configuration group. The groups attribute must be combined with the inherit attribute, and the one acceptable value for it is groups. |
inherit | — | Specifies how the NETCONF server displays statements that are defined in configuration groups and interface ranges. If the inherit attribute is omitted, the output uses the <groups>, <apply-groups>, and <apply-groups-except> tag elements to represent user-defined configuration groups and uses the <interface-range> tag element to represent user-defined interface ranges; it does not include tag elements for statements defined in the junos-defaults group. There are two acceptable values:
|
interface-ranges | — | Specifies that the junos:interface-ranges="source-interface-range" attribute appears in the opening tag for each configuration element that is inherited from an interface-range. The source-interface-range variable specifies the name of the interface-range. The interface-ranges attribute must be combined with the inherit attribute, and the one acceptable value for it is interface-ranges. |
junos:key | key | — | Specifies that the junos:key="key" attribute appears in the opening tag of each element that serves as an identifier for a configuration object. The only acceptable value is key. |