cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giri Prasad <g_p...@yahoo.com.INVALID>
Subject API calls and keys
Date Wed, 03 Sep 2014 12:10:05 GMT
Hello,

 I am using a html/php script to read in userid, password and domain id from the user.  Using
CloudStackClient.php, I am able to call most of the api's, like list vm's, and the output
seems correct.

 And I want to use some API's via <a href ....>  like:

http://XXX.XXX.XXX.5:8080/client/api?command=startVirtualMachine&id=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
http://XXX.XXX.XXX.5:8080/client/api?command=stopVirtualMachine&id=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
http://XXX.XXX.XXX.5:8080/client/console?cmd=access&vm=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee

I need to add dynamically the apikey and signature:

&apiKey=miVr6X7u6bN_sdahOBpjNejPgEsT35eXqjB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ
&signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU%3D

since apikey and signature are required, are there, any api's, where I can dynamically, get
it from the CS infra, and use the return values, for building the apiKey and signature part
of the url. 


I need to get the apikey and signature dynamically, for a specific user (userid/passwd), and
then use it, for building the url.


Thanks & Regards,
Giri

Without apikeys and signature:
<startvirtualmachineresponse cloud-stack-version="4.1.1"><errorcode>401</errorcode><errortext>unable
to verify user credentials and/or request signature</errortext></startvirtualmachineresponse>

console?cmd=access
Access denied. Invalid web session or API key in request
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message