-
Notifications
You must be signed in to change notification settings - Fork 8
Add a separate controller for payload download. #37
Add a separate controller for payload download. #37
Conversation
@martinpovolny on my local machine I get this response when using your {
"error": {
"kind": "internal_server_error",
"message": "undefined method `payload_path' for #<Hash:0x00007f958cb4ddd0>",
"klass": "NoMethodError"
}
} |
Yep, I'm getting the same error that Mike shows above. It really seems that
|
e0865d3
to
0475fa8
Compare
Thanks, @mzazrivec, @mturley. Fixing the hash access and doing the TODOs.... |
4546f3d
to
9b49f54
Compare
Checked commits martinpovolny/cfme-migration_analytics@c9e61ed~...9b49f54 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 **
|
I'm OK with this change, though I'll let @mturley chime in here before it's merged. |
task_id = params['task_id'] | ||
raise "Must specify a task id via \"task_id\"" if task_id.blank? | ||
|
||
begin |
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.
begin
block is needed here ?
I am not aware about it.As far as I know you can probably do: POST + "action mechanism" like we have for example for set_ownership question is if this "action mechanism" is proper for your requirement regard to its semantics. |
@lpichler : the action mechanism is ok, but you cannot call I am talking about "arbitrary" methods, grep |
Hmm, @martinpovolny I'm realizing there may be an issue with using the So, either I need to make a patch to manageiq-ui-classic to make it possible to call |
@martinpovolny I'll open a PR to manageiq-ui-classic to resolve the issue I'm describing. If it gets rejected we'll have to follow up and maybe encode in base64 or something. |
@martinpovolny do you need anyone else to review this or are you ok with me and @mzazrivec merging it? |
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 good 👍
Add a separate controller for payload download. (cherry picked from commit 9873a39) https://bugzilla.redhat.com/show_bug.cgi?id=1805818
Ivanchuk backport details:
|
I implemented the option a) from #33
I did not figure how to make a "arbitrary" method other thatn
index
orshow
using what is available in the API. (callingsend_file
from other methods does now work due to assumptions in the API code).example usage:
curl -i -u admin:smartvm http://localhost:3000/api/red_hat_migration_analytics_payload?task_id=30
@lpichler: do you have an idea how to do this in a the existing controller?
@mturley: can you, please, try if this works for you (with use of the
file-saver
package)?TODO:
if we agree on this approach I will:
move the duplicated method to a mixinwrite some testBZ for backport to ivanchuk: https://bugzilla.redhat.com/show_bug.cgi?id=1788730
JIRA task for feature: https://issues.redhat.com/browse/MIGENG-241