Bug 1489486 - API hosts/X interfaces array info inconsistent return of interface flags
Summary: API hosts/X interfaces array info inconsistent return of interface flags
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API
Version: 6.2.11
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: 6.5.0
Assignee: Amit Karsale
QA Contact: Jameer Pathan
URL:
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2017-09-07 14:29 UTC by Peter Vreman
Modified: 2019-11-05 22:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:36:36 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:36:54 UTC
Foreman Issue Tracker 20940 None None None 2017-09-15 12:00:53 UTC

Description Peter Vreman 2017-09-07 14:29:59 UTC
Description of problem:
API host interfaces response is confusing, when querying it on hosts level the interfaces array returns the field "primary" and "provision", but not the other option fields.

The hosts/X/interfaces level returns all the fields as expected.

That the hosts/X interfaces array returns only 2 out of the 5 flag fields is confusing for the user why e.g. the "managed" field is not returned.

If the hosts/X interfaces array would not have returned any flags then it would be better because then as a user i would be triggered to use the hosts/X/interfaces API call instead


[crash/LI] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999999}" -XGET https://localhost:443/api/v2/hosts/23 | jq .interfaces
[
  {
    "id": 67,
    "name": "li-lc-1441.hag.hilti.com",
    "ip": "10.92.14.89",
    "mac": "00:50:56:97:44:75",
    "identifier": "ens192",
    "primary": true,
    "provision": true,
    "type": "interface"
  },
  {
    "id": 66,
    "name": "",
    "ip": "10.92.65.49",
    "mac": "00:50:56:97:00:80",
    "identifier": "ens224",
    "primary": false,
    "provision": false,
    "type": "interface"
  },
  {
    "id": 65,
    "name": "",
    "ip": null,
    "mac": "00:50:56:97:4b:9a",
    "identifier": "ens32",
    "primary": false,
    "provision": false,
    "type": "interface"
  }
]
[crash/LI] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999999}" -XGET https://localhost:443/api/v2/hosts/23/interfaces | jq .
{
  "total": 3,
  "subtotal": 3,
  "page": 1,
  "per_page": 9999999,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "subnet_id": 3,
      "subnet_name": "install6-crash",
      "domain_id": 1,
      "domain_name": "hag.hilti.com",
      "created_at": "2017-08-15 14:53:59 UTC",
      "updated_at": "2017-09-07 12:56:03 UTC",
      "managed": true,
      "identifier": "ens192",
      "id": 67,
      "name": "li-lc-1441.hag.hilti.com",
      "ip": "10.92.14.89",
      "mac": "00:50:56:97:44:75",
      "primary": true,
      "provision": true,
      "type": "interface",
      "virtual": false
    },
    {
      "subnet_id": null,
      "subnet_name": null,
      "domain_id": 1,
      "domain_name": "hag.hilti.com",
      "created_at": "2017-08-15 14:53:55 UTC",
      "updated_at": "2017-09-07 12:11:06 UTC",
      "managed": true,
      "identifier": "ens32",
      "id": 65,
      "name": "",
      "ip": null,
      "mac": "00:50:56:97:4b:9a",
      "primary": false,
      "provision": false,
      "type": "interface",
      "virtual": false
    },
    {
      "subnet_id": null,
      "subnet_name": null,
      "domain_id": null,
      "domain_name": null,
      "created_at": "2017-08-15 14:53:59 UTC",
      "updated_at": "2017-09-07 12:11:06 UTC",
      "managed": false,
      "identifier": "ens224",
      "id": 66,
      "name": "",
      "ip": "10.92.65.49",
      "mac": "00:50:56:97:00:80",
      "primary": false,
      "provision": false,
      "type": "interface",
      "virtual": false
    }
  ]
}

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


How reproducible:


Steps to Reproduce:
1. Query hosts/X look at interfaces array
2. 
3.

Actual results:
Interfaces array returned with only "primary" and "provision" flags.

Expected results:
Interfaces array returned with all or none of the flags.


Additional info:

Comment 1 Tomas Strachota 2017-09-15 12:00:51 UTC
Created redmine issue http://projects.theforeman.org/issues/20940 from this bug

Comment 4 Jameer Pathan 2018-11-15 09:53:17 UTC
verified:

@satellite 6.5.0 snap 3

steps:
1.Query hosts/X look at interfaces array

observation:
Interfaces array returned with all of the flags.

Comment 8 errata-xmlrpc 2019-05-14 12:36:36 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-2019:1222


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