1 module ietf-restconf-client {
3 namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-client";
6 import ietf-yang-types {
9 "RFC 6991: Common YANG Data Types";
12 import ietf-tcp-client {
15 "RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
18 import ietf-tcp-server {
21 "RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
24 import ietf-tls-client {
27 "RFC FFFF: YANG Groupings for TLS Clients and TLS Servers";
30 import ietf-http-client {
33 "RFC GGGG: YANG Groupings for HTTP Clients and HTTP Servers";
37 "IETF NETCONF (Network Configuration) Working Group";
40 "WG Web: https://datatracker.ietf.org/wg/netconf
41 WG List: NETCONF WG list <mailto:netconf@ietf.org>
42 Author: Kent Watsen <mailto:kent+ietf@watsen.net>";
45 "This module contains a collection of YANG definitions
46 for configuring RESTCONF clients.
48 Copyright (c) 2024 IETF Trust and the persons identified
49 as authors of the code. All rights reserved.
51 Redistribution and use in source and binary forms, with
52 or without modification, is permitted pursuant to, and
53 subject to the license terms contained in, the Revised
54 BSD License set forth in Section 4.c of the IETF Trust's
55 Legal Provisions Relating to IETF Documents
56 (https://trustee.ietf.org/license-info).
58 This version of this YANG module is part of RFC IIII
59 (https://www.rfc-editor.org/info/rfcIIII); see the RFC
60 itself for full legal notices.
62 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
63 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
64 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
65 are to be interpreted as described in BCP 14 (RFC 2119)
66 (RFC 8174) when, and only when, they appear in all
67 capitals, as shown here.";
73 "RFC IIII: RESTCONF Client and Server Models";
78 feature https-initiate {
80 "The 'https-initiate' feature indicates that the RESTCONF
81 client supports initiating HTTPS connections to RESTCONF
82 servers. This feature exists as HTTPS might not be a
83 mandatory to implement transport in the future.";
85 "RFC 8040: RESTCONF Protocol";
90 "The 'http-listen' feature indicates that the RESTCONF client
91 supports opening a port to listen for incoming RESTCONF
92 server call-home connections using HTTP. This feature
93 exists as not all RESTCONF clients may support RESTCONF
96 "RFC 8071: NETCONF Call Home and RESTCONF Call Home";
99 feature https-listen {
101 "The 'https-listen' feature indicates that the RESTCONF client
102 supports opening a port to listen for incoming RESTCONF
103 server call-home connections using HTTPS. This feature
104 exists as not all RESTCONF clients may support RESTCONF
107 "RFC 8071: NETCONF Call Home and RESTCONF Call Home";
110 feature central-restconf-client-supported {
112 "The 'central-restconf-client-supported' feature indicates
113 that the server that implements this module supports
114 the top-level 'restconf-client' node.
116 This feature is needed as some servers may want to use
117 features defined in this module, which requires this
118 module to be implemented, without having to support
119 the top-level 'restconf-client' node.";
124 grouping restconf-client-grouping {
126 "A reusable grouping for configuring a RESTCONF client
127 without any consideration for how underlying transport
128 sessions are established.
130 This grouping currently does not define any nodes. It
131 exists only so the model can be consistent with other
132 'client-server' models.";
135 grouping restconf-client-initiate-stack-grouping {
137 "A reusable grouping for configuring a RESTCONF client
138 'initiate' protocol stack for a single outbound connection.";
143 "Selects between available transports.";
145 if-feature "https-initiate";
147 must 'tls-client-parameters/client-identity
148 or http-client-parameters/client-identity';
150 "TCP, TLS, HTTP, and RESTCONF configuration to
151 initiate a RESTCONF over HTTPS connection.";
152 container tcp-client-parameters {
154 "TCP-level client parameters to initiate
155 a RESTCONF over HTTPS connection.";
156 uses tcpc:tcp-client-grouping {
157 refine "remote-port" {
160 "The RESTCONF client will attempt to
161 connect to the IANA-assigned well-known
162 port value for 'https' (443) if no value
167 container tls-client-parameters {
169 "TLS-level client parameters to initiate
170 a RESTCONF over HTTPS connection.";
171 uses tlsc:tls-client-grouping;
173 container http-client-parameters {
175 "HTTP-level client parameters to initiate
176 a RESTCONF over HTTPS connection.";
177 uses httpc:http-client-grouping;
179 container restconf-client-parameters {
181 "RESTCONF-level client parameters to initiate
182 a RESTCONF over HTTPS connection.";
183 uses rcc:restconf-client-grouping;
188 } // restconf-client-initiate-stack-grouping
190 grouping restconf-client-listen-stack-grouping {
192 "A reusable grouping for configuring a RESTCONF client
193 'listen' protocol stack for listening on a single port. The
194 'listen' stack supports call home connections, as
195 described in RFC 8071";
197 "RFC 8071: NETCONF Call Home and RESTCONF Call Home";
201 "Selects between available transports.";
203 if-feature "http-listen";
206 "TCP, HTTP, and RESTCONF configuration to
207 listen for RESTCONF over HTTPS connections.
209 This transport option is made available to support
210 deployments where the TLS connections are terminated
211 by another system (e.g., a load balancer) fronting
213 container tcp-server-parameters {
215 "TCP-level server parameters to listen for
216 RESTCONF over HTTP connections.";
217 uses tcps:tcp-server-grouping {
218 refine "local-port" {
221 "The RESTCONF client will listen on the IANA-
222 assigned well-known port for 'restconf-ch-tls'
223 (4336) if no value is specified.";
227 container http-client-parameters {
229 "HTTP-level client parameters to listen for
230 RESTCONF over HTTP connections.";
231 uses httpc:http-client-grouping;
233 container restconf-client-parameters {
235 "RESTCONF-level client parameters to listen
236 for RESTCONF over HTTP connections.";
237 uses rcc:restconf-client-grouping;
242 if-feature "https-listen";
244 must 'tls-client-parameters/client-identity
245 or http-client-parameters/client-identity';
247 "TCP, TLS, HTTP, and RESTCONF configuration to
248 listen for RESTCONF over HTTPS connections.";
249 container tcp-server-parameters {
251 "TCP-level server parameters to listen
252 for RESTCONF over HTTPS connections.";
253 uses tcps:tcp-server-grouping {
254 refine "local-port" {
257 "The RESTCONF client will listen on the IANA-
258 assigned well-known port for 'restconf-ch-tls'
259 (4336) if no value is specified.";
263 container tls-client-parameters {
265 "TLS-level client parameters to listen
266 for RESTCONF over HTTPS connections.";
267 uses tlsc:tls-client-grouping;
269 container http-client-parameters {
271 "HTTP-level client parameters to listen
272 for RESTCONF over HTTPS connections.";
273 uses httpc:http-client-grouping;
275 container restconf-client-parameters {
277 "RESTCONF-level client parameters to listen
278 for RESTCONF over HTTPS connections.";
279 uses rcc:restconf-client-grouping;
284 } // restconf-client-listen-stack-grouping
286 grouping restconf-client-app-grouping {
288 "A reusable grouping for configuring a RESTCONF client
289 application that supports both 'initiate' and 'listen'
290 protocol stacks for a multiplicity of connections.";
292 if-feature "https-initiate";
294 "Indicates that client-initiated connections have been
295 configured. This statement is present so the mandatory
296 descendant nodes do not imply that this node must be
299 "Configures client initiating underlying TCP connections.";
300 list restconf-server {
304 "List of RESTCONF servers the RESTCONF client is to
305 maintain simultaneous connections with.";
309 "An arbitrary name for the RESTCONF server.";
311 container endpoints {
313 "Container for a list of endpoints.";
319 "A non-empty user-ordered list of endpoints for this
320 RESTCONF client to try to connect to in sequence.
321 Defining more than one enables high-availability.";
325 "An arbitrary name for this endpoint.";
327 uses restconf-client-initiate-stack-grouping;
330 container connection-type {
332 "Indicates the RESTCONF client's preference for how
333 the RESTCONF connection is maintained.";
334 choice connection-type {
337 "Selects between available connection types.";
338 case persistent-connection {
339 container persistent {
341 "Indicates that a persistent connection is to be
344 "Maintain a persistent connection to the
345 RESTCONF server. If the connection goes down,
346 immediately start trying to reconnect to the
347 RESTCONF server, using the reconnection strategy.
349 This connection type minimizes any RESTCONF server
350 to RESTCONF client data-transfer delay, albeit
351 at the expense of holding resources longer.";
354 case periodic-connection {
357 "Indicates that a periodic connection is to be
360 "Periodically connect to the RESTCONF server.
362 This connection type decreases resource
363 utilization, albeit with increased delay
364 in RESTCONF server to RESTCONF client
367 The RESTCONF client SHOULD gracefully close
368 the underlying TLS connection upon completing
371 Connections are established at the same start
372 time regardless how long the previous connection
375 In the case that the previous connection is
376 still active, establishing a new connection
377 is NOT RECOMMENDED.";
383 "Duration of time between periodic
387 type yang:date-and-time {
388 // constrained to minute-level granularity
389 pattern '[0-9]{4}-(1[0-2]|0[1-9])-(0[1-9]|[1-2]'
390 + '[0-9]|3[0-1])T(0[0-9]|1[0-9]|2[0-3]):['
391 + '0-5][0-9]:00(Z|[\+\-]((1[0-3]|0[0-9]):'
392 + '([0-5][0-9])|14:00))?';
395 "Designates a timestamp before or after which a
396 series of periodic connections are determined.
397 The periodic connections occur at a whole
398 multiple interval from the anchor time.
400 If an 'anchor-time' is not provided, then the
401 server may implicitly set it to the time when
402 this configuraton is applied (e.g., on boot).
404 For example, for an anchor time is 15 minutes
405 past midnight and a period interval of 24 hours,
406 then a periodic connection will occur 15 minutes
407 past midnight everyday.";
412 default "180"; // three minutes
414 "Specifies the maximum number of seconds
415 that the underlying TCP session may remain
416 idle. A TCP session will be dropped if it
417 is idle for an interval longer than this
418 number of seconds If set to zero, then the
419 RESTCONF client will never drop a session
420 because it is idle.";
423 } // periodic-connection
426 container reconnect-strategy {
428 "The reconnection strategy directs how a RESTCONF
429 client reconnects to a RESTCONF server, after
430 discovering its connection to the server has
431 dropped, even if due to a reboot. The RESTCONF
432 client starts with the specified endpoint and
433 tries to connect to it max-attempts times before
434 trying the next endpoint in the list (round
440 "Indicates that reconnections should start
441 with the first endpoint listed.";
443 enum last-connected {
445 "Indicates that reconnections should start
446 with the endpoint last connected to. If
447 no previous connection has ever been
448 established, then the first endpoint
449 configured is used. RESTCONF clients
450 SHOULD be able to remember the last
451 endpoint connected to across reboots.";
453 enum random-selection {
455 "Indicates that reconnections should start with
459 default "first-listed";
461 "Specifies which of the RESTCONF server's
462 endpoints the RESTCONF client should start
463 with when trying to connect to the RESTCONF
473 "Specifies the amount of time in seconds after which,
474 if the connection is not established, an endpoint
475 connection attempt is considered unsuccessful.";
483 "Specifies the number times the RESTCONF client
484 tries to connect to a specific endpoint before
485 moving on to the next endpoint in the list
493 if-feature "http-listen or https-listen";
495 "Indicates that client-listening ports have been configured.
496 This statement is present so the mandatory descendant nodes
497 do not imply that this node must be configured.";
499 "Configures the client to accept call-home TCP connections.";
503 default "180"; // three minutes
505 "Specifies the maximum number of seconds that an
506 underlying TCP session may remain idle. A TCP session
507 will be dropped if it is idle for an interval longer
508 then this number of seconds. If set to zero, then
509 the server will never drop a session because it is
512 container endpoints {
514 "Container for a list of endpoints.";
519 "List of endpoints to listen for RESTCONF connections.";
523 "An arbitrary name for the RESTCONF listen endpoint.";
525 uses restconf-client-listen-stack-grouping;
529 } // restconf-client-app-grouping
531 // Protocol accessible node for servers that implement this module.
532 container restconf-client {
533 if-feature central-restconf-client-supported;
534 uses restconf-client-app-grouping;
536 "Top-level container for RESTCONF client configuration.";