netconf.git
9 months agoOpenApi create required operational data 94/106894/15
Peter Suna [Thu, 13 Jul 2023 13:23:05 +0000 (15:23 +0200)]
OpenApi create required operational data

Create only required operational data to provide example
for operational GET request.
This removed duplicity with configurational and operational nodes
in OpenApi schemas by creating only operational container and lists.

For container and lists are created specific GET request only for
operational data. This patch solves this by creating only required
operational data and not mixing them with configurational data.

JIRA: NETCONF-1142
Change-Id: I4f1f544f9cf65b6f58ad9c2068cec6ac1c0927f0
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoSet default for number type 80/105880/30
tobias.pobocik [Wed, 10 May 2023 11:23:35 +0000 (13:23 +0200)]
Set default for number type

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

Set "default" with "example" since it was misused.

JIRA: NETCONF-999
Change-Id: I2fbb6ab7643c6028219f38da3e07d2e67a8f3049
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
9 months agoEliminate PatchEditOperation 57/107457/2
Robert Varga [Sun, 20 Aug 2023 16:35:54 +0000 (18:35 +0200)]
Eliminate PatchEditOperation

PatchEditOperation has little added value compared to the generated
Operation enum. Furthermore it is overly-lenient, requiring case
conversion.

Eliminate PatchEditOperation and replace it with Operation. Rehost
isWithValue() into a separate utility method in AbstractPatchBodyReader.

JIRA: NETCONF-1118
Change-Id: Ib3bc102f69ca3a618b7e58d0e537fa485b4ed665
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUse ImmutableList.Builder for edits 56/107456/1
Robert Varga [Sun, 20 Aug 2023 16:12:13 +0000 (18:12 +0200)]
Use ImmutableList.Builder for edits

Do not pass a List down, just a builder.

JIRA: NETCONF-1128
Change-Id: I0beec35bfae225837bae69b9a864940358562af3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMove parserPatchTarget() 55/107455/1
Robert Varga [Sun, 20 Aug 2023 16:03:35 +0000 (18:03 +0200)]
Move parserPatchTarget()

This method is only used in AbstractPatchBodyReader specializations,
move it to common superclass.

JIRA: NETCONF-1128
Change-Id: Iea9993606591d80d8247755d3c63a3b4d43a0ade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate UriInfo parameters 53/107453/1
Robert Varga [Sat, 19 Aug 2023 15:54:04 +0000 (17:54 +0200)]
Eliminate UriInfo parameters

PATCH requests are not using URI information, hence we do not need to
specify them.

JIRA: NETCONF-1128
Change-Id: Ib3b574039a6e16944d62e21b6a3352b22a66cfd5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate restconf.common.patch.Patch 52/107452/1
Robert Varga [Fri, 18 Aug 2023 15:17:40 +0000 (17:17 +0200)]
Eliminate restconf.common.patch.Patch

This annotation is completely superfluous, remove it.

JIRA: NETCONF-1141
Change-Id: I42508e6d0b03dfc4571fed906bc074bb257b3229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDeprecate @Patch 51/107451/1
Robert Varga [Fri, 18 Aug 2023 15:00:12 +0000 (17:00 +0200)]
Deprecate @Patch

JAX-RS 2.1+ contains a @PATCH annotation, there is no point of brewing
our own.

JIRA: NETCONF-1140
Change-Id: Id27e8936bf50fa90ed5e240ffb9adb08679a28be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUse first child in POST payloads 71/107271/15
Yaroslav Lastivka [Fri, 4 Aug 2023 07:40:33 +0000 (10:40 +0300)]
Use first child in POST payloads

Enhanced the logic to generate POST payloads by choosing one
child for both container and list types.
Introduced unit tests to validate the correctness of the
request body generated by this new logic.

JIRA: NETCONF-1054
Change-Id: I8568f570fe77a9ef0b7f20122feef6a85758ccef
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoEliminate TOP schemas 64/107364/13
Oleksandr Zharov [Tue, 8 Aug 2023 12:18:59 +0000 (14:18 +0200)]
Eliminate TOP schemas

Removed TOP schemas from OpenApi object.

JIRA: NETCONF-1057
Change-Id: I88d8d5f5f52f9215d1124a26e54330252580c8f8
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoDo not use TOP schemas in RPC requests 59/107359/14
Oleksandr Zharov [Tue, 8 Aug 2023 10:36:28 +0000 (12:36 +0200)]
Do not use TOP schemas in RPC requests

Refactored RPC operations in order to stop using TOP schemas for
generation of it's request body.

JIRA: NETCONF-1057
Change-Id: Ib5bf2a258a8aa9df515a9a466ddcbc5a99a0dea4
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
9 months agoDo not use TOP schemas in GET requests 63/107263/12
Oleksandr Zharov [Fri, 4 Aug 2023 21:13:14 +0000 (23:13 +0200)]
Do not use TOP schemas in GET requests

Refactored GET operations in order to stop using TOP schemas for
generation of it's request body.

JIRA: NETCONF-1057
Change-Id: I12ad1c9e9b54ec2b7f50f5f5bc2b90ba4327a66e
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
9 months agoDo not use TOP schemas in PATCH requests 38/107238/15
Oleksandr Zharov [Thu, 3 Aug 2023 16:56:35 +0000 (18:56 +0200)]
Do not use TOP schemas in PATCH requests

Refactored PATCH operations in order to stop using TOP schemas for
generation of it's request body.

