netconf.git
4 months agoFix nullability checks in ParameterSchemaEntity class 13/110013/2
lubos-cicut [Fri, 26 Jan 2024 08:30:29 +0000 (09:30 +0100)]
Fix nullability checks in ParameterSchemaEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: Ibd745802a31aa29cce57706056b25e7fdaaa6486
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in PathsEntity class 12/110012/2
lubos-cicut [Fri, 26 Jan 2024 08:30:06 +0000 (09:30 +0100)]
Fix nullability checks in PathsEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: I8dcbafa3bc88e09da176b036e0c1e98c45778a90
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in SecurityEntity class 11/110011/2
lubos-cicut [Fri, 26 Jan 2024 08:29:03 +0000 (09:29 +0100)]
Fix nullability checks in SecurityEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: Icebdd9d178a1850dd60b58aea32e432a23902c2f
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in SecuritySchemesEntity class 10/110010/2
lubos-cicut [Fri, 26 Jan 2024 08:28:42 +0000 (09:28 +0100)]
Fix nullability checks in SecuritySchemesEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: I7975d31f053ac223e80728ba1cc2579148d332f2
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in ServersEntity class 09/110009/2
lubos-cicut [Fri, 26 Jan 2024 08:27:34 +0000 (09:27 +0100)]
Fix nullability checks in ServersEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: If55ddb78471d457db3eb1c8f99ad2f004ddbf2aa
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in ParameterEntity class 91/109991/2
lubos-cicut [Thu, 25 Jan 2024 07:47:11 +0000 (08:47 +0100)]
Fix nullability checks in ParameterEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: Ic03d603bfa0ae5356f82576471ba50d8d4331d7d
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in ServerEntity class 90/109990/2
lubos-cicut [Thu, 25 Jan 2024 07:42:52 +0000 (08:42 +0100)]
Fix nullability checks in ServerEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: I36e524b42a43698a80972e4980ab7450dfb95e66
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix nullability checks in InfoEntity class 89/109989/2
lubos-cicut [Thu, 25 Jan 2024 07:39:09 +0000 (08:39 +0100)]
Fix nullability checks in InfoEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: I31b556927df909878e3bbe0b0bc3cc6865660011
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix wrong path reference - schema for actions 25/109825/7
lubos-cicut [Wed, 17 Jan 2024 16:53:30 +0000 (17:53 +0100)]
Fix wrong path reference - schema for actions

After rewrite we lost reference to parent node in some of actions
paths. This patch repairs it.

JIRA: NETCONF-938
Change-Id: I90d048a3157e0cf07b52621eee351ee6119790af
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoAdd restconf-{client,server} 02/110002/3
Robert Varga [Thu, 25 Jan 2024 21:31:03 +0000 (22:31 +0100)]
Add restconf-{client,server}

This patch adds the bare-bones ietf-restconf-{client,server} models from
draft-ietf-netconf-restconf-client-server-29 without packaging or
implementing them.

JIRA: NETCONF-773
Change-Id: Ie1070076544e4b3b30f75f641cdc66bfb0efff43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoAdd transport-http 01/110001/3
Robert Varga [Thu, 25 Jan 2024 21:17:41 +0000 (22:17 +0100)]
Add transport-http

This patch adds the bare-bones ietf-http-{client,server} models from
draft-ietf-netconf-http-client-server-13 without providing feature
packaging.

A baseline intended set of features is also introduced, but nothing else
is done on the implementation side.

JIRA: NETCONF-773
Change-Id: Ic86a6fd8d850c8cc16a25db54fc8f7f27a20bf0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoRefresh IETF client/server models 85/109985/4
Robert Varga [Wed, 24 Jan 2024 20:19:10 +0000 (21:19 +0100)]
Refresh IETF client/server models

This updates the models to the versions published in
- draft-ietf-netconf-crypto-types-28
- draft-ietf-netconf-keystore-29
- draft-ietf-netconf-trust-anchors-22
- draft-ietf-netconf-tcp-client-server-17
- draft-ietf-netconf-tls-client-server-34
- draft-ietf-netconf-ssh-client-server-34
- draft-ietf-netconf-netconf-client-server-30

The ietf-truststore.yang model is augmented with four if-feature
statements which are missing in the published model. Their absence
causes binding runtime to fail because it sees the two leaves using
their respective leafref types and it cannot resolve them (becase we do
not support central-truststore).

JIRA: NETCONF-590
Change-Id: I1fe3be6151a5aa633b1e8a2405454063cfba8c84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoClean up netconf-{common,client}-mdsal constants 99/109999/6
Robert Varga [Thu, 25 Jan 2024 16:32:18 +0000 (17:32 +0100)]
Clean up netconf-{common,client}-mdsal constants

We have a ton of constants relating to naming elements which hark back
to when we did not have Binding representation of RPCs and anyxmls.

These days we have pre-generated constants, so use those, which makes
for looser code coupling and better expressiveness in terms of what we
are doing.

Change-Id: Ied0bda7c3c78cdaa0c59bbca6f1aa9b87342848d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoSet backoff-jitter for call-home devices 54/109954/2
Peter Suna [Wed, 24 Jan 2024 14:36:54 +0000 (15:36 +0100)]
Set backoff-jitter for call-home devices

Call-home devices are not using datastore defaults. We have to set
the default value for backoff-jitter programatically.

JIRA: NETCONF-1193
Change-Id: I2ff37fce1ccd195bba9768257bb96886095b6d0d
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
4 months agoFix odl-restconf-common dependencies 64/109964/1
Robert Varga [Wed, 24 Jan 2024 22:38:46 +0000 (23:38 +0100)]
Fix odl-restconf-common dependencies

We need to depend on the MD-SAL feature packaging the RFC8072 model.

