1. Updated pom.xml for renderer and impl to replace mockito-all with mockito-core
[transportpce.git] / ordmodels / src / main / yang / ietf-restconf@2016-08-15.yang
1 module ietf-restconf {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-restconf";
4   prefix "rc";
5
6   organization
7     "IETF NETCONF (Network Configuration) Working Group";
8
9   contact
10     "WG Web:   <http://tools.ietf.org/wg/netconf/>
11      WG List:  <mailto:netconf@ietf.org>
12      Author:   Andy Bierman
13                <mailto:andy@yumaworks.com>
14      Author:   Martin Bjorklund
15                <mailto:mbj@tail-f.com>
16      Author:   Kent Watsen
17                <mailto:kwatsen@juniper.net>";
18
19   description
20     "This module contains conceptual YANG specifications
21      for basic RESTCONF media type definitions used in
22      RESTCONF protocol messages.
23      Note that the YANG definitions within this module do not
24      represent configuration data of any kind.
25      The 'restconf-media-type' YANG extension statement
26      provides a normative syntax for XML and JSON message
27      encoding purposes.
28      Copyright (c) 2016 IETF Trust and the persons identified as
29      authors of the code.  All rights reserved.
30      Redistribution and use in source and binary forms, with or
31      without modification, is permitted pursuant to, and subject
32      to the license terms contained in, the Simplified BSD License
33      set forth in Section 4.c of the IETF Trust's Legal Provisions
34      Relating to IETF Documents
35      (http://trustee.ietf.org/license-info).
36      This version of this YANG module is part of RFC XXXX; see
37      the RFC itself for full legal notices.";
38
39   // RFC Ed.: replace XXXX with actual RFC number and remove this
40   // note.
41
42   // RFC Ed.: remove this note
43   // Note: extracted from draft-ietf-netconf-restconf-17.txt
44
45   // RFC Ed.: update the date below with the date of RFC publication
46   // and remove this note.
47   revision 2016-08-15 {
48     description
49       "Initial revision.";
50     reference
51       "RFC XXXX: RESTCONF Protocol.";
52   }
53
54   extension yang-data {
55     argument name {
56       yin-element true;
57     }
58     description
59       "This extension is used to specify a YANG data template which
60        represents conceptual data defined in YANG. It is
61        intended to describe hierarchical data independent of
62        protocol context or specific message encoding format.
63        Data definition statements within a yang-data extension
64        specify the generic syntax for the specific YANG data
65        template, whose name is the argument of the yang-data
66        extension statement.
67        Note that this extension does not define a media-type.
68        A specification using this extension MUST specify the
69        message encoding rules, including the content media type.
70        The mandatory 'name' parameter value identifies the YANG
71        data template that is being defined. It contains the
72        template name.
73        This extension is ignored unless it appears as a top-level
74        statement. It MUST contain data definition statements
75        that result in exactly one container data node definition.
76        An instance of a YANG data template can thus be translated
77        into an XML instance document, whose top-level element
78        corresponds to the top-level container.
79        The module name and namespace value for the YANG module using
80        the extension statement is assigned to instance document data
81        conforming to the data definition statements within
82        this extension.
83        The sub-statements of this extension MUST follow the
84        'data-def-stmt' rule in the YANG ABNF.
85        The XPath document root is the extension statement itself,
86        such that the child nodes of the document root are
87        represented by the data-def-stmt sub-statements within
88        this extension. This conceptual document is the context
89        for the following YANG statements:
90          - must-stmt
91          - when-stmt
92          - path-stmt
93          - min-elements-stmt
94          - max-elements-stmt
95          - mandatory-stmt
96          - unique-stmt
97          - ordered-by
98          - instance-identifier data type
99        The following data-def-stmt sub-statements are constrained
100        when used within a yang-data-resource extension statement.
101          - The list-stmt is not required to have a key-stmt defined.
102          - The if-feature-stmt is ignored if present.
103          - The config-stmt is ignored if present.
104          - The available identity values for any 'identityref'
105            leaf or leaf-list nodes is limited to the module
106            containing this extension statement, and the modules
107            imported into that module.
108       ";
109   }
110
111   rc:yang-data yang-errors {
112     uses errors;
113   }
114
115   rc:yang-data yang-api {
116     uses restconf;
117   }
118
119   grouping errors {
120     description
121       "A grouping that contains a YANG container
122        representing the syntax and semantics of a
123        YANG Patch errors report within a response message.";
124
125     container errors {
126       description
127         "Represents an error report returned by the server if
128          a request results in an error.";
129
130       list error {
131         description
132           "An entry containing information about one
133            specific error that occurred while processing
134            a RESTCONF request.";
135         reference "RFC 6241, Section 4.3";
136
137         leaf error-type {
138           type enumeration {
139             enum transport {
140               description "The transport layer";
141             }
142             enum rpc {
143               description "The rpc or notification layer";
144             }
145             enum protocol {
146               description "The protocol operation layer";
147             }
148             enum application {
149               description "The server application layer";
150             }
151           }
152           mandatory true;
153           description
154             "The protocol layer where the error occurred.";
155         }
156
157         leaf error-tag {
158           type string;
159           mandatory true;
160           description
161             "The enumerated error tag.";
162         }
163
164         leaf error-app-tag {
165           type string;
166           description
167             "The application-specific error tag.";
168         }
169
170         leaf error-path {
171           type instance-identifier;
172           description
173             "The YANG instance identifier associated
174              with the error node.";
175         }
176
177         leaf error-message {
178           type string;
179           description
180             "A message describing the error.";
181         }
182
183         anydata error-info {
184            description
185              "This anydata value MUST represent a container with
186              zero or more data nodes representing additional
187              error information.";
188         }
189       }
190     }
191   }
192
193   grouping restconf {
194     description
195       "Conceptual grouping representing the RESTCONF
196        root resource.";
197
198     container restconf {
199       description
200         "Conceptual container representing the RESTCONF
201          root resource.";
202
203       container data {
204         description
205           "Container representing the datastore resource.
206            Represents the conceptual root of all state data
207            and configuration data supported by the server.
208            The child nodes of this container can be any data
209            resource which are defined as top-level data nodes
210            from the YANG modules advertised by the server in
211            the ietf-yang-library module.";
212       }
213
214       container operations {
215         description
216           "Container for all operation resources.
217            Each resource is represented as an empty leaf with the
218            name of the RPC operation from the YANG rpc statement.
219            For example, the 'system-restart' RPC operation defined
220            in the 'ietf-system' module would be represented as
221            an empty leaf in the 'ietf-system' namespace. This is
222            a conceptual leaf, and will not actually be found in
223            the module:
224               module ietf-system {
225                 leaf system-reset {
226                   type empty;
227                 }
228               }
229            To invoke the 'system-restart' RPC operation:
230               POST /restconf/operations/ietf-system:system-restart
231            To discover the RPC operations supported by the server:
232               GET /restconf/operations
233            In XML the YANG module namespace identifies the module:
234              <system-restart
235                 xmlns='urn:ietf:params:xml:ns:yang:ietf-system' />
236            In JSON the YANG module name identifies the module:
237              { 'ietf-system:system-restart' : [null] }
238           ";
239       }
240
241       leaf yang-library-version {
242         type string {
243           pattern '\d{4}-\d{2}-\d{2}';
244         }
245         config false;
246         mandatory true;
247         description
248           "Identifies the revision date of the ietf-yang-library
249            module that is implemented by this RESTCONF server.
250            Indicates the year, month, and day in YYYY-MM-DD
251            numeric format.";
252       }
253     }
254   }
255
256 }