Bug 1511545 - edit actions with PATCH and PUT methods are not listed in actions
Summary: edit actions with PATCH and PUT methods are not listed in actions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: GA
: 5.9.0
Assignee: Jillian Tullo
QA Contact: Martin Kourim
URL:
Whiteboard: api:rest
Depends On: 1491336
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-09 14:39 UTC by Satoe Imaishi
Modified: 2018-03-06 15:10 UTC (History)
5 users (show)

Fixed In Version: 5.9.0.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1491336
Environment:
Last Closed: 2018-03-06 15:10:01 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 2 CFME Bot 2017-11-29 20:48:35 UTC
New commit detected on ManageIQ/manageiq-api/gaprindashvili:
https://github.com/ManageIQ/manageiq-api/commit/5fd0240428e4774ac0d336d004bcf2f99edf71a6

commit 5fd0240428e4774ac0d336d004bcf2f99edf71a6
Author:     Alberto Bellotti <abellotti.github.com>
AuthorDate: Thu Nov 9 08:48:18 2017 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Tue Nov 14 17:40:45 2017 -0500

    Merge pull request #179 from jntullo/bz/put_patch_on_edit
    
    Return put and patch edit actions for resources
    (cherry picked from commit 3931588e5ff27962116f854bd9a3ad5fc6c02e89)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1511545

 app/controllers/api/base_controller/renderer.rb | 14 +++++++++++---
 spec/requests/authentications_spec.rb           | 13 ++++++++++---
 spec/requests/custom_actions_spec.rb            |  6 +++---
 3 files changed, 24 insertions(+), 9 deletions(-)

Comment 3 Martin Kourim 2017-12-04 10:55:30 UTC
On 5.9.0.11 edit actions with put and patch are available only for some collections. For e.g. /api/providers it's not available, for /api/services it is available:

GET /api/providers/:id
{
...
    "actions": [
        {
            "name": "edit",
            "method": "post",
            "href": "https://<addr>/api/providers/5"
        },
        {
            "name": "refresh",
            "method": "post",
            "href": "https://<addr>/api/providers/5"
        },
        {
            "name": "delete",
            "method": "post",
            "href": "https://<addr>/api/providers/5"
        },
        {
            "name": "delete",
            "method": "delete",
            "href": "https://<addr>/api/providers/5"
        }
    ]
}

Comment 4 Jillian Tullo 2017-12-04 18:45:02 UTC
Hi Martin--

If you look at the api.yml, you'll be able to see when put/patch should be listed. For example, for the providers endpoint, only post is specified (https://github.com/ManageIQ/manageiq-api/blob/master/config/api.yml#L1848) via *gpd. Therefore, put and patch are not supported at this time. On the other hand, for Services, all of the verbs are specified (https://github.com/ManageIQ/manageiq-api/blob/master/config/api.yml#L2586). 

Let me know if this provides clarity.

Thanks!
- Jillian

Comment 5 Martin Kourim 2018-02-15 15:53:59 UTC
Thanks for explanation Jillian.


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