Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 866934

Summary: API:Links given for the provider_accounts are not working while listing all provider_accounts via API
Product: [Retired] CloudForms Cloud Engine Reporter: pushpesh sharma <psharma>
Component: aeolus-conductorAssignee: Richard Su <rwsu>
Status: CLOSED WONTFIX QA Contact: Rehana <aeolus-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: bbandari, dajohnso, morazi
Target Milestone: beta6Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-19 18:08:48 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:
Attachments:
Description Flags
provider accounts links none

Description pushpesh sharma 2012-10-16 11:02:38 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:

[root@dhcp201-113 ~]# curl --user admin:password --header "Accept: application/xml" https://localhost/conductor/api/provider_accounts -k
<provider_accounts>
<provider_account href='https://localhost/conductor/api/provider_accounts/1' id='1'>
</provider_account>

<provider_account href='https://localhost/conductor/api/provider_accounts/2' id='2'>
</provider_account>

<provider_account href='https://localhost/conductor/api/provider_accounts/3' id='3'>
</provider_account>

<provider_account href='https://localhost/conductor/api/provider_accounts/4' id='4'>
</provider_account>

<provider_account href='https://localhost/conductor/api/provider_accounts/5' id='5'>
</provider_account>

Actual results:

The link that should be given while listing should be like:- 

<provider_account href='https://localhost/conductor/api/provider/1/provider_accounts/1' id='1'>
 

Expected results:
Links given for the providers while listing are working well.  

Additional info:

[root@dhcp201-113 ~]# rpm -qa|grep aeolus
aeolus-all-0.13.18-1.el6cf.noarch
aeolus-conductor-0.13.18-1.el6cf.noarch
rubygem-aeolus-cli-0.7.4-1.el6cf.noarch
aeolus-configure-2.8.9-1.el6cf.noarch
rubygem-aeolus-image-0.3.0-12.el6.noarch
aeolus-conductor-doc-0.13.18-1.el6cf.noarch
aeolus-conductor-daemons-0.13.18-1.el6cf.noarch

Comment 1 pushpesh sharma 2012-10-16 11:03:12 UTC
Created attachment 628105 [details]
provider accounts links

Comment 3 Richard Su 2012-10-17 23:17:58 UTC
The links listed by the API are correct for version 1.1. Currently https://localhost/conductor/api/provider/id/provider_accounts/id is not implemented, but http://localhost/conductor/api/provider_accounts/id is.

The resources are organized differently in the UI and is the reverse of the API. https://localhost/conductor/api/provider/id/provider_accounts/id is implemented, but http://localhost/conductor/api/provider_accounts/id is not.

If you're are viewing the API from the browser you'll need to indicate the Accept header should be "application/xml", otherwise you'll see the UI try to present an html response that doesn't exist.

From a browser, http://localhost/conductor/api/provider_accounts/id.xml would show the correct response from an API perspective.

This does point to an interesting issue, whether requests are under http://localhost/conductor/api should default to respond as xml. Something worth considering for the next release.

Comment 4 Richard Su 2012-10-18 17:07:28 UTC
Reverting status change.

Comment 5 Dave Johnson 2012-10-19 16:26:35 UTC
I believe this is a consistency issue, pushpesh, correct me if I am wrong here...

The problem is if I click on the any of the urls from the api responses like the following, I always get proper webpage but when the url is to a provider account, the screenshot error in comment 1 is displayed.

https://localhost/conductor/api/pool_families/10
https://localhost/conductor/api/pools/10
https://localhost/conductor/api/provider/10

Comment 6 Dave Johnson 2012-10-19 18:08:48 UTC
So after discussing with dev, the fact that the links are working comment 5 are purely coincedental and not necessary on purpose.  Closing this as won't fix, we can reopen if this proves to be a issue in the field.