JIRA: NETCONF-1057
Change-Id: I969e092a27d524d75b5e53d9bbd9b7dce93fc1e1
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoDo not use TOP schemas in PUT requests 23/107223/16
Oleksandr Zharov [Thu, 3 Aug 2023 13:12:47 +0000 (15:12 +0200)]
Do not use TOP schemas in PUT requests

Refactored PUT operations in order to stop using TOP schemas for
generation of it's request body.

JIRA: NETCONF-1057
Change-Id: I7d57fd0ec188091cce983629b7ce37ce8179075e
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoSpecialize RestconfInvokeOperationsServiceImpl.invokeRpc() 32/107332/10
Robert Varga [Mon, 7 Aug 2023 22:45:09 +0000 (00:45 +0200)]
Specialize RestconfInvokeOperationsServiceImpl.invokeRpc()

Do not use NormalizedNodePayload, but instead inline handling, so that
we are in explicit control of how input is interpreted.

For XML case we also side-step the need to go through a org.w3c.Document,
speeding up deconding.

This eliminates out the first of the four uses of *NormalizedNodeBodyReader,
but it does not reduce its complexity due to codepaths being shared with
the action invocation (which goes through POST).

JIRA: NETCONF-1128
Change-Id: I2d36b38236dcddc1849133a13c1bc9766f54fc8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix processTypeDef method call 32/107432/1
Ivan Hrasko [Tue, 15 Aug 2023 15:11:03 +0000 (17:11 +0200)]
Fix processTypeDef method call

We are missing module parameter in processTypeDef method call.
Fix it.

Change-Id: I7abda0dbe90cd62ad1f2489096f064122227140b
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoBump json-unit-assertj to 3.0.0 30/107430/3
Oleksandr Zharov [Tue, 15 Aug 2023 11:33:55 +0000 (13:33 +0200)]
Bump json-unit-assertj to 3.0.0

https://github.com/lukas-krecan/JsonUnit#300-2023-07-05

Change-Id: Ie6413689a5e4f32a5eea5066717e209e81fae440
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
9 months agoBump json to version 20230618 27/107427/2
Ivan Hrasko [Tue, 15 Aug 2023 10:46:26 +0000 (12:46 +0200)]
Bump json to version 20230618

https://github.com/stleary/JSON-java/releases/tag/20230618

Change-Id: Iafb38fc01ec3de6c449beae67f5a9dcbbf313f2b
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoBump json to version 20230227 26/107426/2
Ivan Hrasko [Tue, 15 Aug 2023 10:41:08 +0000 (12:41 +0200)]
Bump json to version 20230227

https://github.com/stleary/JSON-java/releases/tag/20230227

Change-Id: I9548b25ad768d201f26abaaa1a1f10d07efe0667
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoImprove union type processing 34/107334/4
Ivan Hrasko [Tue, 8 Aug 2023 09:02:43 +0000 (11:02 +0200)]
Improve union type processing

Instead of introducing cumbersome logic for union processing,
choose first one.

JIRA: NETCONF-1124
Change-Id: I6f79cfc0edafd9cf3cdd25dff4a751b69ad15953
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
9 months agoMove generateUrlPrefixFromInstanceID method 20/107420/2
Ivan Hrasko [Mon, 14 Aug 2023 13:21:20 +0000 (15:21 +0200)]
Move generateUrlPrefixFromInstanceID method

Move generateUrlPrefixFromInstanceID to MountPointOpenApi class
as it is its only user.

Change-Id: I80c91b989767cb81e05feb3ee09e0505de0d465c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoOpenaApi: Use empty content for operational GET 47/106747/17
Peter Suna [Wed, 28 Jun 2023 10:29:58 +0000 (12:29 +0200)]
OpenaApi: Use empty content for operational GET

Previously, operational data was included in schemas
to provide a GET example for operational containers and lists.
However, removing this operational data caused an error in
the OpenAPI UI since the expected data was not found.

To address this issue, the operational data can be replaced
with empty content instead. Creating a duplicate schema
specifically for this use case is both memory-intensive
and unnecessary.

This commit solves the problem by adding empty example
for the operational GET data.

JIRA: NETCONF-1061
Change-Id: I1444aad588c42417e5ff21dee46ff91ec0a1a07d
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoConvert DefinitionGenerator into utility class 71/107371/13
lubos-cicut [Thu, 10 Aug 2023 04:26:54 +0000 (06:26 +0200)]
Convert DefinitionGenerator into utility class

DefinitionGenerator was generally being used as it was
utility class. Converted into utility class.

The only instance field topLevelModule has been converted
into method parameter.

JIRA: NETCONF-1122
Change-Id: I5cb76e8b6baa1a8b6f5776a8da1518bae9e5e973
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoOpenApi: Fix module names in Json payload 78/107078/3
Peter Suna [Mon, 24 Jul 2023 10:18:08 +0000 (12:18 +0200)]
OpenApi: Fix module names in Json payload

Ensure the correct module name format MODULE_NAME:NODE_NAME
is used for the first node in the PUT request.
Otherwise, it may result in a 400 error:
"Error parsing input: Choose suitable module name for element..."

JIRA: NETCONF-1083
Change-Id: I9ca3bc62754855a551e8fea4e552b784a8e6c426
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
10 months agoRework summary creation by formatting text blocks 34/106934/13
Šimon Ukuš [Mon, 17 Jul 2023 12:58:31 +0000 (14:58 +0200)]
Rework summary creation by formatting text blocks

We had a dedicated method to construct a basic summary.
Remove the method and use formatted text block to increase readability.

