Typedef for struct in Yang

Hi Conny,

I have a structure like below.

  1. First i want to define a struct in yang.
  2. Typedef struct with some name
  3. Use the typedefed struct as an type inside leaf-list

To make it more clear i want to define a leaf-list of type struct.

Struct A
int a;
int b;

Harish P

Hi Harish,
Have you reviewed the “YANG manual” , i.e. RFC 7950 https://tools.ietf.org/html/rfc7950#section-7.7 ?
For example the leaf-list statement is covered in detail there together with some nice examples.

For your struct use-case I would use a list with two keys:.

    list structA {
      key "a b";
      leaf a {
        type int32;
      leaf b {
        type int32;