-
Notifications
You must be signed in to change notification settings - Fork 143
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 VM set_description action #1120
Conversation
bc0b49e
to
1372260
Compare
@agrare agreed While I prefer 403, we can not go that direction. Our rbac is on the query so nothing comes back - we can't tell the difference between 403/404. I have a number of outstanding branches/PRs consolidating code and those move us to towards this 404 consistency |
raise BadRequestError, "Setting description requires a new_description" if new_description.blank? | ||
|
||
task_id = vm.set_description_queue(User.current_user.userid, new_description) | ||
action_result(true, "Setting description for #{model_ident(vm, type)} to #{new_description}", :task_id => task_id) |
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.
do we need to tell the user what they passed in, or can we just use the default description of "Setting description for #{model_ident(vm, type)}"
(which will get automatically added for us).
1372260
to
66647c4
Compare
66647c4
to
7752b27
Compare
I just rewrote this and realized that this PR already existed update:
|
config/api.yml
Outdated
@@ -4534,6 +4534,8 @@ | |||
:identifier: vm_guest_shutdown | |||
- :name: reboot_guest | |||
:identifier: vm_guest_restart | |||
- :name: set_description | |||
:identifier: vm_rename |
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.
not sure about this identifier...I'm wondering if vm_edit
is better.
7752b27
to
37fb0f1
Compare
update:
|
37fb0f1
to
f9d6b0c
Compare
Checked commit kbrock@f9d6b0c with ruby 2.6.9, rubocop 1.19.1, haml-lint 0.35.0, and yamllint |
Hey @kbrock, I was trying to use the API like this -
is this the right way? Also, this is how the component is being rendered.
we have 2 kinds of id in here,
I am guessing we need to use the |
Hey Jeffrey, Use From here, the actual description will not change but rather a message will get sent to the provider to change it at the source. Think you'll get a task I'd, and when the task completes, it will tell you success but in fact the success is the queuing to the provider. If you have a provider setup, then it will flow back, otherwise you won't be able to test it on your machine. |
@jeffibm Think the issue is this needs to be a POST and not a GET
|
Alternative to #1112
ManageIQ/manageiq#21561
@agrare sorry. Just had to tweak the way you wrote
set_resource_description