JIRA: NETCONF-1118
Change-Id: I6c9cba22c8af011cd7bf254c8c35a1d5179b5ff4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not package iana-crypt-hash 63/109963/1
Robert Varga [Wed, 24 Jan 2024 21:17:45 +0000 (22:17 +0100)]
Do not package iana-crypt-hash

MD-SAL is already providing a pre-packaged model, consume that instead
of rolling our own.

Change-Id: I9486ecfe0519351c7a8588e4a894b222fc8224bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoDo not use threadpool-config-impl in websocket-client 60/109960/1
Robert Varga [Wed, 24 Jan 2024 16:48:58 +0000 (17:48 +0100)]
Do not use threadpool-config-impl in websocket-client

threadpool-config-impl provides just a few simple wrappers, ditch their
use and just use Java/Guava equivalents.

Change-Id: I31eafb83c05b1d79b1c7f96021a8157ffd26089e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoUpdate User Guide with Enhanced Authentication Details 28/109828/5
Yaroslav Lastivka [Thu, 18 Jan 2024 09:08:06 +0000 (11:08 +0200)]
Update User Guide with Enhanced Authentication Details

Added note wich emphasizing encryption key access and
password format in User Guide.

JIRA: NETCONF-1217
Change-Id: I3503df759326915de55246fcda9d6462c994c52c
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
4 months agoMake RESTCONF base path configurable 01/109701/9
Robert Varga [Mon, 22 Jan 2024 21:13:39 +0000 (22:13 +0100)]
Make RESTCONF base path configurable

Move BASE_PATH constant into OSGi configuration to make it
configurable and propagate it to other components through
RestconfStreamServletFactory.

JIRA: NETCONF-1218
Change-Id: Ie1aed49ed37ff3e0cc862db77c7b88c7470c082a
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoFixup NetconfDeviceCommunicatorTest 10/109910/1
Robert Varga [Mon, 22 Jan 2024 13:36:48 +0000 (14:36 +0100)]
Fixup NetconfDeviceCommunicatorTest

Use Mockito.spy() again, now that we have an upgraded Mockito.

Change-Id: Ibdb5322f1cd2a46bf70f891a406f461c046aad76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoCreate Unit Test for POST existing data error 15/107715/6
lubos-cicut [Wed, 6 Sep 2023 05:54:25 +0000 (07:54 +0200)]
Create Unit Test for POST existing data error

Successfully create resource of your choice using POST request.
When we invoke the same request again, we get the error
response 500 Internal Server Error. According to RFC 8040
we should get 409 Conflict.

Unit Test has been created to verify this issue.

JIRA: NETCONF-1130
Change-Id: Iad1254d2f058a8aa69ed1076e43823224d54c06e
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoUse OpenApiServiceImpl#DEFAULT_PAGESIZE after rewrite 17/109817/6
lubos-cicut [Wed, 17 Jan 2024 08:41:03 +0000 (09:41 +0100)]
Use OpenApiServiceImpl#DEFAULT_PAGESIZE after rewrite

Renew usage of constant OpenApiServiceImpl#DEFAULT_PAGESIZE which
we lost during rewrite OpenApi.

JIRA: NETCONF-938
Change-Id: I211f85f1f740c40173bc40c8c058d047cfc79a01
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoUse DefinitionNames#addUnlinkedName after rewrite 07/109807/5
lubos-cicut [Tue, 16 Jan 2024 18:14:23 +0000 (19:14 +0100)]
Use DefinitionNames#addUnlinkedName after rewrite

Renew usage of DefinitionNames#addUnlinkedName which we lost during
rewrite OpenApi.

JIRA: NETCONF-938
Change-Id: I6cd173752075483974b53d4761dd4c125fb8fcc6
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoRemove unused lock field 37/109837/3
Ivan Hrasko [Thu, 18 Jan 2024 14:51:08 +0000 (15:51 +0100)]
Remove unused lock field

Remove unused lock from from MountPointOpenApi class.

JIRA: NETCONF-938
Change-Id: I4e2b6806c81e7ea23baa5f57cd0eda416e34b3da
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoAdd max-backoff-millis to user guide 56/109856/1
Ivan Hrasko [Fri, 19 Jan 2024 11:30:33 +0000 (12:30 +0100)]
Add max-backoff-millis to user guide

Inform users that we have created new netconf device
configuration parameter called max-backoff-millis.

JIRA: NETCONF-1139
Change-Id: Ie4fd03062b97dc74a74c81059d8bfe76ff520943
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoSet max-backoff-millis for call-home devices 55/109855/1
Ivan Hrasko [Fri, 19 Jan 2024 11:24:43 +0000 (12:24 +0100)]
Set max-backoff-millis for call-home devices

Call-home devices are not using datastore defaults. We have to set
the default value for max-backoff-millis programatically.

JIRA: NETCONF-1193
Change-Id: Ic39cdb9b2dc1210c6e5a8c9ee5485c0040bfc944
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRefactor leaf names in odl-netconf-device.yang 54/109754/8
lubos-cicut [Fri, 12 Jan 2024 10:07:59 +0000 (11:07 +0100)]
Refactor leaf names in odl-netconf-device.yang

Name simplifications of leafs between-attempts-timeout-millis to
min-backoff-millis, max-timeout-between-attempts-millis to
max-backoff-millis and sleep-factor to backoff-multiplier.

JIRA: NETCONF-1193
Change-Id: I237929dca4bf95c10a953c5734f2e0aea5808d89
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoMark backoff settings obsolete 51/109851/1
Ivan Hrasko [Fri, 19 Jan 2024 08:58:19 +0000 (09:58 +0100)]
Mark backoff settings obsolete

Mark between-attempts-timeout-millis,
max-timeout-between-attempts-millis and sleep-factor as obsolete.

