-----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.

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.
 
thoughts, 

-Sebastien

Reply via email to