netconf-wg / restconf

9 stars 4 forks source link

AD review of restconf-13 #62

Closed abierman closed 8 years ago

abierman commented 8 years ago

Dear all,

Here is my draft-ietf-netconf-restconf-13 AD review [sorry for the delay, it took longer than expected]. If some of the points have already been discussed, let me know.

Are we good in terms of I2RS requirements for RESTCONF, if any?

NEW: The YANG language defines the syntax and semantics of datastore content, configuration, state data, protocol operations, and event notifications.

Justification, to be more in line with RFC6020bis, which says: A YANG module defines a hierarchy of data that can be used for NETCONF-based operations, including configuration, state data, Remote Procedure Calls (RPCs), and notifications.

Terminology: RESTCONF server, NETCONF server, server. "Server" according to the terminology section is the RFC6241 definition, so the NETCONF server. I don't think that's right in this sentence. You should review all "server" instances in the doc, and/or potentially change the terminology. Maybe: Server is not specific, so NETCONF or RESTCONF server NETCONF server RESTCONF server

Same issue with "client".

As Lionel Morand mentioned in his OPS-DIR draft-ietf-netmod-rfc6020bis-11 review: LM: "non-presence container" is not defined anywhere in the document. I can assume that it refers to a container that does not have a "presence" statement. If it is, it could be good to: define the term in the section 3 and to extend the existing text in the section 7.5.5

Except from the name itself, it doesn't tell me that this resource is linked to the "operations", meaning the RPC operations in YANG.

For example: OLD: o schema resource: a resource with the media type "application/ yang". The YANG representation of the schema can be retrieved by the client with the GET method. NEW: o schema resource: a resource with the media type "application/ yang". The schema resource is used to retrieve the YANG representation of the schema by the client with the GET method.

I would add that the examples throughout the document are based on a jukebox YANG data model, and that, even if the examples should be self contained, the full jukebox YANG data model is available in the appendix C

Just one of the many justifications. See section 4.8.3 where this example comes out of the blue For example, assume the target resource is the "album" list. To retrieve only the "label" and "catalogue-number" of the "admin" container within an album, use: "fields=admin(label;catalogue-number)".

From section 1: This document defines an HTTP [RFC7230] based protocol called RESTCONF, for configuring data defined in YANG version 1 [RFC6020] or YANG version 1.1 [I-D.ietf-netmod-rfc6020bis], using datastores defined in NETCONF [RFC6241]. ...

The following figure shows the system components if a RESTCONF server is co-located with a NETCONF server:

  +-----------+           +-----------------+
  |  Web app  | <-------> |                 |
  +-----------+   HTTP    | network device  |
                          |                 |
  +-----------+           |   +-----------+ |
  |  NMS app  | <-------> |   | datastore | |
  +-----------+  NETCONF  |   +-----------+ |
                          +-----------------+

The following figure shows the system components if a RESTCONF server is implemented in a device that does not have a NETCONF server:

  +-----------+           +-----------------+
  |  Web app  | <-------> |                 |
  +-----------+   HTTP    | network device  |
                          |                 |
                          +-----------------+

So we don't use the datastores defined in NETCONF, but datastore concepts. See next point.

The abstract says: This document describes an HTTP-based protocol that provides a programmatic interface for accessing data defined in YANG, using the datastores defined in NETCONF.

So on one side, we eliminated the datastore and on the other side, we use them. And the first figure in section 1.2 doesn't help. In case of HTTP and NETCONF access to the network device, does HTTP use the datastore? I guess you want to introduce the conceptual datastore concept. Maybe: This document describes an HTTP-based protocol that provides a programmatic interface for accessing data defined in YANG, using the datastore concepts defined in NETCONF.

Introduction needs to be updated as well.

We want to stress that there is no lock in RESTCONF

What do you mean with "protocol operations"?

Similarly in section 4: +----------+--------------------------------------------+ | RESTCONF | NETCONF | +----------+--------------------------------------------+ | OPTIONS | none | | HEAD | none | | GET | , | | POST | (operation="create") | | POST | invoke any operation | <===== | PUT | (operation="create/replace") | | PATCH | (operation="merge") | | DELETE | (operation="delete") | +----------+--------------------------------------------+

Which operation do we speak about here? It could be understood as NETCONF protocol operations...

And I see in 3.3.1 that querying {+restconf}/data content requires application/yang.data+xml (or json), as opposed to .api+xml (or json) What about the querying {+restconf}/operations? does it require application/yang.api+xml or application/yang.data+xml ? https://tools.ietf.org/html/draft-ietf-netconf-restconf-13#section-3.3.2 should provide any example. My first guess was: since operations = API, I would have used application/yang.api+xml. Re-reading the draft, I now guess it's application/yang.data+xml (or json). The point is: what are the entry points for the operations resources?

Make it clear that the date to be changed is 2016-04-09, as opposed to only:

Mon, 23 Apr 2012

3.4. Datastore Resource The "{+restconf}/data" subtree represents the datastore resource type, which is a collection of configuration data and state data nodes. Should be "{+restconf}/datastore", right ?

Section 3.4.1.1 The last change time is maintained and the "Last-Modified" ([RFC7232], Section 2.2) header is returned in the response for a retrieval request. The "If-Unmodified-Since" header can be used in edit operation requests to cause the server to reject the request if the resource has been modified since the specified timestamp.

Section 3.5 For configuration data resources, the server MAY maintain a last- modified timestamp for the resource, and return the "Last-Modified" header when it is retrieved with the GET or HEAD methods.

Section 9.1 The server MUST maintain a last-modified timestamp for this container, and return the "Last-Modified" header when this data node is retrieved with the GET or HEAD methods.

Section 10.1 The server MUST maintain a last-modified timestamp for this container, and return the "Last-Modified" header when this data node is retrieved with the GET or HEAD methods.

Section 10.1.1 The server SHOULD maintain a last-modified timestamp for each instance of this list entry, and return the "Last-Modified" header when this data node is retrieved with the GET or HEAD methods.

and potentially some more sections At the minimum, we should have forward references from section 3.4.1.1 as it looks like self-contained.

Same remark for entity-tag and section 3.4.1.2

Mentions that "container top" is part of the example-top YANG data model

I guess that it depends on the default handing mode. What about trim? ref: https://tools.ietf.org/html/rfc6243#section-3.2

NEW:

If the "rpc" or "action" statement has an "input" section and the "input" object tree contains mandatory parameters, then a message-body MUST be sent by the client in the request.

If the "rpc" or "action" statement has an "input" section and the "input" object tree doesn't contain mandatory parameters, then a message-body MAY be sent by the client in the request.

If the "rpc" or "action" statement has no "input" section, the request message MUST NOT include a message-body.

First, I don't understand the first MAY. I would have thought it would be a MUST. Second, "MUST NOT include a message-body in the response message, and MUST send a "204 No Content" status-line instead." So the errors are not part of the message-body? Section 7.1 says: then the server SHOULD send a response message-body containing the information described by the "errors" container definition within the YANG module Section 8 And third, message body or message-body. The document uses both.

You could include the generic specifications, along with the RFC2119 language, in section 4.8, as opposed to every 4.8.x section.

RFC 6241 says: o The function library is the core function library, plus any functions defined by the data model.

Should this be aligned?

Something I completely missed (and only understood when I spoke to Martin). To edit a resource, we have two ways:

  1. PATCH on the datastore resource like in appendix D.2.3
  2. PATCH on the data resource, with the full path. To map the example in D.2.3, something like PATCH /restconf/data HTTP/1.1 Host: example.com Content-Type: application/yang.data+xml "http://x.x.x.x:yyyy/restconf/data/jukebox:library" Both examples should be illustrated next to each others, and the text in 4.6 or 4.6.1 clear.

    • Section 4.8.7 What is this "notification replay feature"? I searched for "notification replay" in the doc, without luck. I finally found it, in https://tools.ietf.org/html/rfc5277#section-3.3, from the reference link: leaf replay-support { type boolean; description "Indicates if replay buffer supported for this stream. If 'true', then the server MUST support the 'start-time' and 'stop-time' query parameters for this stream."; reference "RFC 5277, Section 3.4, element."; } You should really add the references in section 4.8.7 and 8, to RFC 5277, Section 3.4 and to the replay-support
    • Section 5.1, editorial //?#
    ^       ^        ^       ^         ^
    |       |        |       |         |

    method entry resource query fragment

    M       M        O        O         I

The method points to a space. Indent the line starting with

I don't understand "the YANG module name has to be assigned manually"

Also, In section 5.3:

The RESTCONF protocol needs to retrieve the same meta-data that is used in the NETCONF protocol. Information about default leafs, last- modified timestamps, etc. are commonly used to annotate representations of the datastore contents. This meta-data is not defined in the YANG schema because it applies to the datastore, and is common across all data nodes.

=> I don't understand: This meta-data is not defined in the YANG schema because it applies to the datastore, and is common across all data nodes. This meta-data relates to default leafs and last-modified timestamps. The last-modified timestamps apply to more than just the datastore.

Also: This information is encoded as attributes in XML. JSON encoding of meta-data is defined in [I-D.ietf-netmod-yang-metadata].

You want to express something like this: With the XML encoding, the metadata is encoded as attributes in XML With the JSON encoding, the metadata is encoded as specified in [I-D.ietf-netmod-yang-metadata].

btw, use a single convention throughout the doc: meta-data or metadata draft-ietf-netmod-yang-metadata uses metadata

Why only 4xx and 5xx?

Section 8 container operations { description "Container for all operation resources (application/yang.operation),

          Each resource is represented as an empty leaf with the
          name of the RPC operation from the YANG rpc statement.

          E.g.;

             POST /restconf/operations/show-log-errors

             leaf show-log-errors {
               type empty;
             }
         ";
     }

I've been confused by this example, as at first glance I didn't consider a show-something as an operation. You might be thinking of a more obvious example: Reset-xxx is one

If this is a typical operational example, I guess you want to start by retrieving: GET /.well-known/host-meta HTTP/1.1

pyang --ietf example-jukebox.yang example-jukebox.yang:1: error: expected keyword "namespace" as child to "module" example-jukebox.yang:1: error: expected keyword "prefix" as child to "module" example-jukebox.yang:1: warning: RFC 6087: 4.1: the module name should start with one of the strings "ietf-" or "iana-" example-jukebox.yang:1: error: RFC 6087: 4.7: statement "module" must have a "contact" substatement example-jukebox.yang:1: error: RFC 6087: 4.7: statement "module" must have a "organization" substatement example-jukebox.yang:1: error: RFC 6087: 4.7: statement "module" must have a "description" substatement example-jukebox.yang:1: error: RFC 6087: 4.7: statement "module" must have a "revision" substatement

What was the agreed convention for example modules that should pass compilation?

Don't we need [] for the album list?

       list album {
          key name;

          description
            "Represents one album resource within one
             artist resource, within the jukebox library.";

          leaf name {
            type string {
              length "1 .. max";
            }
            description "The name of the album.";
          }

          leaf genre {
            type identityref { base genre; }
            description
              "The genre identifying the type of music on
               the album.";
          }

          leaf year {
            type uint16 {
              range "1900 .. max";
            }
            description "The year the album was released";
          }

See https://tools.ietf.org/html/draft-ietf-netmod-yang-json-10#section-5.4 list bar { key foo; leaf foo { type uint8; } leaf baz { type string; } }

the following is a valid JSON-encoded instance:

"bar": [ { "foo": 123, "baz": "zig" }, { "baz": "zag", "foo": 0 } ]

Regards, Benoit (OPS AD)

abierman commented 8 years ago

Are we good in terms of I2RS requirements for RESTCONF, if any?

A: There are strong objections to adding datastores to RESTCONF. All datastore support will be through operations in the /restconf/operations/ subtree

abierman commented 8 years ago

3.4. Datastore Resource The "{+restconf}/data" subtree represents the datastore resource type, which is a collection of configuration data and state data nodes. Should be "{+restconf}/datastore", right ?

No -- this was "datastore" in YANG-API but shortened to "data" in RESTCONF

abierman commented 8 years ago

RFC5277 is a normative reference. I guess that pub/sub will obsolete RFC5277. So we would have to update this RESTCONF RFC-to-be with the pub/sub publication?

No -- IMO SSE and RFC5277 functionality works fine. Additional functionality is a separate feature

abierman commented 8 years ago

Issue

  pyang --ietf example-jukebox.yang 
  example-jukebox.yang:1: error: expected keyword "namespace" as child to "module"
   .... errors and warnings

When I run pyang:

     pyang --ietf example-jukebox.yang 
     example-jukebox.yang:1: warning: RFC 6087: 4.1: the module name should start 
     with one of the strings "ietf-" or "iana-"
     example-jukebox.yang:3: warning: RFC 6087: 4.8: namespace value should be 
    "urn:ietf:params:xml:ns:yang:example-jukebox"

These are expected, since these IETF warnings are wrong for examples

abierman commented 8 years ago
abierman commented 8 years ago

Issues not addressed

abierman commented 8 years ago

not sure we need to say anything about HTTP/2

abierman commented 8 years ago

closed in draft 15