Bug 866913

Summary: API:Map a provider account,Show,delete a provider accounts associated with a pool family functionality is not working as described in wiki
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: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-17 23:58:04 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:

Description pushpesh sharma 2012-10-16 09:58:54 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:

[root@dhcp201-113 ~]# curl -X POST --user admin:password --header "Content-Type: application/xml" --header "Accept: application/xml" -k  https://localhost:443/conductor/api/pool_families --data '<pool_family><name>family115name</name><quota> <maximum_running_instances>'100'</maximum_running_instances></quota></pool_family>'
<pool_family href='https://localhost/conductor/api/pool_families/25' id='25'>
<name>family115name</name>
<quota maximum_running_instances='100'></quota>
<pools>
</pools>
</pool_family>



Actual results:



[root@dhcp201-113 ~]#  curl -X GET --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  https://localhost:443/conductor/api/pool_families/25/provider_accounts/
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <h1>The page you were looking for doesn't exist.</h1>
    <p>You may have mistyped the address or the page may have moved.</p>
  </div>
</body>
</html>





[root@dhcp201-113 ~]#  curl -X PUT --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  https://localhost:443/conductor/api/pool_families/25/provider_accounts/1
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <h1>The page you were looking for doesn't exist.</h1>
    <p>You may have mistyped the address or the page may have moved.</p>
  </div>
</body>
</html>



[root@dhcp201-113 ~]#  curl -X DELETE --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  https://localhost:443/conductor/api/pool_families/1/provider_accounts/2
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <h1>The page you were looking for doesn't exist.</h1>
    <p>You may have mistyped the address or the page may have moved.</p>
  </div>
</body>
</html>


Expected results:


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 2 Dave Johnson 2012-12-12 20:38:24 UTC
Pushpesh, please retest this.  You original command is using embedded single quotes in a string that is single quoted.  That is definitely going to cause issues.

curl -X POST --user admin:password --header "Content-Type: application/xml" --header "Accept: application/xml" -k  https://localhost:443/conductor/api/pool_families --data '<pool_family><name>family115name</name><quota> <maximum_running_instances>'100'</maximum_running_instances></quota></pool_family>'

Comment 3 pushpesh sharma 2012-12-13 06:19:28 UTC
The bug reported for the 2nd request(and onwards) mentioned in the description i.e mapping of the provider account with pool family (not for the first one)

The wiki page has been updated and mapping provider account feature has been removed(with a comment:- mapping of provider accounts needs to be revised).Here is what I found in the history of wiki page :-


h2. Map a provider account to pool family

*Request*

Associate provider account with id = 2 with pool family with id = 1.

<pre>
curl -X PUT --user admin:password --header "Content-Type: application/xml" --header "Accept: application/xml" \
-k https://localhost/conductor/api/pool_families/1/provider_accounts/2
</pre>

*Response*

Returns status code 204 if successful.

h2. Show provider accounts associated with a pool family

*Request*

<pre>
curl -X PUT --user admin:password --header "Content-Type: application/xml" --header "Accept: application/xml" \
-k https://localhost/conductor/api/pool_families/1/provider_accounts
</pre>

*Response*

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

h2. Remove a provider account from pool family

Remove provider account with id = 2 from pool family with id = 1.

*Request*

<pre>
curl -X DELETE --user admin:password --header "Content-Type: application/xml" --header "Accept: application/xml" \
-k https://localhost/conductor/api/pool_families/1/provider_accounts/2
</pre>

*Response*

Returns status code of 204 if successful.


These feature were not working yet.I am also not sure if these feature will be inplemented or not. Here is what i got the test setup(aeolus2.0) this time:- 

[root@dhcp193-111 ~]# curl -X GET --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  http://localhost:3000/api/pool_families/2/provider_accounts
<provider_accounts>
</provider_accounts>
[root@dhcp193-111 ~]# curl -X GET --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  http://localhost:3000/api/pool_families/2/provider_accounts/1
<error>
  <code>RecordNotFound</code>
  <message>Couldn't find ProviderAccount with id=1</message>
</error>

After i added mock account from UI:-

[root@dhcp193-111 ~]# curl -X GET --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  http://localhost:3000/api/pool_families/1/provider_accounts/1
[root@dhcp193-111 ~]# curl -X GET --user admin:password --header "Content-Type: application/xml"  --header "Accept: application/xml" -k  http://localhost:3000/api/pool_families/2/provider_accounts/1
 [root@dhcp193-111 ~]# curl -X GET --user admin:password --header "Content-Type: application/xml"  --header "Acept: application/xml" -k  http://localhost:3000/api/pool_families/2/provider_accounts/
<provider_accounts>
</provider_accounts>


I am changing status to assign.Please clear the air on this issue.

Comment 4 pushpesh sharma 2012-12-13 06:21:13 UTC
No output is received in last three request that is very strange.

Comment 5 Richard Su 2012-12-21 00:20:06 UTC
Please hold off on further tests. We're planning to change the way provider accounts are mapped to be more REST-ful. There is an open issue for this at https://github.com/aeolusproject/conductor/issues/240.