module ietf-yang-instance-data {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data";
prefix yid;
import ietf-yang-structure-ext {
prefix sx;
reference
"RFC 8791: YANG Data Structure Extensions";
}
import ietf-datastores {
prefix ds;
reference
"RFC 8342: Network Management Datastore Architecture (NMDA)";
}
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-netconf-with-defaults {
prefix ncwd;
reference
"RFC 6243: With-defaults Capability for NETCONF";
}
organization
"IETF NETMOD Working Group";
contact
"WG Web:
WG List:
Author: Balazs Lengyel
Author: Benoit Claise
";
description
"The module defines the structure and content of YANG
instance data sets.
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.
Copyright (c) 2022 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 Revised BSD License
set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC 9195
(https://www.rfc-editor.org/info/rfc9195); see the RFC itself
for full legal notices.";
revision 2022-02-17 {
description
"Initial revision.";
reference
"RFC 9195: YANG Instance Data File Format";
}
typedef module-with-revision-date {
type string {
pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'
+ '(@\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1]))?';
pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
}
description
"A type defining a module name and an optional revision
date, e.g., ietf-yang-library@2019-01-04.";
}
sx:structure instance-data-set {
description
"A data structure to define a format for YANG instance
data. The majority of the YANG nodes provides metadata
about the instance data; the instance data itself is
contained only in the 'content-data' node.";
leaf name {
type string;
description
"An arbitrary name for the YANG instance data set. This
value is primarily used for descriptive purposes. However,
when the instance data set is saved to a file, then the
filename MUST encode the name's value per Section 2
of RFC 9195.";
}
leaf format-version {
type string {
pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])';
}
default "2022-01-20";
description
"The 'revision' of the 'ietf-yang-instance-data' module
used to encode this 'instance-data-set'.";
}
leaf includes-defaults {
type ncwd:with-defaults-mode;
default "report-all";
description
"Indicates how data nodes with default values are
represented for all data nodes contained in the
instance-data-set.
It uses the same definitions as per Section 3 of RFC 6243
but applied in the context of an instance data file rather
than a NETCONF request using the
parameter.
For JSON files, the encoding of the 'report-all-tagged'
option is as defined in Section 4.8.9 of RFC 8040.";
reference
"RFC 6243: With-defaults Capability for NETCONF";
}
container content-schema {
description
"The content schema (i.e., YANG modules) used to create
the instance data set.
If not present, the user needs to obtain the information
through external documents.";
choice content-schema-spec {
description
"Specification of the content-schema.";
case simplified-inline {
leaf-list module {
type module-with-revision-date;
min-elements 1;
description
"The list of content-defining YANG modules.
The value SHALL start with the module name.
If the module contains a revision statement, the
revision date SHALL be included in the leaf-list
entry, e.g., ietf-yang-library@2019-01-04.
Usage of this leaf-list implies the modules are
used without any deviations and with all features
supported. Multiple revisions of the same module
MUST NOT be specified.";
}
}
case inline {
anydata inline-yang-library {
mandatory true;
description
"Instance data corresponding to the
ietf-yang-library@2019-01-04 defining
the set of content-defining YANG modules for
this instance-data-set.";
}
}
case uri {
leaf same-schema-as-file {
type inet:uri;
description
"A reference to another YANG instance data file.
This instance data file uses the same
content schema as the referenced file.
Referenced files using the 'inline' or the
'simplified-inline' methods MUST be supported.
Referenced files using the 'URI method' MAY be
supported.
The URL schemes 'file://' and 'https://' MUST
be supported; other schemes MAY also be
supported.";
}
}
}
}
leaf-list description {
type string;
description
"Description of the instance data set.";
}
leaf contact {
type string;
description
"Contact information for the person or
organization to whom queries concerning this
instance data set should be sent.";
}
leaf organization {
type string;
description
"Organization responsible for the instance
data set.";
}
leaf datastore {
type ds:datastore-ref;
description
"The identity of the datastore with which the
instance data set is associated, e.g., the datastore from
where the data was read, the datastore into which the data
may be loaded, or the datastore that is being documented.
If a single specific datastore cannot be specified, the
leaf MUST be absent.
If this leaf is absent, then the datastore to which the
instance data belongs is unspecified.";
}
list revision {
key "date";
description
"Instance data sets that are produced as
a result of some sort of specification or design effort
SHOULD have at least one revision entry. For every
published editorial change, a new unique revision SHOULD
be added in front of the revisions sequence so that all
revisions are in reverse chronological order.
In cases of instance data sets that are read from
or produced by a server or otherwise subject to
frequent updates or changes, revision
SHOULD NOT be present.";
leaf date {
type string {
pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])';
}
description
"Specifies the date the instance data set
was last modified. Formatted as YYYY-MM-DD.";
}
leaf description {
type string;
description
"Description of this revision of the instance data set.";
}
}
leaf timestamp {
type yang:date-and-time;
description
"The date and time when the instance data set
was last modified.
In cases of instance data sets that are read from or
produced by a server or otherwise subject to frequent
updates or changes, the timestamp SHOULD be present.
If both a revision list entry and timestamp are present,
the timestamp SHOULD contain the same date as the
latest revision statement.";
}
anydata content-data {
description
"Contains the real instance data.
The data MUST conform to the relevant YANG modules
specified either in the content-schema or in some other
implementation-specific manner.";
}
}
}