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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Š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š <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
Š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š <[email protected]>
Š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š <[email protected]>
Š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š <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
Š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š <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Šimon Ukuš <[email protected]>
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 <[email protected]>
Š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š <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: lubos-cicut <[email protected]>
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 <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Matej Sramcik <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Robert Varga [Tue, 1 Aug 2023 15:18:29 +0000 (17:18 +0200)]
Evacuate static methods tests to RestconfDataServiceImplTest
Static methods are tested in the wrong test suite, evacuate them. Also
promote relevant static test data to AbstractJukeboxTest.
JIRA: NETCONF-1107
Change-Id: I16883ec236c14261f7432fb8f83fe0c58969d75e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 1 Aug 2023 14:53:25 +0000 (16:53 +0200)]
Clean up testPostData()
Rework how we prepare test data so that the NormalizedNodePayload is
just something we pass down to the tested method.
JIRA: NETCONF-1107
Change-Id: Ic47c82392d41ba8609cb64fe4e9efd838f5f12f1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 1 Aug 2023 13:48:59 +0000 (15:48 +0200)]
Move PutDataTransactionUtil.readList()
This is an intermediate step towards properly resolving data lifecycle:
readList() is used only when we already have a transaction, hence we can
route the request appropriately.
JIRA: NETCONF-1107
Change-Id: I40ef1262ff0c48e2bdbf5b266fb716af0733c9a7
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 1 Aug 2023 12:59:20 +0000 (14:59 +0200)]
Clean up {Post,Put}DataTransactionUtil.submitData()
Use a switch expression on insert() and also dispatch directly.
JIRA: NETCONF-1107
Change-Id: I26a910d7d20aedcaf3fe4d6cd39d4a21eb7fc6ca
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 1 Aug 2023 12:27:49 +0000 (14:27 +0200)]
Minimize PostDataTransactionUtilTest.before()
We are shuffling immutable structures, there is no need to instantiate
them for each test.
Change-Id: I2e8c6e7f5bf9c4bb2c28d073a9453d9018f2bc02
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 1 Aug 2023 12:17:09 +0000 (14:17 +0200)]
Minimize PutDataTransactionUtilTest.before()
We have static assertion data, there is no need to build for each test
execution.
Change-Id: Ia42c36235c1c444897432c429deb37eaf6f0b08d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 1 Aug 2023 12:05:59 +0000 (14:05 +0200)]
Centralize jukebox constants
We are have multiple places defining the same QNames. Centralize these
in AbstractJukeboxTest.
Change-Id: I1680f0d4c0cba72acab08179b8581c9bcc94e7e1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 18:14:09 +0000 (20:14 +0200)]
Split up DeleteDataTransactionUtilTest
At the end of the day, these tests are really flexing the two
RestconfStrategy implementations. Provide a substrate for testing them
separately as a precondition to integrating DeleteDataTransactionUtil.
JIRA: NETCONF-1107
Change-Id: I6a2de0727274b2e667afbfa15b0a41d7b954b2c3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 16:15:37 +0000 (18:15 +0200)]
Remove addOperations()
This is a static utility method which builds an object and populates it
to a Map -- but there are only two callers and what gets put and where
and under which name is quite conflated.
Introduce a buildPostPath(), which just returns a Path and use that
instead.
While we are at it, use List.of() to specify empty inherited parameters.
Change-Id: I7d69af0ba96caecae3f1e389dc6f2368409c1b14
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 22:38:52 +0000 (00:38 +0200)]
Clean up DocumentedException
Provide tie-ins to constant refactor and clean up the class.
JIRA: NETCONF-1014
Change-Id: Ieffc03ec27fb2cddef43db4c6f1a32352df0c840
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 22:20:41 +0000 (00:20 +0200)]
Register NioSocketChannel
NioSocketChannel must be bound to an Eventloop during close(). This
patch adds the smarts to associate it.
JIRA: NETCONF-1030
Change-Id: I0fcb2d130f38f4f44c4c9979d81ea8c2e611b0a6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 19:51:45 +0000 (21:51 +0200)]
Qualify ListenersBroker FIXMEs
Mark the issue associated with cleaning up ListenersBroker.getInstance()
and deprecate that method to increase visibility of its users.
JIRA: NETCONF-1104
Change-Id: Iaef1883e028debb446c1186c6b105d9088465c98
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 16:31:06 +0000 (18:31 +0200)]
Eliminate OperationBuilder.CONSUMES_PUT_POST
This constant is not used anywhere, remove it.
Change-Id: I01d5ffb3882cbe6f2181582d9b2d2f211366d390
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 16:07:02 +0000 (18:07 +0200)]
Reduce builder exposure
Build objects fluently so the builders do not escape.
Change-Id: I34d145224ae33965bb9751ec3f59a115378a41c4
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 16:02:13 +0000 (18:02 +0200)]
Use local variable type inference
Bind more tightly to TreeSet.
Change-Id: I6eb31f902a89bbce7396c3555581120f67120761
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 16:01:19 +0000 (18:01 +0200)]
Reduce casts a bit
Use instanceof patterns to reduce explicit casts.
Change-Id: I2d06c9702c6d3f9cdadb84c5bce0506ffe98566d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 14:34:33 +0000 (16:34 +0200)]
Import javax.ws.rs.core.UriInfo
There is no point in using a FQCN, just import UriInfo.
Change-Id: I117cd8f756e42ae17c9d1dc1a0f3505ef48b9037
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 19:23:11 +0000 (21:23 +0200)]
Do not use ArrayList in RestconfDataServiceImplTest
Use List.of() and inline the set of patch entities.
Change-Id: Ia4e608095e2bc17c82e19543be6bad65dc9297f2
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 18:58:04 +0000 (20:58 +0200)]
Eliminate lockOperationCallback
Having the callback as a field is not nice, move it to its sole user.
Change-Id: I4f3d7da2b792da9562a10efed676e97bea828953
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 7 Mar 2022 09:55:36 +0000 (10:55 +0100)]
Switch RESTCONF data root namespace to ietf-restconf
The namespace being used here is wrong, referencing NETCONF. We should
be using the RESTCONF namespace instread.
JIRA: NETCONF-855
Change-Id: I43a8d64057ede0badae520b14c99cf49f208f82b
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 12:06:34 +0000 (14:06 +0200)]
Update sal-remote.yang
The path parameter and list of qnames is mandatory, make sure we express
that in the model.
JIRA: NETCONF-1099
Change-Id: Ica48ea16b238557de1881af0e726b6ad7662c265
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 31 Jul 2023 10:13:13 +0000 (12:13 +0200)]
Eliminate AbstractNotificationsData.localName
This field is not really derived from path/identifier, but really is the
stream name.
JIRA: NETCONF-1099
Change-Id: I33d70ffad8077615f7933df1a99042d881c42f94
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 27 Jul 2023 14:37:04 +0000 (16:37 +0200)]
Update RestconfStreamsSubscriptionService
The @Path element has magic structure, make sure the constant is
expressed therein.
Change-Id: Ife99becaac60b8c6ac1273cde944dac6e2dc30ce
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 27 Jul 2023 14:06:13 +0000 (16:06 +0200)]
Rename and move RestconfConstants
Document RestconfConstants and move them to the base package. The new
name is URLConstants.
Change-Id: If3698e2e89c21e79c08a8920b4b911134e80329b
Signed-off-by: Robert Varga <[email protected]>
Matej Sramcik [Mon, 24 Jul 2023 07:46:44 +0000 (09:46 +0200)]
Remove Rfc8040 class
This class only holds ietf-yang-library constants. Move those constants
to their users are eliminate the class.
JIRA: NETCONF-1092
Change-Id: Id089620022afc629ade29451dcc9ccc140bb54fa
Signed-off-by: Matej Sramcik <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Jul 2023 15:26:41 +0000 (17:26 +0200)]
Extract modules directly from EffectiveModelContext
We are ignoring the value passed into mapModulesByIetfYangLibraryYang(),
remove the argument and let the method pick up modules from there.
Change-Id: I81a09a7c30cb9e5d8bade1f9b7d9f7da04059011
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Jul 2023 22:42:10 +0000 (00:42 +0200)]
Centralize access decoding
We have a number of places which perform access syncing, duplicating
code. Introduce TransactionUtil.syncAccess() to deal with them.
Change-Id: I645cbee00c3a28fd5bbf52683e5253f6f096d11f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Jul 2023 22:05:48 +0000 (00:05 +0200)]
Eliminate FutureCallbackTx
The FutureCallbackTx.addCallback() is misleading and ResponseFactory
is a useless indirection. Eliminate both in favor of
TransactionUtil.syncCommit().
Change-Id: Iebddeac64b624ceaff71260aa3dc0579596fd454
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Jul 2023 21:55:14 +0000 (23:55 +0200)]
Clean up PatchDataTransactionUtil error list handling
The errors reported are immutable, there is absolutely no point in
copying them.
Change-Id: I80a98921f7c4d1127a4d7de7933229db44681a89
Signed-off-by: Robert Varga <[email protected]>