Thnx Prasanna, James,

Using the url provided by James, I could invoke the API.

]# curl --user "admin:sigma123" 
"http://localhost:8080/client/api?command=listAccounts&keypair=bXFnKCix8VhhEGunkFbo0-PGixkjOhtb2gKA\&signature=eaddca273cba89aacf4d0472356516586e2b24f8";
Response:

<?xml version="1.0" encoding="UTF-8"?><listaccountsresponse 
cloud-stack-version="4.0.0.20121024012150"><errorcode>401</errorcode><errortext>unable
 to verify user credentials and/or request 
signature</errortext></listaccountsresponse>

The credentials were not correct.
How do you create the api key  and the signature, I dint quite understand the 
documentation for this, please guide.

@Prasanna : We cannot use cloudmonkey interface because we don't manually call 
the APIs. We have our own provisioning system, which makes a call to the REST 
APIs that the Cloudstack provides.

Thanks and Regards.

Asmita Patil Vagyani. 


-----Original Message-----
From: prasanna [mailto:srivatsav.prasa...@gmail.com] On Behalf Of Prasanna 
Santhanam
Sent: 15 January 2013 PM 04:33
To: cloudstack-users@incubator.apache.org
Subject: Re: Cloudstack API calls

On Tue, Jan 15, 2013 at 04:30:05PM +0530, Asmita Vagyani wrote:
> Hi all,
> 
> After installing management server I am trying to call a cloudstack 
> API -
> 
> #curl --user "admin:sigma123"
> "http://localhost:8080/client/api?command=listAccountskeypair=bXFnKCix8VhhEGunkFbz8gWgwHc3WB0Tg7m3nE7LujhYo0-PGixkjOhtb2gKA\&signature=eaddca273cba89aacf4d0472356516586e2b24f8";
> 
> <?xml version="1.0" encoding="UTF-8"?><errorresponse 
> cloud-stack-version="4.0.0.20121024012150"><errorcode>432</errorcode><
> errortext>The given command does not 
> exist</errortext></errorresponse>[root@torvm-cloudstack-mgmt ~]#
> 
> I am getting an error saying command doesnot exist.
> 
> I generated the signature using
> # echo -n "value" | openssl sha1 -hmac 
> "keypair=bXFnKCix8VhhEGunkFbzqniHwYjgVUFr7KrUbKIc_g_tH8gWgwHc3WB0Tg7m3nE7LujhYo0-PGixkjOhtb2gKA"
> 
Try cloudmonkey:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+cloudmonkey+CLI

It encapsulates what you are trying to do through an autcompleteing CLI.


--
Prasanna.,


Reply via email to