Output format tag

The following example shows the <get-data> operation combined with a subtree filter and requests the output in the MD-CLI format.

Example: MD-CLI format

<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
  <get-data>
    <format>md-cli</format>
    <datastore>running</datastore>
    <subtree-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-nmda">
      <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
        <system>
          <management-interface>
            <netconf/>
          </management-interface>
        </system>
      </configure>
    </subtree-filter>
  </get-data>
</rpc>
]]>]]>

The following example shows the reply.

Example: MD-CLI format reply

<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
    <data>
    configure {
        system {
            management-interface {
                netconf {
                    admin-state enable
                    auto-config-save true
                    capabilities {
                        candidate true
                        writable-running false
                    }
                }
            }
        }
    }
    </data>
</rpc-reply>
]]>]]>

The following example shows the <get-data> operation combined with a subtree filter and requests the output in the JSON (IETF) format.

Example: JSON (IETF) format

<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
  <get-data>
    <format>json</format>
    <datastore>running</datastore>
    <subtree-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-nmda">
      <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
        <system>
          <management-interface>
            <netconf/>
          </management-interface>
        </system>
      </configure>
    </subtree-filter>
  </get-data>
</rpc>
]]>]]>

The following example shows the reply.

Example: JSON (IETF) format reply

<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
    <data>
{
    "nokia-conf:configure": {
        "system": {
            "management-interface": {
                "netconf": {
                    "admin-state": "enable",
                    "auto-config-save": true,
                    "capabilities": {
                        "candidate": true,
                        "writable-running": false
                    }
                }
            }
        }
    }
}
    </data>
</rpc-reply>
]]>]]>