cloudstack
cloudstack copied to clipboard
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.