Bug 1684196

Summary: Incorrect HREF in API for compliance result
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: APIAssignee: Nick LaMuro <nlamuro>
Status: CLOSED ERRATA QA Contact: Parthvi Vala <pvala>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.9.6CC: dmetzger, nlamuro, obarenbo, smallamp
Target Milestone: GAKeywords: ZStream
Target Release: 5.9.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.9.9.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1682739 Environment:
Last Closed: 2019-03-19 07:22:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1682739    
Bug Blocks:    

Comment 2 CFME Bot 2019-02-28 17:08:24 UTC
New commit detected on ManageIQ/manageiq-api/gaprindashvili:

https://github.com/ManageIQ/manageiq-api/commit/331431992575c0a2114659d7c24baf1b7385c175
commit 331431992575c0a2114659d7c24baf1b7385c175
Author:     Chris Arcand <chrisarcand.github.com>
AuthorDate: Tue Feb 13 10:05:42 2018 -0500
Commit:     Chris Arcand <chrisarcand.github.com>
CommitDate: Tue Feb 13 10:05:42 2018 -0500

    Merge pull request #319 from jntullo/no_href

    Do not return hrefs for objects without a collection

    (cherry picked from commit 8eb4223a0184ce9aaf9cf86efedd887b7c16f812)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1684196

 app/controllers/api/base_controller/renderer.rb | 2 +-
 spec/requests/service_templates_spec.rb | 12 +
 2 files changed, 13 insertions(+), 1 deletion(-)

Comment 4 Parthvi Vala 2019-03-06 10:52:46 UTC
FIXED. Verified on 5.9.9.1.20190304164243_28a581b.

Steps taken to verify the BZ:
1. Create a compliance policy, and create a policy profile and assign the newly created compliance policy to it.
2. Assign the new policy profile to a VM.
3. Query the VM.
GET /api/vms/:id?attributes=compliances

Response: {
  "href": "https://<ip_address>/api/vms/8",
  "id": "8",
  "vendor": "vmware",
  "name": "v2v-rhel8-mini",
    ...
  "compliances": [
    {
      "id": "1",
      "resource_id": "8",
      "resource_type": "VmOrTemplate",
      "compliant": true,
      "timestamp": "2019-03-06T09:48:55Z",
      "updated_on": "2019-03-06T09:48:55Z",
      "event_type": "vm_compliance_check"
    }
  ],
    ...
}

Comment 6 errata-xmlrpc 2019-03-19 07:22:13 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:0600