JIRA: NETCONF-1088
Change-Id: I019403b4725c30f0e06ab05d68523bab633f0128
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoAdd sonarcloud badges to README 92/107192/8
Matej Sramcik [Tue, 1 Aug 2023 14:10:37 +0000 (16:10 +0200)]
Add sonarcloud badges to README

Add sonarcloud badges: Reliability Rating, Quality Gate Status,
Technical Debt, Coverage, Lines of Code, Code Smells, Maintainability
Rating, Security Rating, Vulnerabilities and Duplicated Lines.

JIRA: NETCONF-1091
Change-Id: Ic9fdd1435b1773446b1bfa0de7fd01ad0f41d8b5
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoAdd maven, javadoc and license badges to README 48/106948/8
Matej Sramcik [Fri, 21 Jul 2023 08:18:18 +0000 (10:18 +0200)]
Add maven, javadoc and license badges to README

Add maven central, javadoc and license badges to README.

JIRA: NETCONF-1091
Change-Id: If090ad34aeb103a08e6a01ad8d7ea39f9e94ca9d
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoDisconnect PostDataTransactionUtil from JAX-RS 67/107367/3
Robert Varga [Tue, 8 Aug 2023 13:53:05 +0000 (15:53 +0200)]
Disconnect PostDataTransactionUtil from JAX-RS

We are only creating a location from the passed-in UriInfo. This should
really be done in RestconfDataServiceImpl.

JIRA: NETCONF-1126
Change-Id: I3faa4fa6d494032cbfa7b7322ecf16fc342f1ffc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUpdate RestconfDataServiceImplTest assertions 66/107366/4
Robert Varga [Tue, 8 Aug 2023 12:39:35 +0000 (14:39 +0200)]
Update RestconfDataServiceImplTest assertions

We are exercising the main API entrypoint here based on JAX-RS Response.
Add an explicit test for posting a keyed list item.

JIRA: NETCONF-1126
Change-Id: I99895dde662e4bb51627f5153f2e14624fb9c8b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse {JUKEBOX,GAP}_IID 65/107365/3
Robert Varga [Tue, 8 Aug 2023 13:17:23 +0000 (15:17 +0200)]
Use {JUKEBOX,GAP}_IID

We have AbstractJukeboxTest provides pre-built constants for these
constructs. Use those instead rolling our own.

Change-Id: I30319f0af86971fe69f47c8e6860e4496068d41d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDisconnect PutDataTransactionUtil from JAX-RS 63/107363/2
Robert Varga [Tue, 8 Aug 2023 09:32:16 +0000 (11:32 +0200)]
Disconnect PutDataTransactionUtil from JAX-RS

The only information being conveyed here through response are the two
possible outcomes. Capture those outcomes in CreateOrReplaceResult
and let RestconfDataServiceImpl turn them into appropriate Responses.

JIRA: NETCONF-1125
Change-Id: Ia6303d3ed7e8e02aaba5403cce8b4482bf775660
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RestDocgenUtil#resolveNodesName method 74/107374/1
Ivan Hrasko [Wed, 9 Aug 2023 10:53:21 +0000 (12:53 +0200)]
Remove RestDocgenUtil#resolveNodesName method

Remove deprecated and not used RestDocgenUtil#resolveNodesName method.

JIRA: NETCONF-1129
Change-Id: I74695908b733964f8fb6f0f568cb5adc8403cba2
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoTest Path with single module vs all modules 43/106943/9
Šimon Ukuš [Fri, 21 Jul 2023 09:48:04 +0000 (11:48 +0200)]
Test Path with single module vs all modules

There are differences between Paths that are constructed
when building OpenApiObject for single module of a mounted
device "/mounts/{instance}/{module}({revision})" vs
when requesting it for all modules of the device "/mounts/{instance}".
The differences are are in summary value and tags value, where
the deviceName was missing when building OpenApiObject for single
module.

Tests are provided to check whether the summary is created as expected
and also to verify that there is no difference in the paths field
of the OpenApiObject between the two ways of requesting it (single
module vs all modules).

JIRA: NETCONF-1090
Change-Id: I577629e91a58383a38c73bd27847f5dadd27e115
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoConsolidate methods called once in OpenApi 30/106930/6
Šimon Ukuš [Mon, 17 Jul 2023 12:58:31 +0000 (14:58 +0200)]
Consolidate methods called once in OpenApi

Previous change, which prevented the deviceName from being null,
reduced the number of calls to some private methods to one call.

This change moves the contents of those methods to the caller.

JIRA: NETCONF-1089
Change-Id: I6c05f8ac8e20c193e33dffe574b9e8a367d10eb4
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
10 months agoRework tags creation in OpenApi 32/106932/17
Šimon Ukuš [Tue, 18 Jul 2023 12:21:00 +0000 (14:21 +0200)]
Rework tags creation in OpenApi

The tags values inside Operation object, according to Swagger spec
https://swagger.io/specification/#operation-object, do not have
any specific requirement. We are storing them in an ArrayNode,
which adds unnecessary overhead.

This change replaces the ArrayNode for List<String>.

JIRA: NETCONF-1087
Change-Id: I3a75b57f885503780867702a400d1be1c3ec6567
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
10 months agoMake deviceName not to be null 25/106925/12
Šimon Ukuš [Mon, 17 Jul 2023 11:37:59 +0000 (13:37 +0200)]
Make deviceName not to be null

We are passing null value of deviceName to methods only if the request,
for swagger document, is for controller (not a mounted device).
In that case we want "Controller" in place of the deviceName.

