netconf.git
3 months agoDo not use SecurityUtils in callhome-provider 49/110049/1
Robert Varga [Sat, 27 Jan 2024 20:50:26 +0000 (21:50 +0100)]
Do not use SecurityUtils in callhome-provider

Use plain KeyStore access to acquire provides. This eliminate
AuthorizedKeysDecoder's dependency on sshd -- which does not make sense
in its current shape and form.

Change-Id: I95e743a34d78f7220e2edf49dbac177a132f0c3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAccess RemoteAddress exactly once 48/110048/1
Robert Varga [Sat, 27 Jan 2024 20:49:22 +0000 (21:49 +0100)]
Access RemoteAddress exactly once

We are using the value twice, so let's save it in a local variable.

Change-Id: Ib38a12a3ee71199cbdf8e118225225d2c4ada6f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove netconf-api dependency 47/110047/1
Robert Varga [Sat, 27 Jan 2024 20:47:12 +0000 (21:47 +0100)]
Remove netconf-api dependency

callhome-provider does not deal with netconf-api directly, remove the
unused dependency.

Change-Id: I0f100db47c5e31897bc37af1fd136f6ec1fa4ce3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoClean up netconf-common-mdsal dependencies 46/110046/2
Robert Varga [Sat, 27 Jan 2024 20:12:14 +0000 (21:12 +0100)]
Clean up netconf-common-mdsal dependencies

We have a number of warnings here, fix them up.

Change-Id: Ib12bd9d67aa2c76f7b51392b8f3c9a83a8ab2ff3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoClean up netconf-nb dependencies 45/110045/1
Robert Varga [Sat, 27 Jan 2024 20:03:55 +0000 (21:03 +0100)]
Clean up netconf-nb dependencies

The dependency graph has changed significantly, this patch eliminates
the problems reported in netconf-nb.

Change-Id: Ice97ce72a1e02d74fb60c7a54c8d2b2d6b2b9d5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoClean up netconf-client-mdsal dependencies 44/110044/1
Robert Varga [Sat, 27 Jan 2024 19:57:50 +0000 (20:57 +0100)]
Clean up netconf-client-mdsal dependencies

We are using netconf-common, but not shaded-sshd and not
netconf-netty-util.

Change-Id: I9bc99d8270b4b2d3467925b8a9e43d6b989db7c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix shutdown message 43/110043/2
Robert Varga [Sat, 27 Jan 2024 19:47:57 +0000 (20:47 +0100)]
Fix shutdown message

The timer is being stopped, not started, fix that.

Change-Id: Iebce87f8710bbb05c6e60f4fbcfd4a7b691938fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate use of PKIUtil 42/110042/1
Robert Varga [Sat, 27 Jan 2024 19:39:18 +0000 (20:39 +0100)]
Eliminate use of PKIUtil

aaa-encrypt-service is confused as to what it's role is. We are using a
a very simple method from PKIUtil -- inline and optimize it for our use,
making it clear we depend on BouncyCastle.

Change-Id: Ic9bbda2c49f41f7bca483ac0127f08a8ff992e9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove AuthenticationHandler 41/110041/1
Robert Varga [Sat, 27 Jan 2024 19:21:08 +0000 (20:21 +0100)]
Remove AuthenticationHandler

This class is not used anywhere, remove it and clean up dependencies,
making it plenty clear that netconf-netty-util is just a Netty thing.

JIRA: NETCONF-1108
Change-Id: I0454c53b2c3b9d8573c1b386c37df97e7fc2df1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoActivate NetconfClientFactoryImpl lazily 38/110038/4
Robert Varga [Sat, 27 Jan 2024 18:07:14 +0000 (19:07 +0100)]
Activate NetconfClientFactoryImpl lazily

This is a simple service, which should be deactivated when it is not
needed. Also drop the use of properties, as there really is no point.

JIRA: NETCONF-1108
Change-Id: I880ccb112b3c86fa196fe2c20157e070bc5efd47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoIntroduce NetconfTimer 37/110037/8
Robert Varga [Sat, 27 Jan 2024 15:44:55 +0000 (16:44 +0100)]
Introduce NetconfTimer

