Subject: [Netconf] YANG-API comments

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 8 Apr 2013 13:03:43 +0200

Hi,

I think YANG-API is an important work because it uses concepts and technologies that are widely deployed and well-known to both developers and admins. Here are my comments:

1. There might actually be use cases for two different APIs:

  (i) a limited but truly RESTful API with opaque URIs and only the basic HTTP methods;

 (ii) a sophisticated API, with a functionality comparable to NETCONF, where the client knows the data model and is expected to construct URI.

API (i) would be suitable for browsers whereas (ii) would require a specialized client app utilising HTTP PATCH for editing configurations.

2. In PUT, POST and PATCH, the name of the target node appears both in the URI and in request contents. What if they are not the same? Maybe the member name in the contents could be generic, e.g. "value".

3. I think that using the "insert" and "point" parameters with PUT violates idempotency, which is a required property of the PUT method. The example request in sec. 3.8.5 is certainly not idempotent.

4. The use of JSON Patch with HTTP PATCH is IMO worth investigating. One scenario could be to have only datastores as resources, and YANG data nodes inside them would be addressed using "path".  

Lada

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C