You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Addresses  CPS-43 - Getting issue details... STATUS


Cases

Augmentation

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

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;
        }
    }
}
augment.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;
    }
}
JSON
{
  "base-container": {
    "name": "test name",
    "description": "test description",
    "augmented-leaf": "more information"
  }
}

Imports

Submodules

Module vs Yang File

  • No labels