When clicking a custom button in the VM details level it failed with "Action to able to submit" in the UI, the production.log shows the following: [----] I, [2017-05-23T10:11:39.736924 #7746:105511c] INFO -- : Started POST "/api/services/1000000000001" for 127.0.0.1 at 2017-05-23 10:11:39 -0400 [----] I, [2017-05-23T10:11:39.739517 #7746:105511c] INFO -- : Processing by Api::ServicesController#update as JSON [----] I, [2017-05-23T10:11:39.739652 #7746:105511c] INFO -- : Parameters: {"c_id"=>"1000000000001", "service"=>{}} [----] I, [2017-05-23T10:11:39.769864 #7746:105511c] INFO -- : Completed 400 Bad Request in 30ms (Views: 0.2ms | ActiveRecord: 4.3ms)
Ive traced back through our custom button logic and we are calling button actions as specified by documentation on this link. http://manageiq.org/docs/reference/latest/api/reference/service_custom_actions Here is where we call the api for button actions. https://github.com/ManageIQ/manageiq-ui-service/blob/master/client/app/services/custom-button/custom-button.component.js#L35 I recommend someone from the API team take a look and let us know their thoughts.
Does it make sense to call Service_custom_actions for a button at VM level?
It appears that the actions are not working on subresources (ie POST /api/services/:service_id/vms/:vm_id). I am currently working on a fix, but it is a complex problem. If an immediate fix is necessary in the SUI, a workaround would be to call the custom action via: POST /api/vms/:vm_id as I have verified that to work.
After discussing with Chris Hale, for the time being the SUI will use the workaround to call custom actions on the vms collection endpoint rather than with VMs as a subcollection so that this particular issue can be resolved. The greater issue from the API perspective is something Tim has been working on and is a big change in the api. Now that this bug has been discovered, I think it's best to create a separate BZ for the API portion.
Assigning back to Chris as I believe he has fixed this issue.
PV Ticket https://www.pivotaltracker.com/story/show/146045337 GH PR https://github.com/ManageIQ/manageiq-ui-service/pull/791
On clicking custom button the page does navigate to show the dialog. But when request is submitted shows error " Error submitting this request"
Created attachment 1285088 [details] Error submititng reuqest I can open a separate bug for this if required ?
Working in 5.9.0.2.20171010190026_0413a06