They will be renamed to min-backoff-millis,
max-backoff-millis and backoff-multiplier in the next future release.

JIRA: NETCONF-1193
Change-Id: Ie978dda4ae88be209afde73e09e3cfc0f3827d65
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoMark backoff settings deprecated 35/109835/3
Ivan Hrasko [Thu, 18 Jan 2024 13:52:39 +0000 (14:52 +0100)]
Mark backoff settings deprecated

Mark between-attempts-timeout-millis,
max-timeout-between-attempts-millis and sleep-factor as deprecated.

They will be renamed to min-backoff-millis,
max-backoff-millis and backoff-multiplier in the future release.

JIRA: NETCONF-1193
Change-Id: Ifc33d1974f1724046beaf1b7e59c12fee5b73448
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoUse PathsEntity class to simplify PathsStream 96/109796/3
lubos-cicut [Tue, 16 Jan 2024 07:45:21 +0000 (08:45 +0100)]
Use PathsEntity class to simplify PathsStream

Use PathsEntity class to simplify PathsStream. PathsEntity holds
a collection of PathEntity. Class PathStream is no more necessary.

JIRA: NETCONF-938
Change-Id: Idee405b28ebcb6007a3be1ce93230658bf46024b
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoUse configurable basePath in PathsStream 43/109643/6
lubos-cicut [Fri, 5 Jan 2024 15:40:57 +0000 (16:40 +0100)]
Use configurable basePath in PathsStream

Added possibility to use configurable basePath in OpenApi paths which
we have lost during rewrite.

Deleted constant BASE_PATH which was hardcoded to be "/".

JIRA: NETCONF-938
Change-Id: Ic4e9317aa463b3fe98709530c59a359c513fd341
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoUpdate documentation of RFC 8040 configuration 02/109702/9
Samuel Schneider [Wed, 10 Jan 2024 17:08:12 +0000 (18:08 +0100)]
Update documentation of RFC 8040 configuration

Update documentation to reflect removal of restconf8040.cfg
file. The configuration can be changed in karaf's
etc/org.opendaylight.restconf.nb.rfc8040.cfg file instead.

JIRA: NETCONF-1219
Change-Id: I96b8f1e68e216a8d9fa61decdcca51c567b86c87
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
4 months agoImplement registerNotificationListeners() 02/109802/10
Robert Varga [Tue, 16 Jan 2024 13:51:32 +0000 (14:51 +0100)]
Implement registerNotificationListeners()

Bulk listener registration, as introduced a long time ago, should be
supported for all clients. Make sure we have an implementation.

While we are here, also fix thread safety hazards around
registration/unregistration -- with minimal critical sections.

Optimize retained memory by specializing empty/one/multiple registrations,
which in turn allows for some code reuse.

JIRA: NETCONF-1224
Change-Id: I8e40a6c149dbc8bea63d840cbd4cd0a807860175
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 months agoSupport random backoff between connection attempts 33/109633/12
lubos-cicut [Fri, 12 Jan 2024 08:42:31 +0000 (09:42 +0100)]
Support random backoff between connection attempts

First connection attempt gets initialized to minimum sleep, each
subsequent is exponentially backed off by sleepFactor (default 1.5)
until reach max sleep and randomized by +/- jitter (default 0.1).

JIRA: NETCONF-1193
Change-Id: Ia252e61e6b574bad09969e2c629c14ebf7320644
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoSupport maximum wait time of connection attempts 30/109630/11
lubos-cicut [Thu, 4 Jan 2024 10:01:16 +0000 (11:01 +0100)]
Support maximum wait time of connection attempts

First connection attempt gets initialized to minimum sleep, each
subsequent is exponentially backed off by sleepFactor. So the value
is limited because it could grow indefinitely.

Added leaf to odl-netconf-device.yang to get possibility of max wait
time between connection attempts. Default value set to 30 minutes.

JIRA: NETCONF-1193
Change-Id: If5865911fd2822dfcfde15eb1974e58fbc104489
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoFix XML Namespace Handling in serializeExceptionToXml 01/109801/1
Yaroslav Lastivka [Tue, 16 Jan 2024 13:15:21 +0000 (15:15 +0200)]
Fix XML Namespace Handling in serializeExceptionToXml

In the commit 1b59089de6b8306b3f6c9dd7b14299c14f6c00d3,
we inadvertently introduced an issue in the
serializeExceptionToXml method where the XML namespace was
set in a manner not compliant with XML standards,
causing issues in XML parsing.
Additionally, the method did not utilize the currentDatabindContext
for writing the error-path, which could lead to incorrect
serialization of error paths in certain contexts.

The fix involves correctly setting the default XML namespace for
the errors element. Additionally, the method now properly utilizes
the currentDatabindContext for encoding error paths.

JIRA: NETCONF-1130
Change-Id: Ia7900bff2e63d23213896b5e0c96a514ace92873
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
4 months agoReplace escape character by empty line 80/109780/4
Ivan Hrasko [Mon, 15 Jan 2024 14:17:56 +0000 (15:17 +0100)]
Replace escape character by empty line

The newline escape character in InfoEntity description is
marked by IDE as redundant. Use blank line instead.

Change-Id: I146bc26c800214321e3681f205ea4554b934c2b4
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoMake ServersStream fields final 79/109779/2
Ivan Hrasko [Mon, 15 Jan 2024 14:16:39 +0000 (15:16 +0100)]
Make ServersStream fields final

The ServersStream class fields are effectively final.
Mark them with final keyword.

Change-Id: Ib28c78e166e500022185f3c7e08e763344e98511
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRefactor SchemasStreams class 15/109315/5
lubos-cicut [Thu, 14 Dec 2023 17:56:13 +0000 (18:56 +0100)]
Refactor SchemasStreams class

