|
Packit |
8fb591 |
module ietf-restconf {
|
|
Packit |
8fb591 |
yang-version 1.1;
|
|
Packit |
8fb591 |
namespace "urn:ietf:params:xml:ns:yang:ietf-restconf";
|
|
Packit |
8fb591 |
prefix "rc";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
organization
|
|
Packit |
8fb591 |
"IETF NETCONF (Network Configuration) Working Group";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
contact
|
|
Packit |
8fb591 |
"WG Web: <https://datatracker.ietf.org/wg/netconf/>
|
|
Packit |
8fb591 |
WG List: <mailto:netconf@ietf.org>
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Author: Andy Bierman
|
|
Packit |
8fb591 |
<mailto:andy@yumaworks.com>
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Author: Martin Bjorklund
|
|
Packit |
8fb591 |
<mailto:mbj@tail-f.com>
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Author: Kent Watsen
|
|
Packit |
8fb591 |
<mailto:kwatsen@juniper.net>";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"This module contains conceptual YANG specifications
|
|
Packit |
8fb591 |
for basic RESTCONF media type definitions used in
|
|
Packit |
8fb591 |
RESTCONF protocol messages.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Note that the YANG definitions within this module do not
|
|
Packit |
8fb591 |
represent configuration data of any kind.
|
|
Packit |
8fb591 |
The 'restconf-media-type' YANG extension statement
|
|
Packit |
8fb591 |
provides a normative syntax for XML and JSON
|
|
Packit |
8fb591 |
message-encoding purposes.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Copyright (c) 2017 IETF Trust and the persons identified as
|
|
Packit |
8fb591 |
authors of the code. All rights reserved.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Redistribution and use in source and binary forms, with or
|
|
Packit |
8fb591 |
without modification, is permitted pursuant to, and subject
|
|
Packit |
8fb591 |
to the license terms contained in, the Simplified BSD License
|
|
Packit |
8fb591 |
set forth in Section 4.c of the IETF Trust's Legal Provisions
|
|
Packit |
8fb591 |
Relating to IETF Documents
|
|
Packit |
8fb591 |
(http://trustee.ietf.org/license-info).
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
This version of this YANG module is part of RFC 8040; see
|
|
Packit |
8fb591 |
the RFC itself for full legal notices.";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
revision 2017-01-26 {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Initial revision.";
|
|
Packit |
8fb591 |
reference
|
|
Packit |
8fb591 |
"RFC 8040: RESTCONF Protocol.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
extension yang-data {
|
|
Packit |
8fb591 |
argument name {
|
|
Packit |
8fb591 |
yin-element true;
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"This extension is used to specify a YANG data template that
|
|
Packit |
8fb591 |
represents conceptual data defined in YANG. It is
|
|
Packit |
8fb591 |
intended to describe hierarchical data independent of
|
|
Packit |
8fb591 |
protocol context or specific message-encoding format.
|
|
Packit |
8fb591 |
Data definition statements within a yang-data extension
|
|
Packit |
8fb591 |
specify the generic syntax for the specific YANG data
|
|
Packit |
8fb591 |
template, whose name is the argument of the 'yang-data'
|
|
Packit |
8fb591 |
extension statement.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Note that this extension does not define a media type.
|
|
Packit |
8fb591 |
A specification using this extension MUST specify the
|
|
Packit |
8fb591 |
message-encoding rules, including the content media type.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
The mandatory 'name' parameter value identifies the YANG
|
|
Packit |
8fb591 |
data template that is being defined. It contains the
|
|
Packit |
8fb591 |
template name.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
This extension is ignored unless it appears as a top-level
|
|
Packit |
8fb591 |
statement. It MUST contain data definition statements
|
|
Packit |
8fb591 |
that result in exactly one container data node definition.
|
|
Packit |
8fb591 |
An instance of a YANG data template can thus be translated
|
|
Packit |
8fb591 |
into an XML instance document, whose top-level element
|
|
Packit |
8fb591 |
corresponds to the top-level container.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
The module name and namespace values for the YANG module using
|
|
Packit |
8fb591 |
the extension statement are assigned to instance document data
|
|
Packit |
8fb591 |
conforming to the data definition statements within
|
|
Packit |
8fb591 |
this extension.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
The substatements of this extension MUST follow the
|
|
Packit |
8fb591 |
'data-def-stmt' rule in the YANG ABNF.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
The XPath document root is the extension statement itself,
|
|
Packit |
8fb591 |
such that the child nodes of the document root are
|
|
Packit |
8fb591 |
represented by the data-def-stmt substatements within
|
|
Packit |
8fb591 |
this extension. This conceptual document is the context
|
|
Packit |
8fb591 |
for the following YANG statements:
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
- must-stmt
|
|
Packit |
8fb591 |
- when-stmt
|
|
Packit |
8fb591 |
- path-stmt
|
|
Packit |
8fb591 |
- min-elements-stmt
|
|
Packit |
8fb591 |
- max-elements-stmt
|
|
Packit |
8fb591 |
- mandatory-stmt
|
|
Packit |
8fb591 |
- unique-stmt
|
|
Packit |
8fb591 |
- ordered-by
|
|
Packit |
8fb591 |
- instance-identifier data type
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
The following data-def-stmt substatements are constrained
|
|
Packit |
8fb591 |
when used within a 'yang-data' extension statement.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
- The list-stmt is not required to have a key-stmt defined.
|
|
Packit |
8fb591 |
- The if-feature-stmt is ignored if present.
|
|
Packit |
8fb591 |
- The config-stmt is ignored if present.
|
|
Packit |
8fb591 |
- The available identity values for any 'identityref'
|
|
Packit |
8fb591 |
leaf or leaf-list nodes are limited to the module
|
|
Packit |
8fb591 |
containing this extension statement and the modules
|
|
Packit |
8fb591 |
imported into that module.
|
|
Packit |
8fb591 |
";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
grouping errors {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"A grouping that contains a YANG container
|
|
Packit |
8fb591 |
representing the syntax and semantics of a
|
|
Packit |
8fb591 |
YANG Patch error report within a response message.";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
container errors {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Represents an error report returned by the server if
|
|
Packit |
8fb591 |
a request results in an error.";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
list error {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"An entry containing information about one
|
|
Packit |
8fb591 |
specific error that occurred while processing
|
|
Packit |
8fb591 |
a RESTCONF request.";
|
|
Packit |
8fb591 |
reference
|
|
Packit |
8fb591 |
"RFC 6241, Section 4.3.";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
leaf error-type {
|
|
Packit |
8fb591 |
type enumeration {
|
|
Packit |
8fb591 |
enum transport {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The transport layer.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
enum rpc {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The rpc or notification layer.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
enum protocol {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The protocol operation layer.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
enum application {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The server application layer.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
mandatory true;
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The protocol layer where the error occurred.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
leaf error-tag {
|
|
Packit |
8fb591 |
type string;
|
|
Packit |
8fb591 |
mandatory true;
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The enumerated error-tag.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
leaf error-app-tag {
|
|
Packit |
8fb591 |
type string;
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The application-specific error-tag.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
leaf error-path {
|
|
Packit |
8fb591 |
type instance-identifier;
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"The YANG instance identifier associated
|
|
Packit |
8fb591 |
with the error node.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
leaf error-message {
|
|
Packit |
8fb591 |
type string;
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"A message describing the error.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
anydata error-info {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"This anydata value MUST represent a container with
|
|
Packit |
8fb591 |
zero or more data nodes representing additional
|
|
Packit |
8fb591 |
error information.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
grouping restconf {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Conceptual grouping representing the RESTCONF
|
|
Packit |
8fb591 |
root resource.";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
container restconf {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Conceptual container representing the RESTCONF
|
|
Packit |
8fb591 |
root resource.";
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
container data {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Container representing the datastore resource.
|
|
Packit |
8fb591 |
Represents the conceptual root of all state data
|
|
Packit |
8fb591 |
and configuration data supported by the server.
|
|
Packit |
8fb591 |
The child nodes of this container can be any data
|
|
Packit |
8fb591 |
resources that are defined as top-level data nodes
|
|
Packit |
8fb591 |
from the YANG modules advertised by the server in
|
|
Packit |
8fb591 |
the 'ietf-yang-library' module.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
container operations {
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Container for all operation resources.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
Each resource is represented as an empty leaf with the
|
|
Packit |
8fb591 |
name of the RPC operation from the YANG 'rpc' statement.
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
For example, the 'system-restart' RPC operation defined
|
|
Packit |
8fb591 |
in the 'ietf-system' module would be represented as
|
|
Packit |
8fb591 |
an empty leaf in the 'ietf-system' namespace. This is
|
|
Packit |
8fb591 |
a conceptual leaf and will not actually be found in
|
|
Packit |
8fb591 |
the module:
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
module ietf-system {
|
|
Packit |
8fb591 |
leaf system-reset {
|
|
Packit |
8fb591 |
type empty;
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
To invoke the 'system-restart' RPC operation:
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
POST /restconf/operations/ietf-system:system-restart
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
To discover the RPC operations supported by the server:
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
GET /restconf/operations
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
In XML, the YANG module namespace identifies the module:
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
xmlns='urn:ietf:params:xml:ns:yang:ietf-system'/>
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
In JSON, the YANG module name identifies the module:
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
{ 'ietf-system:system-restart' : [null] }
|
|
Packit |
8fb591 |
";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
leaf yang-library-version {
|
|
Packit |
8fb591 |
type string {
|
|
Packit |
8fb591 |
pattern '\d{4}-\d{2}-\d{2}';
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
config false;
|
|
Packit |
8fb591 |
mandatory true;
|
|
Packit |
8fb591 |
description
|
|
Packit |
8fb591 |
"Identifies the revision date of the 'ietf-yang-library'
|
|
Packit |
8fb591 |
module that is implemented by this RESTCONF server.
|
|
Packit |
8fb591 |
Indicates the year, month, and day in YYYY-MM-DD
|
|
Packit |
8fb591 |
numeric format.";
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
}
|
|
Packit |
8fb591 |
|
|
Packit |
8fb591 |
}
|