Hi all,
   When we try to implementing, there are 3 questions want to clear on WG, 
please expert help to answer the questions, thanks.


[Question 1]: whether "mandatory true" node can be deviated as "not-supported" ?

[Question 2]: Whether can deviation YANG to expand the range of type?

   example:

 target YANG node:
 leaf a {
  type uint 8 {
    range "1..50";
  }
}

deviation yang:

deviation "/a:a" {
  replace type {
    range "1..100";
  }
}

[Question 3]: How to use a new type defined by "typedef" to deviate replace the 
target module's type.

example:
module example-base {
      namespace "urn:example-base";
      prefix base;

      container system {
        description
         "System group configuration.";
        leaf daytime {
           type string;
        }
        leaf date {
           type string;
        }
        leaf interface {
           type string;
        }
        leaf status {
           type string;
           config false;
        }
      }
}

module example-deviations {
       yang-version 1.1;
       namespace "urn:example:deviations";
       prefix md;

       import example-base {
         prefix base;
       }

       import ietf-interfaces {
         prefix if;
       }

       // here, define a new type with typedef statement
       typedef date-and-time {
         type string {
           pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
             + '(Z|[\+\-]\d{2}:\d{2})';
         }
        }

       // try to replace the target node's type with new typedef type
       deviation /base:system/base:date {
         deviate replace {
            type date-and-time;
         }
       }

        deviation /base:system/base:interface {
         deviate replace {
            type leafref {
                    path "/if:interfaces/if:interface/if:name";
                }              }
       }
       ...
     }


problem 1: when use new type defined in deviation YANG file to replace the 
target node's type, some tools give compile error, because they can not find 
the definition of new type "date-and-time" . From the YANG language view, this 
error looks reasonable, but how to replace the target node with newly deifned 
type?

problem 2: when try to replace the type to leafref a xpath which not imported 
in the target module, it have the compile error too, then how to replace the 
target node with another module's xpath?


Thanks
Walker(Guangying zheng)
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to