Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Image Removed
DescriptionYangJava Object ViewNotes

Datatypes and basic constraints

Basic String

leaf response-code {
  type string;
}

Image Removed834pxImage Added


Mandatory Basic String

leaf response-code {
  type string;

    mandatory "true";
}

Image RemovedImage Added


Limited String leaf pnf-name {
  type string {
    length "0..256";
}

Specialized class to hold length limitation
typedef (String) with pattern

typedef dotted-quad {
  type string {
pattern
  '(([0-9] ...';
  }
}

leaf address {
   type dotted-quad;
   mandatory "true";
}

Image RemovedImage Added


Limited unint64 leaf cid {
  type string {
  length "0..52";
}

Image RemovedImage Added


boolean with default value

leaf blacklisted {
  type boolean;
  default 1;
}

Image RemovedImage Added


Choice

Choicechoice transfer-method {
  leaf transfer-interval {
    type uint64 {
      range  range "15..2880";
    }
    units minutes;
 }
  leaf transfer-on-commit {
  type empty;
  }}

Image Added


Must

Must leaf ifType {
type enumeration {
enum ethernet;
enum atm;}}

leaf ifMTU {
type uint32;}
must "ifType != 'ethernet' or "
+ "(ifType = 'ethernet' and ifMTU = 1500)" {error-message 466px"An ethernet MTU must be 1500";}

Image Added


When





Extension

Extension declaration extension store-state-ext {
argument duration;
description "An extension to enable state-storage for any attribute. Use duration to specify how long: nnn h|d|y";
}

Image RemovedImage Added


Extension usage leaf attribute-with-temporal-storage {
  type string;
  cm-notify-api:store-state-ext "3 d"; // store state 3 days
}

Image RemovedImage Added

extension is stored as 'UnknownNode' and refers back to the extension declaration

Augmentation

...