flexera-public / rightscale_cookbooks

Other
76 stars 103 forks source link

lb_clb using deprecated version 1.0 of the Rackspace API which no longer returns X-Server-Management-URL #156

Open johnshafer opened 10 years ago

johnshafer commented 10 years ago

While leveraging the cookbook: https://github.com/rightscale/rightscale_cookbooks/blob/master/cookbooks/lb_clb/

We found that the script portion of the cookbook failed upon making a request to https://auth.api.rackspacecloud.com/v1.0. This was determined to be because the X-Server-Management-URL is not returning the account id in the response. This was on a newly created Rackspace account.

The shell script responsible for making the calls is templates/default/clb_attach_exec.erb

After talking with Rackspace it was confirmed that the reason behind the new account lacking the X-Server-Management-URL header is because this account is relatively new and does not have access to create First Generation servers. We have confirmed that this does still function on old accounts

The version 1.0 of the API is deprecated and they are suggesting a move to version 2.0. Documentation follows:

Following is and example API call for both a new and a old account:

Old Account ( contains X-Server-Management-Url )

Request:

curl -D - -H "X-Auth-Key: XXXX-AUTHKEY-XXXX" -H "X-Auth-User: XXXX-AUTHUSER-XXXX" https://auth.api.rackspacecloud.com/v1.0

Response:

HTTP/1.1 204 No Content
Server: nginx/0.8.55
vary: Accept, Accept-Encoding, X-Auth-Token, X-Auth-Key, X-Storage-User, X-Storage-Pass, X-Auth-User
X-Storage-Url: https://storage101.dfw1.clouddrive.com/v1/XXXXXXX
Cache-Control: s-maxage=85833
X-Cloud-Auth: true
Date: Tue, 03 Dec 2013 15:43:56 GMT
Front-End-Https: on
X-Auth-Token: XXXXXX
X-Storage-Token: XXXXXX
X-Server-Management-Url: https://servers.api.rackspacecloud.com/v1.0/XXXXXXX
VIA: 1.0 Repose (Repose/2.3.5)
X-Global-Auth: true
Connection: keep-alive
X-CDN-Management-Url: https://cdn.clouddrive.com/v1/XXXXXXX

New Account ( missing X-Server-Management-Url )

Request:

curl -D - -H "X-Auth-Key: XXXX-AUTHKEY-XXXX" -H "X-Auth-User: XXXX-AUTHUSER-XXXX" https://auth.api.rackspacecloud.com/v1.0

Response:

HTTP/1.1 204 No Content
Server: nginx/0.8.55
vary: Accept, Accept-Encoding, X-Auth-Token, X-Auth-Key, X-Storage-User, X-Storage-Pass, X-Auth-User
X-Storage-Url: https://storage101.iad3.clouddrive.com/v1/XXXXXXX
Cache-Control: s-maxage=11565
X-Cloud-Auth: true
Date: Tue, 03 Dec 2013 15:43:23 GMT
Front-End-Https: on
X-Auth-Token: XXXXXX
X-Storage-Token: XXXXXX
VIA: 1.0 Repose (Repose/2.3.5)
X-Global-Auth: true
Connection: keep-alive
X-NewRelic-App-Data: XXXXXXX
X-CDN-Management-Url: https://cdn5.clouddrive.com/v1/XXXXXXX
ryanoleary commented 10 years ago

Hey John, can you please submit this as a bug through support.rightscale.com. That way we can make sure it gets the visibility required and that you are kept up to date on the progress.

Thanks.