On Sep 13, 2012, at 1:55 PM, Rajesh Battala wrote: > > > -----Original Message----- > From: sebgoa [mailto:run...@gmail.com] > Sent: Thursday, September 13, 2012 4:34 PM > To: cloudstack-dev@incubator.apache.org > Subject: Re: need advice on awsapi docs > > > On Sep 12, 2012, at 10:26 PM, Prachi Damle wrote: > >> -----Original Message----- >> From: sebgoa [mailto:run...@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. > > [Rajesh Battala] > [Rajesh Battala] No need to download. When we install the build, this script > will be available under /usr/bin/cloudstack-aws-api-register
That is true, but users of the cloud will not install the *build*. The administrator of CloudStack will have the script but remote users will not. > > >> >> 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 > > > > -Sebastien Goasguen Cloud Computing Evangelist, Citrix EMEA