module ietf-yang-packages {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-packages";
prefix pkgs;
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.2.0;
reference "RFC XXX: YANG Packages.";
}
import ietf-inet-types {
prefix inet;
rev:revision-or-derived 2013-07-15;
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 defines YANG packages on a server implementation.
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.
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 2020-01-21 {
rev:revision-label 0.2.0;
description
"Initial revision";
reference
"RFC XXXX: YANG Packages";
}
/*
* Groupings
*/
grouping yang-pkg-ref {
description
"Defines the leaves used to reference a single YANG package";
leaf name {
type leafref {
path '/pkgs:packages/pkgs:package/pkgs:name';
}
description
"The name of the references package.";
}
leaf version {
type leafref {
path '/pkgs:packages'
+ '/pkgs:package[pkgs:name = current()/../name]'
+ '/pkgs:version';
}
description
"The version of the referenced package.";
}
leaf checksum {
type leafref {
path '/pkgs:packages'
+ '/pkgs:package[pkgs:name = current()/../name]'
+ '[pkgs:version = current()/../version]/pkgs:checksum';
}
description
"The checksum of the referenced package.";
}
}
grouping yang-ds-pkg-ref {
description
"Defines the list used to reference a set of YANG packages that
collectively represent a datastore schema.";
list package {
key "name version";
description
"Identifies the YANG packages that collectively defines the
schema for the associated datastore.
The datastore schema is defined as the union of all
referenced packages, that MUST represent a referentially
complete schema.
All of the referenced packages must be compatible with no
conflicting module versions or dependencies.";
uses yang-pkg-ref;
}
}
/*
* Top level data nodes.
*/
container packages {
config false;
description "All YANG package definitions";
list package {
key "name version";
description
"YANG package instance";
uses pkg-types:yang-pkg-instance;
leaf-list location {
type inet:uri;
description
"Contains a URL that represents where an instance data file
for this YANG package can be found.
This leaf will only be present if there is a URL available
for retrieval of the schema for this entry.
If multiple locations are provided, then the first
location in the leaf-list MUST be the definitive location
that uniquely identifies this package";
}
leaf checksum {
type pkg-types:sha-256-hash;
description
"The checksum of the package this schema relates to,
calculated on the 'YANG instance data file' package
definition available in the 'location' leaf list.
This leaf MAY be omitted if the referenced package is
locally scoped without an associated checksum.";
}
}
}
}