netconf.git
10 months agoChange hard-coded actions path 59/106859/1
Šimon Ukuš [Wed, 7 Jun 2023 10:29:47 +0000 (12:29 +0200)]
Change hard-coded actions path

There was an assumption about the basePath ('rests') when creating
path for POST method for actions. The path was incorrect if instead of
the default basePath a custom one was used.

This patch fixes the path creation while not making any assumptions
about the basePath. The path is resolved when needed.

JIRA: NETCONF-1021
Change-Id: I4b4a7f8f69626874d9c9821205d7c726dfe90919
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
(cherry picked from commit 206fb9f0c4b589222fc4a9fc3a47c9e203110d70)

10 months agoFix device data update failure after successful connection 33/106833/7
Sangwook Ha [Wed, 5 Jul 2023 21:59:55 +0000 (14:59 -0700)]
Fix device data update failure after successful connection

NetconfNodeHandler does not propagate successful connection to its
delegate (RemoteDeviceHandler). Make sure that it's notified so that
the device data is updated accordingly.

JIRA: NETCONF-1074
Change-Id: Id32996c11d0a63812d439ad386472c059255cf4e
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUpdate draft-ietf-client-server models 20/106820/3
Robert Varga [Wed, 5 Jul 2023 17:00:15 +0000 (19:00 +0200)]
Update draft-ietf-client-server models

There is a new drop for drafts, updating the modules we are packaging.
Update them. This aligns the revisions with the models used in
netconf-{client,server}.

Since this requires some code changes, code is cleaned up to eliminate
most of the warnings and take advantage of BindingMap.

JIRA: NETCONF-1073
Change-Id: I5c610d852ab504050cb258c6b42bc6e32e5b19e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
10 months agoChange default keyword to example 46/106546/6
tobias.pobocik [Tue, 20 Jun 2023 08:43:43 +0000 (10:43 +0200)]
Change default keyword to example

In many cases we misuse default swagger property to set an example
value. Instead, use example property as specified in:
https://swagger.io/docs/specification/adding-examples/

Also, adjust the existing tests to match the changes.

JIRA: NETCONF-999
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Change-Id: Ic1d168b119e4b2226b1fa46c0bf86629ebd990d1

10 months agoConvert restconf-api to a JPMS module 26/106826/2
Robert Varga [Wed, 5 Jul 2023 20:24:24 +0000 (22:24 +0200)]
Convert restconf-api to a JPMS module

This is a simple artifact, make sure it is a proper module. While we are
here, also remove @Beta annotations and seal class hierarchies.

Change-Id: I972fe27f25a84f1f04c261bfed76add59da61fa0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up ApiPathParser.URL_FACTORY 25/106825/1
Robert Varga [Wed, 5 Jul 2023 20:33:53 +0000 (22:33 +0200)]
Clean up ApiPathParser.URL_FACTORY

Use a switch expression and guarantee a @NonNull result.

Change-Id: I8a53c1b358f739aa8f4efeb9d36641a3039145cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse HexFormat instead of custom code 24/106824/1
Robert Varga [Wed, 5 Jul 2023 20:29:51 +0000 (22:29 +0200)]
Use HexFormat instead of custom code

JDK17+ ships with HexFormat, which renders some of our code superfluous.
Migrate over while retaining compatibility.

Change-Id: I608ab71ad0406974a56d60c63de12a198a85d922
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up ReadDataTransactionUtil 22/106822/2
Robert Varga [Wed, 5 Jul 2023 19:28:42 +0000 (21:28 +0200)]
Clean up ReadDataTransactionUtil

Couple of improvements:
- do not rebuild LeafNodes and LeafSetEntryNodes
- use instanceof patterns to eliminate part of the casting
- eliminate use of ImmutableNodes' methods.
- perform strict System(Map,LeafSet) checks

Change-Id: If49ab99f9a1f82d210261173f631a5f18b2ce84f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix deprecation warnings in restconf-nb 21/106821/1
Robert Varga [Wed, 5 Jul 2023 19:11:33 +0000 (21:11 +0200)]
Fix deprecation warnings in restconf-nb

NormalizedNode and YangInstanceIdentifier have both new methods, switch
to using those.

Change-Id: If84f273fcb32a3ed2b876ec62209f660ac767482
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUpdate constructors, remove Optional, add non-null 35/106235/12
Šimon Ukuš [Tue, 30 May 2023 06:36:31 +0000 (08:36 +0200)]
Update constructors, remove Optional, add non-null

It is not advised to use Optional in constructors.
Remove Optionals with DOMSchemaService in constructors.

Add non-null annotations with requireNonNull check to avoid NPE,
since DOMSchemaService is being used.
The same applies to custom basePath

JIRA: NETCONF-998
Change-Id: I2b02be7438355b5ca0e75a3dc54bb7e5f2a675ab
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
10 months agoConvert transport-api into a JPMS module 19/106819/1
Robert Varga [Wed, 5 Jul 2023 16:55:32 +0000 (18:55 +0200)]
Convert transport-api into a JPMS module

This is a simple APi. Fix its dependencies and convert it to a proper
module.

Change-Id: I65cf64e461ea8f3751318bdcea07b9776488842b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert netconf-dom-api to a JPMS module 18/106818/1
Robert Varga [Wed, 5 Jul 2023 16:13:57 +0000 (18:13 +0200)]
Convert netconf-dom-api to a JPMS module

This is a simple artifact, convert it to a module and fix its
dependencies to eliminate warnings.

