Re: [yang-doctors] YANG must statement constraints

Ladislav Lhotka <ladislav.lhotka@nic.cz> Fri, 19 March 2021 15:08 UTC

Return-Path: <ladislav.lhotka@nic.cz>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 04A203A182C for <yang-doctors@ietfa.amsl.com>; Fri, 19 Mar 2021 08:08:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, 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=nic.cz
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 B_uKvr7FYf9L for <yang-doctors@ietfa.amsl.com>; Fri, 19 Mar 2021 08:08:29 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (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 2BBA83A182A for <yang-doctors@ietf.org>; Fri, 19 Mar 2021 08:08:29 -0700 (PDT)
Received: from [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8] (unknown [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8]) by mail.nic.cz (Postfix) with ESMTPSA id DC0A1140A71; Fri, 19 Mar 2021 16:08:25 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1616166506; bh=L9v9z73izwoWtaVWSYPDeyvB+NjI8jmZ6Gu1YLEa230=; h=To:From:Date; b=VUPaqwOGPtUM9quIqBHrnwr56HWGVJuxVgMVYbM92yZmptBu0uw/CM2oUBoE3ChtW VJrtH1V9eUtcCvBkrbCHXPiY1p5/tMHldqGjAujVxMpDcCjtRUDBdVvO6tlKVNcMNf hw4p4ZRkRKGU47nQ1g0FN5DHwONSzNZQ9I1lqNvE=
To: "Acee Lindem (acee)" <acee=40cisco.com@dmarc.ietf.org>, YANG Doctors <yang-doctors@ietf.org>
References: <27FBDC6F-0D23-4D18-9764-42E4F1826952@cisco.com>
From: Ladislav Lhotka <ladislav.lhotka@nic.cz>
Organization: CZ.NIC
Message-ID: <4c68b8ea-dad7-5097-7b31-09045463da5d@nic.cz>
Date: Fri, 19 Mar 2021 16:08:25 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1
MIME-Version: 1.0
In-Reply-To: <27FBDC6F-0D23-4D18-9764-42E4F1826952@cisco.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.102.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/zhmU79-K0yRFSUXdq0Df8U7llO8>
Subject: Re: [yang-doctors] YANG must statement constraints
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 19 Mar 2021 15:08:31 -0000

Hi Acee,

On 19. 03. 21 15:25, Acee Lindem (acee) wrote:
> When the constraint references a non-key leaf in a list, do all members
> of the list have to satisfy the constraint or only one of the list entries?

It depends on how the constraint is written.

If you have e.g.

    must "list/non-key-leaf = 42";

then it is sufficient that at least one instance on non-key-leaf exist
with that value. In contrast,

    must "not(list/non-key-leaf != 42)";

requires all instances to have that value.

Lada

> 
>  
> 
> Thanks,
> Acee
> 
> 
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
> 

-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67