Add API command remove management server
Description
This PR adds a command to mark a Management Server as removed on the database only if its status is marked as Down. To execute the command, it is obligatory to inform the id of the targeted MS.
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [x] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
How Has This Been Tested?
In a local lab, I added an MS through the database.
- With State="Down" I executed through CMK
remove managementserver id=<uuid>and verified that the MS wasn't being listed on the UI and was marked asRemovedon the database. - With State="Up" I executed the same command and verified an error was returned informing it wasn't possible to remove an MS which state was marked as "Up".
- With State="Down" I executed through a URL
http://<IP>:8080/client/api?command=removeManagementServer&response=json&id=<UUID>and verified the MS was marked as removed and wasn't being listed on the UI. - With State="Up" I executed the same URL and received an error informing it wasn't possible to remove an MS which state was marked as "Up".
- Trying to execute the command with a non-existent id returns an error warning the request format may be invalid, the entity may not exist, or the parameter annotation may be wrong.
- Trying to execute the command without an id, both in CMK and with a URL, returns an error informing the id parameter is obligatory and it is missing.
@nicoschmdt, apparently the ManagementServerImpl.java file has conflicts. Could you resolve them, please?
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@blueorangutan package
@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12343
Codecov Report
:x: Patch coverage is 5.26316% with 36 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 16.71%. Comparing base (7632814) to head (fb3e7de).
:warning: Report is 227 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10325 +/- ##
============================================
+ Coverage 16.57% 16.71% +0.13%
- Complexity 13868 14144 +276
============================================
Files 5719 5731 +12
Lines 507178 517729 +10551
Branches 61571 66058 +4487
============================================
+ Hits 84085 86536 +2451
- Misses 413674 421532 +7858
- Partials 9419 9661 +242
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.26% <ø> (+0.29%) |
:arrow_up: |
| unittests | 17.61% <5.26%> (+0.15%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@blueorangutan package
@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 12461
@JoaoJandre could we run package again?
@nicoschmdt you do not need any permission to run package
@blueorangutan package
@nicoschmdt a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12490
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@blueorangutan package
@nicoschmdt a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12560
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12569
@blueorangutan package
@nicoschmdt a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 12579
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 12580
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12596
@blueorangutan package
@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13001
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@blueorangutan package