netconf.git
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>
12 months agoRemove NetconfUtil.newWriter() 36/105736/3
Robert Varga [Fri, 28 Apr 2023 13:35:46 +0000 (15:35 +0200)]
Remove NetconfUtil.newWriter()

This is a internal utility method which is no longer needed, as YANG
tools correctly handles null path.

Change-Id: Id7e7754f33fe76eb2a68eb0a78cbe54b67594f6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRework README to markdown 67/106067/3
OleksandrZharov [Fri, 19 May 2023 16:12:09 +0000 (18:12 +0200)]
Rework README to markdown

.rst files are not parsed by GitHub thus for correct display
of our README we should translate it into .md format.

JIRA: NETCONF-1035
Change-Id: I0416dbd4ca22bd66a490a486c48f223cfe499a91
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoAdd odl-yanglib into experimental features 97/105897/8
Šimon Ukuš [Fri, 12 May 2023 09:37:30 +0000 (11:37 +0200)]
Add odl-yanglib into experimental features

During reorganizing of netconf features we have lost odl-yanglib
feature.

Create features-netconf-experimental which installs odl-yanglib.

JIRA: NETCONF-1028
Change-Id: I8f9ecb9d498d04d7edbb2d8c75ddebbcbf6ab371
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRemove "Generex" dependency 73/104973/26
Yaroslav Lastivka [Tue, 21 Mar 2023 12:39:19 +0000 (14:39 +0200)]
Remove "Generex" dependency

Removed "Generex" and replaced with direct usage of "Automaton"
to generate random strings as "Genegex" seems to be no longer
actively developed project.

In fact the previous logic to generate example strings was broken.
We have fixed it by using RegularExpressionString instead of
JavaPatternString.

Now we have the same examples generated every run which helps us
to write better tests with assertions.

JIRA: NETCONF-980
Change-Id: I52e6d9d1a0f0cf43eb17b99309d9101c32d75a42
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRename restconf bundles 30/106030/2
Ivan Hrasko [Thu, 18 May 2023 10:41:28 +0000 (12:41 +0200)]
Rename restconf bundles

Rename restconf bundles to get rid of MD SAL mention and reflect
actual state of codebase (Rest Api Doc -> openapi).

JIRA: NETCONF-1034
Change-Id: If8a150f9f67f94b3b6641f9c651904e5b8f9c84a
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoOpenAPI: Eliminate JsonUtil#addFields method 21/106021/3
OleksandrZharov [Tue, 16 May 2023 10:30:38 +0000 (12:30 +0200)]
OpenAPI: Eliminate JsonUtil#addFields method

JsonUtil#addFields method is no more used.
addFields method was removed.

JIRA: NETCONF-1025
Change-Id: Ia95cb0aaa9273f6735f59f000005f5b4fd789b69
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRename convertToJsonSchema method 32/106032/6
Ivan Hrasko [Thu, 18 May 2023 13:13:27 +0000 (15:13 +0200)]
Rename convertToJsonSchema method

We are no more returning JSON ObjectNode but Map of Schema.
Rename method accordingly.

JIRA: NETCONF-1024
Change-Id: Ib1d03f2be463c754a0eda2564b50162a9eb9ab45
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoUse Java Schema object instead of JsonNode 89/105989/12
OleksandrZharov [Tue, 16 May 2023 10:30:38 +0000 (12:30 +0200)]
Use Java Schema object instead of JsonNode

Created Schema.java object and replaced ObjectNode schemas inside
Components class with Map<String, Schema>. This allowed us remove
JsonUtil#addFields method which is addressed by another issue.

JIRA: NETCONF-1024
Change-Id: I13477fae13298b782df4af6e100fe9f807b331bd
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRemove unused "resourcePath" parameter 34/106034/2
Ivan Hrasko [Thu, 18 May 2023 13:21:52 +0000 (15:21 +0200)]
Remove unused "resourcePath" parameter

This parameter is not used. Remove it.

Change-Id: I4fa8799b98a8ba1c7906a24fb8c098d06511baf6
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRename odl-mdsal-apidocs feature to odl-restconf-openapi 90/105990/3
Yaroslav Lastivka [Tue, 16 May 2023 13:35:57 +0000 (16:35 +0300)]
Rename odl-mdsal-apidocs feature to odl-restconf-openapi