This change removes @Nullable annotations around String deviceName
and reworks the calls to methods, to pass "Controller" instead of
null value.

JIRA: NETCONF-1089
Change-Id: I5b37419f81c12c21f4ef65cc90e7b8dceb79995c
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoFix deviceName with specific module request 26/106926/12
Šimon Ukuš [Mon, 17 Jul 2023 12:58:31 +0000 (14:58 +0200)]
Fix deviceName with specific module request

When requesting swagger document for a specific module under a specific
mounted device, the deviceName was ignored and not included in the
summary of the paths.

This change makes the deviceName part of the summary of the paths.

JIRA: NETCONF-1090
Change-Id: I1c50ecc6c69c82fd110d1ba5b67d631df1b95337
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoFix build when GID exceeds 2097151 62/107362/3
matus.matok [Tue, 8 Aug 2023 11:03:18 +0000 (13:03 +0200)]
Fix build when GID exceeds 2097151

Fixed the build of the netconf-testtool module for users whose primary group id is greater than 2097151.

JIRA: NETCONF-1127
Change-Id: Ib9331a9d57e31bf3f78adfb7493ce21bca674d0c
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
10 months agoAdd keys into configuration lists 57/106957/5
Ivan Hrasko [Fri, 21 Jul 2023 12:00:37 +0000 (14:00 +0200)]
Add keys into configuration lists

According to RFC 7950 configuration list MUST have key statement.

Fix restconf-openapi test models accordingly.

JIRA: NETCONF-1082
Change-Id: Ibc8c202f55886a69bb217bb1e7a3a6b9854c094e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
10 months agoEliminate duplicate logic for anyXml/anyData 92/106892/12
Matej Sramcik [Wed, 12 Jul 2023 12:51:57 +0000 (14:51 +0200)]
Eliminate duplicate logic for anyXml/anyData

Methods processAnydataNode and processAnyXMLNode were almost
identical.
Methods are merged into single method processUnknownDataSchemaNode,
which can process both AnyxmlSchemaNode and AnydataSchemaNode.

JIRA: NETCONF-1079
Change-Id: Ied831a543b40f8876503eb78788c11e93b6e87cc
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
10 months agoAdd value "all" to content query parameter 74/106974/7
Šimon Ukuš [Fri, 21 Jul 2023 13:05:33 +0000 (15:05 +0200)]
Add value "all" to content query parameter

The query parameter content can be omitted or used with values:
"config", "nonconfig", "all".

We are not showing the "all" value in OpenApi, which is fixed here.

When at place eliminate one-time constants.

JIRA: NETCONF-1094
Change-Id: Ic42bdcfec0e6db486f54e4fdc45debc49e9ebd50
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoRemove OpenApiObject builder 79/106479/42
Oleksandr Zharov [Wed, 14 Jun 2023 08:45:03 +0000 (10:45 +0200)]
Remove OpenApiObject builder

Removed builder for OpenApiObject and changed all affected methods
according to new logic.

Refactored code to avoid mutating schemas and paths.

JIRA: NETCONF-1052
Change-Id: I949dbdf79705a9e95353ce92b6c6ff8e321db4fe
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoRemove createOpenApiObjectBuilder method 76/106476/36
Oleksandr Zharov [Tue, 13 Jun 2023 16:17:15 +0000 (18:17 +0200)]
Remove createOpenApiObjectBuilder method

Removing this method in prepare for next patch where
we will remove OpenApiObject#Builder.

JIRA: NETCONF-1052
Change-Id: I1f50bd1d9717b1d98215c6f1bc5b71b64fb1eca6
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoRefactor getOpenApiSpec method 66/106466/25
Oleksandr Zharov [Tue, 13 Jun 2023 12:24:26 +0000 (14:24 +0200)]
Refactor getOpenApiSpec method

Refactored BaseYangOpenApiGenerator#getOpenApiSpec.

This method did more than one thing thus it has been divided into
getSchemas and getPaths methods.

JIRA: NETCONF-1052
Change-Id: If0f3ab19597c5fcdc767b51a295750ef65541dc5
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoMigrate to restconf-common to JUnit5 83/107283/2
Robert Varga [Mon, 7 Aug 2023 09:05:18 +0000 (11:05 +0200)]
Migrate to restconf-common to JUnit5

This is a straightforward migration to a parameterized test.

Change-Id: Ibf6aed9810e9872777d4f322c5f3c4b5a2adc809
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrate restconf-api to JUnit5 82/107282/2
Robert Varga [Mon, 7 Aug 2023 08:57:56 +0000 (10:57 +0200)]
Migrate restconf-api to JUnit5

Automated conversion, with some hand-editing to ditch hamcrest.

Change-Id: I337912a5ee06d74caf29ab67a351800a9fbae872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove "config" prefix from OpenApi 95/106895/11
Peter Suna [Thu, 13 Jul 2023 15:55:39 +0000 (17:55 +0200)]
Remove "config" prefix from OpenApi

Remove "config" prefix from OpenApi schemas node.

It is no longer required as configurational data and operational
data are not being created multiple times.

JIRA: NETCONF-982
Change-Id: I56be54dcb9a36cc41c4955ae40aa9f94b701bd83
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoEliminate putIfNonNull(ObjectNode, String, Number) 61/107261/8
Ivan Hrasko [Fri, 4 Aug 2023 14:36:36 +0000 (16:36 +0200)]
Eliminate putIfNonNull(ObjectNode, String, Number)

