3

What is the difference between Operational and Config in YANG model? Is it a correct way to supporting GET,PUT,POST and DELETE interfaces both in Operational and Config ?

vinllen
  • 1,369
  • 2
  • 18
  • 36
  • 1
    While I don't know what this means in the context of OpenDaylight (which I do not use), I suggest you read [Section 2 of `A Revised Conceptual Model for YANG Datastores`](https://tools.ietf.org/html/draft-nmdsdt-netmod-revised-datastores-00#section-2) document. It gathers all related definitions in a single place (`configuration`, `state` and `operational`) and also references the RFCs that define them. I do not understand your secondary question. – predi Nov 29 '16 at 13:55

3 Answers3

6

Config is what represents configuration data, usually what will be writable via the northbound agents (CLI, Netconf, Web, etc.), it is also what will be retrieved in a get-config Netconf operation.
Operational data is status data, data that is not writable via the northbound agents, it will come from a data provider application.

A web client should only be able to do a GET operation on operational data. Because it doesn't make sense to allow a client to change the information about a status.
For config data it makes sense to have all the operations.

Nogoseke
  • 969
  • 1
  • 12
  • 24
0

NETCONF separates configuration and state (or operational) data:

The information that can be retrieved from a running system is separated into two classes, configuration data and state data. Configuration data is the set of writable data that is required to transform a system from its initial default state into its current state. State data is the additional data on a system that is not configuration data such as read-only status information and collected statistics.

RESTCONF works as NETCONF, but on HTTP: it does map CRUD verbs onto NETCONF operations:

   +----------+-------------------------------------------------------+
   | RESTCONF | NETCONF                                               |
   +----------+-------------------------------------------------------+
   | OPTIONS  | none                                                  |
   |          |                                                       |
   | HEAD     | <get-config>, <get>                                   |
   |          |                                                       |
   | GET      | <get-config>, <get>                                   |
   |          |                                                       |
   | POST     | <edit-config> (nc:operation="create")                 |
   |          |                                                       |
   | POST     | invoke an RPC operation                               |
   |          |                                                       |
   | PUT      | <copy-config> (PUT on datastore)                      |
   |          |                                                       |
   | PUT      | <edit-config> (nc:operation="create/replace")         |
   |          |                                                       |
   | PATCH    | <edit-config> (nc:operation depends on PATCH content) |
   |          |                                                       |
   | DELETE   | <edit-config> (nc:operation="delete")                 |
   +----------+-------------------------------------------------------+
Community
  • 1
  • 1
Ariel Otilibili
  • 260
  • 1
  • 6
0

On supporting GET,PUT,POST and DELETE, if you are reffering to http methods here, you should probably follow RestConf

Community
  • 1
  • 1
Keshava
  • 702
  • 1
  • 7
  • 20