Change-Id: I320a15d9a7227b95b7ba1ed7476bef0e66873808
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert netconf-api into a module 17/106817/2
Robert Varga [Wed, 5 Jul 2023 16:03:57 +0000 (18:03 +0200)]
Convert netconf-api into a module

This is a simplistic module, convert it to JPMS. Also correct dependency
declarations to fix warnings.

Change-Id: I84549eb24ed5c1977ef23b8c0432d8cab6fc8ad4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd Automatic-Module-Name to RFC6241 model 16/106816/1
Robert Varga [Wed, 5 Jul 2023 15:54:05 +0000 (17:54 +0200)]
Add Automatic-Module-Name to RFC6241 model

This is a standard model and hence we use the usual module naming from
MD-SAL.

Change-Id: I2b879df166f1c15729687075edb17c2a58fc171d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump versions to 6.0.1-SNAPSHOT 14/106814/1
Robert Varga [Wed, 5 Jul 2023 14:26:31 +0000 (16:26 +0200)]
Bump versions to 6.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I906433322e159b633475244b3673eeae70e1644c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove blueprint from netconf-topology-singleton 06/106806/3
Robert Varga [Tue, 4 Jul 2023 18:37:57 +0000 (20:37 +0200)]
Remove blueprint from netconf-topology-singleton

We have only a single configuration knob. Convert that to OSGi Config
Admin and allow it to be manually controller. Then convert
NetconfTopologyManager to an OSGi DS Component and a
javax.inject.Singleton.

JIRA: NETCONF-1072
Change-Id: I802b51bc15ab0eb406d94471336aed34399b9cc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove NetconfTopologySingletonService 05/106805/2
Robert Varga [Tue, 4 Jul 2023 17:48:52 +0000 (19:48 +0200)]
Remove NetconfTopologySingletonService

This service is not used anywhere and it does not provide anything.
Remove it.

Change-Id: I00c91673b942d63804f6b4aa5d6805e5a8221d9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDrop unused services 04/106804/2
Robert Varga [Tue, 4 Jul 2023 17:31:02 +0000 (19:31 +0200)]
Drop unused services

NetconfTopologyManager does not use DOMActionProviderService nor
DOMRpcProviderService. Drop them from dependencies.

Change-Id: If94076805de7672462cc0844030828921c993d55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoReduce casts in NetconfNodeActor 03/106803/2
Robert Varga [Tue, 4 Jul 2023 17:15:53 +0000 (19:15 +0200)]
Reduce casts in NetconfNodeActor

We have 5 individual explicit casts here -- use instanceof pattern to
remove them.

Change-Id: I1162d51ee52c6b9302cc822d2d259d91c7842b1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoReuse NetconfTopologySetup 02/106802/2
Robert Varga [Tue, 4 Jul 2023 17:01:14 +0000 (19:01 +0200)]
Reuse NetconfTopologySetup

NetconfTopologySetup pretty much all the context we need, there is just
no point in passing down individual services.

JIRA: NETCONF-1039
Change-Id: I21ec0fad9e267df06e5eb4dab11d2962feb2eee4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse simple Executor in NetconfDevice 01/106801/3
Robert Varga [Tue, 4 Jul 2023 16:34:00 +0000 (18:34 +0200)]
Use simple Executor in NetconfDevice

Passing down ListenableExecutorService ends up being interesting, as it
is not clear what the actual lifecycle is. Luckily we can get by using a
simple Executor with Futures.submit(), which essentially performs the
same task.

This makes it clear that the service is not touched by anyone in the
stack and we can use any old Executor -- to the point of using
directExecutor() in NetconfDeviceTest.

Change-Id: I31fcfcb7b303046935392bffd6d50c8f83ec33a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not use AbstractNetconfTopology in netconf-topology-singleton 00/106800/3
Robert Varga [Tue, 4 Jul 2023 16:13:47 +0000 (18:13 +0200)]
Do not use AbstractNetconfTopology in netconf-topology-singleton

An AbstractNetconfTopology is meant to represent the entire topology,
do not misuse it to track single nodes.

JIRA: NETCONF-1039
Change-Id: If4e98f2b59bf92e90beed40df09e52fe8bacd7d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSplit out NetconfClientConfigurationBuilderFactory 99/106799/2
Robert Varga [Tue, 4 Jul 2023 14:28:38 +0000 (16:28 +0200)]
Split out NetconfClientConfigurationBuilderFactory

The task of creating a client configuration is independent of the actual
topology implementation. Rather that requiring a full-blown
AbstractNetconfTopology to accomplish this, split it out into a
self-contained component.

This component is then injected into topologies instead of its
constituent services -- which paves the way to expose NetconfNodeHandler
at a later point in time.

This also allows us to move a few tests from netconf-topology-impl to
netconf-topology-spi.

JIRA: NETCONF-1039
Change-Id: I9b92b662d6daf3106c26cbc6e470325bc5153348
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRework NETCONF client reconnection 86/106786/8
Robert Varga [Mon, 3 Jul 2023 08:32:23 +0000 (10:32 +0200)]
Rework NETCONF client reconnection

This patch reworks the way establishing a connection works: we only have
createClient(), which returns a simple future. The logic for
reconnecting the client is now owned by each individual app.

This affects only netconf-topology implementations, which share common
code here in NetconfConnectorDTO and AbstractNetconfTopology. This is
re-shuffled into NetconfNodeHandler, which now encapsulates all the
state as well as the logic to issue reconnects.

JIRA: NETCONF-1070
Change-Id: I8f175329ab2826e46c95dee59c408e71bf453ccf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoConvert yanglib to OSGi DS 19/103919/18
OleksandrZharov [Wed, 4 Jan 2023 09:05:07 +0000 (10:05 +0100)]
Convert yanglib to OSGi DS

