Bug 1754972 - API should not declare HTTP DELETE verb on pxe_servers collection
Summary: API should not declare HTTP DELETE verb on pxe_servers collection
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.12.0
Assignee: abellott
QA Contact: Parthvi Vala
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1767786
TreeView+ depends on / blocked
 
Reported: 2019-09-24 13:09 UTC by Parthvi Vala
Modified: 2020-10-26 16:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1767786 (view as bug list)
Environment:
Last Closed: 2020-10-26 16:25:46 UTC
Category: Inquiry
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Parthvi Vala 2019-09-24 13:09:17 UTC
Description of problem:
API should not be declaring HTTP DELETE verb on collections. In this specific case, API was allowing DELETE on the pxe_servers collection which causes incorrect representation of actions when fetching pxe_servers.

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

How reproducible:
Always

Steps to Reproduce:
1. Get an appliance
2. Fetch pxe_servers via GET /api/pxe_servers

Actual results:
You will notice the following 2 entries in the collection actions:
 {'name': 'edit',
  'method': 'patch',
  'href': 'https://<ip_address>/api/pxe_servers'},
 {'name': 'delete',
  'method': 'delete',
  'href': 'https://10.8.199.37/api/pxe_servers'}

Expected results:
Only the "post" method should be exposed, 'patch' and 'delete' must not be present.

Additional info:
Reference BZ -https://bugzilla.redhat.com/show_bug.cgi?id=1392595

Comment 3 Parthvi Vala 2019-09-24 13:44:33 UTC
I think there is some misunderstanding here, this BZ is not a regression. `pxe_servers` was added as a REST collection in 5.11 and actions were only added to it from 5.11.0.13 as far as I can tell.
The reference BZ I provided is related to `blueprints` collection.

Comment 4 abellott 2019-09-27 14:41:41 UTC
Correct, the collection level actions should not be declaring PATCH and DELETE as those are resource centric. I will work on the PR for this.

Comment 5 abellott 2019-09-30 19:21:18 UTC
PR Merged: https://github.com/ManageIQ/manageiq-api/pull/678


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