Refactored SchemasStream in order to have separate *Stream class
for components and schemas.

JIRA: NETCONF-938
Change-Id: I69a02493f370d60ffe3f8d905456275277d012b9
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
4 months agoRemove not validating JSON/XML stream writters 96/109096/8
Ivan Hrasko [Tue, 28 Nov 2023 14:29:17 +0000 (15:29 +0100)]
Remove not validating JSON/XML stream writters

We have now customized logic to write JSON/XML errors
in RestconfDocumentedExceptionMapper. Thus we no longer need
Json/XmlStreamWriterWithDisabledValidation classes.

JIRA: NETCONF-1130
Change-Id: I2249004c58070d8ad46a1f9dae78fbb5222f5230
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
4 months agoXML: Resolve 500 response from device exception 11/108611/16
Yaroslav Lastivka [Tue, 24 Oct 2023 07:45:17 +0000 (10:45 +0300)]
XML: Resolve 500 response from device exception

Utilize a custom XmlWriter to prepare the ietf-restconf
error response body. To emit the error-path value,
use the XmlCodec from the device to generate the correct
path format based on the device's model context.

JIRA: NETCONF-1130
Change-Id: I04ae0df51475d7bd49296b7e166fab835afdbaf3
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoJSON: Resolve 500 response from device exception 04/107904/27
Peter Suna [Mon, 18 Sep 2023 11:21:18 +0000 (13:21 +0200)]
JSON: Resolve 500 response from device exception

Utilize a custom JsonWriter to prepare the ietf-restconf
error response body. To emit the error-path value,
use the JSONCodec from the device to generate the correct
path format based on the device's model context.

JIRA: NETCONF-1130
Change-Id: Id82849cabf3fd99b22b4d95eaf9ff5a3ce815b8b
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoSimplify synchronization in MountPointOpenApi 89/109689/3
Ivan Hrasko [Tue, 9 Jan 2024 13:06:15 +0000 (14:06 +0100)]
Simplify synchronization in MountPointOpenApi

Use ConcurrentSkipListMap and ConcurrentHashMap for instanceIdToLongId
and longIdToInstanceId respectivelly which removes the necessity to use
additional locking when we put or get from them.

Change-Id: I8db52cd2aa69c5dacc465db1c20b4d4a6c7dacb2
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove no more used RFC 8040 configuration file 40/109640/5
Ivan Hrasko [Fri, 5 Jan 2024 13:39:05 +0000 (14:39 +0100)]
Remove no more used RFC 8040 configuration file

Delete not used restconf8040.cfg file which was supposed to hold
configuration which can be in fact set in karaf's
etc/org.opendaylight.restconf.nb.rfc8040 file.

When present the file is used to overwrite default values specified in
OSGiNorthbound class.

JIRA: NETCONF-1219
Change-Id: I6dbc1c5696b59d6b2592dbbf01873243ebacd73f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
4 months agoUse BufferedReader to read OpenApi 90/109690/3
Ivan Hrasko [Tue, 9 Jan 2024 15:18:56 +0000 (16:18 +0100)]
Use BufferedReader to read OpenApi

Use BufferedReader when creating OpenApi document to
achieve better efficiency.

JIRA: NETCONF-938
Change-Id: I11c6f935be2022c6fae175100e01f2c51a487831
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoEliminate OpenApiApplication class 45/106145/7
Ivan Hrasko [Wed, 24 May 2023 13:20:32 +0000 (15:20 +0200)]
Eliminate OpenApiApplication class

Eliminate OpenApiApplication by making it an anonymous
class in its sole user.

JIRA: NETCONF-1221
Change-Id: Idfdc00e66e15d812e1921c8e8404c50e8185fa7f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove JaxbContextResolver class 86/109686/1
Ivan Hrasko [Tue, 9 Jan 2024 08:08:33 +0000 (09:08 +0100)]
Remove JaxbContextResolver class

JaxbContextResolver class is unused and has been initially removed by
6baa311. We have accidentally bring it back with b85da3f3.

Remove it again now.

Change-Id: Ib24fc6bcc6d2dcbd68848d4fedb4ad77bf912bbb
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoMake toComponents method static 85/109685/1
Ivan Hrasko [Tue, 9 Jan 2024 08:01:58 +0000 (09:01 +0100)]
Make toComponents method static

SchemasStream#toComponents method can be static if we add context
as parameter.

Change-Id: I41c439a70387503e744ee4f877c62ea1bc6a3602
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove no more valid TODO 84/109684/1
Ivan Hrasko [Tue, 9 Jan 2024 07:59:45 +0000 (08:59 +0100)]
Remove no more valid TODO

OpenApi rewrite to use streams has been completed and definitely
we have assigned payloads to its corrects paths.

Change-Id: If5907dd342d08e2126a7b74fbb0231f09505b271
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoUse base64 encoding for netconf device passwords 35/109035/22
Oleksandr Zharov [Tue, 21 Nov 2023 13:02:25 +0000 (14:02 +0100)]
Use base64 encoding for netconf device passwords

Changed password type to binary for encrypted authentication case to
enforce base64 encoding for odl-netconf-device model.

The binary type is in ODL represented by base64 encoding according
to RFC 7950.

This way we can ensure that authentication service is always able
to decrypt such password during connecting process.

We aim to not touch RPC create-device in netconf-node-topology model
thus we are no more reusing credentials from odl-netconf-device
but we create its own which are still using plain password which is
then encoded by RPC logic and translated into new binary format.

JIRA: NETCONF-1115
Change-Id: Ib70c4f69643162b49d8096ec255f3640ebee2e15
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoAdd call-home device connection verification 01/109301/4
lubos-cicut [Wed, 13 Dec 2023 11:30:46 +0000 (12:30 +0100)]
Add call-home device connection verification

