The PUT method is supported for data and datastore resources. A PUT on the datastore resource is used to replace the entire contents of the datastore. 


In this example, the entire configuration datastore contents are being replaced. Any child nodes not present in the <data> element but present in the server will be deleted.


      PUT /restconf/data HTTP/1.1
      Host: example.com
      Content-Type: application/yang-data+xml

      <data xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
        <jukebox xmlns="http://example.com/ns/example-jukebox">
          <library>
            <artist>
              <name>Foo Fighters</name>
              <album>
                <name>One by One</name>
                <year>2012</year>
              </album>
            </artist>
            <artist>
              <name>Nick Cave and the Bad Seeds</name>
              <album>
                <name>Tender Prey</name>
                <year>1988</year>
              </album>
            </artist>
          </library>
        </jukebox>
      </data>


Note that this operation replaces the WHOLE CONTENT OF THE DATASTORE. So all your previous data will be replaced with new data.


Also, with help of this operation it is easy to clean up the whole datastore, for example:


      PUT /restconf/data HTTP/1.1
      Host: example.com
      Content-Type: application/yang-data+xml

      <data xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
      </data>


As a result, the server will have an empty datastore.



For more details refer to RESTCONF [RFC8040]