[netmod] Y34: use cases for anydata

Andy Bierman <andy@yumaworks.com> Fri, 23 January 2015 17:11 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 34AB31A1AD0 for <netmod@ietfa.amsl.com>; Fri, 23 Jan 2015 09:11:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.979
X-Spam-Level:
X-Spam-Status: No, score=-1.979 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yoT9Q_T_OOTk for <netmod@ietfa.amsl.com>; Fri, 23 Jan 2015 09:11:10 -0800 (PST)
Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 774A91A1AC9 for <netmod@ietf.org>; Fri, 23 Jan 2015 09:11:09 -0800 (PST)
Received: by mail-la0-f42.google.com with SMTP id ms9so12276lab.1 for <netmod@ietf.org>; Fri, 23 Jan 2015 09:11:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=oQbBIhfTU8tBwkToODbSDHA+yiuPZmM1l/uozuoiv8k=; b=dSEZmlwX+tdi4rVsKXw4S5wkulMe9ZfjEVCNDZdYxeQaEMJjS7zLJq48SThNe/IKpQ 7Yu3oZuF4XnMSCtY7PauB5o/svAwWOezYv6DWis0uvkuoQhPXIjbh/GP+RIDwQb+gNZF Vv76qtcpV6M8IZDAJYkikMxnFpDNDRLZYcZIIleZv5l2Mrm7Mu3LULaoifHQ6L3DvePa eEK/mB7BoYoyPR7JGB+MPLkhAcokwEKM8YjpJ2g9R8SjpOA7lsY3sC6z5OmRflCLmvjU isK6Eo6R/Kucjp5g42uagLN/PhXLd4INT50udvPi+84y4gO0bH7kDxX6YUpAOx2AgDki +nww==
X-Gm-Message-State: ALoCoQnkOV5u2fYoPMv1CqIg/b7APmD1hQyO1EhsSfJwUmapnBVdi5I1zKBLujolZHhBfDnN3HBl
MIME-Version: 1.0
X-Received: by 10.152.204.40 with SMTP id kv8mr8082299lac.42.1422033068006; Fri, 23 Jan 2015 09:11:08 -0800 (PST)
Received: by 10.112.160.41 with HTTP; Fri, 23 Jan 2015 09:11:07 -0800 (PST)
Date: Fri, 23 Jan 2015 09:11:07 -0800
Message-ID: <CABCOCHSQyC0thNLjQvGOane4K71=FY3Um9XZ2s6EYAD_M-av7g@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/w9ZvdpKP5bFfYv_QuSw7XkX-3w4>
Subject: [netmod] Y34: use cases for anydata
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Jan 2015 17:11:11 -0000

Hi,

Sometimes it helps to agree on the actual problems that
need to be solved, before we endlessly debate solutions.
I can only think of 4 use case classes for anydata.


Use case 1: root
-----------------------
Description: The anydata node MUST be a container (JSON object)
and the child nodes MUST be top-level YANG data nodes
supported by the server (i.e., TL-nodes defined in the YANG modules
advertised by the server)

Context: rpc/input and rpc/output

Examples: edit-config <config> node, get-config <data> node


Use case 2: fixed unknown schema node
-------------------------------------------------------
Description: The anydata node MUST be a container (JSON object)
and the child nodes MUST be instances of a specific YANG.
data-def-stmt, which does not have to be a TL-node.
The specific YANG object is not known to the server.

Context: data-model dependent; could be abstract data structure,
notification, operational data

Examples: A pass-through application such as a logger


Use case 3: fixed known schema node
-----------------------------------------------------
Description: The anydata node MUST be a container (JSON object)
and the child nodes MUST be instances of a specific YANG.
data-def-stmt, which does not have to be a TL-node.
The specific YANG object is known to the server
in some ad-hoc out-of-band manner.  No machine-readable
base YANG statements indicate the actual schema node.

Context: data-model dependent; could be abstract data structure,
notification, operational data

Examples: YANG Mount


Use case 4: dynamic schema node
-------------------------------------------------
Description: The anydata node MUST be a container (JSON object)
and the child nodes MUST be instances of any YANG.
data-def-stmt, which does not have to be a TL-node.
The specific YANG object may be known to the server
in some ad-hoc out-of-band manner.  No machine-readable
base YANG statements indicate the actual schema node.

Context: rpc/input, rpc/output, ???

Examples: YANG Patch


Summary
--------------
In each case, it should be OK to encode simple nodes as strings
and complex nodes as containers. The end consumer that is
expected to know the correct schema can convert from the
string to the correct YANG type.  There are corner cases
such as instance-identifier and QNames (e.g., identityref),
but I think these can also be handled correctly if specified
in the netmod-yang-json (and metadata) drafts in enough detail.



Andy