Eliminate DefinitionGenerator#putIfNonNull(ObjectNode, String, Number)
method because:
- range type is always Integer
- com.google.common.collect.Range is designed to reject null values
- key is never null - we have passed it into the method

JIRA: NETCONF-1120
Change-Id: If5eed0da8b5cb461c024315bde0d286d7d1ab3ea
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
10 months agoFix NetconfNodeHandler interactions 20/107020/14
Robert Varga [Sat, 5 Aug 2023 23:08:28 +0000 (01:08 +0200)]
Fix NetconfNodeHandler interactions

There are a couple of failures in interacting with RemoteDeviceHandler
API (which is completely undocumented).

The API design (and interactions in implementations) assume that:
- onDeviceConnected()/onDeviceDisconnected() manage a reconnecting
  process -- i.e. when 'disconnected' it is assumed the device might
  come back again
- onDeviceFailed() is the hard alternative, indicating the node is node
  coming back

This is then picked up and routed through NetconfTopologyDeviceSalFacade
to NetconfDeviceTopologyAdapter, which makes assumptions and propagates
them to the datastore.

JIRA: NETCONF-1097
Change-Id: Ib148a617b52e775261212aa3a809d1ab450d7d13
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEnforce stubbing in netconf-topology 69/107269/1
Robert Varga [Sat, 5 Aug 2023 21:37:02 +0000 (23:37 +0200)]
Enforce stubbing in netconf-topology

Fixup existing stubbing and switch Mockito configuration to throw
exception when an unstubbed method is invoked.

Change-Id: Ic854ae949b454e780f267b112c9939c20cbfe44d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix NetconfNodeHandler.connect() accounting 36/107036/9
Ivan Hrasko [Tue, 25 Jul 2023 12:20:45 +0000 (14:20 +0200)]
Fix NetconfNodeHandler.connect() accounting

The accounting is off-by-one, as the first attempt, triggered through
connect() is not correctly accounter for.

This also adds a unit test to cover this and some other basic scenarios.

JIRA: NETCONF-1119
Change-Id: I02781e92423456460c0e780c657acae0e7bae9bf
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up NetconfDevice shutdown 64/107264/5
Robert Varga [Sat, 5 Aug 2023 09:08:47 +0000 (11:08 +0200)]
Clean up NetconfDevice shutdown

When we fail to setup schemas, we should not be calling
onRemoteSessionDown(), as it ends up emitting two changes to
NetconfDeviceListener -- onDeviceDisconnected() and onDeviceFailed().

JIRA: NETCONF-1097
Change-Id: I1b9a3751accfa15791ac2c84a11ad31d51256f16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRun NetconfDeviceTest with MockitoJUnitRunner 68/107268/2
Robert Varga [Sat, 5 Aug 2023 17:45:30 +0000 (19:45 +0200)]
Run NetconfDeviceTest with MockitoJUnitRunner

This provides for stricter validation of the entire test.

JIRA: NETCONF-1097
Change-Id: I27c8dc36a5a667b0fcc95b04b8117671a9831432
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMake @BeforeClass/@AfterClass methods final 67/107267/1
Robert Varga [Sat, 5 Aug 2023 17:12:34 +0000 (19:12 +0200)]
Make @BeforeClass/@AfterClass methods final

Prevent accidental override of these methods.

Change-Id: I529a491ed2fca9ddc6a25db9a0ff38c3795c39ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrate users of YangInstanceIdentifier.create() 66/107266/3
Robert Varga [Sat, 5 Aug 2023 12:48:07 +0000 (14:48 +0200)]
Migrate users of YangInstanceIdentifier.create()

Most of these are trivial changes to of(PathArgument...), but in some
cases we take advantage of of(QName...).

Change-Id: I18054dbe04c127f4c74305f418cbad7018af7ef2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFinish getIdentifier() user migration 65/107265/2
Robert Varga [Sat, 5 Aug 2023 12:37:19 +0000 (14:37 +0200)]
Finish getIdentifier() user migration

There are a few more places using getIdentifier(), clean them up.

Change-Id: I36904efef22b5f2eea92cc3c5032d09cb278299a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove casting from putIfNonNull method 57/107257/4
lubos-cicut [Fri, 4 Aug 2023 11:46:38 +0000 (13:46 +0200)]
Remove casting from putIfNonNull method

We can remove casting from putIfNonNull method
and use simplified code to find number type.

Change-Id: Ic0104f92322b25b05670d07d76ecbdcd737257ec
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
10 months agoSet default for string type 79/105879/26
tobias.pobocik [Wed, 10 May 2023 11:22:11 +0000 (13:22 +0200)]
Set default for string type

Set default value for string type leaf when such value is present.

JIRA: NETCONF-999
Change-Id: Ia0bbecd0913b65b68a3fa30e33485b515964ada6
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoSet default for bits type 78/105878/24
tobias.pobocik [Wed, 10 May 2023 11:20:44 +0000 (13:20 +0200)]
Set default for bits type

Set default bits type leaf value when such value is present.

Dues to constrained nature of bits type its difficult to set
example values.

JIRA: NETCONF-999
Change-Id: I4edccce7699a3b6ce69965779a8651cb3252c564
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoSet default for boolean type 76/105876/23
tobias.pobocik [Wed, 10 May 2023 11:10:29 +0000 (13:10 +0200)]
Set default for boolean type

Set default value for boolean type leaf when such value is present.

