Re: [core] content-formats for cbor YANG
peter van der Stok <stokcons@xs4all.nl> Thu, 20 April 2017 14:36 UTC
Return-Path: <stokcons@xs4all.nl>
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 85A9F131486 for <core@ietfa.amsl.com>; Thu, 20 Apr 2017 07:36:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.621
X-Spam-Level:
X-Spam-Status: No, score=-2.621 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 UFSjFswZ0Cmh for <core@ietfa.amsl.com>; Thu, 20 Apr 2017 07:36:52 -0700 (PDT)
Received: from lb3-smtp-cloud2.xs4all.net (lb3-smtp-cloud2.xs4all.net [194.109.24.29]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B086B13147F for <core@ietf.org>; Thu, 20 Apr 2017 07:36:51 -0700 (PDT)
Received: from webmail.xs4all.nl ([IPv6:2001:888:0:22:194:109:20:204]) by smtp-cloud2.xs4all.net with ESMTP id Aeco1v00Q4CWAV301ecoUH; Thu, 20 Apr 2017 16:36:49 +0200
Received: from 2001:983:a264:1:2149:777c:6426:3c87 by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Thu, 20 Apr 2017 16:36:48 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Date: Thu, 20 Apr 2017 16:36:48 +0200
From: peter van der Stok <stokcons@xs4all.nl>
To: Michel Veillette <Michel.Veillette@trilliantinc.com>
Cc: Carsten Bormann <cabo@tzi.org>, peter van der Stok <consultancy@vanderstok.org>, Core <core@ietf.org>
Organization: vanderstok consultancy
Reply-To: consultancy@vanderstok.org
Mail-Reply-To: consultancy@vanderstok.org
In-Reply-To: <BN6PR06MB230807D8EF9B69A473254077FE1B0@BN6PR06MB2308.namprd06.prod.outlook.com>
References: <c2b6fb6e92c6a5680e544963e88d5fa7@xs4all.nl> <09BD739F-89A1-4DA7-9006-E30AEAEE581E@tzi.org> <BN6PR06MB230807D8EF9B69A473254077FE1B0@BN6PR06MB2308.namprd06.prod.outlook.com>
Message-ID: <063c4a22d221667a92b180e5dce7ea1f@xs4all.nl>
X-Sender: stokcons@xs4all.nl
User-Agent: XS4ALL Webmail
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/nd1hGu4L-2gGBcPjdXtJm5HKHPQ>
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 14:36:55 -0000
Hi Michel, The semantics of the PUT and GET specify that the payload replaces (represents) the whole payload. Applying PUT semantics to a PATCH payload has as consequence that you loose unintentionally large parts of the resource. A different content-format signals this semantics difference. The FETCH payload may contain only an array of YANG-CBOR identifiers and each identifier represents GET semantics Not all CBOR documents represent YANG to CBOR mappings, that's why the content format application/yang-data+cbor is proposed equivalent to application/yang-data+json. Does that help? Peter Michel Veillette schreef op 2017-04-20 15:40: > Hi Peter, Hi Carsten > > The following table summarizes the different payload uses by CoMI. > 'value' is defined in > https://tools.ietf.org/html/draft-ietf-core-yang-cbor-04#section-4 > 'instance-identifier' is defined in > https://tools.ietf.org/html/draft-ietf-core-yang-cbor-04#section-5.13.1 > > Use Case | Request payload | > Response payload > ----------------------------------+-----------------------------------------+---------------------------------------- > GET /c/instance-identifier | na > | value > PUT /c/instance-identifier | value > | na > POST /c/instance-identifier | value > | na > DELETE /c/instance-identifier | na > | na > GET /c | na > | CBOR array (instance-identifier, value) > PUT /c | CBOR array (instance-identifier, > value) | na > POST /c | CBOR array (instance-identifier, > value) | na > FETCH /c | CBOR array (instance-identifier) > | CBOR array (value) > iPATCH/c | CBOR array (instance-identifier, > value) | na > POST /c/instance-identifier (RPC) | value > | value > GET /s (Notification) | value or CBOR array (value) > | na > > As you can see, the payload of a iPATCH /c request have the same > format a PUT /c request, POST /c request and GET /c response. > What will be the rational to use a different Content-Format for the > iPATCH? > Can we simply use (Content-Format: application/cbor) in all cases? > > Quick note, draft-ietf-core-yang-cbor don't propose any > Content-Format, this is left to draft-ietf-core-comi. > > Regards, > Michel > > -----Original Message----- > From: core [mailto:core-bounces@ietf.org] On Behalf Of Carsten Bormann > Sent: Thursday, April 20, 2017 4:55 AM > To: peter van der Stok <consultancy@vanderstok.org> > Cc: Core <core@ietf.org> > Subject: Re: [core] content-formats for cbor YANG > > >> On Apr 20, 2017, at 10:46, peter van der Stok <stokcons@xs4all.nl> >> wrote: >> >> Hi Core, >> >> Following the discussion on CoMI content-formats during ietf98, I want >> to propose the following; >> >> 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 >> >> Looking forward to alternative proposals or noises of approval. > > Sounds very good to me. > > Grüße, Carsten > > _______________________________________________ > core mailing list > core@ietf.org > https://www.ietf.org/mailman/listinfo/core
- Re: [core] content-formats for cbor YANG Carsten Bormann
- [core] content-formats for cbor YANG peter van der Stok
- Re: [core] content-formats for cbor YANG Michel Veillette
- Re: [core] content-formats for cbor YANG Carsten Bormann
- Re: [core] content-formats for cbor YANG Andy Bierman
- Re: [core] content-formats for cbor YANG Michel Veillette
- Re: [core] content-formats for cbor YANG peter van der Stok
- Re: [core] content-formats for cbor YANG peter van der Stok
- Re: [core] content-formats for cbor YANG Michel Veillette
- Re: [core] content-formats for cbor YANG Carsten Bormann
- Re: [core] content-formats for cbor YANG peter van der Stok
- Re: [core] content-formats for cbor YANG Carsten Bormann
- Re: [core] content-formats for cbor YANG Michel Veillette
- Re: [core] content-formats for cbor YANG peter van der Stok