Re: [core] content-formats for cbor YANG

Carsten Bormann <cabo@tzi.org> Thu, 20 April 2017 16:39 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C90D7129B1A for <core@ietfa.amsl.com>; Thu, 20 Apr 2017 09:39:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
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 pLai-H4c8uT1 for <core@ietfa.amsl.com>; Thu, 20 Apr 2017 09:39:01 -0700 (PDT)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4443D129B00 for <core@ietf.org>; Thu, 20 Apr 2017 09:39:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost.informatik.uni-bremen.de [134.102.201.11]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id v3KGcwps006934; Thu, 20 Apr 2017 18:38:58 +0200 (CEST)
Received: from [192.168.217.113] (p5DC7F3A7.dip0.t-ipconnect.de [93.199.243.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (Postfix) with ESMTPSA id 3w84M61D1NzDHTw; Thu, 20 Apr 2017 18:38:58 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <BN6PR06MB2308B088FCC1DE8AD1370C4FFE1B0@BN6PR06MB2308.namprd06.prod.outlook.com>
Date: Thu, 20 Apr 2017 18:38:57 +0200
Cc: peter van der Stok <consultancy@vanderstok.org>, Core <core@ietf.org>
X-Mao-Original-Outgoing-Id: 514399137.549681-721ac9b128c7c734322ce7703627903a
Content-Transfer-Encoding: quoted-printable
Message-Id: <102478F5-703D-46C0-9A0B-A21454F940DB@tzi.org>
References: <c2b6fb6e92c6a5680e544963e88d5fa7@xs4all.nl> <09BD739F-89A1-4DA7-9006-E30AEAEE581E@tzi.org> <BN6PR06MB230807D8EF9B69A473254077FE1B0@BN6PR06MB2308.namprd06.prod.outlook.com> <063c4a22d221667a92b180e5dce7ea1f@xs4all.nl> <BN6PR06MB2308B088FCC1DE8AD1370C4FFE1B0@BN6PR06MB2308.namprd06.prod.outlook.com>
To: Michel Veillette <Michel.Veillette@trilliantinc.com>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/oUCAdu53KbpUaYNfyauCFD3Q8XQ>
Subject: Re: [core] content-formats for cbor YANG
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 20 Apr 2017 16:39:03 -0000

> On Apr 20, 2017, at 18:21, Michel Veillette <Michel.Veillette@trilliantinc.com> wrote:
> 
> Hi Peter
> 
> It still unclear to me what is the role of the CoAP method vs. the role of the Content-Format.
> The PUT, POST and iPATCH methods all share the same payload (i.e. CBOR array (instance-identifier, value)).
> 
> - In the case of the PUT, the existing datastore is deleted and replaced by the provided payload.
> - In the case of the POST, a new datastore is created with the provided payload.
> - In the case of the iPATCH, the existing datastore is updated based on the provided payload.
> 
> For these three use cases, the method defines what to do with the payload, not the Content-Format.
> My question is why iPATCH required a different Content-Format when PUT and POST use the same?

That is a good question.

We definitely need a different format for the FETCH request body, which is a list of IDs, not a set of ID-value pairs.  (We used to have this argument whether the response should be just a list of values or that set; I think we are now at the set selected, which is strictly speaking a bit different from the representation of the whole resource.)

The body of an (i)PATCH is different in meaning, not in structure, from the representation bearing formats.  It is a bit of a taste thing whether we attach media types to semantics or to structural interoperability.

I didn’t have a problem with Peter’s original proposal:

> Draft-ietf-core-yang-cbor deines the content-format application/yang+cbor which defines CBOR documents which contain the results of the mapping of a YANG document to CBOR as specified in the draft.
> 
> Draft-ietf-core-comi defines two additional content-formats:
> 1) application/yang-fetch+cbor that specifies the contents and semantics of a FETCH CoMI request payload
> 2) application/yang-patch+cbor that specifies the contents and semantics of a PATCH CoMI request payload

Just calling the thing application/cbor just tells us the serialization format, by the way; this is a bit like sending text/html as text/plain because any text also is structurally compatible with the latter.

Andy’s argument that yang-patch is taken for the different yang-patch format used with XML/JSON is a good one.  Note that there is no coap in the comi patch format either, so I don’t like application/coap-patch+cbor.  Right now I’m favoring application/yang-set+cbor.

Grüße, Carsten