JIRA: NETCONF-999
Change-Id: Ie6b5c27742b0f3d8c225a8442430732f2bfdaad6
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoSet default for union type 75/105875/24
tobias.pobocik [Wed, 10 May 2023 11:06:14 +0000 (13:06 +0200)]
Set default for union type

Set default value for union type when such value is present.

When at place added examples values for each of union's types.

JIRA: NETCONF-999
Change-Id: I2ef7d002f8cb44a9c7af858209caf20374a92411
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoSet default for binary type 74/105874/24
tobias.pobocik [Wed, 10 May 2023 10:56:14 +0000 (12:56 +0200)]
Set default for binary type

Set default value for binary type leaf when such value is present.

Due to constrained nature of this type its difficult to set
example value.

JIRA: NETCONF-999
Change-Id: I7f5b3cc30ee1c6adab2d159efea0995f3a3b379f
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoRemove casting from processStringType method 53/107253/3
Ivan Hrasko [Fri, 4 Aug 2023 10:45:15 +0000 (12:45 +0200)]
Remove casting from processStringType method

As a consequence of NETCONF-1112 we can remove casting from
processStringType method and use simplified logic to find
constraints of very original base type.

Change-Id: Ie490ed26bdaff2d0db8090f508fd59858d60cbc5
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoEliminate casting in processTypeDef method 46/107246/5
lubos-cicut [Fri, 4 Aug 2023 06:41:57 +0000 (08:41 +0200)]
Eliminate casting in processTypeDef method

Eliminate casting in DefinitionGenerator#processTypeDef method by using
instanceof pattern.

JIRA: NETCONF-1112
Change-Id: I621b0080db35d3db1a9abc0a52a598efaf154047
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoRemove onRemoteSessionFailed() 49/107249/4
Robert Varga [Thu, 3 Aug 2023 18:33:28 +0000 (20:33 +0200)]
Remove onRemoteSessionFailed()

This method is only invoked in tests, remove it.

Change-Id: I79a9dda7cc2fc6f181fa881865b4281c66674efc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrate callers of NormalizedNode.getIdentifier() 56/107256/1
Robert Varga [Fri, 4 Aug 2023 11:40:52 +0000 (13:40 +0200)]
Migrate callers of NormalizedNode.getIdentifier()

Use NormalizedNode.name() instead.

Change-Id: Ide0d0fc4c2b6c4921e7cfb36d2f162c84b84fc09
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBail early from handleSalInitializationSuccess() 55/107255/2
Robert Varga [Fri, 4 Aug 2023 11:29:58 +0000 (13:29 +0200)]
Bail early from handleSalInitializationSuccess()

This is just a minor clean up to make the method a tad more readable.

Change-Id: I204cdac7715de3e8cf119b652dcdd9140a58f9f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoCentralize handleSalInitializationFailure() 48/107248/3
Robert Varga [Fri, 4 Aug 2023 07:55:34 +0000 (09:55 +0200)]
Centralize handleSalInitializationFailure()

We have a single caller, which has a weird interaction. Move the code
together to highlight the issue.

Change-Id: I39452e19ea2cb215b92bfc240a9ee19030f2b8e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoLet logging format the notification message 44/107244/2
Robert Varga [Thu, 3 Aug 2023 17:52:47 +0000 (19:52 +0200)]
Let logging format the notification message

If logging is set above INFO, we should not be formatting the
notification.

Change-Id: Ib81678989814a4a2827a5706874f256d70318bf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not use LogicalDatastoreType.name() in logging 39/107239/2
Robert Varga [Thu, 3 Aug 2023 17:11:28 +0000 (19:11 +0200)]
Do not use LogicalDatastoreType.name() in logging

Issuing name() has no effect -- it is the same as toString(), and slf4j
will do that for us.

Change-Id: Ibb89475de803bd2f77e190f96264e2cebe0065d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse %X instead of %x + toUpperCase() 34/107234/1
Robert Varga [Thu, 3 Aug 2023 16:18:58 +0000 (18:18 +0200)]
Use %X instead of %x + toUpperCase()

This is a tad more expressive.

Change-Id: I1785a38c80c963f6ec1a7f31315c5e3ac59b842a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse EffectiveOperation.xmlValue() in NetconfMessageTransformUtil 33/107233/1
Robert Varga [Thu, 3 Aug 2023 16:07:51 +0000 (18:07 +0200)]
Use EffectiveOperation.xmlValue() in NetconfMessageTransformUtil

Use the well-known constant instead of performing conversions.

Change-Id: I93a8e1b8a78b78d7efe73fb8c17e832f7678b7fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoImprove RestconfDocumentedException 32/107232/1
Robert Varga [Thu, 3 Aug 2023 16:01:39 +0000 (18:01 +0200)]
Improve RestconfDocumentedException

Use instanceof pattern to remove an explicit cast. Also check incoming
errors and do not allocate an ArrayList if the list is null or empty.

Change-Id: I2201438e0fdb11239dfad071987cdc116f748a48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse ErrorSeverity.elementBody() in RestconfError 30/107230/1
Robert Varga [Thu, 3 Aug 2023 15:51:26 +0000 (17:51 +0200)]
Use ErrorSeverity.elementBody() in RestconfError

ErrorSeverity provides the element body through a dedicated method, do
to use toLowerCase().

Change-Id: I5a036dc65de8b798f2dd0eb1121f27f00c4752c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove a stray FIXME 29/107229/1
Robert Varga [Thu, 3 Aug 2023 15:30:50 +0000 (17:30 +0200)]
Remove a stray FIXME

I26a910d7d20aedcaf3fe4d6cd39d4a21eb7fc6ca already addressed this FIXME,
remove it.

