Versions Compared

Key

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

...

The augmentation is mainly used to extends an existing model. The augmentation is encapsulated within separate
module file, having own namespace and revision.


Code Block
themeEmacs
title base.yang
module base {
    yang-version 1.1;

    namespace "org:onap:cps:test:base";
    revision "2020-01-01";
    prefix "base";

    container base-container {
        leaf name {
            type string;
        }
        leaf description {
            type string;
        }
    }
}



Emacs
Code Block
theme
titleaugment.yang
module augment {
    yang-version 1.1;

    namespace "org:onap:cps:test:augment";
    revision "2020-01-02";
    prefix "augment";

    import base {
        prefix "base";
    }

    grouping augment-group {
         leaf augmented-leaf {
             type string;
         }
    }
    augment "base:base-container" {
        uses augment-group;
    }
}



Code Block
themeEclipse
titleJSON
{
  "base-container": {
    "name": "test name",
    "description": "test description",
    "augmented-leaf": "more information"
  }
}


...