Subject: [netmod] empty choice

From: Martin Bjorklund <[email-masked]>
Date: Fri, 08 Aug 2008 22:25:23 +0200 (CEST)

Hi,

The following example reminds me of a detail with choice:

Phil Shafer <[email-masked]> wrote:
> But this suddenly looks just like a normal RPC.  If you had:
> 
>     rpc shutdown {
>         choice target {
>             // placeholder
>         }
>         leaf mode {
>             ...
>         }
>     }
> 
> then your module can augment this RPC as needed.

Currently, we have a CLR which says that there must be at least one
case in a choice.  Thus, the example above is not legal YANG.
Instead, you have to do:

  rpc shutdown {
      choice target {
          case dummy {
              description "Must not be instatiated.";
              leaf dummy { type string; }
          }
      }
      ...
  }

I would like to remove the current rule and allow an empty choice.

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

---

From: Andy Bierman <[email-masked]>
Date: Fri, 08 Aug 2008 13:36:46 -0700

> I would like to remove the current rule and allow an empty choice.

I do not mind the change, but this seems strange to me.
By itself, inline, this RPC method is nonsense.  Unless
it gets augmented externally, there is no target.
How does the inline RPC description clause document
the parameters?  Just add enough examples so readers
understand what to do.

I prefer function calls where the parameters are more stable.
I would probably use an XPath target if I wanted a generic
shutdown-object function.

> /martin

Andy

---

From: Phil Shafer <[email-masked]>
Date: Sat, 09 Aug 2008 17:07:55 -0400

>case in a choice.  Thus, the example above is not legal YANG.

Yup, this was my "//placeholder".

>I would like to remove the current rule and allow an empty choice.

Completely agree.

Thanks,
 Phil