Описание тега ietf-restconf
RESTCONF is a protocol that closely relates to NETCONF protocol and YANG data modeling language. It has been developed by the same IETF workgroup that developed NETCONF and was published as RFC8040 in January 2017.
NETCONF defines configuration datastores and a set of Create, Retrieve, Update, Delete (CRUD) operations that can be used to access these datastores. You can learn more about it by reading its tag wiki - ietf-netconf. The YANG language defines the syntax and semantics of datastore content, configuration, state data, RPC operations, and event notifications. Learn more about the latter by reading its tag wiki - ietf-netmod-yang.
RESTCONF uses HTTP methods to provide CRUD operations on a conceptual datastore containing YANG-defined data, which is compatible with a server which implements NETCONF datastores.
Configuration data and state data are exposed as resources that can be retrieved with the GET method. Resources representing configuration data can be modified with the DELETE, PATCH, POST, and PUT methods. Data is encoded with either XML ( W3C.REC-xml-20081126) or JSON ( RFC7159).
Data-model specific RPC operations defined with the YANG "rpc" or "action" statements can be invoked with the POST method. Data-model specific event notifications defined with the YANG "notification" statement can be accessed.
Here are a couple of examples of communication via RESTCONF (request-response pairs):
GET /restconf/data/ietf-restconf-monitoring:restconf-state/
capabilities HTTP/1.1
Host: example.com
Accept: application/yang-data+xml
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:02:00 GMT
Server: example-server
Cache-Control: no-cache
Last-Modified: Sun, 22 Apr 2012 01:00:14 GMT
Content-Type: application/yang-data+xml
<capabilities
xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring">
<capability>
urn:ietf:params:restconf:capability:defaults:1.0?
basic-mode=explicit
</capability>
<capability>
urn:ietf:params:restconf:capability:with-defaults:1.0
</capability>
<capability>
urn:ietf:params:restconf:capability:depth:1.0
</capability>
<capability>
urn:ietf:params:restconf:capability:fields:1.0
</capability>
<capability>
urn:ietf:params:restconf:capability:filter:1.0
</capability>
<capability>
urn:ietf:params:restconf:capability:start-time:1.0
</capability>
<capability>
urn:ietf:params:restconf:capability:stop-time:1.0
</capability>
<capability>
http://example.com/capabilities/myparam
</capability>
</capabilities>
POST /restconf/data/example-jukebox:jukebox/library HTTP/1.1
Host: example.com
Content-Type: application/yang-data+json
{
"example-jukebox:artist" : {
"name" : "Foo Fighters"
}
}
HTTP/1.1 201 Created
Date: Mon, 23 Apr 2012 17:02:00 GMT
Server: example-server
Location: https://example.com/restconf/data/
example-jukebox:jukebox/library/artist=Foo%20Fighters
Last-Modified: Mon, 23 Apr 2012 17:02:00 GMT
ETag: "b3830f23a4c"
Learn more by reading:
- the specification
- content of related wiki tags, mentioned above.