JIRA: NETCONF-1107
Change-Id: I413bfb6cd316dffa63c1cdbb80319d20558bf4bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RestconfDataStreamService 28/107228/1
Robert Varga [Thu, 3 Aug 2023 15:27:20 +0000 (17:27 +0200)]
Remove RestconfDataStreamService

We have only one implementation of this service, integrate it.

JIRA: NETCONF-1117
Change-Id: I6a3ea6c7f9a3687c4d27476f363cfa81825f05b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RestconfInvokeOperationsService 27/107227/3
Robert Varga [Thu, 3 Aug 2023 14:01:19 +0000 (16:01 +0200)]
Remove RestconfInvokeOperationsService

This interface has a single implementation, inline its definition there.

JIRA: NETCONF-1117
Change-Id: I82c1fbda420703dbc23d8d2aefe1ad5e3ff13ec0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RootResourceDiscoveryService 26/107226/2
Robert Varga [Thu, 3 Aug 2023 13:51:54 +0000 (15:51 +0200)]
Remove RootResourceDiscoveryService

This interface has only a single implementation, fold it into the sole
user. Also fixup whitespace formatting and improve the test a bit.

JIRA: NETCONF-1117
Change-Id: I462f541fcce99a178a237762a0d7b544adf6dbf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RestconfOperationsService 25/107225/2
Robert Varga [Thu, 3 Aug 2023 13:36:55 +0000 (15:36 +0200)]
Remove RestconfOperationsService

This interface is not really useful, inline it into its sole
implementation. Also rename the test to match its name and refactor it a
bit to isolate state.

JIRA: NETCONF-1117
Change-Id: I81d92321bbc06b5aef32981a078565a02b4f2c33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RestconfService 24/107224/1
Robert Varga [Thu, 3 Aug 2023 11:41:26 +0000 (13:41 +0200)]
Remove RestconfService

This interface is not useful, integrate it into the reference
implementation.

JIRA: NETCONF-1117
Change-Id: I371b4c7ce7e6e9e28ff43e1d5fc221cfa81c2a2d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove RestconfDataService 18/107218/2
Robert Varga [Thu, 3 Aug 2023 11:37:14 +0000 (13:37 +0200)]
Remove RestconfDataService

Remove the API definition, leave just the the implementation.

JIRA: NETCONF-1117
Change-Id: I31ff867388abec13bd545b14581b82b9152e1142
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUse AsyncResponse in deleteData/patchData 17/107217/2
Robert Varga [Thu, 3 Aug 2023 10:43:51 +0000 (12:43 +0200)]
Use AsyncResponse in deleteData/patchData

We have the structure support synchronous execution, use it to eliminate
the need to catch/unwrap underlying exceptions.

JIRA: NETCONF-718
Change-Id: I17573f7012de4bbee4c8f1b53c2d7e518cecedbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate PlainPatchDataTransactionUtil 14/107214/6
Robert Varga [Wed, 2 Aug 2023 20:08:12 +0000 (22:08 +0200)]
Eliminate PlainPatchDataTransactionUtil

Move the implementation and rework synchronization, so that it occurs in
RestconfDataServiceImpl. Also drop a FIXME for optimization follow-up.

JIRA: NETCONF-1113
Change-Id: I0b4f23ecf71fbd0d5f923972d8333434970e9d19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix parameters to build action paths 22/107222/2
Ivan Hrasko [Thu, 3 Aug 2023 12:50:52 +0000 (14:50 +0200)]
Fix parameters to build action paths

During refactoring done in db4726f577d90c944841e31fdf01e8567309df3f
we have changed the parameters used to build action paths which results
in incorrect schema assigned in buildPostOperation method.

Fix the parameters to original values.

Change-Id: I764d5198eba6c9c1b15ee742b57a48e3f28bfbd2
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoRemove DeleteDataTransactionUtil 12/107212/11
Robert Varga [Wed, 2 Aug 2023 12:44:21 +0000 (14:44 +0200)]
Remove DeleteDataTransactionUtil

DeleteDataTransactionUtil contains only a single method, which is the
request to delete data from the configuration datastore.

Rather than having a free-standing utility, integrate this request into
RestconfStrategy as a well-defined method. The strategy can then
determine what is the appropriate way to implement it.

In the course of this exercise, we introduce RestconfFuture, which is a
ListenableFuture of a non-null value, which can only fail with a
RestconfDocumentedException.

As a side-effect of this, the MD-SAL implementation is made more
performant by removing an intermediate synchronization point when we
check for presence of target data.

JIRA: NETCONF-1111
Change-Id: I984547691baae19f21e8611a14ca50e4d5298c64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoCreate only config data for OpenApi 43/105043/39
Peter Suna [Mon, 27 Mar 2023 15:58:48 +0000 (17:58 +0200)]
Create only config data for OpenApi

There is no need to create duplicate JSON nodes for operational
data just to provide an example for the Get response.
Instead, we can use an example from the configuration memory,
which is sufficient for demonstration purposes.
Therefore, creating operational example data should be removed.

Remove operational GET request from OpenApi
This commit solves the problem by completly removing Operational
GET request from OpenApi.

JIRA: NETCONF-982
JIRA: NETCONF-1061
Change-Id: I894e6c2860ce622fb5258ea3518c19c853adac39
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
10 months agoOpenApi simplify processChildNode method 20/106920/6
Peter Suna [Thu, 13 Jul 2023 14:53:18 +0000 (16:53 +0200)]
OpenApi simplify processChildNode method

