<edit-data>

The <edit-data> operation can be used to load all or some configuration data to a specified target configuration database (<ietf-datastores:running/> or <ietf-datastores:candidate/>). The device authorizes the operation in <edit-data>. After the authorization succeeds, the device performs corresponding modification.

The <edit-data> operation supports multiple modes for loading configurations. For example, you can load local and remote files, and edit files online. If a NETCONF server supports the URL capability, the <url> parameter (which identifies a local configuration file) can be used to replace the <config> parameter.

Parameters in an RPC message of the <edit-data> operation are described as follows:

The following example shows how to change the description of GigabitEthernet interface 0/1/0 in the <ietf-datastores:running/> configuration database to huawei.
  • RPC request
    <?xml version="1.0" encoding="utf-8"?>
    <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
      <edit-data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-nmda"
                 xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">
        <datastore>ds:running</datastore>
        <config>
          <ifm xmlns="urn:huawei:yang:huawei-ifm">
            <interfaces>
              <interface>
                <name>GigabitEthernet0/1/0</name>
                <description>huawei</description>
              </interface>
            </interfaces>
          </ifm>
        </config>
      </edit-data>
    </rpc>
  • RPC reply
    <?xml version="1.0" encoding="utf-8"?>
    <rpc-reply xmlns:nc-ext="urn:huawei:yang:huawei-ietf-netconf-ext"
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
               message-id="5"
               nc-ext:flow-id="27">
    <ok/>
    </rpc-reply>
The following example shows how to delete the configuration on the interface named LoopBack1023 from the running configuration database.
  • RPC request
    <?xml version="1.0" encoding="utf-8"?>
    <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
      <edit-data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-nmda"
                 xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">
        <datastore>ds:running</datastore>
        <config>
          <ifm xmlns="urn:huawei:yang:huawei-ifm">
            <interfaces>
              <interface xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete">
                <name>LoopBack1023</name>
              </interface>
            </interfaces>
          </ifm>
        </config>
      </edit-data>
    </rpc>
  • RPC reply
    <?xml version="1.0" encoding="utf-8"?>
    <rpc-reply xmlns:nc-ext="urn:huawei:yang:huawei-ietf-netconf-ext"
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
               message-id="5"
               nc-ext:flow-id="28">
    <ok/>
    </rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >