PUT Method
The RESTCONF PUT method represents the NETCONF "create" or "replace" operation.
The PUT method on the datastore resource is used to replace the entire contents of the datastore. The PUT method on a data resource only replaces that data resource within the datastore.
Resource Types Supporting PUT
| Type | Description |
|---|---|
| Datastore | Replaces the entire contents of the datastore |
| Data | Replaces that data resource within the datastore |
The "insert" and "point" query parameters are supported by the PUT method for data resources. These parameters are only allowed if the list or leaf-list is "ordered-by user". The query parameters are not allowed for the requests for a datastore resource.
- If the PUT request creates a new resource, a "201 Created" message is returned. If an existing resource is modified, a "204 No Content" message is returned.
- If the user is not authorized to create or replace the target resource, a "403 Forbidden" message is returned. The error tag value "access-denied" is used in this case.
- If the target resource represents a YANG leaf-list, then the PUT method must not change the value of the leaf-list instance.
- If the target resource represents a YANG list instance, then the key leaf values in the message-body representation must be the same as the key leaf values in the request URI. The PUT method must not be used to change the key leaf values for a data resource instance.