Add verification to check that when netconf device calls home then
ODL connects it (enable in topology).

JIRA: NETCONF-1212
Change-Id: I843bc151b54b2bc20fedc2ead1b04d523b41f60b
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
4 months agoRemove not used DataBroker reference 41/109641/1
Ivan Hrasko [Fri, 5 Jan 2024 13:51:01 +0000 (14:51 +0100)]
Remove not used DataBroker reference

Remove not used DataBroker from IetfZeroTouchCallHomeServerProvider.

Change-Id: I872a7f76af436e7743423aebb13309b42a731b30
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoBump upstreams 79/109479/5
Robert Varga [Fri, 29 Dec 2023 09:56:46 +0000 (10:56 +0100)]
Bump upstreams

Adopt:
- odparent-13.0.10
- infrautils-6.0.5
- yangtools-11.0.5
- mdsal-12.0.4
- controller-8.0.4
- aaa-0.18.4

Change-Id: I8c5b540fd07ce872b97bd4d37d9cf493a30c1777
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDo not use mockito-subclass 84/109484/2
Robert Varga [Fri, 29 Dec 2023 11:18:26 +0000 (12:18 +0100)]
Do not use mockito-subclass

The tests seem to work now out of the box, remove the workaround.

Change-Id: Id260fbdb9bc3d577936332b22461331b4d8171f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoReduce the number of conditional operators in RestconfStream 30/109230/2
Oleksandr Zharov [Fri, 8 Dec 2023 17:02:33 +0000 (18:02 +0100)]
Reduce the number of conditional operators in RestconfStream

Refactored code to reduce number of lines that are
overloaded with conditions.

JIRA: NETCONF-1211
Change-Id: Ia2d0a1f785bebce03f6d6dc0c0553c0eeca244e0
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
5 months agoJunos device: Fix IllegalStateException 21/109321/2
Yaroslav Lastivka [Fri, 15 Dec 2023 10:05:32 +0000 (12:05 +0200)]
Junos device: Fix IllegalStateException

To address the IllegalStateException encountered in choice processing,
an additional condition has been implemented to check if the choice has cases.
This ensures proper handling and avoids the exception.

JIRA: NETCONF-938
Change-Id: I3d1062bb5a0505944cffb1d3df1ddc80de5f7e00
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRemove jackson-annotations from OpenApi 02/109302/2
Ivan Hrasko [Wed, 13 Dec 2023 11:32:14 +0000 (12:32 +0100)]
Remove jackson-annotations from OpenApi

Remove the last unnecessary usage and completely remove
jackson-annotations and related jackson-databind dependencies
from restconf OpenApi.

Change-Id: I08ccc9240bc45b753df2a5e6c0ba828b5e3a6f9e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoUpdate user-guide after login-password removal 13/109213/2
Oleksandr Zharov [Thu, 7 Dec 2023 17:47:18 +0000 (18:47 +0100)]
Update user-guide after login-password removal

Updated request payloads in user-giude to new one according
to login-password removal.

JIRA: NETCONF-1203
Change-Id: I8bb718cd1b30c70a1df1ab62e817ca5b34ef1756
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
5 months agoFix typos in the user-guide 23/109223/4
Yaroslav Lastivka [Fri, 8 Dec 2023 12:46:16 +0000 (14:46 +0200)]
Fix typos in the user-guide

Several typographical errors have been addressed in the NETCONF User Guide. These corrections will enhance the clarity and readability of the documentation, ensuring accurate and understandable information for users.

Change-Id: I6fa0346310ee90c9e1ef1c46077a4d4c83547ed8
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoNetconf client configuration cleanup 95/108895/17
Ruslan Kashapov [Thu, 9 Nov 2023 11:08:22 +0000 (13:08 +0200)]
Netconf client configuration cleanup

Legacy attributes and related obsolete artifacts removed.

JIRA: NETCONF-1108
Change-Id: Ibf317c2bffb83793603eea343463a74fe37084d0
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoDeprecate WebSocket event stream delivery 61/109161/5
Robert Varga [Wed, 6 Dec 2023 09:20:55 +0000 (10:20 +0100)]
Deprecate WebSocket event stream delivery

We support RFC8040-standard delivery of events via Server-Sent Events
and Websockets do not offer any advantage over that. Deprecate them for
removal.

JIRA: NETCONF-1208
Change-Id: Ib52085f0df50d723ea27e4815e77c988c21135ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRevert models description change 67/109167/8
Oleksandr Zharov [Wed, 6 Dec 2023 12:30:22 +0000 (13:30 +0100)]
Revert models description change

Reverted changes in models that was related to incorrect
display of ' in swagger.

JIRA: NETCONF-938
Change-Id: Ic62cea63facef03b7b2c23741d532565147e8872
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
5 months agoRemove OpenApiObject 74/109074/21
lubos-cicut [Mon, 27 Nov 2023 09:43:36 +0000 (10:43 +0100)]
Remove OpenApiObject

Remove OpenApiObject and all its components.

JIRA: NETCONF-938
Change-Id: I584a17db3404c3f3be1d084b86b790b1c99bca38
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoAdapt API to OpenApiObject removal 05/108305/35
Ivan Hrasko [Tue, 10 Oct 2023 13:53:55 +0000 (15:53 +0200)]
Adapt API to OpenApiObject removal

Adapted REST API to use new logic.

Adapted tests for OpenApiInputStream.

JIRA: NETCONF-938
Change-Id: Idc6a35bb29f77c37e7ac70e873fd6b720fc5584d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoAdapt tests for OpenApi 04/108304/32
Ivan Hrasko [Tue, 10 Oct 2023 13:41:24 +0000 (15:41 +0200)]
Adapt tests for OpenApi

