Re: [netmod] choice mandatory case mandatory

tom petch <ietfc@btconnect.com> Fri, 01 May 2020 11:14 UTC

Return-Path: <ietfc@btconnect.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 33FD83A0F18 for <netmod@ietfa.amsl.com>; Fri, 1 May 2020 04:14:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H2=-0.82, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=btconnect.onmicrosoft.com
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 HeNkanrQEXqK for <netmod@ietfa.amsl.com>; Fri, 1 May 2020 04:14:03 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2109.outbound.protection.outlook.com [40.107.20.109]) (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 96B443A0F11 for <netmod@ietf.org>; Fri, 1 May 2020 04:14:02 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5gjYs+8ERXocd59NpSYmMukRcYAEZai2vQkexU6hbGivN4/0g2t+KsOJA6ckEX+4rjxd/A3QhofntpFK0zsb/39tgds6wm5guMM2tbGFojvUHR2nJllQZW8FvtiHETGB6CiGySAV9/a/YNjZsbFnDmnEQv2Bu4GbRb0dUi5ak2HQ4Q+SdX+7y4QPjsHiDJWGrGMrLQ3im4rZ8htDjwzhiNWtT9Yt93H4uHBTw1lfiMeH4ZfHpEMI/yyafTTj4J8n2Uc0Mzj0Ao/qYLfIyRoDdZ7ptnD8DmhXz8vL6ApzY/CAe+uO7uoVtG0pIoAcy7gT6Phtv0uUX8OvPzIFcorVQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kWSSnXmmYkmyqhdD4AMlqH1DA1WZhFQu0Z9uPD9cgAU=; b=ZLAhOtdNEqj7Xod7s1SBM/028EdpKl3Ye73c6JEKq4zZSPO+d2sZhI9eIZO7DLhmWuZMFy3bFH9kM+sMkQgipf/m7CB/lu8mmyjZ4TOartXdmynlTXCrMK/ju6Igt3d5VOIeuLIjbuDbu94baXQHHKr46vwVXxCjz7fyAVQxPZrh8O0ziOSXUxq0AfDZCwgQyBekeF1pC8Wp0JHzaDQqDeoxDDhcTCDuqn1JHUFDfhxd+iCQEc0VJKKqTW1yz7pA/5LlNj/1OYo4VvgaFv/CqZb2XYsZO4obLkQGF0smVOUZQ8DpHA8R7l0U8nunKdCK9D9xI7dza1JE5L2Rzsjt7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=btconnect.com; dmarc=pass action=none header.from=btconnect.com; dkim=pass header.d=btconnect.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btconnect.onmicrosoft.com; s=selector2-btconnect-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kWSSnXmmYkmyqhdD4AMlqH1DA1WZhFQu0Z9uPD9cgAU=; b=srzU9rl0Fxy2cXiEapoFDL/PRFHfrk6c0KEG1Hze8X1u1bQOEpHzJPkyguZ4ulfYBL3Qj7KhB70jAVU/Vr4S9jmSpXx3dNpVmJwRQK/NuiDh8Re0Cc+0r3LhmSGcWXhpxXVfD0h7CFAX9UeQGpqEVXpxcS06q40PCIXr+dDTL3k=
Received: from DB7PR07MB4522.eurprd07.prod.outlook.com (2603:10a6:5:34::23) by DB7PR07MB5323.eurprd07.prod.outlook.com (2603:10a6:10:67::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.11; Fri, 1 May 2020 11:14:00 +0000
Received: from DB7PR07MB4522.eurprd07.prod.outlook.com ([fe80::1980:df3f:5436:3e6d]) by DB7PR07MB4522.eurprd07.prod.outlook.com ([fe80::1980:df3f:5436:3e6d%5]) with mapi id 15.20.2958.019; Fri, 1 May 2020 11:14:00 +0000
From: tom petch <ietfc@btconnect.com>
To: =?iso-8859-1?Q?Martin_Bj=F6rklund?= <mbj+ietf@4668.se>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] choice mandatory case mandatory
Thread-Index: AQHWH5wO67cAF/+Q1Em5WVwSxqSjUaiTDe0AgAAEM1s=
Date: Fri, 1 May 2020 11:14:00 +0000
Message-ID: <DB7PR07MB4522E8EF5C10F662C70C2614A0AB0@DB7PR07MB4522.eurprd07.prod.outlook.com>
References: <6D4B643D-3264-4B00-A993-A140F5C54F30@cisco.com> <20200428160140.xzmqxf6c3u47ce7m@anna.jacobs.jacobs-university.de> <DB7PR07MB4522606C24F0A91C89B78E66A0AB0@DB7PR07MB4522.eurprd07.prod.outlook.com>, <20200501.125214.1680672299672620160.id@4668.se>
In-Reply-To: <20200501.125214.1680672299672620160.id@4668.se>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: 4668.se; dkim=none (message not signed) header.d=none;4668.se; dmarc=none action=none header.from=btconnect.com;
x-originating-ip: [81.131.229.19]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: be6830e5-2543-4019-9c6b-08d7edc0bfe8
x-ms-traffictypediagnostic: DB7PR07MB5323:
x-microsoft-antispam-prvs: <DB7PR07MB532389B89326794A0ECA6859A0AB0@DB7PR07MB5323.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0390DB4BDA
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Y1znmEQRWh+f55Ak/5ho1CJ5+0YkDDB91GEC5iTu0YOnbtMAoRbvv+CFFpn3CNffEb1gfm1Rh8lRUYCpTvVqpimaUf4aK3/AuCEZyco2gM0ejuW6Ao7eYD7No51nSA0HQDnSKmY48MFTP5c9pHdmDQW79jz7pf5fpGTvLaxcwyl/j2jhNvwLNAl/DgpA0qLpzxrpxMxA7fqjnpBul00EOwwGLZm9W69ry0/fB7nUDL671GuPDuPJRl62zpTGDOh3oUoBQVGhF0smD/zIGTr0vIJDXhqmFJOpDoJicIQpCctsZ/ZBJ9ofVRSOz937SthUDEn7UCK0r70c0ZCPU5A4AsyMH18rbQhG1K8xOWWhrvjmKF0UNgTHUqVkk4rVRYhbKsb/T0w6NizJqemgvO01aCWoOcZmDmL6/pFpPThZuFkbqr5iViwGTyFUix7qj1nx
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR07MB4522.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(136003)(376002)(39860400002)(366004)(396003)(346002)(5660300002)(71200400001)(55016002)(66574012)(2906002)(66946007)(33656002)(52536014)(91956017)(76116006)(66476007)(66446008)(9686003)(64756008)(4326008)(66556008)(86362001)(7696005)(8676002)(6506007)(8936002)(26005)(316002)(478600001)(186003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: GcUBj9Rc/NPJalhWpYYauan/DVJ68C7YJWzs74IRxBNodi/A4XcpxpM8ZVHMvvggcKPjfRgjy4vruZTTAz5p6tnO64L3k7tzM1Oh8Zd3UhkDIr82L6vR4dXHVXda5MD5f1+STQe/1nvFFYslxbr5Q5ynYQnCcUEH1NJlICuqdqVNooFNtkmYtDrWgPLlIwyXF1DhgzRd88n6mgENcHILqBKyvx6xOPeZt5QsVfbRoAYxbFm1r5sva3f8m/TPnC+hiROtfoAYWvkSKrLpIVRPsecY91iOnXYpgTCZTLvy5HXfwkY8LEJZaghlXfEp64lVUr1Rj/c89BZuCd3xDD/cV99uAjQBxodORaKivXdcwLNm8edeY16oXEK1yoKbCkJ9UolacXDoLrlJo/7QVVkD1vT5yhWq9IcG9ALG1iB39TxGwccorI4Vkxze9d4gCOAq1RuYBwm/RE3SgKYWsr9G8dFl5rQ3195IPNAU3zPHZ5RJapfJYuajfn4+aYAs82Sgj1BFe24Lvfobj9yjeiTxv7tRzdoAiJwipSD5yoMLORaRhU9oPSVfseq3QnX1fewLO5G/Me62G1R4Hhk2PDV6tCIM2qgCiBxV9FG89ycijJSWB7XyEePkX+wSjQwGsU0gF8129WdbZx4KHrTIT/39RW8ucecWz6vlF0RiTLDFq0BbjZz+E+4Hsr3QgaAz8BIkk2IDVvuMrRVdvSVqZt1yqd/pzsAINuX9N+gItFqwBN0akvJm18Vf2hWwZ1o5+KSD54WzXbHLm3DmEXBz83ne0k9H8ByKBpvL2jKrR/nmXh0=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: btconnect.com
X-MS-Exchange-CrossTenant-Network-Message-Id: be6830e5-2543-4019-9c6b-08d7edc0bfe8
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2020 11:14:00.3801 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: cf8853ed-96e5-465b-9185-806bfe185e30
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Lgj9IAY33teM36yxK4T7m3k6nLFwfT99RhESpH1tqj/KQ/3JD6gKdqLODLm+CQLCaddTlLCs686vOGy45cD3Ug==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB5323
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/rOV6fRtr1-U8QAFimw31lO9Elxg>
Subject: Re: [netmod] choice mandatory case mandatory
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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, 01 May 2020 11:14:05 -0000

From: Martin Björklund <mbj+ietf@4668.se>
Sent: 01 May 2020 11:52

tom petch <ietfc@btconnect.com> wrote:
> given
> rpc tunnels
>   input
>     container tunnel
>       choice filter
>          mandatory true

This means that some node from some case must be present.

>          case all
>            leaf all
>            mandatory true

I assume that this mandatory is inside "leaf all".  This means that if
this case is selected (i.e., at least some node from the case is
present), then this leaf must be present as well.

>           case one
>               leaf justone
> what does mandatory do?  I could understand one mandatory or three
> mandatory but struggle to see the point of two.

You need to look at complete model for the choice to see if it makes
sense or not.

<tp>
Thanks for that.
Yes, what I give is the entire RPC as far as data nodes go (which I meant to mention) so it seems to me that the second mandatory is not needed unless the expectation is that the first case will be augmented with other nodes which then need not be present.   The aim is to either act on one or act on all of a list, tunnels in this case, which is quite common in routing YANG modules but I have not seen this pattern before and wondered what I was missing.  I think the answer is nothing!

Tom Petch





>
> Something like this is in draft-ietf-teas-yang-te


/martin