module ietf-constrained-yang-library {
namespace
"urn:ietf:params:xml:ns:yang:ietf-constrained-yang-library";
prefix "lib";
import ietf-comi {
prefix comi;
}
organization
"IETF CORE (Constrained RESTful Environments) Working Group";
contact
"WG Web:
WG List:
WG Chair: Carsten Bormann
WG Chair: Jaime Jimenez
Editor: Michel Veillette
";
description
"This module contains the list of YANG modules and submodules
implemented by a server.
Copyright (c) 2016 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.: replace XXXX with actual RFC number and remove
// this note.
// RFC Ed.: update the date below with the date of the RFC
// publication and remove this note.
revision 2018-01-20 {
description
"Initial revision.";
reference
"RFC XXXX: Constrained YANG Module Library.";
}
/*
* Typedefs
*/
typedef revision {
type binary {
length "4";
}
description
"Revision date encoded as a binary string as follow:
- First byte = Century
- Second byte = Year (0 to 99)
- Third byte = Month (1 = January to 12 = December)
- Forth byte = Day (1 to 31)";
}
/*
* Groupings
*/
grouping identification-info {
description
"YANG modules and submodules identification information.";
leaf sid {
type comi:sid;
mandatory true;
description
"SID assigned to this module or submodule.";
}
leaf revision {
type revision;
description
"Revision date assigned to this module or submodule.
A zero-length binary string is used if no revision
statement is present in the YANG module or submodule.";
}
}
identity module-set {
description
"Base identity from which shared module-set identifiers
are derived.";
}
/*
* Operational state data nodes
*/
container modules-state {
config false;
description
"Contains information about the different data models
implemented by the server.";
leaf hash {
type binary {
length "8..32";
}
mandatory true;
description
"A server-generated hash of the contents of the library.
The server MUST change the value of this leaf each time
the content of the library has changed. The hash function
and size are not specified, but shall be collision
resistant.";
}
list module {
key "sid revision";
description
"Each entry represents one revision of one module
currently supported by the server.";
uses identification-info;
leaf-list feature {
type comi:sid;
description
"List of YANG features from this module that are
supported by the server, regardless whether
they are defined in the module or in any
included submodules.";
}
list deviation {
key "sid revision";
description
"List of YANG deviation modules used by this server
to modify the conformance of the module associated
with this entry. Note that the same module can be
used for deviations for multiple modules, so the same
entry MAY appear within multiple 'module' entries.
Deviation modules MUST also be present in the 'module'
list, with the same sid and revision values and the
'conformance-type' set to 'implement'.";
uses identification-info;
}
leaf conformance-type {
type enumeration {
enum implement {
value 0;
description
"Indicates that the server implements one or more
protocol-accessible objects defined in the YANG
module identified in this entry. This includes
deviation statements defined in the module.
For YANG version 1.1 modules, there is at most one
module entry with conformance type 'implement' for
a particular module, since YANG 1.1 requires that
at most one revision of a module is implemented.
For YANG version 1 modules, there SHOULD NOT be more
than one module entry for a particular module.";
}
enum import {
value 1;
description
"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 module entries for the same module MAY
exist. This can occur if multiple modules import
the same module, but specify different revision-dates
in the import statements.";
}
}
mandatory true;
description
"Indicates the type of conformance the server is claiming
for the YANG module identified by this entry.";
}
list submodule {
key "sid revision";
description
"Each entry represents one submodule within the
parent module.";
uses identification-info;
}
}
}
/*
* Notifications
*/
notification yang-library-change {
description
"Generated when the set of modules and submodules supported
by the server has changed.";
leaf hash {
type leafref {
path "/lib:modules-state/lib:hash";
}
mandatory true;
description
"New hash value.";
}
}
}