cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
743
Views
0
Helpful
0
Replies

action present on some entry of a list

mfontane
Cisco Employee
Cisco Employee

Hi all.

 

I have an action in a list

I would like to have this action present only in certain entry of this list.

The entry are already implemented to show some configuration depending of a certain when.

I insert the action within one of this when expecting to see that action only when the condition is true.

But, actually, what I see is that the action is present on all the entry, but the leaf are those are expected by the condition when.

 

here the part of yang

 

list module {

        key slot;

 

        leaf slot {

          type cet:slot-t;

        }

        uses module-content;     

      }

 

  grouping module-content {

 

    uses card-type-grp {

      when "condition rule";          

    }

 

    uses ppm-type-grp {

        when "condition rule";          

    }        

 

    uses passive-shelf-grp {

      when "condition rule";          

    }

  }

 

grouping card-type-grp {

     leaf module-type {

       type identityref {

         base cet:card-type;

       }

       mandatory true;

                

     

 

     leaf card-mode {

       type identityref {

         base cet:card-mode;

       }

       description "Card mode applicable to TXP/MXP module";

     }

     

     uses ncs2k-module-act:module-actions;               

  }

 

  grouping ppm-type-grp {

    leaf ppm-module-type {

      type identityref {

         base cet:ppm-type;

      }

      mandatory true;

      description "Module type for PPM";

    }

 

    leaf parent-module {

       type leafref {

         path "../../module/slot";

       }

       must "deref(current())/../module-type";       

       mandatory true;

       description "Parent module, valid in case of ppm only";

    }

  }

 

  grouping module-actions {

    container commands {      

    

        tailf:action soft-reset {

        description "Action to do a software reset on a card ";

        tailf:actionpoint ncsinternal {

          tailf:internal;

        }

        input {

        }

        output {

          uses cct:rpc-status;

        }

                

      }

    }

    

  }

 

Using the Model Browser, the soft-reset is present both on Card and PPM page, but the other leaf are correctly present only on the valid page.

 

How can I manage the action in the same way?

 

Here the screenshot of both the page

 

 

 

Screen Shot 2018-07-26 at 14.32.46.pngScreen Shot 2018-07-26 at 14.32.32.png

0 Replies 0