Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rest.network.configuration.provider): new rest api for network configuration management #4915

Merged
merged 12 commits into from
Nov 17, 2023

Conversation

sfiorani
Copy link
Contributor

This PR add a new REST api for managing network configuraion.

Related Issue:

Description of the solution adopted:

Screenshots:

Manual Tests:

Any side note on the changes made:

@sfiorani sfiorani force-pushed the rest-network-configuration branch 2 times, most recently from 82591f8 to bf6f717 Compare October 26, 2023 16:01

private static final Logger logger = LoggerFactory.getLogger(NetworkConfigurationRestService.class);

private static final String APP_ID = "NETCONF-V1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to expose this as a request handler, please remove this.


private static final String SNAPSHOT_SUBTASK_ID = "snapshot";

private final RequestHandler requestHandler = new JaxRsRequestHandlerProxy(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to expose this as a request handler, please remove this.

this.cryptoService = cryptoService;
}

public void setRequestHandlerRegistry(final RequestHandlerRegistry registry) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to expose this as a request handler, please remove this.

}
}

public void unsetRequestHandlerRegistry(final RequestHandlerRegistry registry) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to expose this as a request handler, please remove this.

<reference bind="setUserAdmin" cardinality="0..1"
interface="org.osgi.service.useradmin.UserAdmin" name="UserAdmin"
policy="static" />
<reference bind="setRequestHandlerRegistry" cardinality="0..n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to expose this as a request handler, please remove this.

*/
@GET
@RolesAllowed("network.configuration")
@Path("/networkConfigurableComponents")
Copy link
Contributor

@nicolatimeus nicolatimeus Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can replace networkConfigurableComponents with configurableComponents to be consistent with CONF-V2, we already have networkConfiguration in the prefix

@sfiorani sfiorani force-pushed the rest-network-configuration branch from 7daabcb to 6bb17bc Compare October 27, 2023 15:54
@sfiorani sfiorani marked this pull request as ready for review October 27, 2023 16:00
@nicolatimeus
Copy link
Contributor

@sfiorani
Copy link
Contributor Author

Tested on Raspberry Pi with generic-aarch64 kura profile

@nicolatimeus
Copy link
Contributor

There are conflicts that need to be solved

@@ -0,0 +1,19 @@
#
# Copyright (c) 2021 Eurotech and/or its affiliates and others
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set to 2023

@@ -0,0 +1,15 @@
#
# Copyright (c) 2021 Eurotech and/or its affiliates and others
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2023

@@ -0,0 +1,74 @@
package org.eclipse.kura.rest.network.configuration.provider.test.responses;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright header is missing

@@ -0,0 +1,19 @@
package org.eclipse.kura.rest.network.configuration.provider.test.responses;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright header is missing

Signed-off-by: SimoneFiorani <[email protected]>
Signed-off-by: SimoneFiorani <[email protected]>
Signed-off-by: SimoneFiorani <[email protected]>
Signed-off-by: SimoneFiorani <[email protected]>
Signed-off-by: SimoneFiorani <[email protected]>
Signed-off-by: SimoneFiorani <[email protected]>
@sfiorani sfiorani force-pushed the rest-network-configuration branch from 7c7debf to 42c6c14 Compare November 2, 2023 09:16
Signed-off-by: SimoneFiorani <[email protected]>
@nicolatimeus
Copy link
Contributor

This bundle should only be added to the distribution profiles with network management support, it is not needed on the -nn profiles. Please remove the new permission from the snapshot_0.xml of nn profiles and modify the ant script to add the new bundle only if we are not building an -nn profile.

@sfiorani
Copy link
Contributor Author

Eclipse team approved changes

@nicolatimeus nicolatimeus merged commit ee2c973 into eclipse-kura:develop Nov 17, 2023
1 check passed
Copy link
Contributor

The backport to release-5.4.0 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-5.4.0 release-5.4.0
# Navigate to the new working tree
cd .worktrees/backport-release-5.4.0
# Create a new branch
git switch --create backport-4915-to-release-5.4.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ee2c973f7bff56f555e987f4d819611dc7635d40
# Push it to GitHub
git push --set-upstream origin backport-4915-to-release-5.4.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-5.4.0

Then, create a pull request where the base branch is release-5.4.0 and the compare/head branch is backport-4915-to-release-5.4.0.

nicolatimeus added a commit to nicolatimeus/kura that referenced this pull request Nov 17, 2023
…onfiguration management (eclipse-kura#4915)

* Added first structure of bundle

Signed-off-by: SimoneFiorani <[email protected]>

* Rebase branch on develop

Signed-off-by: SimoneFiorani <[email protected]>

* working apis, missing tests

Signed-off-by: SimoneFiorani <[email protected]>

* Added tests, update code with comments

Signed-off-by: SimoneFiorani <[email protected]>

* Fixed formatter problem and duplications

Signed-off-by: SimoneFiorani <[email protected]>

* Fixed general problems

Signed-off-by: SimoneFiorani <[email protected]>

* Fixed headers and conflicts

Signed-off-by: SimoneFiorani <[email protected]>

* Resolving conflicts

Signed-off-by: SimoneFiorani <[email protected]>

* Resolved all conflicts

Signed-off-by: SimoneFiorani <[email protected]>

* Added bundle configuration only in not-nn profiles

Signed-off-by: SimoneFiorani <[email protected]>

* fix: Deleted incorrectly named license files

---------

Signed-off-by: SimoneFiorani <[email protected]>
Co-authored-by: nicolatimeus <[email protected]>
MMaiero pushed a commit that referenced this pull request Nov 17, 2023
…onfiguration management (#4915) [backport release-5.4.0] (#4992)

feat(rest.network.configuration.provider): new rest api for network configuration management (#4915)

* Added first structure of bundle



* Rebase branch on develop



* working apis, missing tests



* Added tests, update code with comments



* Fixed formatter problem and duplications



* Fixed general problems



* Fixed headers and conflicts



* Resolving conflicts



* Resolved all conflicts



* Added bundle configuration only in not-nn profiles



* fix: Deleted incorrectly named license files

---------

Signed-off-by: SimoneFiorani <[email protected]>
Co-authored-by: sfiorani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants