incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebgoa <run...@gmail.com>
Subject Re: need advice on awsapi docs
Date Thu, 13 Sep 2012 11:03:32 GMT

On Sep 12, 2012, at 10:26 PM, Prachi Damle wrote:

> -----Original Message-----
> From: sebgoa [mailto:runseb@gmail.com] 
> Sent: Wednesday, September 12, 2012 7:50 PM
> To: cloudstack
> Subject: need advice on awsapi docs
> 
> Hi,
> 
> I am working on the new EC2 documentation.
> The CloudPlatform doc that I am looking at, as well as other web pages mention the script:
cloudstack-aws-api-register
> 
> for instance:
> "Register the mapping from the X.509 certificate to the API/Secret keys. Download the
following script from http://download.cloud.com/releases.3.0.3/cloudstack-aws-api-register
and run it. Substitute the values you obtained from the administrator in the URL below."
> 
> It's a Python script. The interesting function from the file download on the web is:
> 
> def register(url, api_key, secret_key, cert):
>    # Register API keys
>    query = 'accesskey=' + api_key + '&secretkey=' + secret_key
>    get_url(url, api_key, secret_key, 'SetUserKeys', query)
> 
>    # Tie Certifcate to API keys
>    query = 'cert=' + urllib.quote_plus(cert)
>    get_url(url, api_key, secret_key, 'SetCertificate', query)
> 
> In the source it's at: awsapi-setup/setup/cloudstack-aws-api.register and the function
is:
> 
> def register(url, api_key, secret_key, cert):
>    # Register API keys
>    query = 'accesskey=' + api_key + '&secretkey=' + secret_key
>    result = get_url(url, api_key, secret_key, 'SetUserKeys', query)
> 
>    if result == True:
>            # Tie Certifcate to API keys
>            query = 'cert=' + urllib.quote_plus(cert)
>            get_url(url, api_key, secret_key, 'SetCertificate', query)
> 
> Currently, even if you only want to use the REST interface you will need to register
your cert.
> 
> So couple things that I need advice on:
> 
> 1-Do we make this script available on the web or in source ? If we choose the web (like
now), where should this script be (not on download.cloud.com I presume) ?
> 	we can't really expect users to download the source of CloudStack to get a single python
script.
> [Rajesh Battala] 
> This script will be available as a command when user installs the cloud. 
> 
>>> [Prachi] I think the script should be made available for download for users so
that they don't have to pull the source code. I am not sure what location we should use though.

I agree. You can get the script directly from git with:
wget --no-check-certificate -O aws-register.py "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=HEAD"

but that's kind of ugly.

> 
> 2-The register function calls, SetUserKeys and SetCertificate. Does the REST service
work if we do not set the certificate ?
> [Rajesh Battala]  the script will work even if the certificate file is empty. 
> 
>>> [Prachi] The register script is used for user registration for both SOAP and
REST.
> For REST, even if the cert is empty, it should not matter as REST API calls do not use
it anyways.

Ok, but right now the script requires to pass a cert even if an empty one. I can work on a
small patch to remove this requirement.

What would be nice is to be able to do the registration on the UI, just like we generate the
keys.

> 
> thoughts, 
> 
> -Sebastien

-Sebastien Goasguen
Cloud Computing Evangelist, Citrix EMEA





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message