1 .. _netconf-user-guide:
17 NETCONF is an XML-based protocol used for configuration and monitoring
18 devices in the network. The base NETCONF protocol is described in
19 `RFC-6241 <https://www.rfc-editor.org/rfc/rfc6241>`__.
21 **NETCONF in OpenDaylight:.**
23 OpenDaylight supports the NETCONF protocol as a northbound server as
24 well as a southbound plugin. It also includes a set of test tools for
25 simulating NETCONF devices and clients.
27 Southbound (netconf-connector)
28 ------------------------------
30 The NETCONF southbound plugin is capable of connecting to remote NETCONF
31 devices and exposing their configuration/operational datastores, RPCs
32 and notifications as MD-SAL mount points. These mount points allow
33 applications and remote users (over RESTCONF) to interact with the
36 In terms of RFCs, the connector supports:
38 - `RFC-6241 <https://www.rfc-editor.org/rfc/rfc6241>`__
40 - `RFC-5277 <https://www.rfc-editor.org/rfc/rfc5277>`__
42 - `RFC-6022 <https://www.rfc-editor.org/rfc/rfc6022>`__
44 - `RFC-7895 <https://www.rfc-editor.org/rfc/rfc7895>`__
46 **Netconf-connector is fully model-driven (utilizing the YANG modeling
47 language) so in addition to the above RFCs, it supports any
48 data/RPC/notifications described by a YANG model that is implemented by
53 NETCONF southbound can be activated by installing
54 ``odl-netconf-connector-all`` Karaf feature.
56 .. _netconf-connector:
58 Netconf-connector configuration
59 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 NETCONF connectors are configured directly through the usage of the
62 network-topology model. You can configure new NETCONF connectors both
63 through the NETCONF server for MD-SAL (port 2830) or RESTCONF. This guide
68 Since 2022.09 Chlorine there is only one RESTCONF endpoint:
70 - | ``http://localhost:8181/rests`` is related to `RFC-8040 <https://www.rfc-editor.org/rfc/rfc8040>`__,
71 | can be activated by installing ``odl-restconf-nb``
74 | Resources for configuration and operational datastores start
77 http://localhost:8181/rests/data/network-topology:network-topology
78 with response of both datastores. It's allowed to use query
79 parameters to distinguish between them.
81 http://localhost:8181/rests/data/network-topology:network-topology?content=config
82 for configuration datastore
84 http://localhost:8181/rests/data/network-topology:network-topology?content=nonconfig
85 for operational datastore.
87 | Also if a data node in the path expression is a YANG leaf-list or list
88 node, the path segment has to be constructed by having leaf-list or
89 list node name, followed by an "=" character, then followed by the
90 leaf-list or list value. Any reserved characters must be
93 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf?content=config
94 for retrieving data from configuration datastore for
95 topology-netconf value of topology list.
100 1. OpenDaylight is running
102 2. In Karaf, you must have the ``odl-netconf-topology`` or
103 ``odl-netconf-clustered-topology`` feature installed.
105 3. Feature ``odl-restconf-nb`` must be installed
107 Spawning new NETCONF connectors
108 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110 To create a new NETCONF connector you need to send the following PUT request
117 - http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device
119 You could use the same body to create the new NETCONF connector with a POST
120 without specifying the node in the URL:
126 - http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf
128 Payload for password authentication:
134 **Content-type:** ``application/xml``
136 **Accept:** ``application/xml``
138 **Authentication:** ``admin:admin``
142 <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
143 <node-id>new-netconf-device</node-id>
144 <host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
145 <port xmlns="urn:opendaylight:netconf-node-topology">17830</port>
146 <login-password-unencrypted xmlns="urn:opendaylight:netconf-node-topology">
147 <username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
148 <password xmlns="urn:opendaylight:netconf-node-topology">admin</password>
149 </login-password-unencrypted>
150 <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
151 <!-- non-mandatory fields with default values, you can safely remove these if you do not wish to override any of these values-->
152 <reconnect-on-changed-schema xmlns="urn:opendaylight:netconf-node-topology">false</reconnect-on-changed-schema>
153 <connection-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">20000</connection-timeout-millis>
154 <max-connection-attempts xmlns="urn:opendaylight:netconf-node-topology">0</max-connection-attempts>
155 <min-backoff-millis xmlns="urn:opendaylight:netconf-node-topology">2000</min-backoff-millis>
156 <max-backoff-millis xmlns="urn:opendaylight:netconf-node-topology">1800000</max-backoff-millis>
157 <backoff-multiplier xmlns="urn:opendaylight:netconf-node-topology">1.5</backoff-multiplier>
158 <!-- keepalive-delay set to 0 turns off keepalives-->
159 <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">120</keepalive-delay>
164 **Content-type:** ``application/json``
166 **Accept:** ``application/json``
168 **Authentication:** ``admin:admin``
175 "node-id": "new-netconf-device",
176 "netconf-node-topology:port": 17830,
177 "netconf-node-topology:reconnect-on-changed-schema": false,
178 "netconf-node-topology:connection-timeout-millis": 20000,
179 "netconf-node-topology:tcp-only": false,
180 "netconf-node-topology:max-connection-attempts": 0,
181 "netconf-node-topology:login-password-unencrypted": {
182 "netconf-node-topology:username": "admin",
183 "netconf-node-topology:password": "admin"
185 "netconf-node-topology:host": "127.0.0.1",
186 "netconf-node-topology:min-backoff-millis": 2000,
187 "netconf-node-topology:max-backoff-millis": 1800000,
188 "netconf-node-topology:backoff-multiplier": 1.5,
189 "netconf-node-topology:keepalive-delay": 120
196 You have the option to use the 'login-password' configuration for authentication as shown below:
201 "netconf-node-topology:username": "netconf",
202 "netconf-node-topology:password": "c5R3aLBss7J8T2VC3pEeAQ=="
205 In OpenDaylight's configuration, the AAAEncryptionServiceImpl generates a new encryption key with
206 each application build. You can use this method if you have access to the current encryption key.
207 Additionally, it is important to ensure that the entire password is encoded in base64 format and
208 that its length is a multiple of 16 bytes for successful authentication.
210 There is also option of using key-based authentication instead
211 of password. First we need to create key in datastore.
213 *Adding a client private key credential to the netconf-keystore*
218 /rests/operations/netconf-keystore:add-keystore-entry
219 Content-Type: application/json
220 Accept: application/json
228 "key-id": "example-client-key-id",
229 "private-key": "PEM-format-private-key",
230 "passphrase": "passphrase"
236 After we can use this key to create connector using this key.
238 Payload for key-based authentication via SSH:
244 **Content-type:** ``application/xml``
246 **Accept:** ``application/xml``
248 **Authentication:** ``admin:admin``
252 <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
253 <node-id>new-netconf-device</node-id>
254 <host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
255 <port xmlns="urn:opendaylight:netconf-node-topology">17830</port>
256 <key-based xmlns="urn:opendaylight:netconf-node-topology">
257 <username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
258 <key-id xmlns="urn:opendaylight:netconf-node-topology">key-id</password>
260 <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
261 <!-- non-mandatory fields with default values, you can safely remove these if you do not wish to override any of these values-->
262 <reconnect-on-changed-schema xmlns="urn:opendaylight:netconf-node-topology">false</reconnect-on-changed-schema>
263 <connection-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">20000</connection-timeout-millis>
264 <max-connection-attempts xmlns="urn:opendaylight:netconf-node-topology">0</max-connection-attempts>
265 <min-backoff-millis xmlns="urn:opendaylight:netconf-node-topology">2000</min-backoff-millis>
266 <max-backoff-millis xmlns="urn:opendaylight:netconf-node-topology">1800000</max-backoff-millis>
267 <backoff-multiplier xmlns="urn:opendaylight:netconf-node-topology">1.5</backoff-multiplier>
268 <!-- keepalive-delay set to 0 turns off keepalives-->
269 <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">120</keepalive-delay>
274 **Content-type:** ``application/json``
276 **Accept:** ``application/json``
278 **Authentication:** ``admin:admin``
285 "node-id": "new-netconf-device",
286 "netconf-node-topology:port": 17830,
287 "netconf-node-topology:reconnect-on-changed-schema": false,
288 "netconf-node-topology:connection-timeout-millis": 20000,
289 "netconf-node-topology:tcp-only": false,
290 "netconf-node-topology:max-connection-attempts": 0,
291 "netconf-node-topology:key-based": {
292 "netconf-node-topology:username": "admin",
293 "netconf-node-topology:key-id": "key-id"
295 "netconf-node-topology:host": "127.0.0.1",
296 "netconf-node-topology:min-backoff-millis": 2000,
297 "netconf-node-topology:max-backoff-millis": 1800000,
298 "netconf-node-topology:backoff-multiplier": 1.5,
299 "netconf-node-topology:keepalive-delay": 120
304 Connecting via TLS protocol is similar to SSH. First setup keystore
305 by using three RPCs from `Configure device to connect over TLS protocol`_
306 to add a client private key, associate a private key with a client and CA
307 certificates chain and add a list of trusted CA and server certificates.
308 Only after that we can process and create a new NETCONF connector you need
309 to send the following PUT request.
311 Payload for key-based authentication via TLS:
317 **Content-type:** ``application/xml``
319 **Accept:** ``application/xml``
321 **Authentication:** ``admin:admin``
325 <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
326 <node-id>new-netconf-device</node-id>
327 <host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
328 <port xmlns="urn:opendaylight:netconf-node-topology">17830</port>
329 <key-based xmlns="urn:opendaylight:netconf-node-topology">
330 <username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
331 <key-id xmlns="urn:opendaylight:netconf-node-topology">key-id</password>
333 <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
334 <!-- non-mandatory fields with default values, you can safely remove these if you do not wish to override any of these values-->
335 <reconnect-on-changed-schema xmlns="urn:opendaylight:netconf-node-topology">false</reconnect-on-changed-schema>
336 <connection-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">20000</connection-timeout-millis>
337 <max-connection-attempts xmlns="urn:opendaylight:netconf-node-topology">0</max-connection-attempts>
338 <min-backoff-millis xmlns="urn:opendaylight:netconf-node-topology">2000</min-backoff-millis>
339 <max-backoff-millis xmlns="urn:opendaylight:netconf-node-topology">1800000</max-backoff-millis>
340 <backoff-multiplier xmlns="urn:opendaylight:netconf-node-topology">1.5</backoff-multiplier>
341 <!-- keepalive-delay set to 0 turns off keepalives-->
342 <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">120</keepalive-delay>
343 <protocol xmlns="urn:opendaylight:netconf-node-topology">
344 <name xmlns="urn:opendaylight:netconf-node-topology">TLS</name>
350 **Content-type:** ``application/json``
352 **Accept:** ``application/json``
354 **Authentication:** ``admin:admin``
361 "node-id": "new-netconf-device",
362 "netconf-node-topology:port": 17830,
363 "netconf-node-topology:reconnect-on-changed-schema": false,
364 "netconf-node-topology:connection-timeout-millis": 20000,
365 "netconf-node-topology:tcp-only": false,
366 "netconf-node-topology:max-connection-attempts": 0,
367 "netconf-node-topology:key-based": {
368 "netconf-node-topology:username": "admin",
369 "netconf-node-topology:key-id": "key-id"
371 "netconf-node-topology:host": "127.0.0.1",
372 "netconf-node-topology:min-backoff-millis": 2000,
373 "netconf-node-topology:max-backoff-millis": 1800000,
374 "netconf-node-topology:backoff-multiplier": 1.5,
375 "netconf-node-topology:keepalive-delay": 120,
384 Note that the device name in <node-id> element must match the last
385 element of the restconf URL.
387 Reconfiguring an existing connector
388 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
390 The steps to reconfigure an existing connector are exactly the same as
391 when spawning a new connector. The old connection will be disconnected
392 and a new connector with the new configuration will be created. This needs
393 to be done with a PUT request because the node already exists. A POST
394 request will fail for that reason.
396 Additionally, a PATCH request can be used to modify an existing
397 configuration. Currently, only yang-patch (`RFC-8072 <https://www.rfc-editor.org/rfc/rfc8072>`__)
398 is supported. The URL would be the same as the above PUT examples.
399 Using JSON for the body, the headers needed for the request would
404 - Accept: application/yang-data+json
406 - Content-Type: application/yang-patch+json
408 Example JSON payload to modify the password entry:
413 "ietf-restconf:yang-patch" : {
418 "operation" : "merge",
423 "node-id": "new-netconf-device",
424 "netconf-node-topology:password" : "newpassword"
433 Deleting an existing connector
434 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
436 To remove an already configured NETCONF connector you need to send a
437 DELETE request to the same PUT request URL that was used to create the
444 - http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device
448 No body is needed to delete the node/device
450 Connecting to a device not supporting NETCONF monitoring
451 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
453 The netconf-connector in OpenDaylight relies on ietf-netconf-monitoring
454 support when connecting to remote NETCONF device. The
455 ietf-netconf-monitoring support allows netconf-connector to list and
456 download all YANG schemas that are used by the device. NETCONF connector
457 can only communicate with a device if it knows the set of used schemas
458 (or at least a subset). However, some devices use YANG models internally
459 but do not support NETCONF monitoring. Netconf-connector can also
460 communicate with these devices, but you have to side load the necessary
461 yang models into OpenDaylight’s YANG model cache for netconf-connector.
462 In general there are 2 situations you might encounter:
464 **1. NETCONF device does not support ietf-netconf-monitoring but it does
465 list all its YANG models as capabilities in HELLO message**
467 This could be a device that internally uses only ietf-inet-types YANG
468 model with revision 2010-09-24. In the HELLO message that is sent from
469 this device there is this capability reported:
473 urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2010-09-24
475 **For such devices you only need to put the schema into folder
476 cache/schema inside your Karaf distribution.**
480 The file with YANG schema for ietf-inet-types has to be called
481 ietf-inet-types@2010-09-24.yang. It is the required naming format of
484 **2. NETCONF device does not support ietf-netconf-monitoring and it does
485 NOT list its YANG models as capabilities in HELLO message**
487 Compared to device that lists its YANG models in HELLO message, in this
488 case there would be no capability with ietf-inet-types in the HELLO
489 message. This type of device basically provides no information about the
490 YANG schemas it uses so its up to the user of OpenDaylight to properly
491 configure netconf-connector for this device.
493 Netconf-connector has an optional configuration attribute called
494 yang-module-capabilities and this attribute can contain a list of "YANG
495 module based" capabilities. So by setting this configuration attribute,
496 it is possible to override the "yang-module-based" capabilities reported
497 in HELLO message of the device. To do this, we need to modify the
498 configuration of netconf-connector like in the example below:
504 **Content-type:** ``application/xml``
506 **Accept:** ``application/xml``
508 **Authentication:** ``admin:admin``
512 <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
513 <node-id>r5</node-id>
514 <host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
515 <port xmlns="urn:opendaylight:netconf-node-topology">8305</port>
516 <login-password-unencrypted xmlns="urn:opendaylight:netconf-node-topology">
517 <username xmlns="urn:opendaylight:netconf-node-topology">root</username>
518 <password xmlns="urn:opendaylight:netconf-node-topology">root</password>
519 </login-password-unencrypted>
520 <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
521 <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">30</keepalive-delay>
522 <yang-module-capabilities xmlns="urn:opendaylight:netconf-node-topology">
523 <override>true</override>
524 <capability xmlns="urn:opendaylight:netconf-node-topology">
525 urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2013-07-15
527 </yang-module-capabilities>
532 **Content-type:** ``application/json``
534 **Accept:** ``application/json``
536 **Authentication:** ``admin:admin``
544 "netconf-node-topology:host": "127.0.0.1",
545 "netconf-node-topology:login-password-unencrypted": {
546 "netconf-node-topology:password": "root",
547 "netconf-node-topology:username": "root"
549 "netconf-node-topology:yang-module-capabilities": {
552 "urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2013-07-15"
555 "netconf-node-topology:port": 8305,
556 "netconf-node-topology:tcp-only": false,
557 "netconf-node-topology:keepalive-delay": 30
562 **Remember to also put the YANG schemas into the cache folder.**
566 For putting multiple capabilities, you just need to replicate the
567 capability element inside yang-module-capability element.
568 Capability element is modeled as a leaf-list. With this
569 configuration, we would make the remote device report usage of
570 ietf-inet-types in the eyes of netconf-connector.
572 Connecting to a device supporting only NETCONF 1.0
573 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
575 OpenDaylight is schema-based distribution and heavily depends on YANG
576 models. However some legacy NETCONF devices are not schema-based and
577 implement just RFC 4741. This type of device does not utilize YANG
578 models internally and OpenDaylight does not know how to communicate
579 with such devices, how to validate data, or what the semantics of data
582 NETCONF connector can communicate also with these devices, but the
583 trade-offs are worsened possibilities in utilization of NETCONF
584 mountpoints. Using RESTCONF with such devices is not supported. Also
585 communicating with schemaless devices from application code is slightly
588 To connect to schemaless device, there is a optional configuration option
589 in netconf-node-topology model called schemaless. You have to set this
592 Clustered NETCONF connector
593 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
595 To spawn NETCONF connectors that are cluster-aware you need to install
596 the ``odl-netconf-clustered-topology`` karaf feature.
600 The ``odl-netconf-topology`` and ``odl-netconf-clustered-topology``
601 features are considered **INCOMPATIBLE**. They both manage the same
602 space in the datastore and would issue conflicting writes if
605 Configuration of clustered NETCONF connectors works the same as the
606 configuration through the topology model in the previous section.
608 When a new clustered connector is configured the configuration gets
609 distributed among the member nodes and a NETCONF connector is spawned on
610 each node. From these nodes a master is chosen which handles the schema
611 download from the device and all the communication with the device. You
612 will be able to read/write to/from the device from all slave nodes due
613 to the proxy data brokers implemented.
615 You can use the ``odl-netconf-clustered-topology`` feature in a single
616 node scenario as well but the code that uses akka will be used, so for a
617 scenario where only a single node is used, ``odl-netconf-topology``
620 Netconf-connector utilization
621 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
623 Once the connector is up and running, users can utilize the new mount
624 point instance. By using RESTCONF or from their application code. This
625 chapter deals with using RESTCONF and more information for app
626 developers can be found in the developers guide or in the official
627 tutorial application **ncmount** that can be found in the coretutorials
630 - https://github.com/opendaylight/coretutorials/tree/master/ncmount
632 Reading data from the device
633 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
635 Just invoke (no body needed):
638 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount?content=nonconfig
640 This will return the entire content of operation datastore from the
641 device. To view just the configuration datastore, change **nonconfig**
642 in this URL to **config**.
644 Writing configuration data to the device
645 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
647 In general, you cannot simply write any data you want to the device. The
648 data have to conform to the YANG models implemented by the device. In
649 this example we are adding a new interface-configuration to the mounted
650 device (assuming the device supports Cisco-IOS-XR-ifmgr-cfg YANG model).
651 In fact this request comes from the tutorial dedicated to the
652 **ncmount** tutorial app.
655 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount/Cisco-IOS-XR-ifmgr-cfg:interface-configurations
659 <interface-configuration xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg">
661 <interface-name>mpls</interface-name>
662 <description>Interface description</description>
663 <bandwidth>32</bandwidth>
664 <link-status></link-status>
665 </interface-configuration>
667 Should return 200 response code with no body.
671 This call is transformed into a couple of NETCONF RPCs. Resulting
672 NETCONF RPCs that go directly to the device can be found in the
673 OpenDaylight logs after invoking ``log:set TRACE
674 org.opendaylight.controller.sal.connect.netconf`` in the Karaf
675 shell. Seeing the NETCONF RPCs might help with debugging.
677 This request is very similar to the one where we spawned a new netconf
678 device. That’s because we used the loopback netconf-connector to write
679 configuration data into config-subsystem datastore and config-subsystem
680 picked it up from there.
685 Devices can implement any additional RPC and as long as it provides YANG
686 models for it, it can be invoked from OpenDaylight. Following example
687 shows how to invoke the get-schema RPC (get-schema is quite common among
688 netconf devices). Invoke:
691 http://localhost:8181/rests/operations/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount/ietf-netconf-monitoring:get-schema
695 <input xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
696 <identifier>ietf-yang-types</identifier>
697 <version>2013-07-15</version>
700 This call should fetch the source for ietf-yang-types YANG model from
703 Receiving Netconf Device Notifications on a http client
704 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
706 Devices emit netconf alarms and notifications in certain situations, which can demand
707 attention from Device Administration. The notifications are received as Netconf messages on an
708 active Netconf session.
710 Opendaylight provides the way to stream the device notifications over a http session.
712 - Step 1: Mount the device (assume node name is test_device)
714 - Step 2: Wait for the device to be connected.
716 - Step 3: Create the Subscription for notification on the active session.
721 http://localhost:8181/rests/operations/network-topology:network-topology/topology=topology-netconf/node=test_device/yang-ext:mount/notifications:create-subscription
722 Content-Type: application/json
723 Accept: application/json
733 - Step 4: Create the http Stream for the events.
738 http://localhost:8181/rests/operations/odl-device-notification:subscribe-device-notification
739 Content-Type: application/json
740 Accept: application/json
746 "path":"/network-topology:network-topology/topology[topology-id='topology-netconf']/node[node-id='test_device']"
750 The response suggests the http url for reading the notifications.
755 "odl-device-notification:output": {
756 "stream-path": "http://localhost:8181/rests/notif/test_device?notificationType=test_device"
760 - Step 5: User can access the url in the response and the notifications will be as follows.
765 http://localhost:8181/rests/notif/test_device?notificationType=test_device
766 Content-Type: application/xml
767 Accept: application/xml
782 data: <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"><eventTime>2022-06-17T07:01:08.60228Z</eventTime><netconf-session-start xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"><username>root</username><source-host>127.0.0.1</source-host><session-id>2</session-id></netconf-session-start></notification>
784 data: <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"><eventTime>2022-06-17T07:01:12.458258Z</eventTime><netconf-session-end xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"><username>root</username><source-host>127.0.0.1</source-host><termination-reason>closed</termination-reason><session-id>2</session-id></netconf-session-end></notification>
786 Change event notification subscription tutorial
787 -----------------------------------------------
789 Subscribing to data change notifications makes it possible to obtain
790 notifications about data manipulation (insert, change, delete) which are
791 done on any specified **path** of any specified **datastore** with
792 specific **scope**. In following examples *{odlAddress}* is address of
793 server where ODL is running and *{odlPort}* is port on which
794 OpenDaylight is running. OpenDaylight offers two methods for receiving notifications:
795 Server-Sent Events (SSE) and WebSocket. SSE is the default notification mechanism used in OpenDaylight.
797 SSE notifications subscription process
798 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
800 In this section we will learn what steps need to be taken in order to
801 successfully subscribe to data change event notifications.
806 In order to use event notifications you first need to call RPC that
807 creates notification stream that you can later listen to. You need to
808 provide three parameters to this RPC:
810 - **path**: data store path that you plan to listen to. You can
811 register listener on containers, lists and leaves.
813 - **datastore**: data store type. *OPERATIONAL* or *CONFIGURATION*.
815 - **scope**: Represents scope of data change. Possible options are:
817 - BASE: only changes directly to the data tree node specified in the
818 path will be reported
820 - ONE: changes to the node and to direct child nodes will be
823 - SUBTREE: changes anywhere in the subtree starting at the node will
826 The RPC to create the stream can be invoked via RESTCONF like this:
831 URI: http://{odlAddress}:{odlPort}/rests/operations/sal-remote:create-data-change-event-subscription
832 HEADER: Content-Type=application/json
833 Accept=application/json
839 "path": "/toaster:toaster/toaster:toasterStatus",
840 "sal-remote-augment:datastore": "OPERATIONAL",
841 "sal-remote-augment:scope": "ONE"
845 The response should look something like this:
850 "sal-remote:output": {
851 "stream-name": "data-change-event-subscription/toaster:toaster/toaster:toasterStatus/datastore=CONFIGURATION/scope=SUBTREE"
855 **stream-name** is important because you will need to use it when you
856 subscribe to the stream in the next step.
860 Internally, this will create a new listener for *stream-name* if it
861 did not already exist.
866 In order to subscribe to stream and obtain SSE location you need
867 to call *GET* on your stream path. The URI should generally be
868 `http://{odlAddress}:{odlPort}/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream/{streamName}`,
869 where *{streamName}* is the *stream-name* parameter contained in
870 response from *create-data-change-event-subscription* RPC from the
876 URI: http://{odlAddress}:{odlPort}/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream/data-change-event-subscription/toaster:toaster/datastore=CONFIGURATION/scope=SUBTREE
878 The subscription call may be modified with the following query parameters defined in the RESTCONF RFC:
880 - `filter <https://www.rfc-editor.org/rfc/rfc8040#section-4.8.4>`__
882 - `start-time <https://www.rfc-editor.org/rfc/rfc8040#section-4.8.7>`__
884 - `end-time <https://www.rfc-editor.org/rfc/rfc8040#section-4.8.8>`__
886 In addition, the following ODL extension query parameter is supported:
888 :odl-leaf-nodes-only:
889 If this parameter is set to "true", create and update notifications will only
890 contain the leaf nodes modified instead of the entire subscription subtree.
891 This can help in reducing the size of the notifications.
893 :odl-skip-notification-data:
894 If this parameter is set to "true", create and update notifications will only
895 contain modified leaf nodes without data.
896 This can help in reducing the size of the notifications.
898 The response should look something like this:
903 "subscribe-to-notification:location": "http://localhost:8181/rests/notif/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=SUBTREE"
908 During this phase there is an internal check for to see if a
909 listener for the *stream-name* from the URI exists. If not, new a
910 new listener is registered with the DOM data broker.
912 Receive notifications
913 ^^^^^^^^^^^^^^^^^^^^^
915 Once you got SSE location you can now connect to it and
916 start receiving data change events. The request should look something like this:
920 curl -v -X GET http://localhost:8181/rests/notif/data-change-event-subscription/toaster:toaster/toasterStatus/datastore=OPERATIONAL/scope=ONE -H "Content-Type: text/event-stream" -H "Authorization: Basic YWRtaW46YWRtaW4="
923 WebSocket notifications subscription process
924 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
926 Enabling WebSocket notifications in OpenDaylight requires a manual setup before starting the application.
927 The following steps can be followed to enable WebSocket notifications in OpenDaylight:
929 1. Open the file `org.opendaylight.restconf.nb.rfc8040.cfg`, at `etc/` folder inside your Karaf distribution. Or create in case it does not exist.
930 2. Locate the `use-sse` configuration parameter and change its value from `true` to `false`. Or add ``use-sse=false`` as new line in case this parameter is not present.
931 3. Save the changes made to the `org.opendaylight.restconf.nb.rfc8040.cfg` file.
932 4. Restart OpenDaylight if it is already running.
934 Once these steps are completed, WebSocket notifications will be enabled in OpenDaylight,
935 and they can be used for receiving notifications instead of SSE.
937 WebSocket Notifications subscription process is the same as SSE until you receive a location of WebSocket.
938 You can follow steps given above and after subscribing to a notification stream over WebSocket,
939 you will receive a response indicating that the subscription was successful:
944 "subscribe-to-notification:location": "ws://localhost:8181/rests/notif/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=SUBTREE"
947 You can use this WebSocket to listen to data
948 change notifications. To listen to notifications you can use a
949 JavaScript client or if you are using chrome browser you can use the
951 Client <https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo>`__.
953 Also, for testing purposes, there is simple Java application named
954 WebSocketClient. The application is placed in the
955 */restconf/websocket-client* project. It accepts a WebSocket URI
956 as an input parameter. After starting the utility (WebSocketClient
957 class directly in Eclipse/InteliJ Idea) received notifications should be
958 displayed in console.
960 Notifications are always in XML format and look like this:
964 <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
965 <eventTime>2014-09-11T09:58:23+02:00</eventTime>
966 <data-changed-notification xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote">
968 <path xmlns:meae="http://netconfcentral.org/ns/toaster">/meae:toaster</path>
969 <operation>updated</operation>
971 <!-- updated data -->
974 </data-changed-notification>
980 The typical use case is listening to data change events to update web
981 page data in real time. In this tutorial we will be using toaster as the
984 When you call *make-toast* RPC, it sets *toasterStatus* to "down" to
985 reflect that the toaster is busy making toast. When it finishes,
986 *toasterStatus* is set to "up" again. We will listen to these toaster
987 status changes in data store and will reflect it on our web page in
988 real-time thanks to WebSocket data change notification.
990 Simple javascript client implementation
991 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
993 We will create a simple JavaScript web application that will listen for
994 updates on *toasterStatus* leaf and update some elements of our web page
995 according to the new toaster status state.
1000 First you need to create stream that you are planning to subscribe to.
1001 This can be achieved by invoking "create-data-change-event-subscription"
1002 RPC on RESTCONF via AJAX request. You need to provide data store
1003 **path** that you plan to listen on, **data store type** and **scope**.
1004 If the request is successful you can extract the **stream-name** from
1005 the response and use that to subscribe to the newly created stream. The
1006 *{username}* and *{password}* fields represent the credentials that you
1007 use to connect to OpenDaylight via RESTCONF:
1011 The default user name and password are "admin".
1013 .. code-block:: javascript
1015 function createStream() {
1018 url: 'http://{odlAddress}:{odlPort}/rests/operations/sal-remote:create-data-change-event-subscription',
1021 'Authorization': 'Basic ' + btoa('{username}:{password}'),
1022 'Content-Type': 'application/json'
1024 data: JSON.stringify(
1027 'path': '/toaster:toaster/toaster:toasterStatus',
1028 'sal-remote-augment:datastore': 'OPERATIONAL',
1029 'sal-remote-augment:scope': 'ONE'
1033 }).done(function (data) {
1034 // this function will be called when ajax call is executed successfully
1035 subscribeToStream(data.output['stream-name']);
1036 }).fail(function (data) {
1037 // this function will be called when ajax call fails
1038 console.log("Create stream call unsuccessful");
1045 The Next step is to subscribe to the stream. To subscribe to the stream
1046 you need to call *GET* on
1047 *http://{odlAddress}:{odlPort}/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream/{stream-name}*.
1048 If the call is successful, you get WebSocket address for this stream in
1049 **Location** parameter inside response header. You can get response
1050 header by calling *getResponseHeader(\ *Location*)* on HttpRequest
1051 object inside *done()* function call:
1053 .. code-block:: javascript
1055 function subscribeToStream(streamName) {
1058 url: 'http://{odlAddress}:{odlPort}/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream/' + streamName;
1061 'Authorization': 'Basic ' + btoa('{username}:{password}'),
1064 ).done(function (data, textStatus, httpReq) {
1065 // we need function that has http request object parameter in order to access response headers.
1066 listenToNotifications(httpReq.getResponseHeader('Location'));
1067 }).fail(function (data) {
1068 console.log("Subscribe to stream call unsuccessful");
1072 Receive notifications
1073 ^^^^^^^^^^^^^^^^^^^^^
1075 Once you have WebSocket server location you can now connect to it and
1076 start receiving data change events. You need to define functions that
1077 will handle events on WebSocket. In order to process incoming events
1078 from OpenDaylight you need to provide a function that will handle
1079 *onmessage* events. The function must have one parameter that represents
1080 the received event object. The event data will be stored in
1081 *event.data*. The data will be in an XML format that you can then easily
1084 .. code-block:: javascript
1086 function listenToNotifications(socketLocation) {
1088 var notificatinSocket = new WebSocket(socketLocation);
1090 notificatinSocket.onmessage = function (event) {
1091 // we process our received event here
1092 console.log('Received toaster data change event.');
1093 $($.parseXML(event.data)).find('data-change-event').each(
1095 var operation = $(this).find('operation').text();
1096 if (operation == 'updated') {
1097 // toaster status was updated so we call function that gets the value of toasterStatus leaf
1098 updateToasterStatus();
1104 notificatinSocket.onerror = function (error) {
1105 console.log("Socket error: " + error);
1107 notificatinSocket.onopen = function (event) {
1108 console.log("Socket connection opened.");
1110 notificatinSocket.onclose = function (event) {
1111 console.log("Socket connection closed.");
1113 // if there is a problem on socket creation we get exception (i.e. when socket address is incorrect)
1115 alert("Error when creating WebSocket" + e );
1119 The *updateToasterStatus()* function represents function that calls
1120 *GET* on the path that was modified and sets toaster status in some web
1121 page element according to received data. After the WebSocket connection
1122 has been established you can test events by calling make-toast RPC via
1127 for more information about WebSockets in JavaScript visit `Writing
1129 applications <https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications>`__
1131 Netconf-connector + Netopeer
1132 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1134 `Netopeer <https://github.com/cesnet/netopeer>`__ (an open-source
1135 NETCONF server) can be used for testing/exploring NETCONF southbound in
1138 Netopeer installation
1139 ^^^^^^^^^^^^^^^^^^^^^
1141 A `Docker <https://www.docker.com/>`__ container with netopeer will be
1142 used in this guide. To install Docker and start the `netopeer
1143 image <https://hub.docker.com/r/sysrepo/sysrepo-netopeer2>`__ perform
1146 1. Install docker https://docs.docker.com/get-started/
1148 2. Start the netopeer image:
1152 docker run -it --name sysrepo -p 830:830 --rm sysrepo/sysrepo-netopeer2:latest
1154 3. Verify netopeer is running by invoking (netopeer should send its
1155 HELLO message right away:
1159 ssh root@localhost -p 830 -s netconf
1162 Mounting netopeer NETCONF server
1163 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1167 - OpenDaylight is started with features ``odl-restconf-all`` and
1168 ``odl-netconf-connector-all``.
1170 - Netopeer is up and running in docker
1172 Now just follow the section: `Spawning new NETCONF connectors`_ for
1173 password authentication.
1174 In the payload change the:
1176 - name, e.g., to netopeer
1178 - username/password to your system credentials
1184 After netopeer is mounted successfully, its configuration can be read
1185 using RESTCONF by invoking:
1188 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=netopeer/yang-ext:mount?content:config
1190 Mounting netopeer NETCONF server using key-based authentication SSH
1191 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1193 1. Install docker https://docs.docker.com/get-started/
1195 2. Create RSA key pair - it will be user for connection.
1197 3. Start the netopeer image(this command will also copy you pub key
1198 into docker container):
1202 docker run -dt -p 830:830 -v {path-to-pub-key}:/home/{netopeer-username}/.ssh/authorized_keys sysrepo/sysrepo-netopeer2:latest netopeer2-server -d -v 2
1204 4. Verify netopeer is running by invoking (netopeer should send its
1205 HELLO message right away:
1209 ssh root@localhost -p 830 -s netconf
1212 Now just follow the section: `Spawning new NETCONF connectors`_ for
1213 key-based authentication(SSH) to create device.
1214 In the payload change the:
1216 - name, e.g., to netopeer
1218 - username/password to your system credentials
1224 After netopeer is mounted successfully, its configuration can be read
1225 using RESTCONF by invoking:
1228 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=netopeer/yang-ext:mount?content:config
1230 Mounting netopeer NETCONF server using key-based authentication TLS
1231 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1233 1. Install docker https://docs.docker.com/get-started/
1239 docker pull sysrepo/sysrepo-netopeer2
1240 docker run -it --name sysrepo -p 830:830 --rm sysrepo/sysrepo-netopeer2:latest
1242 3. Enable TLS communication on server netopeer2
1246 ssh root@localhost -p 830 -s netconf
1247 (type password root)
1249 After successful connecting to netopeer2 setup your
1250 TLS configuration xml
1251 (See: https://github.com/CESNET/netopeer2/tree/master/example_configuration).
1255 - :~/netconf/karaf/target/assembly/bin$ ./karaf
1257 - feature:install odl-netconf-topology odl-restconf-nb-bierman02 odl-mdsal-apidocs
1259 5. Set up ODL netconf keystore
1261 To setup keystore is needed to send three RPCs from
1262 `Configure device to connect over TLS protocol`_
1263 to add a client private key, associate a private key with a client and CA
1264 certificates chain and add a list of trusted CA and server certificates.
1266 Now just follow the section: `Spawning new NETCONF connectors`_ for
1267 key-based authentication(TLS) to create device.
1268 In the payload change the:
1270 - name, e.g., to netopeer
1272 - username/password to your system credentials
1278 After netopeer is mounted successfully, its configuration can be read
1279 using RESTCONF by invoking:
1282 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=netopeer/yang-ext:mount?content:config
1284 Northbound (NETCONF servers)
1285 ----------------------------
1287 OpenDaylight provides 2 types of NETCONF servers:
1289 - **NETCONF server for config-subsystem (listening by default on port
1292 - Serves as a default interface for config-subsystem and allows
1293 users to spawn/reconfigure/destroy modules (or applications) in
1296 - **NETCONF server for MD-SAL (listening by default on port 2830)**
1298 - Serves as an alternative interface for MD-SAL (besides RESTCONF)
1299 and allows users to read/write data from MD-SAL’s datastore and to
1300 invoke its rpcs (NETCONF notifications are not available in the
1301 Boron release of OpenDaylight)
1305 The reason for having 2 NETCONF servers is that config-subsystem and
1306 MD-SAL are 2 different components of OpenDaylight and require
1307 different approaches for NETCONF message handling and data
1308 translation. These 2 components will probably merge in the future.
1312 Since Nitrogen release, there has been performance regression in NETCONF
1313 servers accepting SSH connections. While opening a connection takes
1314 less than 10 seconds on Carbon, on Nitrogen time can increase up to
1315 60 seconds. Please see https://jira.opendaylight.org/browse/ODLPARENT-112
1317 NETCONF server for config-subsystem
1318 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1320 This NETCONF server is the primary interface for config-subsystem. It
1321 allows the users to interact with config-subsystem in a standardized
1324 In terms of RFCs, these are supported:
1326 - `RFC-6241 <https://www.rfc-editor.org/rfc/rfc6241>`__
1328 - `RFC-5277 <https://www.rfc-editor.org/rfc/rfc5277>`__
1330 - `RFC-6470 <https://www.rfc-editor.org/rfc/rfc6470>`__
1332 - (partially, only the schema-change notification is available in
1335 - `RFC-6022 <https://www.rfc-editor.org/rfc/rfc6022>`__
1337 For regular users it is recommended to use RESTCONF + the
1338 controller-config loopback mountpoint instead of using pure NETCONF. How
1339 to do that is specific for each component/module/application in
1340 OpenDaylight and can be found in their dedicated user guides.
1342 NETCONF server for MD-SAL
1343 ~~~~~~~~~~~~~~~~~~~~~~~~~
1345 This NETCONF server is just a generic interface to MD-SAL in
1346 OpenDaylight. It uses the standard MD-SAL APIs and serves as an
1347 alternative to RESTCONF. It is fully model-driven and supports any data
1348 and rpcs that are supported by MD-SAL.
1350 In terms of RFCs, these are supported:
1352 - `RFC-6241 <https://www.rfc-editor.org/rfc/rfc6241>`__
1354 - `RFC-6022 <https://www.rfc-editor.org/rfc/rfc6022>`__
1356 - `RFC-7895 <https://www.rfc-editor.org/rfc/rfc7895>`__
1358 Notifications over NETCONF are not supported in the Boron release.
1362 Install NETCONF northbound for MD-SAL by installing feature:
1363 ``odl-netconf-mdsal`` in karaf. Default binding port is **2830**.
1368 The default configuration can be found in file: *08-netconf-mdsal.xml*.
1369 The file contains the configuration for all necessary dependencies and a
1370 single SSH endpoint starting on port 2830. There is also a (by default
1371 disabled) TCP endpoint. It is possible to start multiple endpoints at
1372 the same time either in the initial configuration file or while
1373 OpenDaylight is running.
1375 The credentials for SSH endpoint can also be configured here, the
1376 defaults are admin/admin. Credentials in the SSH endpoint are not yet
1377 managed by the centralized AAA component and have to be configured
1380 Verifying MD-SAL’s NETCONF server
1381 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1383 After the NETCONF server is available it can be examined by a command
1388 ssh admin@localhost -p 2830 -s netconf
1390 The server will respond by sending its HELLO message and can be used as
1391 a regular NETCONF server from then on.
1393 Mounting the MD-SAL’s NETCONF server
1394 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1396 To perform this operation, just spawn a new netconf-connector as
1397 described in `Spawning new NETCONF connectors`_. Just change the ip to
1398 "127.0.0.1" port to "2830" and its name to "controller-mdsal".
1400 Now the MD-SAL’s datastore can be read over RESTCONF via NETCONF by
1404 http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=controller-mdsal/yang-ext:mount?content:nonconfig
1408 This might not seem very useful, since MD-SAL can be accessed
1409 directly from RESTCONF or from Application code, but the same method
1410 can be used to mount and control other OpenDaylight instances by the
1411 "master OpenDaylight".
1413 NETCONF stress/performance measuring tool
1414 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1416 This is basically a NETCONF client that puts NETCONF servers under heavy
1417 load of NETCONF RPCs and measures the time until a configurable amount
1418 of them is processed.
1420 RESTCONF stress-performance measuring tool
1421 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1423 Very similar to NETCONF stress tool with the difference of using
1424 RESTCONF protocol instead of NETCONF.
1426 YANGLIB remote repository
1427 -------------------------
1429 There are scenarios in NETCONF deployment, that require for a centralized
1430 YANG models repository. YANGLIB plugin provides such remote repository.
1432 To start this plugin, you have to install odl-yanglib feature. Then you
1433 have to configure YANGLIB either through RESTCONF or NETCONF. We will
1434 show how to configure YANGLIB through RESTCONF.
1436 YANGLIB configuration
1437 ~~~~~~~~~~~~~~~~~~~~~
1438 YANGLIB configuration works through OSGi Configuration Admin interface, in the
1439 ``org.opendaylight.netconf.yanglib`` configuration PID. There are three tuneables you can
1442 * ``cache-folder``, which defaults to ``cache/schema``
1443 * ``binding-address``, which defaults to ``localhost``
1444 * ``binding-port``, which defaults to ``8181``
1446 In order to change these settings, you can either modify the corresponding configuration
1447 file, ``etc/org.opendaylight.netconf.yanglib.cfg``, for example:
1450 cache-folder = cache/newSchema
1451 binding-address = localhost
1457 opendaylight-user@root>config:edit org.opendaylight.netconf.yanglib
1458 opendaylight-user@root>config:property-set cache-folder cache/newSchema
1459 opendaylight-user@root>config:property-set binding-address localhost
1460 opendaylight-user@root>config:property-set binding-port 8181
1461 opendaylight-user@root>config:update
1463 This YANGLIB takes all YANG sources from the configured sources folder and
1464 for each generates URL in form:
1468 http://localhost:8181/yanglib/schemas/{modelName}/{revision}
1470 On this URL will be hosted YANG source for particular module.
1472 YANGLIB instance also writes this URL along with source identifier to
1473 ietf-netconf-yang-library/modules-state/module list.
1475 Netconf-connector with YANG library as fallback
1476 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1478 There is an optional configuration in netconf-connector called
1479 yang-library. You can specify YANG library to be plugged as additional
1480 source provider into the mount's schema repository. Since YANGLIB
1481 plugin is advertising provided modules through yang-library model, we
1482 can use it in mount point's configuration as YANG library. To do this,
1483 we need to modify the configuration of netconf-connector by adding this
1488 <yang-library xmlns="urn:opendaylight:netconf-node-topology">
1489 <yang-library-url xmlns="urn:opendaylight:netconf-node-topology">http://localhost:8181/rests/data/ietf-yang-library:modules-state</yang-library-url>
1490 <username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
1491 <password xmlns="urn:opendaylight:netconf-node-topology">admin</password>
1494 This will register YANGLIB provided sources as a fallback schemas for
1495 particular mount point.
1497 Restconf northbound configuration
1498 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1499 Restconf-nb configuration works through OSGi Configuration Admin interface, in the
1500 ``org.opendaylight.restconf.nb.rfc8040`` configuration PID. There are six tuneables you can
1503 * ``maximum-fragment-length``, which defaults to ``0``
1504 * ``heartbeat-interval``, which defaults to ``10000``
1505 * ``idle-timeout``, which defaults to ``30000``
1506 * ``ping-executor-name-prefix``, which defaults to ``ping-executor``
1507 * ``max-thread-count``, which defaults to ``1``
1508 * ``use-sse``, which defaults to ``true``
1509 * ``restconf``, which defaults to ``rests``
1511 *maximum-fragment-length* — Maximum web-socket fragment length in number of Unicode code units (characters)
1512 (exceeded message length leads to fragmentation of messages)
1514 *heartbeat-interval* — Interval in milliseconds between sending of ping control frames.
1516 *idle-timeout* — Maximum idle time of web-socket session before the session is closed (milliseconds).
1518 *ping-executor-name-prefix* — Name of thread group Ping Executor will be run with.
1520 *max-thread-count* — Number of threads Ping Executor will be run with.
1522 *use-sse* — In case of ``true`` access to notification streams will be via Server-Sent Events.
1523 Otherwise web-socket servlet will be initialized.
1525 *restconf* — The value of RFC8040 restconf URI template, pointing to the root resource. Must not end with '/'.
1527 In order to change these settings, you can either modify the corresponding configuration
1528 file, ``org.opendaylight.restconf.nb.rfc8040.cfg``, for example:
1532 maximum-fragment-length=0
1533 heartbeat-interval=10000
1535 ping-executor-name-prefix=ping-executor
1544 opendaylight-user@root>config:edit org.opendaylight.restconf.nb.rfc8040
1545 opendaylight-user@root>config:property-set maximum-fragment_length 0
1546 opendaylight-user@root>config:property-set heartbeat-interval 10000
1547 opendaylight-user@root>config:property-set idle-timeout 30000
1548 opendaylight-user@root>config:property-set ping-executor-name-prefix "ping-executor"
1549 opendaylight-user@root>config:property-set max-thread-count 1
1550 opendaylight-user@root>config:property-set use-sse true
1551 opendaylight-user@root>config:property-set restconf "rests"
1552 opendaylight-user@root>config:update
1557 Call Home Installation
1558 ~~~~~~~~~~~~~~~~~~~~~~
1560 ODL Call-Home server is installed in Karaf by installing karaf feature
1561 ``odl-netconf-callhome-ssh``. RESTCONF feature is recommended for
1562 configuring Call Home & testing its functionality.
1566 feature:install odl-netconf-callhome-ssh
1571 In order to test Call Home functionality we recommend Netopeer or
1572 Netopeer2. See `Netopeer Call Home <https://github.com/CESNET/netopeer/wiki/CallHome>`__
1573 or `Netopeer2 <https://github.com/CESNET/netopeer2>`__ to learn how to
1574 enable call-home on Netopeer.
1576 Northbound Call-Home API
1577 ~~~~~~~~~~~~~~~~~~~~~~~~
1579 The northbound Call Home API is used for administering the Call-Home Server. The
1580 following describes this configuration.
1582 Global Configuration
1583 ^^^^^^^^^^^^^^^^^^^^
1586 The global configuration is not a part of the `RFC 8071
1587 <https://www.rfc-editor.org/rfc/rfc8071>`__ and, therefore, subject to change.
1589 Configuring global credentials
1590 ''''''''''''''''''''''''''''''
1592 The ODL Call-Home server allows user to configure global credentials, which will be
1593 used for devices connecting over SSH transport protocol that do not have
1594 device-specific credentials configured.
1596 This is done by creating
1597 ``/odl-netconf-callhome-server:netconf-callhome-server/global/credentials``
1598 with username and passwords specified.
1600 *Configuring global username & passwords to try*
1605 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/global/credentials
1606 Content-Type: application/json
1607 Accept: application/json
1609 .. code-block:: json
1614 "username": "example",
1615 "passwords": [ "first-password-to-try", "second-password-to-try" ]
1619 Configuring to accept any ssh server key using global credentials
1620 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
1622 By default Netconf Call-Home Server accepts only incoming connections
1623 from allowed devices
1624 ``/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices``,
1625 if user desires to allow all incoming connections, it is possible to set
1626 ``accept-all-ssh-keys`` to ``true`` in
1627 ``/odl-netconf-callhome-server:netconf-callhome-server/global``.
1629 The name of these devices in ``netconf-topology`` will be in format
1630 ``ip-address:port``. For naming devices see Device-Specific
1633 *Allowing unknown devices to connect*
1635 This is a debug feature and should not be used in production. Besides being an obvious
1636 security issue, this also causes the Call-Home Server to drastically increase its output
1642 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/global/accept-all-ssh-keys
1643 Content-Type: application/json
1644 Accept: application/json
1646 .. code-block:: json
1649 "accept-all-ssh-keys": "true"
1652 Device-Specific Configuration
1653 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1655 Netconf Call Home server supports both of the secure transports used
1656 by the Network Configuration Protocol (NETCONF) - Secure Shell (SSH),
1657 and Transport Layer Security (TLS).
1659 Configure device to connect over SSH protocol
1660 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1662 Netconf Call Home Server uses device provided SSH server key (host key)
1663 to identify device. The pairing of name and server key is configured in
1664 ``/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices``.
1665 This list is colloquially called a allowlist.
1667 If the Call-Home Server finds the SSH host key in the allowlist, it continues
1668 to negotiate a NETCONF connection over an SSH session. If the SSH host key is
1669 not found, the connection between the Call Home server and the device is dropped
1670 immediately. In either case, the device that connects to the Call home server
1671 leaves a record of its presence in the operational store.
1673 Configuring Device with Device-specific Credentials
1674 '''''''''''''''''''''''''''''''''''''''''''''''''''
1676 Adding specific device to the allowed list is done by creating
1677 ``/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device={device}``
1678 with device-id and connection parameters inside the ssh-client-params container.
1680 *Configuring Device with Credentials*
1685 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device=example
1686 Content-Type: application/json
1687 Accept: application/json
1689 .. code-block:: json
1693 "unique-id": "example",
1694 "ssh-client-params": {
1696 "username": "example",
1697 "passwords": [ "password" ]
1699 "host-key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDHoH1jMjltOJnCt999uaSfc48ySutaD3ISJ9fSECe1Spdq9o9mxj0kBTTTq+2V8hPspuW75DNgN+V/rgJeoUewWwCAasRx9X4eTcRrJrwOQKzb5Fk+UKgQmenZ5uhLAefi2qXX/agFCtZi99vw+jHXZStfHm9TZCAf2zi+HIBzoVksSNJD0VvPo66EAvLn5qKWQD4AdpQQbKqXRf5/W8diPySbYdvOP2/7HFhDukW8yV/7ZtcywFUIu3gdXsrzwMnTqnATSLPPuckoi0V2jd8dQvEcu1DY+rRqmqu0tEkFBurlRZDf1yhNzq5xWY3OXcjgDGN+RxwuWQK3cRimcosH"
1704 Configuring Device with Global Credentials
1705 '''''''''''''''''''''''''''''''''''''''''''''''''''
1707 It is possible to omit ``username`` and ``password`` for ssh-client-params,
1708 in such case values from global credentials will be used.
1710 *Example of configuring device*
1715 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device=example
1716 Content-Type: application/json
1717 Accept: application/json
1719 .. code-block:: json
1723 "unique-id": "example",
1724 "ssh-client-params": {
1725 "host-key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDHoH1jMjltOJnCt999uaSfc48ySutaD3ISJ9fSECe1Spdq9o9mxj0kBTTTq+2V8hPspuW75DNgN+V/rgJeoUewWwCAasRx9X4eTcRrJrwOQKzb5Fk+UKgQmenZ5uhLAefi2qXX/agFCtZi99vw+jHXZStfHm9TZCAf2zi+HIBzoVksSNJD0VvPo66EAvLn5qKWQD4AdpQQbKqXRf5/W8diPySbYdvOP2/7HFhDukW8yV/7ZtcywFUIu3gdXsrzwMnTqnATSLPPuckoi0V2jd8dQvEcu1DY+rRqmqu0tEkFBurlRZDf1yhNzq5xWY3OXcjgDGN+RxwuWQK3cRimcosH"
1730 Deprecated configuration models for devices accessed with SSH protocol
1731 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
1733 With `RFC 8071 <https://www.rfc-editor.org/rfc/rfc8071>`__ alignment and adding
1734 support for TLS transport following configuration models have been marked
1737 Configuring Device with Global Credentials
1738 '''''''''''''''''''''''''''''''''''''''''''''''''''
1740 *Example of configuring device*
1745 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device=example
1746 Content-Type: application/json
1747 Accept: application/json
1749 .. code-block:: json
1753 "unique-id": "example",
1754 "ssh-host-key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDHoH1jMjltOJnCt999uaSfc48ySutaD3ISJ9fSECe1Spdq9o9mxj0kBTTTq+2V8hPspuW75DNgN+V/rgJeoUewWwCAasRx9X4eTcRrJrwOQKzb5Fk+UKgQmenZ5uhLAefi2qXX/agFCtZi99vw+jHXZStfHm9TZCAf2zi+HIBzoVksSNJD0VvPo66EAvLn5qKWQD4AdpQQbKqXRf5/W8diPySbYdvOP2/7HFhDukW8yV/7ZtcywFUIu3gdXsrzwMnTqnATSLPPuckoi0V2jd8dQvEcu1DY+rRqmqu0tEkFBurlRZDf1yhNzq5xWY3OXcjgDGN+RxwuWQK3cRimcosH"
1758 Configuring Device with Device-specific Credentials
1759 '''''''''''''''''''''''''''''''''''''''''''''''''''
1761 Call Home Server also allows the configuration of credentials per device basis.
1762 This is done by introducing ``credentials`` container into the
1763 device-specific configuration. Format is same as in global credentials.
1765 *Configuring Device with Credentials*
1770 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device=example
1771 Content-Type: application/json
1772 Accept: application/json
1774 .. code-block:: json
1778 "unique-id": "example",
1780 "username": "example",
1781 "passwords": [ "password" ]
1783 "ssh-host-key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDHoH1jMjltOJnCt999uaSfc48ySutaD3ISJ9fSECe1Spdq9o9mxj0kBTTTq+2V8hPspuW75DNgN+V/rgJeoUewWwCAasRx9X4eTcRrJrwOQKzb5Fk+UKgQmenZ5uhLAefi2qXX/agFCtZi99vw+jHXZStfHm9TZCAf2zi+HIBzoVksSNJD0VvPo66EAvLn5qKWQD4AdpQQbKqXRf5/W8diPySbYdvOP2/7HFhDukW8yV/7ZtcywFUIu3gdXsrzwMnTqnATSLPPuckoi0V2jd8dQvEcu1DY+rRqmqu0tEkFBurlRZDf1yhNzq5xWY3OXcjgDGN+RxwuWQK3cRimcosH"
1787 Configure device to connect over TLS protocol
1788 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1790 Netconf Call Home Server allows devices to use TLS transport protocol to
1791 establish a connection towards the NETCONF device. This communication
1792 requires proper setup to make two-way TLS authentication possible for client
1795 The initial step is to configure certificates and keys for two-way TLS by
1796 storing them within the netconf-keystore.
1798 *Adding a client private key credential to the netconf-keystore*
1803 /rests/operations/netconf-keystore:add-keystore-entry
1804 Content-Type: application/json
1805 Accept: application/json
1807 .. code-block:: json
1813 "key-id": "example-client-key-id",
1814 "private-key": "PEM-format-private-key",
1815 "passphrase": "passphrase"
1821 *Associate a private key with a client and CA certificates chain*
1826 /rests/operations/netconf-keystore:add-private-key
1827 Content-Type: application/json
1828 Accept: application/json
1830 .. code-block:: json
1836 "name": "example-client-key-id",
1838 "certificate-chain": [
1846 *Add a list of trusted CA and server certificates*
1851 /rests/operations/netconf-keystore:add-trusted-certificate
1852 Content-Type: application/json
1853 Accept: application/json
1855 .. code-block:: json
1859 "trusted-certificate": [
1861 "name": "example-ca-certificate",
1862 "certificate": "ca-certificate-data"
1865 "name": "example-server-certificate",
1866 "certificate": "server-certificate-data"
1872 In a second step, it is required to create an allowed device associated with
1873 a server certificate and client key. The server certificate will be used to
1874 identify and pin the NETCONF device during SSL handshake and should be unique
1875 among the allowed devices.
1877 *Add device configuration for TLS protocol to allowed devices list*
1882 /rests/data/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device=example-device
1883 Content-Type: application/json
1884 Accept: application/json
1886 .. code-block:: json
1890 "unique-id": "example-device",
1891 "tls-client-params": {
1892 "key-id": "example-client-key-id",
1893 "certificate-id": "example-server-certificate"
1901 Once an entry is made on the config side of "allowed-devices", the Call-Home Server will
1902 populate a corresponding operational device that is the same as the config device but
1903 has an additional status. By default, this status is *DISCONNECTED*. Once a device calls
1904 home, this status will change to one of:
1906 *CONNECTED* — The device is currently connected and the NETCONF mount is available for network
1909 *FAILED_AUTH_FAILURE* — The last attempted connection was unsuccessful because the Call-Home
1910 Server was unable to provide the acceptable credentials of the device. The device is also
1911 disconnected and not available for network management.
1913 *FAILED_NOT_ALLOWED* — The last attempted connection was unsuccessful because the device was
1914 not recognized as an acceptable device. The device is also disconnected and not available for
1917 *FAILED* — The last attempted connection was unsuccessful for a reason other than not
1918 allowed to connect or incorrect client credentials. The device is also disconnected and not
1919 available for network management.
1921 *DISCONNECTED* — The device is currently disconnected.
1926 Devices that are not on the allowlist might try to connect to the Call-Home Server. In
1927 these cases, the server will keep a record by instantiating an operational device. There
1928 will be no corresponding config device for these rogues. They can be identified readily
1929 because their device id, rather than being user-supplied, will be of the form
1930 "address:port". Note that if a device calls back multiple times, there will only be
1931 a single operatinal entry (even if the port changes); these devices are recognized by
1932 their unique host key.
1934 Southbound Call-Home API
1935 ~~~~~~~~~~~~~~~~~~~~~~~~
1937 The Call-Home Server listens for incoming TCP connections and assumes that the other side of
1938 the connection is a device calling home via a NETCONF connection with SSH for
1939 management. The server uses port 4334 by default and this can be configured via a
1940 blueprint configuration file.
1942 The device **must** initiate the connection and the server will not try to re-establish the
1943 connection in case of a drop. By requirement, the server cannot assume it has connectivity
1944 to the device due to NAT or firewalls among others.
1946 Reading data with selected fields
1947 ---------------------------------
1952 If user would like to read only selected fields from a NETCONF device, it is possible to use
1953 the fields query parameter that is described by RFC-8040. RESTCONF parses content of query
1954 parameter into format that is accepted by NETCONF subtree filtering - filtering of data is done
1955 on NETCONF server, not on NETCONF client side. This approach optimizes network traffic load,
1956 because data in which user doesn't have interest, is not transferred over network.
1960 * using single RESTCONF request and single NETCONF RPC for reading multiple subtrees
1961 * possibility to read only selected fields under list node across multiple hierarchies
1962 (it cannot be done without proper selection API)
1966 More information about fields query parameter: `RFC 8071 <https://www.rfc-editor.org/rfc/rfc8040#section-4.8.3>`__
1971 For demonstration, we will define next YANG model:
1975 module test-module {
1977 namespace "urn:opendaylight:test-module";
1979 revision "2023-02-16";
1982 container simple-root {
2002 container list-root {
2015 container next-data {
2037 Follow the :doc:`testtool` instructions to save this schema and run it with testtool.
2039 Mounting NETCONF device that runs on NETCONF testtool:
2041 .. code-block:: bash
2043 curl --location --request PUT 'http://127.0.0.1:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=testtool' \
2044 --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
2045 --header 'Content-Type: application/json' \
2049 "node-id": "testtool",
2050 "netconf-node-topology:host": "127.0.0.1",
2051 "netconf-node-topology:port": 17830,
2052 "netconf-node-topology:keepalive-delay": 100,
2053 "netconf-node-topology:tcp-only": false,
2054 "netconf-node-topology:login-password-unencrypted": {
2055 "netconf-node-topology:username": "admin",
2056 "netconf-node-topology:password": "admin"
2062 Setting initial configuration on NETCONF device:
2064 .. code-block:: bash
2066 curl --location --request PUT 'http://127.0.0.1:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=testtool/yang-ext:mount/test-module:root' \
2067 --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
2068 --header 'Content-Type: application/json' \
2167 1. Reading whole leaf-list 'll' and leaf 'nested/sample-x' under 'simple-root' container.
2171 .. code-block:: bash
2173 curl --location --request GET 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=testtool/yang-ext:mount/test-module:root/simple-root?content=config&fields=ll;nested/sample-x' \
2174 --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
2175 --header 'Cookie: JSESSIONID=node01h4w82eorc1k61866b71qjgj503.node0'
2177 Generated NETCONF RPC request:
2181 <rpc message-id="m-18" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
2186 <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
2187 <root xmlns="urn:ietf:params:xml:ns:yang:test-model">
2201 Using fields query parameter it is also possible to read whole leaf-list or list without
2202 necessity to specify value / key predicate (without reading parent entity). Such scenario
2203 is not permitted in RFC-8040 paths alone - fields query parameter can be used as
2204 workaround for this case.
2208 .. code-block:: json
2211 "test-module:simple-root": {
2223 2. Reading all identifiers of 'nested-list' under all elements of 'top-list'.
2227 .. code-block:: bash
2229 curl --location --request GET 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=testtool/yang-ext:mount/test-module:root/list-root?content=config&fields=top-list(nested-list/identifier)' \
2230 --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
2231 --header 'Cookie: JSESSIONID=node01h4w82eorc1k61866b71qjgj503.node0'
2233 Generated NETCONF RPC request:
2237 <rpc message-id="m-27" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
2242 <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
2243 <root xmlns="urn:ietf:params:xml:ns:yang:test-model">
2260 NETCONF client automatically fetches values of list keys since they are required for correct
2261 deserialization of NETCONF response and at the end serialization of response to RESTCONF
2262 response (JSON/XML).
2266 .. code-block:: json
2269 "test-module:list-root": {
2320 3. Reading value of leaf 'branch-ab' and all values of leaves 'switch-1' that are placed
2321 under 'top-list' list elements.
2325 .. code-block:: bash
2327 curl --location --request GET 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=testtool/yang-ext:mount/test-module:root/list-root?content=config&fields=branch-ab;top-list/next-data/switch-1' \
2328 --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
2329 --header 'Cookie: JSESSIONID=node01jx6o5thwae9t1ft7c2zau5zbz4.node0'
2331 Generated NETCONF RPC request:
2335 <rpc message-id="m-42" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
2340 <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
2341 <root xmlns="urn:ietf:params:xml:ns:yang:test-model">
2359 .. code-block:: json
2362 "test-module:list-root": {
2391 Reading module source
2392 ---------------------
2397 If user would like to read module source from a Controller or NETCONF device, it is possible to use
2398 the subpath "modules". Revision of the module is optional, so it is passed as a query parameter. There is
2399 also a possibility to read modules in yang format or in yin format.
2401 *Read module source from controller*
2406 /rests/modules/{module-name}?revision={revision}
2407 Accept: application/yang or application/yin+xml
2409 *Read mounted module source from device*
2414 /rests/modules/network-topology:network-topology/topology=topology-netconf/node={node-id}/yang-ext:mount/{module-name}?revision={revision}
2415 Accept: application/yang or application/yin+xml
2423 The OpenAPI provides full API for configurational data which can be edited (by POST, PUT, PATCH and DELETE).
2424 For operational data we only provide GET API. For the majority of requests you can see only config data in examples.
2425 That’s because we can show only one example per request. The exception when you can see operational data in an
2426 example is when data are representing an operational (config false) container with no config data in it.
2429 Using the OpenAPI Explorer through HTTP
2430 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2432 1. Install OpenApi into Karaf by installing karaf feature:
2436 $ feature:install odl-restconf-openapi
2438 2. Navigate to OpenAPI in your web browser which is available at URLs:
2440 - http://localhost:8181/openapi/explorer/index.html for general overview
2442 - http://localhost:8181/openapi/api/v3/single for JSON data
2446 In the URL links for OpenAPI, change *localhost* to the IP/Host name of your actual server.
2448 3. Enter the username and password.
2449 By default the credentials are *admin/admin*.
2451 4. Select any model to try out.
2453 5. Select any available request to try out.
2455 6. Click on the **Try it out** button.
2457 7. Provide any required parameters or edit request body.
2459 8. Click the **Execute** button.
2461 9. You can see responses to the given request.
2464 OpenAPI Explorer can also be used for connected device. How to connect a device can be found :ref:`here <netconf-connector>`.
2466 OpenAPI URLs in that case would look like this:
2468 - `http://localhost:8181/openapi/explorer/index.html?urls.primaryName=17830-sim-device resources - RestConf RFC 8040 <http://localhost:8181/openapi/explorer/index.html?urls.primaryName=17830-sim-device%20resources%20-%20RestConf%20RFC%208040>`_ for device overview
2470 - http://localhost:8181/openapi/api/v3/mounts/1 for JSON data
2472 - `http://localhost:8181/openapi/api/v3/mounts/1/toaster(2009-11-20) <http://localhost:8181/openapi/api/v3/mounts/1/toaster(2009-11-20)>`__ JSON data for given model
2476 The URL links for OpenAPI are made for device with name *17830-sim-device* and model toaster
2477 with *2009-11-20* revision and need to be changed accordingly to connected device.