Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1489486

Summary: API hosts/X interfaces array info inconsistent return of interface flags
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: APIAssignee: Amit Karsale <akarsale>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.11CC: akarsale, jpathan, mhulan, nshaik, pcreech
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:36:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1122832    

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