Closed abierman closed 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
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
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
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
Issues not addressed
I2RS requirements for RESTCONF
Proposal: RESTCONF defines how it can be extended. It should not contain any I2RS details
What about HTTP/2?
Proposal: Add text that says server MAY support HTTP/2
not sure we need to say anything about HTTP/2
closed in draft 15
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)".
The following figure shows the system components if a RESTCONF server is co-located with a NETCONF server:
The following figure shows the system components if a RESTCONF server is implemented in a device that does not have a NETCONF server:
So we don't use the datastores defined in NETCONF, but datastore concepts. See next point.
Section 1.2: RESTCONF does not need to mirror the full functionality of the NETCONF protocol, but it does need to be compatible with NETCONF. RESTCONF achieves this by implementing a subset of the interaction capabilities provided by the NETCONF protocol, for instance, by eliminating datastores and explicit locking.
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...
section 3.x
The API resource contains the entry points for the RESTCONF datastore and operation resources.
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
Section 3.5.1, editorial:
container top { list list1 { key "key1 key2 key3"; ... list list2 { key "key4 key5"; ... leaf X { type string; } } } leaf-list Y { type uint32; } }
For the above YANG definition, a target resource URI for leaf "X" would be encoded as follows (line wrapped for display purposes only):
/restconf/data/example-top:top/list1=key1,key2,key3/ list2=key4,key5/X
....
Mentions that "container top" is part of the example-top YANG data model
section 3.5.2.
If the target of a GET method is a data node that represents a leaf that has a default value, and the leaf has not been configured yet, the server MUST return the default value that is in use by the server.
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.
section 4.8.4 The format of this parameter is an XPath 1.0 expression, and is evaluated in the following context: o The set of namespace declarations is the set of prefix and namespace pairs for all supported YANG modules, where the prefix is the YANG module name, and the namespace is as defined by the "namespace" statement in the YANG module.
o The function library is the core function library defined in XPath 1.0.
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:
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.
method entry resource query fragment
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
5.4
Each message represents some sort of resource access. An HTTP "status-line" header line is returned for each request. If a 4xx or 5xx range status code is returned in the status-line, then the error information will be returned in the response, according to the format defined in Section 7.1.
Why only 4xx and 5xx?
Section 8 container operations { description "Container for all operation resources (application/yang.operation),
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
Appendix D.1, editorial
The client may start by retrieving the top-level API resource, using the entry point URI "{+restconf}".
If this is a typical operational example, I guess you want to start by retrieving: GET /.well-known/host-meta HTTP/1.1
D.3.3 I guess this request should not report the module-set-id?
GET /restconf/data?fields=ietf-yang-library:modules-state/ module(name;revision) HTTP/1.1
...
{ "ietf-yang-library:modules-state": { "module-set-id": "cb4c422111a779e1eed55bffc8d6b46a3a0999e2", "module": [
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?
[] in json encoding of list. For example, PUT /restconf/data/example-jukebox:jukebox/ library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1 Host: example.com Content-Type: application/yang.data+json
{ "example-jukebox:album" : { "name" : "Wasting Light", "genre" : "example-jukebox:alternative", "year" : 2011 } }
Don't we need [] for the album list?
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)