This is a rather simple component, convert it to OSGi DS, along with
configuration in Config Admin. This means we are removing an initial
configuration XML and replacing it with defaults in
ObjectClassDefinition.

Further changes entail:
- renaming WebInitialized to JaxRsYangLib to make it clear the component
  is a JAX-RS specific thing
- fixing up pom.xml dependency declarations to eliminate maven warnings

Finally we update the documetation to make sure we do not have stale
references.

JIRA: NETCONF-772
Change-Id: I1ef32510c7acf134d8d548003fc607e2800d235e
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove NetconfTopology 90/106790/4
Robert Varga [Mon, 3 Jul 2023 20:01:44 +0000 (22:01 +0200)]
Remove NetconfTopology

Align Node lifecycle with its users, keeping configuration updates
internal to AbstractNetconfTopology. Also hide NetconfConnectorDTO.

JIRA: NETCONF-1069
Change-Id: If8a1821171d5e52ba84cd317a01588a3f69c5bd6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrate users of YangInstanceIdentifier.empty() 91/106791/2
Robert Varga [Mon, 3 Jul 2023 20:13:00 +0000 (22:13 +0200)]
Migrate users of YangInstanceIdentifier.empty()

Use YangInstanceIdentifier.of() instead, fixing a ton of deprecation
warnings.

Change-Id: I2aabb0ad4647d76ef8a3037180039cd394c386f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRequire maximum chunk size to be specified 22/101922/10
Robert Varga [Fri, 29 Jul 2022 16:32:03 +0000 (18:32 +0200)]
Require maximum chunk size to be specified

The default incoming chunk size is controlled by session negotiator,
make sure to co-locate the tuneable value there and remove deprecated
constructors for both NetconfChunkAggregator and
AbstractNetconfSessionNegotiator.

Change-Id: Iab489e35e18905c33a747a52c1698ece4e51d3ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoUse released aaa versions 83/106783/1
Robert Varga [Sun, 2 Jul 2023 16:04:16 +0000 (18:04 +0200)]
Use released aaa versions

Use properly-released versions.

Change-Id: Ic479e0e55d7069cd90568addd4185caf70864d8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoUse controller released artifacts 80/106780/1
Robert Varga [Sun, 2 Jul 2023 11:25:16 +0000 (13:25 +0200)]
Use controller released artifacts

Ditch snapshots, use the properly-released version.

Change-Id: I849ec6f3d2d577bbd51e22d5d2122c2f39492bca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoUse released mdsal version 70/106770/1
Robert Varga [Fri, 30 Jun 2023 09:35:50 +0000 (11:35 +0200)]
Use released mdsal version

Use properly-release artifacts for mdsal-12.0.0.

Change-Id: I76deb9a3f0f5140c8614ae95e022c77382f28659
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoConvert ReadDataParams to Java record 27/106327/12
OleksandrZharov [Wed, 31 May 2023 14:43:48 +0000 (16:43 +0200)]
Convert ReadDataParams to Java record

Refactored ReadDataParams into Java record.

Now we are sure we conform to requirements specified in
org.opendaylight.yangtools.concepts.Immutable.

JIRA: NETCONF-1044
Change-Id: Ib9f667d53f48cbe2b7602c1bc68f063237c9fad3
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoRemove tagged field from ReadDataParams 00/106500/3
Ivan Hrasko [Thu, 15 Jun 2023 15:14:20 +0000 (17:14 +0200)]
Remove tagged field from ReadDataParams

Remove unneeded tagged field from ReadDataParams as suggested by FIXME.
This means we pass through the selected mode.