The wiring of a global timer is not quite what we want, as it makes
tracking down where and how it is used quite hard.

Add an explicit NetconfTimer interface and a default implementation to
provide indirection in from on the Netty timer.

This has the benefit of reigning in the lifecycle of the timer, so we
actually end up sharing it across components properly.

JIRA: NETCONF-590
Change-Id: Ib58c9f5668ec859d68432116fe63f954f6eae08e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate netconf.nettyutil.handler.ssh.client 40/110040/2
Robert Varga [Sat, 27 Jan 2024 18:30:47 +0000 (19:30 +0100)]
Eliminate netconf.nettyutil.handler.ssh.client

All of this code has been rendered unused, remove it.

JIRA: NETCONF-1108
Change-Id: I3543a42edd7f2464544af6a54036444ee923cf01
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoClean up NetconfClientConfiguration 39/110039/2
Robert Varga [Sat, 27 Jan 2024 18:11:15 +0000 (19:11 +0100)]
Clean up NetconfClientConfiguration

Use normal reference to SslHandlerFactory.

Change-Id: I17bcb552d6a6539f8efc0d0cfc23ebaa3bf68ca8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove NetconfMessageTransformUtil.FILTER_NODEID 00/110000/2
Robert Varga [Thu, 25 Jan 2024 19:10:33 +0000 (20:10 +0100)]
Remove NetconfMessageTransformUtil.FILTER_NODEID

We have Filter.QNAME, which we can use without relying on a special
constant. While at it, fixup GET RPC's input.

Change-Id: I3040c99ae983e2bcd5e28f29007cf031ff1a3a54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove use of threadpool-config-impl 08/110008/4
Robert Varga [Fri, 26 Jan 2024 03:53:28 +0000 (04:53 +0100)]
Remove use of threadpool-config-impl

We are using just one utility, inline the few lines of code that are
needed to make the threadpool work.

JIRA: CONTROLLER-2092
Change-Id: I93d08f348f3331a8b28e40c7f18f60831cd18d8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump sshd to 2.12.0 24/110024/2
Robert Varga [Fri, 26 Jan 2024 14:37:09 +0000 (15:37 +0100)]
Bump sshd to 2.12.0

https://github.com/apache/mina-sshd/blob/master/docs/changes/2.12.0.md

Change-Id: I8aebc6496f95f97c8133b2ced6bfa246da7f5864
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix nullability checks in operations entity classes 15/110015/3
lubos-cicut [Fri, 26 Jan 2024 08:34:58 +0000 (09:34 +0100)]
Fix nullability checks in operations entity classes

During rewrite we have lost requireNonNull checks. This patch
contains all classes which extend OperationEntity.

JIRA: NETCONF-938
Change-Id: I117e723ebfaab1c048f457bda073e29748329495
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
3 months agoRemove netconf-config 07/110007/5
Robert Varga [Fri, 26 Jan 2024 03:06:38 +0000 (04:06 +0100)]
Remove netconf-config

Rehost the remaining threadpool into netconf-topology and let users
inject is as NetconfTopologySchemaAssembler.

JIRA: NETCONF-1232
Change-Id: I3dd7a24d689c53aafd1e067028991302a8925ef4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate GlobalNetconfSshScheduledExecutor 06/110006/4
Robert Varga [Fri, 26 Jan 2024 00:48:52 +0000 (01:48 +0100)]
Eliminate GlobalNetconfSshScheduledExecutor

The only thing this executor is used is for ietf-monitoring listener
updates for netconf-server.

Rather than having a tuneable threadpool, just acknowledge the fact we
need a single thread for this task and manage it internally
NetconfMonitoringServiceImpl if possible.

JIRA: NETCONF-1232
Change-Id: I081947c28981442777ea8bc91a77df01641d23fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix nullability checks in PropertyEntity class 14/110014/2
lubos-cicut [Fri, 26 Jan 2024 08:31:58 +0000 (09:31 +0100)]
Fix nullability checks in PropertyEntity class

During rewrite we have lost requireNonNull checks.

JIRA: NETCONF-938
Change-Id: I6b8a38164a60fd61b35c10af559f6e41514095b3
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
4 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>
4 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>
4 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>
4 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>