module ietf-yang-revisions {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-revisions";
prefix rev;
import ietf-yang-types {
prefix yang;
reference
"XXXX [ietf-netmod-rfc6991-bis]: Common YANG Data Types";
}
organization
"IETF NETMOD (Network Modeling) Working Group";
contact
"WG Web:
WG List:
Author: Benoit Claise
Author: Joe Clarke
Author: Reshad Rahman
Author: Robert Wilton
Author: Kevin D'Souza
Author: Balazs Lengyel
Author: Jason Sterne
";
description
"This YANG 1.1 module contains definitions and extensions to
support updated YANG revision handling.
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 (inc above) with actual RFC number and
// remove this note.
revision 2020-07-06 {
description
"Initial version.";
reference
"XXXX: Updated YANG Module Revision Handling";
}
typedef revision-label {
type string {
length "1..255";
pattern '[^\s@]+';
pattern '\d{4}-\d{2}-\d{2}' {
modifier invert-match;
}
}
description
"A label associated with a YANG revision.
Excludes spaces and '@'. MUST NOT match revision-date.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 3.3, Revision label";
}
typedef revision-date-or-label {
type union {
type yang:revision-identifier;
type revision-label;
}
description
"Represents either a YANG revision date or a revision label";
}
extension nbc-changes {
description
"This statement is used to indicate YANG module revisions that
contain non-backwards-compatible changes.
The statement MUST only be a substatement of the 'revision'
statement.
Zero or one 'nbc-changes' statement per parent statement is
allowed.
The statement MUST NOT have any substatements.
If a revision of a YANG module contains changes, relative to
the preceding revision in the revision history, that do not
conform to the module update rules defined in RFC-XXX, then
the 'nbc-changes' statement MUST be added as a substatement to
the revision statement.
Conversely, if a revision of a YANG module only contains
changes, relative to the preceding revision in the revision
history, that are classified as 'backwards-compatible' then
the revision statement MUST NOT contain any 'nbc-changes'
substatement.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 3.2, nbc-changes revision extension statement";
}
extension revision-label {
argument revision-label;
description
"The revision label can be used to provide an additional
versioning identifier associated with the revision. E.g., one
option for a versioning scheme that could be used is [TODO -
Reference semver draft].
The format of the revision-label argument MUST conform to the
pattern defined for the revision-label typedef.
The statement MUST only be a substatement of the revision
statement.
Zero or one revision-label statement per parent statement
is allowed.
The statement MUST NOT have any substatements.
Revision labels MUST be unique amongst all revisions of a
module.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 3.3, Revision label";
}
extension revision-label-scheme {
argument revision-label-scheme-identity;
description
"The revision label scheme specifies which revision-label scheme
the module or submodule uses.
The mandatory revision-label-scheme-identity argument MUST be an
identity derived from revision-label-scheme-base.
This extension is only valid as a top-level statement, i.e.,
given as as a substatement to 'module' or 'submodule'.
This extension MUST be used if there is a revision-label
statement in the module or submodule.
The statement MUST NOT have any substatements.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 3.3.1, Revision label scheme extension statement";
}
extension revision-or-derived {
argument revision-date-or-label;
description
"Restricts the revision of the module that may be imported to
one that matches or is derived from the specified
revision-date or revision-label.
The argument value MUST conform to the
'revision-date-or-label' defined type.
The statement MUST only be a substatement of the import
statement.
Zero, one or more 'revision-or-derived' statement per parent
statement is allowed.
The statement MUST NOT have any substatements.
If specified multiple
times, then any module revision that satisfies at least one of
the 'revision-or-derived' statements is an acceptable revision
for import.
An 'import' statement MUST NOT contain both a
'revision-or-derived' extension statement and a
'revision-date' statement.
A particular revision of an imported module satisfies an
import's 'revision-or-derived' extension statement if the
imported module's revision history contains a revision
statement with a matching revision date or revision label.
The 'revision-or-derived' extension statement does not
guarantee that all module revisions that satisfy an import
statement are necessarily compatible, it only gives an
indication that the revisions are more likely to be
compatible.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 4, Import by derived revision";
}
identity revision-label-scheme-base {
description
"Base identity from which all revision label schemes are
derived.";
reference
"XXXX: Updated YANG Module Revision Handling;
Section 3.3.1, Revision label scheme extension statement";
}
}