Bug 866913 - API:Map a provider account,Show,delete a provider accounts associated with a pool family functionality is not working as described in wiki
API:Map a provider account,Show,delete a provider accounts associated with a...
Status: CLOSED WONTFIX
Product: CloudForms Cloud Engine
Classification: Red Hat
Component: aeolus-conductor (Show other bugs)
1.1.0
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Richard Su
Rehana
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-16 05:58 EDT by pushpesh sharma
Modified: 2014-08-04 18:31 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-17 19:58:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description pushpesh sharma 2012-10-16 05:58:54 EDT
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 15:38:24 EST
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 01:19:28 EST
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 01:21:13 EST
No output is received in last three request that is very strange.
Comment 5 Richard Su 2012-12-20 19:20:06 EST
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.

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