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; }
import ietf-datastores { prefix ds; }
import ietf-inet-types { prefix inet; }
import ietf-yang-types { prefix yang; }
import ietf-yang-metadata { prefix "md"; }
organization "IETF NETMOD Working Group";
contact
"WG Web:
WG List:
Author: Balazs Lengyel
";
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) 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.";
revision 2019-07-04 {
description "Initial revision.";
reference "RFC XXXX: YANG Instance Data Format";
}
md:annotation entity-tag {
type string;
description "Used to encode the entity-tag defined in
RFC8040 for the annotated instance.";
reference "RESTCONF Protocol RFC8040";
}
md:annotation last-modified {
type yang:date-and-time;
description "Contains the date and time when the annotated
instance was last modified (or created).";
reference "RESTCONF Protocol RFC8040";
}
sx:structure instance-data-set {
description "A data structure to define a format for a
YANG instance data set.Consists of meta-data about
the instance data set and the real content-data.";
leaf name {
type string;
description "Name of the YANG instance data set.";
}
choice content-schema-spec {
description "Specification of the content-schema";
case inline {
leaf-list inline-spec {
type string {
pattern '.+@\d{4}-\d{2}-\d{2}\.yang';
}
min-elements 1;
ordered-by user;
description
"Indicates that content defining Yang modules
are specified inline.
Each value MUST be a YANG Module name including the
revision-date as defined for YANG file names in RFC7950.
E.g. ietf-yang-library@2016-06-21.yang
The first item is either ietf-yang-library or some other
YANG module that contains a list of YANG modules with
their name, revision-date, supported-features and
deviations.
As some versions of ietf-yang-library MAY contain
different module-sets for different datastores, if
multiple module-sets are included, the instance data set's
meta-data MUST contain the datastore information and
instance data for the ietf-yang-library MUST also contain
information specifying the module-set for the relevant
datastore.
Subsequent items MAY specify YANG modules augmenting the
first module with useful data (e.g. a version label).";
}
anydata inline-content-schema {
mandatory true;
description "Instance data corresponding to the YANG modules
specified in the inline-spec nodes defining the set
of content defining Yang YANG modules for this
instance-data-set.";
}
}
case uri {
leaf schema-uri {
type inet:uri;
description
"A reference to another YANG instance data file.
This instance data file will use the same set of target
YANG modules, revisions, supported features and deviations
as the referenced YANG instance data file.";
}
}
}
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 or the datastore where the data
could be loaded or the datastore which is being documented.
If a single specific datastore can not be specified, the
leaf MUST be absent.
If this leaf is absent, then the datastore to which the
instance data belongs is undefined.";
}
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 one SHOULD be added
in front of the revisions sequence so that all
revisions are in reverse chronological order.
For 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}-\d{2}-\d{2}';
}
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.
For instance data sets that are read from or produced
by a server or otherwise subject to frequent
updates or changes, timestamp SHOULD be present";
}
anydata content-data {
description "Contains the real instance data.
The data MUST conform to the relevant YANG Modules specified
either in the content-schema-spec or in some other
implementation specific manner.";
}
}
}