As intermediate step in adaptation from OpenApiObject record
removed all tests.

Edited AbstractDocumentTest class to save functionality.

JIRA: NETCONF-938
Change-Id: Ie64b28037652a7608f2129b19dd822400216e88e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoRe-implement logic for security and securitySchemes 09/108809/34
Yaroslav Lastivka [Mon, 30 Oct 2023 18:02:29 +0000 (20:02 +0200)]
Re-implement logic for security and securitySchemes

Added SecurityEntity, SecuritySchemesEntity for generating
Security fields in JSON.

JIRA: NETCONF-938
Change-Id: Ia45e5b590bee65325b7b131d5e4f11b0836c5634
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement paths for ChildNodes 36/109036/24
lubos-cicut [Mon, 20 Nov 2023 17:17:27 +0000 (18:17 +0100)]
Re-implement paths for ChildNodes

Re-implement logic for generating paths for child nodes
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I38bda3346e8ec49751a2ac511ad8bd790a6d27cd
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoRe-implement paths for RPCs 65/108865/23
Samuel Schneider [Mon, 6 Nov 2023 19:51:49 +0000 (20:51 +0100)]
Re-implement paths for RPCs

Re-implement logic for generating paths for RPCs
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I4957d303148fcdffc0fb09b393209d72e9f7b63b
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
5 months agoRe-implement components/schemas for RPC's childs 24/109124/17
Matej Sramcik [Thu, 30 Nov 2023 08:08:35 +0000 (09:08 +0100)]
Re-implement components/schemas for RPC's childs

Re-implement logic for generating components/schemas for child
nodes of RPCs with new input streams approach.

JIRA: NETCONF-938
Change-Id: I9725d2772130d673ad0e6114df41dae568981c2e
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement components/schemas for nodes 45/109045/23
Yaroslav Lastivka [Tue, 21 Nov 2023 08:00:30 +0000 (10:00 +0200)]
Re-implement components/schemas for nodes

Re-implement logic for generating components/schemas for nodes
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I81dad0f0049e69fc913a7b0ba4f7662d5356aa3a
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement components/schemas for actions 29/109029/11
Yaroslav Lastivka [Mon, 20 Nov 2023 13:36:50 +0000 (15:36 +0200)]
Re-implement components/schemas for actions

Re-implement logic for generating components/schemas for actions
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I90a769a81fbf5d6199fbd51db73de981eda9acd6
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
5 months agoRe-implement components/schemas for RPCs 12/108912/23
Matej Sramcik [Fri, 10 Nov 2023 11:06:16 +0000 (12:06 +0100)]
Re-implement components/schemas for RPCs

Re-implement logic for generating components/schemas for RPCs
with new input streams approach.

JIRA: NETCONF-938
Change-Id: I9b42659155d16e3efd316608e436c97a2becd8bc
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
5 months agoWIP: Draft reading YANG context into OpenApiInputStream 58/108258/16
Ivan Hrasko [Thu, 24 Aug 2023 15:01:05 +0000 (17:01 +0200)]
WIP: Draft reading YANG context into OpenApiInputStream

We would like to create JSON document according to
OpenApi specification from EffectiveModelContext.

We are going to use OpenApiInputStream to create overall
document structure by deploying nested input streams.

For example we are creating nested input stream for 'paths'
where we are iterating over EffectiveModelContext multiple times
(for each module) to read each module's paths by dedicated input
stream. This way we will never have in memory more paths than paths
for one module.

The same applies for schemas.

Some parts of the document can be done without iterating over
EffectiveModelContext, like 'info', 'servers', etc. These are just
read from their respective entities where we even can use hard-coded
or constant values.

JIRA: NETCONF-938
Change-Id: I75db8424e5559786f402a6ed79d35b2ff8ec647e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoWIP: Add OpenApi{Entity,BodyWriter} 49/107149/20
Robert Varga [Mon, 31 Jul 2023 13:48:03 +0000 (15:48 +0200)]
WIP: Add OpenApi{Entity,BodyWriter}

With JAX-RS we can defer generation to when the response is created,
via indirection through a MessageBodyWriter.

This provides the basic wiring to do that.

JIRA: NETCONF-938
Change-Id: I7451cc49ac1cceddfde1ddf4bb1052a9888c1886
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
5 months agoFix NoSuchElementException for callhome topology node 20/109220/1
Ruslan Kashapov [Fri, 8 Dec 2023 10:23:52 +0000 (12:23 +0200)]
Fix NoSuchElementException for callhome topology node

Call-home to topology integration uses dynamically composed
Node in order to initialize Netconf layer. Some parameters
were omitted resulting NoSuchElementException on NetconfNodeHandler
instantiation. Set of required parameters was restored to prior
implementation in order to fix this.

JIRA: NETCONF-1183
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Change-Id: I94df8aa1f77580bb2d379f6c3d4e2046c13b35a6

5 months agoFix Call-Home services start failure 93/109193/3
Ruslan Kashapov [Thu, 7 Dec 2023 11:22:43 +0000 (13:22 +0200)]
Fix Call-Home services start failure

- reconfigured services to start automatically on feature install
- fixed NPE on TLS service start due to missing status recorder

JIRA: NETCONF-1183
Change-Id: I0c3bd91d0f81fc9343037ae9b06962c9929edf43
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
5 months agoFix NPE on logging topology node with no credentials 97/109197/3
Ruslan Kashapov [Thu, 7 Dec 2023 11:52:51 +0000 (13:52 +0200)]
Fix NPE on logging topology node with no credentials

When netconf topology node is passed for connection
it's configuration is logged with credentials masking.
However, it wasn't taken into account credentials
value could be null (tcp-only, tls and call-home
integration cases) resulting NPE on direct unconditional
toString() invocation.

