module ietf-ysdl {
namespace "urn:ietf:params:xml:ns:yang:ietf-ysdl";
prefix "ysdl";
import ietf-yang-types {
prefix "yang";
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web:
WG List:
WG Chair: Thomas Nadeau
WG Chair: Juergen Schoenwaelder
WG Chair: Kent Watsen
Editor: Ladislav Lhotka
";
description
"This module defines YANG Schema Dispatching Language (YSDL) - a
meta-schema language for YANG-based data models.
A YSDL schema allows for embedding a YANG schema as a subschema
in a specific location of another module.
Copyright (c) 2015 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).
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and
'OPTIONAL' in the module text are to be interpreted as described
in RFC 2119 (http://tools.ietf.org/html/rfc2119).
This version of this YANG module is part of RFC XXXX
(http://tools.ietf.org/html/rfcXXXX); see the RFC itself for
full legal notices.";
revision 2015-11-30 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Schema Dispatching Language";
}
/* Typedefs */
typedef schema-node-path {
type string {
pattern "[a-zA-Z_][a-zA-Z0-9\\-_.]*:[a-zA-Z_][a-zA-Z0-9\\-_.]*"
+ "(/([a-zA-Z_][a-zA-Z0-9\\-_.]*"
+ ":)?[a-zA-Z_][a-zA-Z0-9\\-_.]*)";
}
description
"Intra-schema path to a YANG schema node.
The value is a sequence of schema node names separated by the
slash character ('/'). The first (leftmost) component is
prefixed with the name of the YANG module in which the schema
node is defined. A subsequent component has the module prefix
if and only if the preceding schema node is defined in another
module.";
}
typedef schema-ref {
type leafref {
path "/ysdl:schemas/ysdl:schema/ysdl:name";
}
description
"Reference to a schema.";
}
/* YSDL */
container schemas {
description
"Container for YSDL schemas.";
leaf top-schema {
type schema-ref;
description
"Reference to the top-level schema.";
}
list schema {
key "name";
min-elements "1";
description
"Each entry is a named schema. Exactly one entry must be the
top-level schema, other (optional) entries can be used as
subschemas.";
leaf name {
type string;
description
"Name of the schema.";
}
leaf-list yang-modules {
type yang:yang-identifier;
min-elements "1";
description
"Each entry is the name of a YANG module contributing to
the schema.";
}
list subschema {
key "root";
description
"Each entry is a subschema attached to the parent
schema.";
leaf root {
type schema-node-path;
description
"Each entry specifies the relative (intra-schema) path to
the root node where the subschema is attached. The
schema node MUST be one of: container, list, case or
anydata.
The absolute path of the root node depends on the
structure of schemas:
- For the top-level schema, the root is always '/'.
- For other schemas, the root path is formed by
concatenation of the corresponding root paths of all
ancestor schemas.";
}
leaf-list schemas {
type schema-ref;
description
"References to schemas that comprise the subschema.";
}
}
}
}
}