module ietf-yang-library-packages {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-yang-library-packages";
prefix pkg;
import ietf-yang-package-types {
prefix pkg-types;
reference "RFC XXX: YANG Packages.";
}
import ietf-yang-library {
prefix yanglib;
reference "RFC 7895bis: YANG Library";
}
organization
"IETF NETMOD (Network Modeling) Working Group";
contact
"WG Web:
WG List:
Author: Rob Wilton
";
description
"This module provides defined augmentations to YANG library to
allow a server to report YANG package information.
Copyright (c) 2018 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.";
// RFC Ed.: update the date below with the date of RFC publication
// and remove this note.
// RFC Ed.: replace XXXX with actual RFC number and remove this
// note.
revision 2018-11-26 {
description
"Initial revision";
reference
"RFC XXXX: YANG Schema Versioning.";
}
/*
* Add in the list of packaged into YANG libary.
*/
augment "/yanglib:yang-library" {
description "Add YANG package definitions into YANG library";
list package {
config "false";
key "name version";
description "Defines the packages available on this server.";
uses "pkg-types:yang-pkg-library-definition";
}
}
/*
* Allow schema to be related to a YANG package.
*/
augment "/yanglib:yang-library/yanglib:schema" {
description
"Allow datastore schema to be related to a YANG package";
container package {
leaf name {
type leafref {
path "/yanglib:yang-library/package/name";
}
description
"The name of the package this schema relates to.";
}
leaf version {
type leafref {
path '/yanglib:yang-library/'
+ 'package[name = current()/../name]/version';
}
description
"The version of the package this schema relates to.";
}
description
"Describes which package the schema directly relates to, if
any.";
}
}
/*
* Allow import-only modules to list the versions that they are
* replacing.
*/
augment
"/yanglib:yang-library/yanglib:module-set/" +
"yanglib:import-only-module" {
description
"Add replaces-revision to import-only-module definitions";
leaf-list replaces-revision {
type yanglib:revision-identifier;
description
"Gives the revision of an import-only-module defined in an
imported package that is replaced by this import-only-module
revision.
Only used for YANG package definitions";
}
}
}