Data Model-Driven Management: Example
Acting on resources
GET : Gets a resource
POST : Creates a resource or invoke operation
PUT : Replaces a resource
DELETE : Removes a resource
Module my-interfaces {
{
namespace ”com.my-interfaces”;
container interfaces {
list interface {
key name;
leaf name { type string; }
leaf admin-status { type enum;}
rpc flap-interface {
input {
leaf name { type string; }
}
output {
leaf result { type boolean; }
}
}
POST /restconf/operations/my-interfaces:flap-interface
+ JSON/XML Form Data (including name)
Response will have JSON/XML result
GET /restconf/data/my-interfaces:interfaces
GET /restconf/data/my-interfaces:interfaces/interface/<some
name>
PUT /restconf/data/my-interfaces:interfaces/interface/<some
name> + JSON/XML Form Data (name, admin-status)
DELETE /restconf/data/my-
interfaces:interfaces/interface/<some name>
7