Fix makes credentials masking conditional. It's performed
only if logging is enabled and credentials are defined.

JIRA: NETCONF-1204
Change-Id: Ie628b2c06dc014624cb17a6bb8a9bb03d7d8b359
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
5 months agoFix implementation of create-device RPC 94/109194/2
Peter Suna [Thu, 7 Dec 2023 11:18:46 +0000 (12:18 +0100)]
Fix implementation of create-device RPC

Store NetconfNode instead of NetconfNodeTopology in createDevice method
created from the parameter CreateDeviceInput. This modification allows
storing data augmented from the netconf-node-optional model.
Without this change, configuration from IgnoreMissingSchemaSources
would be lost.

JIRA: NETCONF-1192
Change-Id: Iff006fcfe2a41b40e8e41fca5c8a59fc9a55efcb
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
5 months agoAllow YANG PATCH to communicate ETag/Last-Modified 65/109165/1
Robert Varga [Wed, 6 Dec 2023 11:39:51 +0000 (12:39 +0100)]
Allow YANG PATCH to communicate ETag/Last-Modified

PATCH methods should communicate ETag/Last-Modified where applicable.
Introduce DataYangPatchResult to communicate these for YANG PATCH.

JIRA: NETCONF-1207
Change-Id: Ie98423c6615dc0ef2d19349d19e937f72ed03165
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRepair testDeleteNonexistentData() 64/109164/2
Robert Varga [Wed, 6 Dec 2023 11:36:12 +0000 (12:36 +0100)]
Repair testDeleteNonexistentData()

Our refactoring forgot to delegate to assertTestDeleteNonexistentData(),
leading to far too few assertions. Fix that and add more assertions.

JIRA: NETCONF-1107
Change-Id: If0a0bbb60fbcee08c398da365e2536e4e4b08869
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAllow plain PATCH to communicate ETag/Last-Modified 62/109162/2
Robert Varga [Wed, 6 Dec 2023 10:49:56 +0000 (11:49 +0100)]
Allow plain PATCH to communicate ETag/Last-Modified

PATCH methods should communicate ETag/Last-Modified where applicable.
Introduce DataPatchResult to communicate these for plain PATCH.

JIRA: NETCONF-1207
Change-Id: I3ed2e80385f2b5acdd90c04adab49b491ebd5a79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAllow dataPUT() to control ETag/Last-Modified 57/109157/3
Robert Varga [Wed, 6 Dec 2023 08:15:43 +0000 (09:15 +0100)]
Allow dataPUT() to control ETag/Last-Modified

When creating or replacing a data resource, the underlying strategy
should be free to indicate ETag/Last-Modified headers.

Allow this information to be communicated via DataPutResult and pick it
up when generating a Response.

JIRA: NETCONF-1207
Change-Id: I86b726fcaa5bfb7d762483f007d6de77b894f802
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoAllow dataPOST() to control Etag/Last-Modified 56/109156/3
Robert Varga [Wed, 6 Dec 2023 07:58:28 +0000 (08:58 +0100)]
Allow dataPOST() to control Etag/Last-Modified

In Create Resource Mode, each RestconfStrategy should be able to
communicate ETag and Last-Modified headers.

Retrofit DataPostResult.CreateResource to implement
ConfigurationMetadata and propagate its content when generating the HTTP
response.

JIRA: NETCONF-1207
Change-Id: I6b4440f018c17a41887fecc19b220542f360e2c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoShift ETag/Last-Modified generation to RestconfStrategy 55/109155/4
Robert Varga [Wed, 6 Dec 2023 07:40:27 +0000 (08:40 +0100)]
Shift ETag/Last-Modified generation to RestconfStrategy

We should not be faking headers, but rather let them be controlled by
RestconfStrategy.

This patch introduces ConfigurationMetadata, as the baseline interface
capturing the two headers and DataGetResult as the container allowing
them to be communicated from RestconfServer.dataGET() methods.

JIRA: NETCONF-1207
Change-Id: I2c2b11a60eea0c6c868f2e82f88c002e702fdbc5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoRemove obsolete NetconfClientDispatcher 94/108894/11
Ruslan Kashapov [Thu, 9 Nov 2023 12:40:08 +0000 (14:40 +0200)]
Remove obsolete NetconfClientDispatcher

Removed obsolete NetconfClientDispatcher interface,
implementation, related components and tests

JIRA: NETCONF-1108
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Change-Id: I24efa1deb8a4dffff51ac68f1f8a91cff1771d01

5 months agoCall-Home provider migration to transport-api 81/108881/13
Ruslan Kashapov [Wed, 1 Nov 2023 08:57:22 +0000 (10:57 +0200)]
Call-Home provider migration to transport-api

- new implementation of callhome-server (using on transport-api)
  replacing callhome-protocol
- callhome-provider updated to use callhome-server
- status update for call-home devices no longer uses change
  listener of topology data tree as connection status source,
  uses implementation of CallHomeStatusReporter instead
- call-home data tree sync moved from
  IetfZeroTouchCallHomeServerProvider to CallHomeMountStatusReporter
- configuration provided for OSGI services serving as call-home servers

JIRA: NETCONF-1183
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Change-Id: I8aa57413acbbe5e7cb7f3ebd4ce6a662f1d668ea

5 months agoClean up data{DELETE,PATCH}() 48/109148/2
Robert Varga [Sat, 2 Dec 2023 10:04:53 +0000 (11:04 +0100)]
Clean up data{DELETE,PATCH}()

While we know what we are going to do with the ApiPath, split the lookup
and interpretation.