Accordingly to renaming implementation of OpenApi to restconf-openapi,
odl-mdsal-apidocs was renamed to odl-restconf-openapi.

JIRA: NETCONF-1029
Change-Id: If6bf59644b5e4334513b8ad6f28deffbbf351776
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
12 months agoOpenAPI: Avoid null values in JSON 18/105918/6
Yaroslav Lastivka [Fri, 12 May 2023 08:54:49 +0000 (11:54 +0300)]
OpenAPI: Avoid null values in JSON

The resulted JSON from Restconf openapi endpoints
contain null values for unset fields.

Jackson annotations were aded to ignore null fields.

JIRA: NETCONF-1027
Change-Id: Ia56790b951ba8db649c0bcb0ce688071de70fac7
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoMove openapi test utilities 10/106010/1
Ivan Hrasko [Wed, 17 May 2023 10:35:21 +0000 (12:35 +0200)]
Move openapi test utilities

AbstractOpenApiTest and DocGenTestHelper are meant to be
in org.opendaylight.restconf.openapi package.

We have accidentally changed their position. Fix it now accordingly.

JIRA: NETCONF-1011
Change-Id: I2c1ed7282642e430af24fa1a57345f6bc31dd734
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.util 70/105870/8
OleksandrZharov [Tue, 9 May 2023 13:34:35 +0000 (15:34 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.util

Renamed package org.opendaylight.netconf.sal.rest.doc.util to
org.opendaylight.restconf.openapi.util.

JIRA: NETCONF-1011
Change-Id: Ia75829170a18bb0eda0e42bc28779dd96fb7eb17
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.openapi 69/105869/5
OleksandrZharov [Tue, 9 May 2023 13:18:47 +0000 (15:18 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.openapi

Renamed package org.opendaylight.netconf.sal.rest.doc.openapi to
org.opendaylight.restconf.openapi.model.

Renamed openapi package to model because openapi is now a module
name and we are expressing that we are storing here Java classes
that are used to model OpenAPi objects.

JIRA: NETCONF-1011
Change-Id: I1324f1858ee424b354e5f04b758edb19c801b74a
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.mountpoints 66/105866/6
OleksandrZharov [Tue, 9 May 2023 12:30:32 +0000 (14:30 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.mountpoints

Renamed package org.opendaylight.netconf.sal.rest.doc.mountpoints to
org.opendaylight.restconf.openapi.mountpoints.

JIRA: NETCONF-1011
Change-Id: I4f359419c7297eb2e7f561a3266e043699b1db68
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.model.builder 65/105865/5
OleksandrZharov [Tue, 9 May 2023 12:25:06 +0000 (14:25 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.model.builder

Renamed package org.opendaylight.netconf.sal.rest.doc.model.builder to
org.opendaylight.restconf.openapi.model.builder.

JIRA: NETCONF-1011
Change-Id: I97075d87129996114e75cf7c150ff5e854e00cb9
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.jaxrs 64/105864/6
OleksandrZharov [Tue, 9 May 2023 10:42:24 +0000 (12:42 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.jaxrs

Renamed package org.opendaylight.netconf.sal.rest.doc.jaxrs to
org.opendaylight.restconf.openapi.jaxrs.

JIRA: NETCONF-1011
Change-Id: I0e70e36a0bdacb7efeb8458ae3172767260f190e
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.impl 63/105863/6
OleksandrZharov [Tue, 9 May 2023 10:59:13 +0000 (12:59 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.impl

Renamed package org.opendaylight.netconf.sal.rest.doc.impl to
org.opendaylight.restconf.openapi.impl.

JIRA: NETCONF-1011
Change-Id: I0f0fef987a5150903e1cee3f508960e89f7ef120
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoRefactor org.opendaylight.netconf.sal.rest.doc.api 62/105862/8
OleksandrZharov [Tue, 9 May 2023 10:42:24 +0000 (12:42 +0200)]
Refactor org.opendaylight.netconf.sal.rest.doc.api

Renamed package org.opendaylight.netconf.sal.rest.doc.api to
org.opendaylight.restconf.openapi.api.

JIRA: NETCONF-1011
Change-Id: I681caea35a57e02f445713adf27084fb0c142305
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoChange artifactId in sal-rest-docgen 61/105861/6
OleksandrZharov [Tue, 9 May 2023 10:24:36 +0000 (12:24 +0200)]
Change artifactId in sal-rest-docgen

Changed artifactId in sal-rest-docgen pom.xml to be restconf-openapi
and renamed folder accordingly.

JIRA: NETCONF-1011
Change-Id: I7c628396319da6cc2fb4ae5e93c827b39608c39a
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoRename *ApiDoc* classess to *OpenApi* classes 30/105830/8
OleksandrZharov [Thu, 4 May 2023 17:26:21 +0000 (19:26 +0200)]
Rename *ApiDoc* classess to *OpenApi* classes

Rename all classes and methods in sal-rest-docgen which have
*ApiDoc* in their name to *OpenApi* instead.

JIRA: NETCONF-1012
Change-Id: I46779d465885d6e8411f8405d10fbf3505efbfde
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoDo not create OpenApiObject twice 21/105821/10
Peter Suna [Wed, 3 May 2023 14:29:30 +0000 (16:29 +0200)]
Do not create OpenApiObject twice

Refactor the getMountPointApi method to prevent the creation
of two OpenApiObject instances. Currently,
this duplication occurs because the method is responsible for both
creating the required paths and generating the OpenApiObject.

To improve the code, separate these two functions and use only
the method that creates the data-store paths. This change will make
the code cleaner and more efficient, and help to avoid any potential
issues caused by duplicate objects.

JIRA: NETCONF-1007
Change-Id: I5ff38b706ce34c270f43fd4cf00a98efcbdaf888
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoImprove MountPointOpenApiTest 26/105726/19
OleksandrZharov [Thu, 23 Mar 2023 12:45:50 +0000 (13:45 +0100)]
Improve MountPointOpenApiTest

In previous patch there was case when despite successful build
swagger failed to load device. Improved corresponding unit test
to cover blindspot in tests.

JIRA: NETCONF-997
Change-Id: Ie38319f83ac83c1e9ac1dd64a557b129941a4e23
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoUse Java Path object instead of JsonNode 62/105462/18
OleksandrZharov [Thu, 23 Mar 2023 12:45:50 +0000 (13:45 +0100)]
Use Java Path object instead of JsonNode

Path object is well described in OpenApi specification.
Thus we can model it using Java.

JIRA: NETCONF-997
Change-Id: Idc6c40a386fdd4124aa79d1f0e8b316d2a247304
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoClean-up sal-rest-docgen test classes 27/105827/9
OleksandrZharov [Thu, 4 May 2023 16:10:48 +0000 (18:10 +0200)]
Clean-up sal-rest-docgen test classes

Moved test classes to according packages so now they have same name
as tested classes.

JIRA: NETCONF-1013
Change-Id: I50571453da52bff901801a454709171d8b9f0c7c
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoRename SwaggerObjectTest 59/105859/3
OleksandrZharov [Tue, 9 May 2023 09:07:52 +0000 (11:07 +0200)]
Rename SwaggerObjectTest

For some reason we missed out on renaming SwaggerObjectTest
during NETCONF-984. Renamed this class here.

JIRA: NETCONF-984
Change-Id: I82ab9ff279b3ec8864c91feab8be383182cb0c81
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
12 months agoOpenAPI: Add possibility to change base path 68/105868/2
Ivan Hrasko [Tue, 9 May 2023 13:24:02 +0000 (15:24 +0200)]
OpenAPI: Add possibility to change base path

Create new constructor that enables users to configure
OpenAPI base path.

JIRA: NETCONF-1020
Change-Id: I5507a46cca9da24d274d40b6f679da532bbf4a5c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
12 months agoAdd netconf.api.NamespaceURN 50/105850/1
Robert Varga [Sat, 6 May 2023 10:44:17 +0000 (12:44 +0200)]
Add netconf.api.NamespaceURN

XmlNetconfConstants is a huge constant holder, with very baroque names
for namespaces. Split out NamespaceURN, which holds these namespaces in
the same way CapabilityURN holds capability namespaces.

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