DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
The HTTP GET method is sent in the RESTCONF request by the client
to retrieve data and metadata for a specific resource. It translates into
the NETCONF <get> and <get-config> operations. The GET method is
supported for all resource types except operation resources.
The HTTP POST method is used for NETCONF RPCs and to create a
data resource. It represents the same semantics as the NETCONF
<edit-config> operation with operation= “create”.
The PUT method is used to create or replace the contents of the target
resource. It is the equivalent of the NETCONF <edit-config> operation
with operation=“create/replace”.
The PATCH method provides the framework for resource patching
mechanism. It is the equivalent of the NETCONF <edit-config>
operation with operation=“merge”.
The HTTP DELETE method is used to delete the target resource and is
the equivalent of the NETCONF <edit-config> with operation=“delete”.

RESTCONF data is encoded with either XML or JSON.
Compared with NETCONF, RESTCONF has added
support for the JSON encoding. There are two new
media types defined for RESTCONF:


application/yang.api+xml for XML-encoded payloads
application/yang.api+json for JSON-encoded data

With all REST APIs, including RESTCONF APIs, the URI
is important in identifying the data being requested or
configured. A unique characteristic of RESTCONF is that
it lacks any true API documentation that a developer
would use to learn how to use it. Rather, the YANG
models themselves are the API documentation.


All RESTCONF URIs use the following format:


https://

//data/<[YANG_M
ODULE:]CONTAINER>/ [?]


where


ADDRESS is the IP address or the hostname and port number where
the RESTCONF agent is available.
Free download pdf