JIRA: NETCONF-1157
Change-Id: Ife099f18e3600194f7c922a9455d4a493ee9a28f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 months agoClean up exception handling 46/109146/1
Robert Varga [Sat, 2 Dec 2023 09:30:33 +0000 (10:30 +0100)]
Clean up exception handling

There are a number of places where we allow RestconfDocumentedException
to be thrown, but we are returning a RestconfFuture. Make sure we catch
the exception and propagate it through the future.

JIRA: NETCONF-1157
Change-Id: Ia3a67e9469179302c0a9aabbc420a7a05fc8f08d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoEliminate InstanceIdentifierContext 70/109070/16
Robert Varga [Tue, 28 Nov 2023 18:42:41 +0000 (19:42 +0100)]
Eliminate InstanceIdentifierContext

Rework the way we lookup strategies and generally resolve ApiPath to
actual request paths.

The primary logic now rests with RestconfStrategy, which has a way to
recursively deal with yang-ext:mount steps, resulting in a strategy +
ApiPath tail.

These are then picked up by MdsalRestconfServer and routed to the target
strategy's actual method -- which then interprets the tail ApiPath as
appropriate.

JIRA: NETCONF-1157
Change-Id: I8a6391f5538ba5662bad1bef79186e9a1e08ae81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoGeneralize ResourceBodyTest 28/109128/4
Robert Varga [Thu, 30 Nov 2023 10:53:42 +0000 (11:53 +0100)]
Generalize ResourceBodyTest

Use proper payloads instead of mucking with internals. This shows that
negative case is completely unreachable.

JIRA: NETCONF-1157
Change-Id: I88371fe99362bec68462f6872e874bb7bbf89e5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRemove duplicate container in network-topology 23/109123/2
Peter Suna [Wed, 29 Nov 2023 08:32:57 +0000 (09:32 +0100)]
Remove duplicate container in network-topology

Task NETCONF-670 resolves a failed request to create a device
using the RPC create-device. This task added the grouping
"netconf-node-augmented-optional-fields" to the required RPC
"create-device" but unintentionally to the augmentation for
the list "node" in the network-topology model.

The same augmentation is already done in the
"netconf-node-optional" model.

This results in preparing the same augmentation from
two different models.

JIRA: NETCONF-1192
Change-Id: Ief7a449ffdaff5d42eb52856fac41e87a8e0274a
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
6 months agoGeneralize validTopLevelNodeName() test 14/109114/1
Robert Varga [Tue, 28 Nov 2023 22:08:05 +0000 (23:08 +0100)]
Generalize validTopLevelNodeName() test

Assert the same violation in JSON/XML tests, which shows this method is
that XML is doing its own thing.

Since these are exercising this code path as they should, we can hide
the method and inline it.

Change-Id: I43d172283f4c0089726271e830b7e62f54b7db0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline json_sub_container.json 13/109113/1
Robert Varga [Tue, 28 Nov 2023 21:36:13 +0000 (22:36 +0100)]
Inline json_sub_container.json

This is a simple resource, inline it to its two callers and eliminate
obsolete method which gets freed up.

Change-Id: I706dd3cf59e65e5feda0b787ef658bc41d77c922
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline xml_sub_container.xml 12/109112/1
Robert Varga [Tue, 28 Nov 2023 21:30:46 +0000 (22:30 +0100)]
Inline xml_sub_container.xml

This is a simple document, inline it directly in tests.

Change-Id: Ib0bbc244f9b599c1cdc5f4073fe0c361041cae16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline foo.xml 11/109111/1
Robert Varga [Tue, 28 Nov 2023 21:25:50 +0000 (22:25 +0100)]
Inline foo.xml

This is a simplistic XML fragment, inline it.

Change-Id: I817fb9f29757d5e3a23a068699667138dcedbfc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoMigrate AbstractResourceBodyTest to JUnit5 10/109110/1
Robert Varga [Tue, 28 Nov 2023 21:18:32 +0000 (22:18 +0100)]
Migrate AbstractResourceBodyTest to JUnit5

Clean up test interactions and migrate to JUnit5.

Change-Id: I4a62a1a980552205712b10552bb64229ead95b83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoDo not hide DataGetParams.EMPTY 09/109109/1
Robert Varga [Tue, 28 Nov 2023 17:58:38 +0000 (18:58 +0100)]
Do not hide DataGetParams.EMPTY

This is a simple constant, do not hide it, as we are already a
transparent record-based DTO.

JIRA: NETCONF-773
Change-Id: I103cdc4e8341f53078204fc0c9f4192f80df65c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoInline RestconfApplication 08/109108/1
Robert Varga [Tue, 28 Nov 2023 17:25:44 +0000 (18:25 +0100)]
Inline RestconfApplication

Use an anonymous Application subclass to initialize the servlet, which
makes it obvious JaxRsNorthbound has now mdsal.dom.api dependencies.

JIRA: NETCONF-773
Change-Id: I25aea4b6fdfc3d6d3561387956f2e92ff057c6e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoRefactor ReceiveEventsParams 07/109107/1
Robert Varga [Tue, 28 Nov 2023 17:08:01 +0000 (18:08 +0100)]
Refactor ReceiveEventsParams

This is a simple request DTO. Move it to restconf.server.api, where it
really belongs. Also rename it to EventStreamGetParams in keeping with
package naming.

JIRA: NETCONF-773
Change-Id: I06ca58bcf5dde64b9e8787b4d467a384a960596e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoCleanup restconf-nb dependencies 06/109106/1
Robert Varga [Tue, 28 Nov 2023 17:05:36 +0000 (18:05 +0100)]
Cleanup restconf-nb dependencies

We have accumulated some warnings, clean them up.

JIRA: NETCONF-773
Change-Id: I69058c298a63b2f084c1ab2cce46474b71bd6c51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>