Bug 1491336 - 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.10.0
Assignee: Gregg Tanzillo
QA Contact: Martin Kourim
URL:
Whiteboard: api:rest
Depends On:
Blocks: 1511545
TreeView+ depends on / blocked
 
Reported: 2017-09-13 14:14 UTC by Martin Kourim
Modified: 2019-08-06 20:04 UTC (History)
3 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1511545 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:39:07 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kourim 2017-09-13 14:14:05 UTC
Description of problem:

According to http://manageiq.org/docs/reference/latest/api/overview/http#updating-resources, resources can be updated using the "edit" action with POST method, or using PATCH and PUT HTTP methods.

While the "edit" action with POST method is listed in "actions" attribute of every resource that supports updates, the "edit" actions with PATCH and PUT methods are not listed:
GET /api/users/:id
{
    "href": "https://<address>/api/users/:id",
    "id": :id,
    "name": "Administrator",
    ...
    "actions": [
        {
            "name": "edit",
            "method": "post",
            "href": "https://<address>/api/users/:id"
        },
        {
            "name": "delete",
            "method": "post",
            "href": "https://<address>/api/users/:id"
        },
        {
            "name": "delete",
            "method": "delete",
            "href": "https://<address>/api/users/:id"
        }
    ]
}

Version-Release number of selected component (if applicable):
all versions including 5.7.x - 5.9.x


How reproducible:
very

Comment 3 CFME Bot 2017-11-09 13:54:53 UTC
New commit detected on ManageIQ/manageiq-api/master:
https://github.com/ManageIQ/manageiq-api/commit/a9e48010c099ba130d8047f9bab2eca7564f6a75

commit a9e48010c099ba130d8047f9bab2eca7564f6a75
Author:     Jillian Tullo <jtullo>
AuthorDate: Mon Nov 6 14:43:29 2017 -0500
Commit:     Jillian Tullo <jtullo>
CommitDate: Thu Nov 9 08:26:34 2017 -0500

    Return put and patch edit actions for resources
    
    Currently, only the POST method for resource edits is returned, even if put and patch verbs are specified. This will add in the additional actions for put and patch.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1491336

 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(-)


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