sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 1 | module yrt-ietf-yang-patch { |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 2 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 3 | yang-version 1.1; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 4 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 5 | namespace |
| 6 | "urn:ietf:params:xml:ns:yang:yrt-ietf-yang-patch"; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 7 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 8 | prefix ypatch; |
| 9 | |
| 10 | import yrt-ietf-restconf { |
| 11 | prefix rc; |
| 12 | } |
| 13 | |
| 14 | organization |
| 15 | "IETF NETCONF (Network Configuration) Working Group"; |
| 16 | |
| 17 | contact |
| 18 | "WG Web: <https://datatracker.ietf.org/wg/netconf/> |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 19 | WG List: <mailto:netconf@ietf.org> |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 20 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 21 | Author: Andy Bierman |
| 22 | <mailto:andy@yumaworks.com> |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 23 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 24 | Author: Martin Bjorklund |
| 25 | <mailto:mbj@tail-f.com> |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 26 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 27 | Author: Kent Watsen |
| 28 | <mailto:kwatsen@juniper.net>"; |
| 29 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 30 | description |
| 31 | "This module contains conceptual YANG specifications |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 32 | for the YANG Patch and YANG Patch Status data structures. |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 33 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 34 | Note that the YANG definitions within this module do not |
| 35 | represent configuration data of any kind. |
| 36 | The YANG grouping statements provide a normative syntax |
| 37 | for XML and JSON message-encoding purposes. |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 38 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 39 | Copyright (c) 2017 IETF Trust and the persons identified as |
| 40 | authors of the code. All rights reserved. |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 41 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 42 | Redistribution and use in source and binary forms, with or |
| 43 | without modification, is permitted pursuant to, and subject |
| 44 | to the license terms contained in, the Simplified BSD License |
| 45 | set forth in Section 4.c of the IETF Trust's Legal Provisions |
| 46 | Relating to IETF Documents |
| 47 | (http://trustee.ietf.org/license-info). |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 48 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 49 | This version of this YANG module is part of RFC 8072; see |
| 50 | the RFC itself for full legal notices."; |
| 51 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 52 | revision "2017-02-22" { |
| 53 | description "Initial revision."; |
| 54 | reference |
| 55 | "RFC 8072: YANG Patch Media Type."; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 56 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | rc:yang-data "yang-patch"; |
| 60 | rc:yang-data "yang-patch-status"; |
| 61 | |
| 62 | typedef target-resource-offset { |
| 63 | type string; |
| 64 | description |
| 65 | "Contains a data resource identifier string representing |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 66 | a sub-resource within the target resource. |
| 67 | The document root for this expression is the |
| 68 | target resource that is specified in the |
| 69 | protocol operation (e.g., the URI for the PATCH request). |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 70 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 71 | This string is encoded according to the same rules as those |
| 72 | for a data resource identifier in a RESTCONF request URI."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 73 | reference |
| 74 | "RFC 8040, Section 3.5.3."; |
| 75 | |
| 76 | } |
| 77 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 78 | uses yang-patch; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 79 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 80 | uses yang-patch-status; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 81 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 82 | grouping yang-patch { |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 83 | description |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 84 | "A grouping that contains a YANG container representing the |
| 85 | syntax and semantics of a YANG Patch edit request message."; |
| 86 | container yang-patch { |
| 87 | description |
| 88 | "Represents a conceptual sequence of datastore edits, |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 89 | called a patch. Each patch is given a client-assigned |
| 90 | patch identifier. Each edit MUST be applied |
| 91 | in ascending order, and all edits MUST be applied. |
| 92 | If any errors occur, then the target datastore MUST NOT |
| 93 | be changed by the YANG Patch operation. |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 94 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 95 | It is possible for a datastore constraint violation to occur |
| 96 | due to any node in the datastore, including nodes not |
| 97 | included in the 'edit' list. Any validation errors MUST |
| 98 | be reported in the reply message."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 99 | reference |
| 100 | "RFC 7950, Section 8.3."; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 101 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 102 | leaf patch-id { |
| 103 | type string; |
| 104 | mandatory true; |
| 105 | description |
| 106 | "An arbitrary string provided by the client to identify |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 107 | the entire patch. Error messages returned by the server |
| 108 | that pertain to this patch will be identified by this |
| 109 | 'patch-id' value. A client SHOULD attempt to generate |
| 110 | unique 'patch-id' values to distinguish between |
| 111 | transactions from multiple clients in any audit logs |
| 112 | maintained by the server."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 113 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 114 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 115 | leaf comment { |
| 116 | type string; |
| 117 | description |
| 118 | "An arbitrary string provided by the client to describe |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 119 | the entire patch. This value SHOULD be present in any |
| 120 | audit logging records generated by the server for the |
| 121 | patch."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 122 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 123 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 124 | list edit { |
| 125 | key "edit-id"; |
| 126 | ordered-by user; |
| 127 | description |
| 128 | "Represents one edit within the YANG Patch request message. |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 129 | The 'edit' list is applied in the following manner: |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 130 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 131 | - The first edit is conceptually applied to a copy |
| 132 | of the existing target datastore, e.g., the |
| 133 | running configuration datastore. |
| 134 | - Each ascending edit is conceptually applied to |
| 135 | the result of the previous edit(s). |
| 136 | - After all edits have been successfully processed, |
| 137 | the result is validated according to YANG constraints. |
| 138 | - If successful, the server will attempt to apply |
| 139 | the result to the target datastore."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 140 | leaf edit-id { |
| 141 | type string; |
| 142 | description |
| 143 | "Arbitrary string index for the edit. |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 144 | Error messages returned by the server that pertain |
| 145 | to a specific edit will be identified by this value."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 146 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 147 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 148 | leaf operation { |
| 149 | type enumeration { |
| 150 | enum "create" { |
| 151 | value 0; |
| 152 | description |
| 153 | "The target data node is created using the supplied |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 154 | value, only if it does not already exist. The |
| 155 | 'target' leaf identifies the data node to be |
| 156 | created, not the parent data node."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 157 | } |
| 158 | enum "delete" { |
| 159 | value 1; |
| 160 | description |
| 161 | "Delete the target node, only if the data resource |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 162 | currently exists; otherwise, return an error."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 163 | } |
| 164 | enum "insert" { |
| 165 | value 2; |
| 166 | description |
| 167 | "Insert the supplied value into a user-ordered |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 168 | list or leaf-list entry. The target node must |
| 169 | represent a new data resource. If the 'where' |
| 170 | parameter is set to 'before' or 'after', then |
| 171 | the 'point' parameter identifies the insertion |
| 172 | point for the target node."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 173 | } |
| 174 | enum "merge" { |
| 175 | value 3; |
| 176 | description |
| 177 | "The supplied value is merged with the target data |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 178 | node."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 179 | } |
| 180 | enum "move" { |
| 181 | value 4; |
| 182 | description |
| 183 | "Move the target node. Reorder a user-ordered |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 184 | list or leaf-list. The target node must represent |
| 185 | an existing data resource. If the 'where' parameter |
| 186 | is set to 'before' or 'after', then the 'point' |
| 187 | parameter identifies the insertion point to move |
| 188 | the target node."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 189 | } |
| 190 | enum "replace" { |
| 191 | value 5; |
| 192 | description |
| 193 | "The supplied value is used to replace the target |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 194 | data node."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 195 | } |
| 196 | enum "remove" { |
| 197 | value 6; |
| 198 | description |
| 199 | "Delete the target node if it currently exists."; |
| 200 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 201 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 202 | mandatory true; |
| 203 | description |
| 204 | "The datastore operation requested for the associated |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 205 | 'edit' entry."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 206 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 207 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 208 | leaf target { |
| 209 | type target-resource-offset; |
| 210 | mandatory true; |
| 211 | description |
| 212 | "Identifies the target data node for the edit |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 213 | operation. If the target has the value '/', then |
| 214 | the target data node is the target resource. |
| 215 | The target node MUST identify a data resource, |
| 216 | not the datastore resource."; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 217 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 218 | |
| 219 | leaf point { |
| 220 | when |
| 221 | "(../operation = 'insert' or ../operation = 'move')" |
| 222 | + "and (../where = 'before' or ../where = 'after')" { |
| 223 | description |
| 224 | "This leaf only applies for 'insert' or 'move' |
| 225 | operations, before or after an existing entry."; |
| 226 | } |
| 227 | type target-resource-offset; |
| 228 | description |
| 229 | "The absolute URL path for the data node that is being |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 230 | used as the insertion point or move point for the |
| 231 | target of this 'edit' entry."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 232 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 233 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 234 | leaf where { |
| 235 | when |
| 236 | "../operation = 'insert' or ../operation = 'move'" { |
| 237 | description |
| 238 | "This leaf only applies for 'insert' or 'move' |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 239 | operations."; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 240 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 241 | type enumeration { |
| 242 | enum "before" { |
| 243 | value 0; |
| 244 | description |
| 245 | "Insert or move a data node before the data resource |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 246 | identified by the 'point' parameter."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 247 | } |
| 248 | enum "after" { |
| 249 | value 1; |
| 250 | description |
| 251 | "Insert or move a data node after the data resource |
| 252 | identified by the 'point' parameter."; |
| 253 | } |
| 254 | enum "first" { |
| 255 | value 2; |
| 256 | description |
| 257 | "Insert or move a data node so it becomes ordered |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 258 | as the first entry."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 259 | } |
| 260 | enum "last" { |
| 261 | value 3; |
| 262 | description |
| 263 | "Insert or move a data node so it becomes ordered |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 264 | as the last entry."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 265 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 266 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 267 | default 'last'; |
| 268 | description |
| 269 | "Identifies where a data resource will be inserted |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 270 | or moved. YANG only allows these operations for |
| 271 | list and leaf-list data nodes that are |
| 272 | 'ordered-by user'."; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 273 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 274 | |
| 275 | anydata value { |
| 276 | when |
| 277 | "../operation = 'create' " |
| 278 | + "or ../operation = 'merge' " |
| 279 | + "or ../operation = 'replace' " |
| 280 | + "or ../operation = 'insert'" { |
| 281 | description |
| 282 | "The anydata 'value' is only used for 'create', |
| 283 | 'merge', 'replace', and 'insert' operations."; |
| 284 | } |
| 285 | description |
| 286 | "Value used for this edit operation. The anydata 'value' |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 287 | contains the target resource associated with the |
| 288 | 'target' leaf. |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 289 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 290 | For example, suppose the target node is a YANG container |
| 291 | named foo: |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 292 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 293 | container foo { |
| 294 | leaf a { type string; } |
| 295 | leaf b { type int32; } |
| 296 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 297 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 298 | The 'value' node contains one instance of foo: |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 299 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 300 | <value> |
| 301 | <foo xmlns='example-foo-namespace'> |
| 302 | <a>some value</a> |
| 303 | <b>42</b> |
| 304 | </foo> |
| 305 | </value> |
| 306 | "; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 307 | } |
| 308 | } // list edit |
| 309 | } // container yang-patch |
| 310 | } // grouping yang-patch |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 311 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 312 | grouping yang-patch-status { |
| 313 | description |
| 314 | "A grouping that contains a YANG container representing the |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 315 | syntax and semantics of a YANG Patch Status response |
| 316 | message."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 317 | container yang-patch-status { |
| 318 | description |
| 319 | "A container representing the response message sent by the |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 320 | server after a YANG Patch edit request message has been |
| 321 | processed."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 322 | leaf patch-id { |
| 323 | type string; |
| 324 | mandatory true; |
| 325 | description |
| 326 | "The 'patch-id' value used in the request."; |
| 327 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 328 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 329 | choice global-status { |
| 330 | description |
| 331 | "Report global errors or complete success. |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 332 | If there is no case selected, then errors |
| 333 | are reported in the 'edit-status' container."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 334 | case global-errors { |
| 335 | description |
| 336 | "This container will be present if global errors that |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 337 | are unrelated to a specific edit occurred."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 338 | uses rc:errors; |
| 339 | } // case global-errors |
| 340 | leaf ok { |
| 341 | type empty; |
| 342 | description |
| 343 | "This leaf will be present if the request succeeded |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 344 | and there are no errors reported in the 'edit-status' |
| 345 | container."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 346 | } |
| 347 | } // choice global-status |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 348 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 349 | container edit-status { |
| 350 | description |
| 351 | "This container will be present if there are |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 352 | edit-specific status responses to report. |
| 353 | If all edits succeeded and the 'global-status' |
| 354 | returned is 'ok', then a server MAY omit this |
| 355 | container."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 356 | list edit { |
| 357 | key "edit-id"; |
| 358 | description |
| 359 | "Represents a list of status responses, |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 360 | corresponding to edits in the YANG Patch |
| 361 | request message. If an 'edit' entry was |
| 362 | skipped or not reached by the server, |
| 363 | then this list will not contain a corresponding |
| 364 | entry for that edit."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 365 | leaf edit-id { |
| 366 | type string; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 367 | description |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 368 | "Response status is for the 'edit' list entry |
| 369 | with this 'edit-id' value."; |
| 370 | } |
| 371 | |
| 372 | choice edit-status-choice { |
| 373 | description |
| 374 | "A choice between different types of status |
| 375 | responses for each 'edit' entry."; |
| 376 | leaf ok { |
| 377 | type empty; |
| 378 | description |
| 379 | "This 'edit' entry was invoked without any |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 380 | errors detected by the server associated |
| 381 | with this edit."; |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 382 | } |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 383 | |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 384 | case errors { |
| 385 | description |
| 386 | "The server detected errors associated with the |
| 387 | edit identified by the same 'edit-id' value."; |
| 388 | uses rc:errors; |
| 389 | } // case errors |
| 390 | } // choice edit-status-choice |
| 391 | } // list edit |
| 392 | } // container edit-status |
| 393 | } // container yang-patch-status |
| 394 | } // grouping yang-patch-status |
| 395 | } // module ietf-yang-patch |