Assume the following.

module base-class {
   prefix base;
   container base {
      leaf a;
      leaf b;
      leaf c;
   }
}

module augment-base {
  prefix aug;
  import base-class { prefix base; }

  augment '/base:base'{
    leaf d;
  }
}

module base-deviation {
  prefix base-dev;

  deviation "/base:base" {
    deviate add {
      must "./aug:d" {
        error-message "A value for d must be present when configuring
augmented base";
      }
    }
  }

Best regards - Vriendelijke groeten,
Bart Bogaert
Broadband-Access System Architect Data
Contact number +32 3 2408310 (+32 477 673952)

NOKIA
Copernicuslaan 50, 2018 Antwerp, Belgium
Fortis 220-0002334-42
VAT BE 0404 621 642 Register of Legal Entities Antwerp

<<
This message (including any attachments) contains confidential information
intended for a specific individual and purpose, and is protected by law. If
you are not the intended recipient, you should delete this message. Any
disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited without the prior consent of its
author.
>> 

-----Original Message-----
From: Juergen Schoenwaelder [mailto:[email protected]] 
Sent: 28 November 2016 12:09
To: Bogaert, Bart (Nokia - BE) <[email protected]>
Cc: [email protected]
Subject: Re: [netmod] Mandatory leafs via augment

On Mon, Nov 28, 2016 at 10:42:42AM +0000, Bogaert, Bart (Nokia - BE) wrote:
> 
> How can we achieve the same if no when-clause can be constructed but 
> we still would like to have a leaf to be mandatory.  One way we 
> thought of achieving this is
> 
> -          have a YANG module defining the augmented data
> 
> -          construct a must statement on the object being augmented where
we
> check that something needs to be present that is added via a deviation.
> 

An example may help here...

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to