Subject: Re: [netconf] Netconf Query

From: Martin Bjorklund <[email-masked]>
Date: Mon, 17 Feb 2020 15:57:14 +0100 (CET)

Hi,

"Mahendra Gangaiah (mgangaia)" <[email-masked]> wrote:
> Hi all,
> 
> Can you please help me out with the below query.
> 
> The below netcon payload is intended to create a layer 2 trunk port
> and add allowed vlans 10 to 20 on that interface
> 
>   <edit-config>
>     <target>
>       <running/>
>     </target>
>     <config>
>       <interfaces >
>         <interface>
>           <name>eth1/10</name>
>           <ethernet>
>             <switched-vlan>
>               <config>
>                 <interface-mode>TRUNK</interface-mode>
>                 <trunk-vlans>10..20</trunk-vlans>
>               </config>
>             </switched-vlan>
>           </ethernet>
>         </interface>
>       </interfaces>
>     </config>
>   </edit-config>
> 
> 
> Based on the yang model definition, trunk-vlans is defined as below.
> 
> 
> leaf-list trunk-vlans {
>       when "../interface-mode = 'TRUNK'" {
>         description
>           "Allowed VLANs may be specified for trunk mode
>           interfaces.";
>       }
> 
> Question:
> ==========
> When the above payload is pushed using netconf,
> Does the expression in the when statement defined in the model for an
> object refers to data in the datastore context, or data in the request
> context or can be either.
> Can the netconf request include both the change to the configuration
> that satisfies the when expression and changes to elements that are
> enabled by that same when expression ?
> Should the above payload work ?

Yes it should work; the request sets the interface-mode to "TRUNK"
which makes 'trunk-vlans' valid.

/martin

---

From: "Mahendra Gangaiah (mgangaia)" <[email-masked]>
Date: Mon, 17 Feb 2020 15:41:38 +0000

Thanks a lot, Martin.

Thanks,
Mahendra

-----Original Message-----
From: Martin Bjorklund <[email-masked]> 
Sent: Monday, February 17, 2020 6:57 AM
To: Mahendra Gangaiah (mgangaia) <[email-masked]>
Cc: [email-masked]
Subject: Re: Netconf Query

Hi,

"Mahendra Gangaiah (mgangaia)" <[email-masked]> wrote:
> When the above payload is pushed using netconf, Does the expression in 
> the when statement defined in the model for an object refers to data 
> in the datastore context, or data in the request context or can be 
> either.

/martin