-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add basic CentralAdmin support to the API #472
Conversation
I think I'm going to refactor the tests to reduce duplication, but I wanted to open this to see if anyone had any major concerns. |
@gtanzillo @jrafanie This wound up being a much cleaner implementation than the others we discussed, and it's easily extendable in the future. |
@@ -152,6 +159,7 @@ def scan_resource(type, id = nil, _data = nil) | |||
result | |||
end | |||
end | |||
central_admin :scan_resource, :scan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few of these in here that I don't think we support from the main app.
Doing a quick look for api_relay
in the core source I can only find shutdown_guest
, reboot_guest
, reset
, start
, stop
, and suspend
. We should keep the actions we support consistent between the UI and API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they were simple, so I added them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd like to add all future central admin features through the api and maybe even deprecate the central admin support in the models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't introduce new behavior just to make it complete. We can add the new ones later when they're needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should leave out the extra methods here until they are also supported through the classic UI. If this PR is meant to solve a particular BZ we should limit the scope that issue rather than also adding new features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since enabling them all is so easy, I figured I would just do it proactively rather than waiting for another high severity customer case saying Action X doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but as I understand it this was because of missing operations in the API vs the classic UI. If you really do want to add the new ones, then please create an additional PR to add the same operations in core for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see the value in separating the bugfix from the enhancement part of this PR. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I removed the things we don't central admin in the UI. I'll open a followup PR to add those.
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enddddddd
Wow, and this works? Looks good. My only concern is what @carbonin brought up above |
For better or worse, it does the same thing that the central admin through the classic-ui does. So, the actions get passed down properly, but the response returned to the user is garbage. Valid action:
Invalid action:
I'm investigating what needs to be done to make the response useful. |
Interesting edge cases you're testing. It's a great idea to try vms in various states. |
621ced9
to
9e11519
Compare
Okay, @carbonin @jrafanie @gtanzillo @abellotti This is ready to go. I got the success and failure responses working properly and all of the hrefs pointing to the correct server. |
- pause - reboot_guest - refresh - reset - scan - shelve - shelve_offload - shutdown_guest - start - stop - suspend Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628658
- pause - reboot_guest - reset - shelve - start - stop - suspend - terminate Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628658
Checked commits bdunne/manageiq-api@5d11ea8~...504eda4 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I can't merge here.
@bdunne and I want to create a new label and call it bughancement with the color of the existing two labels added together.
🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome! 👍
@bdunne |
@simaishi I think so. Also related are: ManageIQ/manageiq#17987 and ManageIQ/manageiq#18036 |
Add basic CentralAdmin support to the API (cherry picked from commit 4dbf6b0) https://bugzilla.redhat.com/show_bug.cgi?id=1628658
Hammer backport details:
|
Add basic CentralAdmin support to the API (cherry picked from commit 4dbf6b0) https://bugzilla.redhat.com/show_bug.cgi?id=1635764
Gaprindashvili backport details:
|
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628658