module ietf-yang-package {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-package";
prefix pkg;
import ietf-yang-revisions {
prefix rev;
reference "XXXX: Updated YANG Module Revision Handling";
}
import ietf-yang-package-types {
prefix pkg-types;
rev:revision-or-derived 0.1.0;
reference "RFC XXX: YANG Schema Versioning.";
}
import ietf-yang-structure-ext {
prefix sx;
reference "RFC XXX: YANG Data Structure Extensions.";
}
import ietf-yang-types {
prefix yang;
rev:revision-or-derived 2013-07-15;
reference "RFC 6991: Common YANG Data Types.";
}
import ietf-inet-types {
prefix inet;
reference "RFC 6991: Common YANG Data Types.";
}
organization
"IETF NETMOD (Network Modeling) Working Group";
contact
"WG Web:
WG List:
Author: Rob Wilton
";
description
"This module provides a definition of a YANG package, which is
used as the schema for an YANG instance data document specifying
a YANG package.
Copyright (c) 2019 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.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
'MAY', and 'OPTIONAL' in this document are to be interpreted as
described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
they appear in all capitals, as shown here.";
// 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 2019-09-11 {
rev:revision-label 0.1.0;
description
"Initial revision";
reference
"RFC XXXX: YANG Packages";
}
/*
* Top-level structure
*/
sx:structure package {
description
"Defines a YANG package.
Intended to be used to specify YANG package within an instance
data document.";
uses pkg-types:yang-pkg-identification-leafs;
uses pkg-types:yang-pkg-common-leafs;
list module {
key "name";
description
"An entry in this list represents a module that must be
implemented by a server implementing this package, as per
RFC 7950 section 5.6.5, with a particular set of supported
features and deviations.
A entry in this list overrides any module revision
'implemented' by an included package. Any replaced module
revision SHOULD also be listed in the 'replaces-revision'
list.";
reference
"RFC 7950: The YANG 1.1 Data Modeling Language.";
leaf name {
type yang:yang-identifier;
mandatory true;
description
"The YANG module name.";
}
leaf revision {
type rev:revision-date-or-label;
description
"The YANG module revision date or revision-label.
If no revision statement is present in the YANG module,
this leaf is not instantiated.";
}
leaf-list replaces-revision {
type rev:revision-date-or-label;
description
"Gives the revision of an module (implemented or
import-only) defined in an included package that is
replaced by this implemented module revision.";
}
leaf namespace {
type inet:uri;
description
"The XML namespace identifier for this module.";
}
leaf-list location {
type inet:uri;
description
"Contains a URL that represents the YANG schema resource
for this module.
This leaf will only be present if there is a URL available
for retrieval of the schema for this entry.";
}
leaf checksum {
type pkg-types:sha-256-hash;
description
"The SHA-256 hash calculated on the textual module
definition, represented as a hexadecimal string.";
}
list submodule {
key "name";
description
"Each entry represents one submodule within the
parent module.";
leaf name {
type yang:yang-identifier;
description
"The YANG submodule name.";
}
leaf revision {
type rev:revision-identifier;
mandatory true;
description
"The YANG submodule revision date. If the parent module
include statement for this submodule includes a revision
date then it MUST match this leaf's value.";
}
leaf-list location {
type inet:uri;
description
"Contains a URL that represents the YANG schema resource
for this submodule.
This leaf will only be present if there is a URL
available for retrieval of the schema for this entry.";
}
leaf checksum {
type pkg-types:sha-256-hash;
description
"The SHA-256 hash calculated on the textual submodule
definition, represented as a hexadecimal string.";
}
}
}
list import-only-module {
key "name revision";
description
"An entry in this list indicates that the server imports
reusable definitions from the specified revision of the
module, but does not implement any protocol accessible
objects from this revision.
Multiple entries for the same module name MAY exist. This
can occur if multiple modules import the same module, but
specify different revision-dates in the import statements.";
leaf name {
type yang:yang-identifier;
description
"The YANG module name.";
}
leaf revision {
type rev:revision-date-or-label;
description
"The YANG module revision date or revision-label.
If no revision statement is present in the YANG module,
this leaf is not instantiated.";
}
leaf-list replaces-revision {
type rev:revision-date-or-label;
description
"Gives the revision of an import-only-module defined in an
included package that is replaced by this
import-only-module revision.";
}
leaf namespace {
type inet:uri;
description
"The XML namespace identifier for this module.";
}
leaf-list location {
type inet:uri;
description
"Contains a URL that represents the YANG schema resource
for this module.
This leaf will only be present if there is a URL available
for retrieval of the schema for this entry.";
}
leaf checksum {
type pkg-types:sha-256-hash;
description
"The SHA-256 hash calculated on the textual submodule
definition, represented as a hexadecimal string.";
}
list submodule {
key "name";
description
"Each entry represents one submodule within the
parent module.";
leaf name {
type yang:yang-identifier;
description
"The YANG submodule name.";
}
leaf revision {
type rev:revision-identifier;
mandatory true;
description
"The YANG submodule revision date. If the parent module
include statement for this submodule includes a revision
date then it MUST match this leaf's value.";
}
leaf-list location {
type inet:uri;
description
"Contains a URL that represents the YANG schema resource
for this submodule.
This leaf will only be present if there is a URL
available for retrieval of the schema for this entry.";
}
leaf checksum {
type pkg-types:sha-256-hash;
description
"The SHA-256 hash calculated on the textual submodule
definition, represented as a hexadecimal string.";
}
}
}
}
}