Skip to content Skip to sidebar Skip to footer

Calling Cloud Stack With Parameters

i am trying to make an api call using the below code and it works fine import urllib2 import urllib import hashlib import hmac import base64 baseurl='http://www.xxxx.com:8080/cl

Solution 1:

Add additional parameters to the the request dictionary.

E.g. listUsers allows details of a specific username to be listed (listUsers API Reference). To do so, you'd update request creation as follows:

request={}
request['command']='listUsers'
request['username']='admin'
request['response']='xml'
request['apikey']='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Also the Rules for Signing say to "Lower case the entire Command String and sort it alphabetically via the field for each field-value pair" This section of the docs also covers adding an expiry to the URL.

Finally, you need to ensure the HTTP GET is not cached by network infrastructure by making each HTTP GET unique. The CloudStack API uses a cache buster. Alternatively, you can add an expiry to each query, or use an HTTP POST.


Post a Comment for "Calling Cloud Stack With Parameters"