Bug 1624424 - [RFE] searching on a specific host's hosts/<id>/interfaces should only return the matching interface
Summary: [RFE] searching on a specific host's hosts/<id>/interfaces should only return...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.3.2
Hardware: All
OS: Linux
high
low vote
Target Milestone: 6.7.0
Assignee: satellite6-bugs
QA Contact: tstrych
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-31 14:20 UTC by Dylan Gross
Modified: 2020-04-14 13:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:23:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 24798 Normal Closed searching on a specific host's hosts/<id>/interfaces should only return the matching interface 2020-04-14 15:31:24 UTC
Red Hat Product Errata RHSA-2020:1454 None None None 2020-04-14 13:23:37 UTC

Description Dylan Gross 2018-08-31 14:20:01 UTC
1. Proposed title of this feature request

   [RFE] searching on a specific host's hosts/<id>/interfaces should only return the matching interface

3. What is the nature and description of the request?

   When querying the interfaces of a specific host and providing a search parameter that should narrow down the search, the results still return all of the interfaces.

   This RFE is to have the api for /hosts/<id>/interfaces only return the matching interface when a matching ?search= is provided.


4. Why does the customer need this? (List the business requirements here)

   For automation purposes.  Now the api must be called, and then all of the results iterated and parsed to find the correct interface.   Whereas, if the search only returned what was searched, that iteration and parsing would be unncessary

5. How would the customer like to achieve this? (List the functional requirements here)

   Add the ability to search for a specific interface on a hosts/<id>/interfaces API call

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

   When a host has multiple interfaces defined, the search will only return the one(s) matching the query.

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

   No

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

   No

9. Is the sales team involved in this request and do they have any additional input?

   No

10. List any affected packages or components.

11. Would the customer be able to assist in testing this functionality if implemented?

   Yes

Comment 2 Ivan Necas 2018-09-04 10:37:12 UTC
Created redmine issue https://projects.theforeman.org/issues/24798 from this bug

Comment 3 Bryan Kearney 2019-02-18 11:01:45 UTC
Upstream bug assigned to akarsale@redhat.com

Comment 5 Bryan Kearney 2019-09-14 05:12:37 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24798 has been resolved.

Comment 6 tstrych 2019-11-18 20:16:56 UTC
Reproduced with this setup : two fake interfaces with mac address aa:bb:cc:dd:ee:ff and aa:bb:cc:dd:ee:85

curl -k -u <user>:<password> https://<hostname>/api/hosts/5/interfaces?search=mac~aa:bb:cc:dd:ee:ff

results for sat 6.7

output:
{
  "total": 3,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": "mac~aa:bb:cc:dd:ee:ff",
  "sort": {
    "by": null,
    "order": null
  },
  "results": # ommitted 
}

and here I am searching for mac~aa:bb:cc:dd:ee
curl -k -u <user>:<password> https://<hostname>/api/hosts/5/interfaces?search=mac~aa:bb:cc:dd:ee
{
  "total": 3,
  "subtotal": 2,
  "page": 1,
  "per_page": 20,
  "search": "mac~aa:bb:cc:dd:ee",
  "sort": {
    "by": null,
    "order": null
  },
  "results": # ommitted 
}

I was able to reproduce the problem on sat 6.6 snap 24 
same setup,

curl -k -u <user>:<password> https://<hostname>/api/hosts/5/interfaces?search=mac~aa:bb:cc:dd:ee:ff
{
  "total": 3,
  "subtotal": 3,
  "page": 1,
  "per_page": 20,
  "search": "mac~aa:bb:cc:dd:ee:ff",
  "sort": {
    "by": null,
    "order": null
  },
  "result": # ommitted
}

Verified.

Comment 9 errata-xmlrpc 2020-04-14 13:23:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454


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