Use return data provided by method to fill properties
in parent node.
Remove unnecessary check for container/list. This is checked
before calling method.

JIRA: NETCONF-982
Change-Id: I189ad3a3115491869b9fe520486eb6ae4dccd110
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
10 months agoCreate tests for operational data in OpenAPI 46/106746/11
Peter Suna [Wed, 28 Jun 2023 10:24:46 +0000 (12:24 +0200)]
Create tests for operational data in OpenAPI

This commit adds unit tests to ensure the correct association
path reference to schemas in requests involving operational data.

JIRA: NETCONF-1061
Change-Id: I110370ccd2cc16f1b30e8b24152c74f5f7e50220
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
10 months agoDo not use Optional in ParserIdentifier.toInstanceIdentifier() 13/107213/2
Robert Varga [Wed, 2 Aug 2023 14:54:56 +0000 (16:54 +0200)]
Do not use Optional in ParserIdentifier.toInstanceIdentifier()

Specify a @Nullable argument instead.

Change-Id: I7aad6ea4e3891e63abf086f30060347e53462b64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate ReadDataTransactionUtilTest 09/107209/2
Robert Varga [Wed, 2 Aug 2023 09:44:08 +0000 (11:44 +0200)]
Eliminate ReadDataTransactionUtilTest

Integrate tests into AbstractRestconfStrategyTest to bring them closer
to where we want the logic to execute.

JIRA: NETCONF-1107
Change-Id: Ia1bf1ced796c38363530b19ce108c5d32d6a4d22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate PatchDataTransactionUtilTest 07/107207/2
Robert Varga [Tue, 1 Aug 2023 22:23:22 +0000 (00:23 +0200)]
Eliminate PatchDataTransactionUtilTest

Integrate tests into AbstractRestconfStrategyTest to bring them closer
to where we want the logic to execute.

JIRA: NETCONF-1107
Change-Id: Ia3860063264be30e5e92b15e976c1ee6240330cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up ReadDataTransactionUtilTest 08/107208/2
Robert Varga [Wed, 2 Aug 2023 09:31:00 +0000 (11:31 +0200)]
Clean up ReadDataTransactionUtilTest

Before splitting this test up, perform obvious clean ups.

JIRA: NETCONF-1107
Change-Id: Ib0f7ccb654983123494d28ea092072ecc8eb3969
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate PlainPatchDataTransactionUtilTest 06/107206/1
Robert Varga [Tue, 1 Aug 2023 20:42:15 +0000 (22:42 +0200)]
Eliminate PlainPatchDataTransactionUtilTest

Move the tests to AbstractRestconfStrategyTest and add proper
specializations. Also adds a few asserts to actually verify things.

JIRA: NETCONF-1107
Change-Id: I64dbfcd10db082d219a4f5e1a25e22319731e8b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate PostDataTransactionUtilTest 05/107205/2
Robert Varga [Tue, 1 Aug 2023 18:58:57 +0000 (20:58 +0200)]
Eliminate PostDataTransactionUtilTest

Split the test into AbstractRestconfStrategyTest with appropriate
specializations.

JIRA: NETCONF-1107
Change-Id: I0b6634bfe6cf74004499f9ab0bce114460c6d948
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoPublish odl-netconf-model-* features 04/107204/1
Robert Varga [Tue, 1 Aug 2023 18:43:50 +0000 (20:43 +0200)]
Publish odl-netconf-model-* features

We should reference all production features in feature-netconf, update
the stragglers.

Change-Id: Ib52dc3e42e15085ab76a054179baca596f6355c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoPackage RFC8650 model 03/107203/1
Robert Varga [Tue, 1 Aug 2023 17:54:03 +0000 (19:54 +0200)]
Package RFC8650 model

This patch adds the YANG model for RESTCONF integration of RFC8639.

JIRA: NETCONF-1110
Change-Id: If762949d6edab1cb19a558509eb9c053d4998fcb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd RFC8641 model 02/107202/4
Robert Varga [Tue, 1 Aug 2023 16:37:49 +0000 (18:37 +0200)]
Add RFC8641 model

This adds the model for YANG notifications on datastore updates, along
with its corresponding feature.

JIRA: NETCONF-1109
Change-Id: Ia1a63e741fbc5b923d793afdf20959805abd4623
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up PatchDataTransactionUtilTest 01/107201/1
Robert Varga [Tue, 1 Aug 2023 16:13:20 +0000 (18:13 +0200)]
Clean up PatchDataTransactionUtilTest

We are about to split this test up, clean up constants and other
interactions. This flushes out a weirdness in addressing which will
need to be addressed.

JIRA: NETCONF-1107
Change-Id: Ie76e493a4074036ea8f71de24896c514daa36c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up PlainPatchDataTransactionUtilTest 00/107200/1
Robert Varga [Tue, 1 Aug 2023 15:42:09 +0000 (17:42 +0200)]
Clean up PlainPatchDataTransactionUtilTest

Use static testing data to eliminate duplicates.

JIRA: NETCONF-1107
Change-Id: Ib135fc93b1ce208ff546462427d10253ed11857b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEliminate PutDataTransactionUtilTest 99/107199/1
Robert Varga [Tue, 1 Aug 2023 15:33:30 +0000 (17:33 +0200)]
Eliminate PutDataTransactionUtilTest

We want to eliminate PutDataTransactionUtil and integrate it into
RestconfStrategy. This takes the first step, splitting tests by the
strategy they are testing.

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