Bug 1455311 - Subresource actions do not work
Summary: Subresource actions do not work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.8.1
Assignee: Tim Wade
QA Contact: Martin Kourim
URL:
Whiteboard:
Depends On: 1454910
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-24 18:17 UTC by Jillian Tullo
Modified: 2017-06-16 22:31 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-16 22:31:41 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jillian Tullo 2017-05-24 18:17:04 UTC
Description of problem:
Subresource actions are not currently responding in the API. 

For example, a VM retrieved through:
/api/services/:service_id/vms/:vm_id

will list actions:
"actions":[
{"name":"deploy postgresql",
"method":"post","
href":"http://localhost:3000/api/services/10000000000570/vms/10000000001658"},{"name":"create aws elb",
"method":"post",
"href":"http://localhost:3000/api/services/10000000000570/vms/10000000001658"},{"name":"test ansible","method":
"post","href":"http://localhost:3000/api/services/10000000000570/vms/10000000001658"},{"name":"register with satellite 6","method":"post","href":"http://localhost:3000/api/services/10000000000570/vms/10000000001658"}
]

but when calling those actions, 
{"error":{"kind":"bad_request","message":"No actions are supported for vms resource","klass":"Api::BadRequestError"}}

This is occurring because the routes are directing to the collection controller rather than the subcollection controller.

The original issue that brought this to light: https://bugzilla.redhat.com/show_bug.cgi?id=1454910

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Jillian Tullo 2017-05-24 18:17:54 UTC
Assigning to Tim as he as already started work on this issue.

Comment 3 Tim Wade 2017-06-16 22:31:41 UTC
I'm going to close this as not a bug - since actions were designed to be implemented on the resource/subresource level (and have not been implemented at the subresource level in the case of these examples), I think it is safe to assume this is working as intended.

I think that if the root cause of https://bugzilla.redhat.com/show_bug.cgi?id=1454910 is addressed (the links in the response are pointing incorrectly to subresources) then this would cease to be an issue.


Note You need to log in before you can comment on or make changes to this bug.