JIRA: NETCONF-1044
Change-Id: Ia64ed6b1de3daefb3d38caa234c7c6eaa48f8f59
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoBump upstreams 98/106698/1
Robert Varga [Mon, 26 Jun 2023 15:39:44 +0000 (17:39 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.3
- infrautils-6.0.1
- yangtools-11.0.1

Change-Id: I3ccaf8efed88081c9c7c158537303c9ad37ef2a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoFix yanglib data merge 19/106619/4
Ruslan Kashapov [Thu, 22 Jun 2023 08:19:30 +0000 (11:19 +0300)]
Fix yanglib data merge

Explicit definition of ordered mapping node causes
incompatibility with schema based unordered mapping node
generated out of Binding object and yanglib data merge
failure as result.

+ Minor code cleanup

JIRA: NETCONF-1065
Change-Id: I23865e1d543819ae60c1160183986c27595dc999
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
11 months agoAdd ietf-netconf-client/sever yang models 36/106436/7
Ruslan Kashapov [Fri, 9 Jun 2023 09:33:37 +0000 (12:33 +0300)]
Add ietf-netconf-client/sever yang models

Added models: ietf-netconf-client, ietf-netconf-server,
ietf-x509-cert-to-name (new rfc7407 module)

JIRA: NETCONF-590
Change-Id: I7e4880339c599bce6932bd952283129e341adac1
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
11 months agoChange schema for GET XML example 81/106581/3
Šimon Ukuš [Wed, 21 Jun 2023 10:17:03 +0000 (12:17 +0200)]
Change schema for GET XML example

The XML example for GET request in OpenApi UI was different
to the one being actually returned. This patch changes the schema
used for that example, making it consistent with what is actually
returned in the response.

JIRA: NETCONF-1059
Change-Id: Ie2d128b6de43d705c93d509c287cabcbc719e591
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoYanglib to return content-type application/yang by default 11/106611/4
Ruslan Kashapov [Thu, 22 Jun 2023 08:19:30 +0000 (11:19 +0300)]
Yanglib to return content-type application/yang by default

Dedicated content-type for yang defined in RFC-6020

JIRA: NETCONF-973
Change-Id: I34920f4b0341a74077387cffc04b2e2f37b5c4fb
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
11 months agoFixup for upstream API changes 32/106632/1
Robert Varga [Mon, 19 Jun 2023 12:03:25 +0000 (14:03 +0200)]
Fixup for upstream API changes

Both yangtools and mdsal have changed API details. This patch fixes them
up.

Change-Id: Id57b7054a4a3e8bffa1e5300b48f21fa0a38a6df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoBump upstreams 33/106533/19
Robert Varga [Mon, 19 Jun 2023 12:03:25 +0000 (14:03 +0200)]
Bump upstreams

Adopt:
- odlparent-13.0.1
- infrautils-6.0.0
- yangtools-11.0.0-SNAPSHOT
- mdsal-12.0.0-SNAPSHOT
- controller-8.0.0-SNAPSHOT
- aaa-0.18.0-SNAPSHOT

Handling of AugmentationIdentifier/AugmentationNode has been removed,
as this indirection is no longer present in yang-data-api.

The handling of PathArguments for the purposes of
{Netconf,Writer}FieldsTranslator has been updated, as yangtools no
longer provide wildcard PathArguments.

Also the handling of DTCLs is updated, so that we serializer changed
nodes in the same namespace first and then proceed to emit other
namespaces in lexical order.

JIRA: NETCONF-841
Change-Id: I6e8b9e834a33711387495e2cae52371ac456553d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoAnnotate all serialVersionUID with @Serial 80/106580/2
Šimon Ukuš [Wed, 21 Jun 2023 09:47:40 +0000 (11:47 +0200)]
Annotate all serialVersionUID with @Serial

There are multiple occurrences of serialVersionUID
throughout the project. This change add missing
@Serial annotations

JIRA: NETCONF-1062
Change-Id: Ic3d1399f37dcba9fbfa377e8d7425dbaf089d3ab
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
11 months agoRemove unrequired testcase from mandatory field 00/106600/3
Peter Suna [Wed, 21 Jun 2023 16:20:23 +0000 (18:20 +0200)]
Remove unrequired testcase from mandatory field

The required field can only be obtained from the schema node.
Checking the inner field is unnecessary.

JIRA: NETCONF-976
Change-Id: I297a6216311c652e7fd460c6efd9cf42a1512add
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
11 months agoOpenApi: Add parameters into actions 84/105884/24
Yaroslav Lastivka [Wed, 10 May 2023 11:01:09 +0000 (14:01 +0300)]
OpenApi: Add parameters into actions

Some devices using actions have invalid swagger URLs
generated. The problem is that we do not generate parameters
for actions.

Implemented logic for adding “pathParameters” to path parameters
for actions.

JIRA: NETCONF-860
Change-Id: If01af731770029fb8f7529312417a3ea46fd5841
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoAdd slash symbol into actions request 99/106599/3
Yaroslav Lastivka [Wed, 21 Jun 2023 16:07:03 +0000 (19:07 +0300)]
Add slash symbol into actions request

Some BBF yang devices using actions have invalid swagger URLs generated

Added additional slash symbol before "rests/operations".

JIRA: NETCONF-860
Change-Id: I92c5f67f2f360759d43564870fc248688dfc6caf
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
11 months agoOpenApi: Eliminate setRequiredIfNotEmpty method 03/106403/8
Yaroslav Lastivka [Wed, 7 Jun 2023 13:31:02 +0000 (16:31 +0300)]
OpenApi: Eliminate setRequiredIfNotEmpty method

SetRequiredIfNotEmpty method has been replaced with ternary operator.

JIRA: NETCONF-1053
Change-Id: I3665d181dc5f6160c7a58d0e6dee0aabe5f15e19
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoEnhance code readability 07/106407/8
Yaroslav Lastivka [Wed, 7 Jun 2023 16:22:55 +0000 (19:22 +0300)]
Enhance code readability

Improve code readability by consolidating object setup using
method chaining in Builder pattern.

JIRA: NETCONF-1053
Change-Id: I9ff315e2b583c9032447f91460a81819e40d7fdc
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoOpenApi: Add missing mandatory nodes to required 79/104979/29
Peter Suna [Wed, 22 Mar 2023 08:10:45 +0000 (09:10 +0100)]
OpenApi: Add missing mandatory nodes to required

Add mandatory containers, lists and leaf-lists to
required JSON array in OpenApi if they are mandatory.

Based on RFC7950:
https://www.rfc-editor.org/rfc/rfc7950#page-14

JIRA: NETCONF-976
Change-Id: Ieca56ad9a325b59fdf57438594b89f34e3776e08
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoOpenApi: Add missing required elements to JSON 75/104975/27
Peter Suna [Mon, 20 Mar 2023 07:38:30 +0000 (08:38 +0100)]
OpenApi: Add missing required elements to JSON

This commit adds missing mandatory nodes to the required
field of the JSON OpenApi data. According to RFC-7950, a node
is mandatory if it is:
A leaf, choice, anydata, or anyxml node with a "mandatory"
statement with the value "true".

See:
https://www.rfc-editor.org/rfc/rfc7950#page-14

The only exception for this patch is the 'choice' node.
If the 'choice' node is mandatory, we cannot require the
'choice' or 'case' name in the body.

Additionally, nodes inside the 'case' should only be required
if they are mandatory.

JIRA: NETCONF-976
Change-Id: I3d1220737a582b27163a9ff8f33ceee1edb94c87
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoCorrect ReadDataTransactionUtilTest 43/106543/3
Robert Varga [Mon, 19 Jun 2023 23:01:44 +0000 (01:01 +0200)]
Correct ReadDataTransactionUtilTest

The model dictates the use of UnkeyedListNode, not MapNode -- fix test
data to conform to the model.

Change-Id: I178a7a1b53d8c2b06a8670dc90f30f481518bec3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoClean up container.yang 42/106542/3
Robert Varga [Mon, 19 Jun 2023 22:47:26 +0000 (00:47 +0200)]
Clean up container.yang

Fix whitespace, making the module more readable.

Change-Id: I1b8c2d52f164ffde1fdacaa6020d7dbffba04af5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoCorrect YangInstanceIdentifierSerializerTest 41/106541/3
Robert Varga [Mon, 19 Jun 2023 22:01:23 +0000 (00:01 +0200)]
Correct YangInstanceIdentifierSerializerTest

Addressing modes for 'list' statements differs when they have a 'key'
statement from when they do not: former takes
NodeIdentifierWithPredicates to identify children, which the latter
takes NodeIdentifiers.

Expand the test cases to differentiate between the two -- note that
upstream accepts NodeIdentifierWithPredicates even for unkeyed lists,
but that is about to change.

Change-Id: Ib13d43097f86a6932e63e33d3a48788abe7640ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoTurn LinkedPathElement into a record 40/106540/2
Robert Varga [Mon, 19 Jun 2023 21:36:17 +0000 (23:36 +0200)]
Turn LinkedPathElement into a record

LinkedPathArgument is a pure DTO, convert it to a record to reduce
ceremony.

Change-Id: I5bb59710f88fe4e8bdb2b3b00f8b539b44b521eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoMake NetconfFieldsTranslator fully static 39/106539/3
Robert Varga [Mon, 19 Jun 2023 21:19:16 +0000 (23:19 +0200)]
Make NetconfFieldsTranslator fully static

There is no point in creating an instance, as all our processing is held
on stack. Turn all methods to static and remove unused instance.

Change-Id: I71f9bf8e3736e74dcf2846fa3f56142bc6c14571
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoRemove AbstractFieldsTranslator 38/106538/2
Robert Varga [Mon, 19 Jun 2023 21:15:15 +0000 (23:15 +0200)]
Remove AbstractFieldsTranslator

This abstract class has only one specialization, WriterFieldsTranslator.
Merge the two classes, making WriterFieldsTranslator a fully-static
utility class.

Change-Id: I5c26fbd1ee1d1678dee648e9cdbc86361a37c38e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoSimplify ListenerAdapterTest 37/106537/2
Robert Varga [Mon, 19 Jun 2023 19:23:48 +0000 (21:23 +0200)]
Simplify ListenerAdapterTest

There is no need to merge parent structures for test purposes, use
simpler operations.

Change-Id: Ic4d263e1d9eccbec42bdecad2ddeb8c1710a9e7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoIncrease timeout for ssh transport UT 34/106534/3
Ruslan Kashapov [Mon, 19 Jun 2023 12:21:49 +0000 (15:21 +0300)]
Increase timeout for ssh transport UT

Increase connection establish timeout for ssh transport UT
to prevent too often occurrences of timeout during verify jobs.

JIRA: NETCONF-590
Change-Id: Ib025fa959bc1ab4aa586c101944b7afe450a83f8
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
11 months agoAdd Builder for Operations 37/106437/4
OleksandrZharov [Fri, 9 Jun 2023 14:35:42 +0000 (16:35 +0200)]
Add Builder for Operations

Added nested Builder for Operations. It help us to limit usage
of null and increase readability.

JIRA: NETCONF-1050
Change-Id: Iaf931433872b82f0a36ca32847cc9da4baec2a3d
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
11 months agoOpenAPI: Eliminate ListPathBuilder interface 04/106404/4
Yaroslav Lastivka [Wed, 7 Jun 2023 14:09:05 +0000 (17:09 +0300)]
OpenAPI: Eliminate ListPathBuilder interface

ListPathBuilder interface has been eliminated.

JIRA: NETCONF-1048
Change-Id: Ia1b602ca7a3a740a78249b8bb17f8d8a05303a28
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
11 months agoEliminate createUniquePathParamName method 02/106402/3
Yaroslav Lastivka [Wed, 7 Jun 2023 13:00:57 +0000 (16:00 +0300)]
Eliminate createUniquePathParamName method

The method 'createUniquePathParamName' has been eliminated.

Instead, use a new logic using a variable named 'discriminator'.
This variable increments on each occurrence of parameter name.

JIRA: NETCONF-1047
Change-Id: I512bed32f27e4eb4ad51afc6e90fd484793cb2fb
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoSet example for enum type 52/105652/9
Ivan Hrasko [Tue, 25 Apr 2023 12:12:58 +0000 (14:12 +0200)]
Set example for enum type

We should distinguish between "default" and "example" OpenAPI
property.

Set "default" only when enum has defined default value in YANG model.
Otherwise set "example" as a first element of enumeration.

JIRA: NETCONF-999
Change-Id: I1873115deacb3f7b06537d1427c1b2e3d4ea82cd
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoReplace Guava's ImmutableList by java.util.List 81/106481/5
Ivan Hrasko [Wed, 14 Jun 2023 12:24:31 +0000 (14:24 +0200)]
Replace Guava's ImmutableList by java.util.List

Use java.util.List.of/copyOf instead of Guava's ImmutableList.of/copyOf
in RestconfDocumentedException class.

Change-Id: I7a7abe0e56f5b06becfa4bbe8099025b11fb4d8b
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoFix Broken refresh in network-topology-singleton 25/106425/6
Peter Suna [Thu, 8 Jun 2023 11:20:56 +0000 (13:20 +0200)]
Fix Broken refresh in network-topology-singleton

Add missed functionality from patch:
https://git.opendaylight.org/gerrit/c/netconf/+/104177

Revert NetconfTopologyManagerTest.
Use refresh method instead of instantiateServiceInstance method.

JIRA: NETCONF-1046
Change-Id: I351e4248928f3c49253a8ccefc414ee8f1a104ce
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoRemove ObjectMapper from BaseYangOpenApiGenerator 29/106429/3
Ivan Hrasko [Thu, 8 Jun 2023 13:15:51 +0000 (15:15 +0200)]
Remove ObjectMapper from BaseYangOpenApiGenerator

Its unfortunate to use heavy ObjectMapper for logging purposes.

Change-Id: I6357d4bd768065144dc8dee2d4f0b722278b5994
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoRemove ObjectMapper from OpenApiServiceImplTest 28/106428/2
Ivan Hrasko [Thu, 8 Jun 2023 13:12:01 +0000 (15:12 +0200)]
Remove ObjectMapper from OpenApiServiceImplTest

There is no need to simulate JSON serialization. We can just
assert that fields have desired values.

Change-Id: I40109512feff449c1c9b64e7e9e9ec6ddad830cc
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoAdd odl-netconf-transport 72/105772/8
Robert Varga [Tue, 2 May 2023 11:06:17 +0000 (13:06 +0200)]
Add odl-netconf-transport

Package the rest of the transport-level features, so that individual
users may depend on this feature to provide all the transports
available.

JIRA: NETCONF-590
Change-Id: Ie3091c2ba29df287a7b374768e25ef100ff54e67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
11 months agoBump upstreams 35/106435/1
Robert Varga [Thu, 8 Jun 2023 18:07:53 +0000 (20:07 +0200)]
Bump upstreams

Adopt:
- yangtools-10.0.8
- mdsal-11.0.11
- controller-7.0.8
- aaa-0.17.10

Change-Id: I806bd7edfc2e0d80d6d0f0a4685abb4283562880
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 months agoRemove redundant local variable 26/106426/1
Ivan Hrasko [Thu, 8 Jun 2023 11:51:29 +0000 (13:51 +0200)]
Remove redundant local variable

Local variable openApiObject is redundant we can directly return
from method.

Change-Id: I3497f4461d0b75498aeb5bdb8721e52fc9758687
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoIntroduce Operation object 90/106390/7
OleksandrZharov [Tue, 6 Jun 2023 11:02:50 +0000 (13:02 +0200)]
Introduce Operation object

Created model for Operations.
All affected logic was adapted to use this model instead of JsonNode.

JIRA: NETCONF-1050
Change-Id: If4c06fd66c4c4487978541aaf372dbc6a20158d9
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoRemove redundant local variable 97/106397/1
Ivan Hrasko [Wed, 7 Jun 2023 10:49:23 +0000 (12:49 +0200)]
Remove redundant local variable

Local variable doc is redundant we can directly return from method.

Change-Id: Idaac58e387bcceb85bffec5eefb5d2e2e35c4bb5
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoSet SECURITY into OpenApiObject.Builder 95/106395/2
Ivan Hrasko [Wed, 7 Jun 2023 10:46:24 +0000 (12:46 +0200)]
Set SECURITY into OpenApiObject.Builder

We have lost SECURITY in the previous commit. Fix it.

JIRA: NETCONF-1041
Change-Id: I8d3b06515426f6fba71bad33f8da5224c84e8b7d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoTransform domain classes to Java records 71/106171/11
Yaroslav Lastivka [Fri, 26 May 2023 11:34:49 +0000 (14:34 +0300)]
Transform domain classes to Java records

All domain Java classes in org.opendaylight.restconf.openapi.model
have been converted into Java records and builders have been created
in case we need to mutate them.

JIRA: NETCONF-1041
Change-Id: Ifd0cdeb07e60210af6247548694a7f415df122a1
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoImprove examples in developer guide 40/106340/2
OleksandrZharov [Thu, 1 Jun 2023 09:35:53 +0000 (11:35 +0200)]
Improve examples in developer guide

Replaced Optional#get with better Optional#orElseThrow in
examples for developer-guide.rst.

JIRA: NETCONF-1045
Change-Id: I5a94d3252e26f8e4907b828f026b4426531cd511
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
11 months agoMigrate callers of Optional#get 38/106338/2
OleksandrZharov [Thu, 1 Jun 2023 09:22:55 +0000 (11:22 +0200)]
Migrate callers of Optional#get

Replaced Optional#get with better Optional#orElseThrow.

JIRA: NETCONF-1045
Change-Id: Ib940e923d040b2d960a594b1c84f0e7403b602df
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
11 months agoMove select definition to new line 50/106150/9
OleksandrZharov [Wed, 24 May 2023 20:51:44 +0000 (22:51 +0200)]
Move select definition to new line

If the pixel width of the screen is lower than 1200px,
move the 'Select a definition' dropdown in Swagger UI to a new line.

JIRA: NETCONF-1033
Change-Id: I7aa69bd6e00c1a7913f262d87928cbb699a3dad8
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
11 months agoUse java.util.function.Predicate 89/106389/1
Ivan Hrasko [Tue, 6 Jun 2023 08:41:02 +0000 (10:41 +0200)]
Use java.util.function.Predicate

Use java.util.function.Predicate instead of Guava's Predicate
in YangLibProvider.java.

Change-Id: I25144169355c3d3160ea04c0d4de4fa68c89e962
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
11 months agoRefactor schema retrieval exception messages 01/106301/5
Šimon Ukuš [Wed, 31 May 2023 09:06:08 +0000 (11:06 +0200)]
Refactor schema retrieval exception messages

Improve excpetion messages for better clarity.

JIRA: NETCONF-964
Change-Id: Ia9e1e39a727980c2b1fe36897c3e523e7a87f830
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
11 months agoThrow NotFoundException on MissingSchemaSource 00/106300/7
Šimon Ukuš [Wed, 31 May 2023 08:48:03 +0000 (10:48 +0200)]
Throw NotFoundException on MissingSchemaSource

Throwing NotFoundException, instead of a more general
WebApplicationException, will return 404 status code to the client,
rather than 500 with the WebAppException.

JIRA: NETCONF-964
Change-Id: Ic72b068a477a98f618bf303c43d7deca94254f3e
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
11 months agoRefactor exception handling 67/105867/8
Šimon Ukuš [Tue, 9 May 2023 13:14:16 +0000 (15:14 +0200)]
Refactor exception handling

Replace IllegalStateException with WebApplicationException when
the process of retrieving yang model fails.

This change has no impact on the status code being sent back
to the user, but changes the status reason phrase from
"Request failed" to "Internal Server Error".

JIRA: NETCONF-964
Change-Id: I7934141c481ddb01dab410d4d04d4b23555212ab
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
11 months agoMake Select definition larger 30/106130/3
OleksandrZharov [Tue, 23 May 2023 11:29:28 +0000 (13:29 +0200)]
Make Select definition larger

Made "Select a definition" drop down list larger.
Now we are able to actually see what is currently
selected there.

JIRA: NETCONF-1033
Change-Id: Ie3b5e9de25dc44e1da5c7eb94f49da45ecc353d6
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoRemove _XML and _POST containers from OpenApi 42/105042/20
Peter Suna [Mon, 27 Mar 2023 11:38:29 +0000 (13:38 +0200)]
Remove _XML and _POST containers from OpenApi

There is no need to create containers for XML since OpenAPI
can convert the provided data to XML format. Additionally,
containers with the "_POST" extension are identical to those
without it, so creating them only consumes memory
resources unnecessarily.

JIRA: NETCONF-938
Change-Id: I14ac602df087c5115d78daa1425841fd5a54e577
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
12 months agoClean-up OpenApiGeneratorRFC8040Test 61/106361/2
Ivan Hrasko [Fri, 2 Jun 2023 11:33:12 +0000 (13:33 +0200)]
Clean-up OpenApiGeneratorRFC8040Test

Remove one-time constants. Use them directly at the place.

Change-Id: I2a6a2fe9b1110ea08a4d8302f92cd287b094999b
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoPrepare tests for OpenApi generated Objects 89/105089/24
Peter Suna [Tue, 28 Mar 2023 12:22:03 +0000 (14:22 +0200)]
Prepare tests for OpenApi generated Objects

Create a test to validate the created operations and
the containers reference related to them.

Verify the created containers and the amount of containers.

JIRA: NETCONF-938
Change-Id: I26d5a57152c151c13d0404babc1edee1c7383f4a
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRemove refresh test from MountPointEndToEndTest 53/106353/3
Peter Suna [Thu, 1 Jun 2023 15:42:46 +0000 (17:42 +0200)]
Remove refresh test from MountPointEndToEndTest

Remove test to show that refresh is not working properly
in current implementation.

JIRA: NETCONF-1046
Change-Id: I4afc50ac1f2b1cbad62726752a3164e48ef6e010
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoBump upstreams 47/106347/1
Robert Varga [Thu, 1 Jun 2023 12:17:46 +0000 (14:17 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.6
- infrautils-5.0.5
- yangtools-10.0.7
- mdsal-11.0.10
- controller-7.0.7
- aaa-0.17.9

Change-Id: I3d44fcb19eafb8a9fcb2c82db394864bb03c622b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRework unit test infrastructure 58/106258/3
OleksandrZharov [Tue, 30 May 2023 09:15:11 +0000 (11:15 +0200)]
Rework unit test infrastructure

Changed AbstractOpenApiTest class into util class named
OpenApiTestUtils.

Copied contents of BeforeClass to each affected test.
This allow us configure resources for each test more freely.

JIRA: NETCONF-1040
Change-Id: I80392d46495b443a56ac568755716511c7e97298
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoBump conf.yaml versions to Potassium 46/106146/3
Ivan Hrasko [Wed, 24 May 2023 13:21:52 +0000 (15:21 +0200)]
Bump conf.yaml versions to Potassium

Change NetConf configuration to Potassium in order to see
correct version at:
https://docs.opendaylight.org/projects/netconf/en/latest/.

JIRA: NETCONF-1038
Change-Id: I37df01503fd2886a26e460f7bb202165499d52d9
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoOpenAPI: Change openapi URLs 49/106149/3
Yaroslav Lastivka [Wed, 24 May 2023 14:19:50 +0000 (17:19 +0300)]
OpenAPI: Change openapi URLs

The URL structure for accessing the OpenAPI documentation and
API endpoints did not align with the name of module and feature.

URL contextPath "apidoc" was changed to "openapi".

JIRA: NETCONF-1032
Change-Id: Ifa09544f53963065a974466e8a7f4eb3262326f0
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoSecure all apidoc paths 18/106218/1
Ivan Hrasko [Mon, 29 May 2023 07:44:53 +0000 (09:44 +0200)]
Secure all apidoc paths

Make sure we secure all paths under apidoc.

JIRA: NETCONF-1032
Change-Id: Ia8f14a3c9a9f387500d732467f9905ea9d40e635
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoAdd JsonProperty for Schema's reference 55/106155/2
Ivan Hrasko [Thu, 25 May 2023 14:36:16 +0000 (16:36 +0200)]
Add JsonProperty for Schema's reference

We have to add JsonProperty to Schema's ref object to have it in
correct format "$ref". Otherwise we get swagger validation errors.

JIRA: NETCONF-1024
Change-Id: If5fb1372a804588ec4ea424b726eb97073c7b012
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRemove RemoteDeviceConnector class 77/104177/30
OleksandrZharov [Thu, 26 Jan 2023 16:03:57 +0000 (17:03 +0100)]
Remove RemoteDeviceConnector class

Removed duplicate code with AbstractNetconfTopology.

Reworked NetconfTopologyContext to use NetconfTopologySingletonImpl
extending AbstractNetconfTopology instead of using
RemoteDeviceConnector.

JIRA: NETCONF-1039
Change-Id: Ic445a9a84becf9607b512a749e167a18f5929084
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
12 months agoMissed required parameters in swagger schema 41/106141/4
Yaroslav Lastivka [Mon, 22 May 2023 16:07:11 +0000 (19:07 +0300)]
Missed required parameters in swagger schema

Logic of BaseYangOpenApiGenerator#addPaths creates
an invalid schema for models which contain lists with nested containers.

We have to clear parameters array as final step of every recursion
and add parameters from parent recursion.

JIRA: NETCONF-1022
Change-Id: If5046817c62ad7d0a71fff6980342467061b0b37
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
12 months agoFix invalid swagger schema 98/105698/17
Yaroslav Lastivka [Wed, 26 Apr 2023 07:49:27 +0000 (10:49 +0300)]
Fix invalid swagger schema

We put nodes to parameters which do not belong to a particular request.
This logic produces invalid schemas.

We have to clear parameters array as final step of every recursion.

JIRA: NETCONF-996
Change-Id: I440689575b790009680b41211c94ad7668ce0b93
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoSimplify adding config/non-config paths 60/105860/5
Ivan Hrasko [Tue, 9 May 2023 09:10:55 +0000 (11:10 +0200)]
Simplify adding config/non-config paths

Simplify the process of adding config and non-config paths
by reusing the same blocks of code.

This can be done when we remove if condition
and use node.isConfiguration() directly as method parameter.

JIRA: NETCONF-1037
Change-Id: I36e1ae3f484a940bf6114d99bd7227c553fadf65
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoFix retrieving operations resource 69/103969/36
Yaroslav Lastivka [Tue, 10 Jan 2023 09:39:21 +0000 (11:39 +0200)]
Fix retrieving operations resource

Fix retrieving operations resource from controller and mount points
by adapting getOperationsJSON/XML to accept identifiers and enhancing
its functionality with ability to match exact operation.

This way we enhance solution proposed by NETCONF-822 to cover
all use cases and avoid error 500.

JIRA: NETCONF-928
JIRA: NETCONF-929
Change-Id: Ic8f0ca5b07e060d36747a110f9049d3d9a2b96c8
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
12 months agoFix netconf README 21/106121/4
OleksandrZharov [Mon, 22 May 2023 13:56:55 +0000 (15:56 +0200)]
Fix netconf README

Fixed links and typos in netconf README.

JIRA: NETCONF-1035
Change-Id: I3de42dbcad4c0f73b7ded895e0d650e6fef5f6c0
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoAdd unit test for request parameters 96/105896/18
OleksandrZharov [Fri, 12 May 2023 09:21:41 +0000 (11:21 +0200)]
Add unit test for request parameters

Added unit test that checks for correct amount of parameters in
requests.

JIRA: NETCONF-1023
Change-Id: I9a448173c5d066ff019cf6b3d07b720d75a73e40
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoUpdate ParameterAwareNormalizedNodeWriter 99/106099/7
Robert Varga [Sun, 21 May 2023 13:05:36 +0000 (15:05 +0200)]
Update ParameterAwareNormalizedNodeWriter

Three distinct changes are being made here:

- use instanceof patterns to remove explicit casts
- reduce instanceof() checks by taking into account ordering
- eliminate childSizeHint() and use directly-exposed size()

Change-Id: If0ffaf9c34575ed4d7fef3a5a7c0dc13ce6ba687
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoDo not use mocks in NodeWriterFields tests 11/106111/6
Robert Varga [Mon, 22 May 2023 06:49:07 +0000 (08:49 +0200)]
Do not use mocks in NodeWriterFields tests

Use Builders to create fully functional test objects instead of mocking
internals.

Change-Id: I7c287e174f5afbbc7395514bf146f33edcd1b0ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoGet rid of JsonUtil#copy 73/105873/8
Ivan Hrasko [Wed, 10 May 2023 10:35:30 +0000 (12:35 +0200)]
Get rid of JsonUtil#copy

We can use ArrayNode#addAll method instead of JsonUtil#copy.

This means we no more need JsonUtil class.

JIRA: NETCONF-1023
Change-Id: Ia6bbca83c4e5f0b11740d8dff627f41135b29077
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoBump SSHD to 2.10.0 49/105949/4
Robert Varga [Mon, 15 May 2023 11:13:51 +0000 (13:13 +0200)]
Bump SSHD to 2.10.0

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

Change-Id: I173b317909ece001843cab8cce269cc02f758a5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>