CloudStackのAPIを簡単に叩けるツール
※Python 2.5以上が必要なので、CentOS 5の場合は、
33 CentOS5にPython2.6インストールで新しいPythonを用意
# pip install cloudmonkey
こちらで対応 2014.01.29 CentOS5でGlobalSignのルート証明書が有効期限切れ
# easy_install pip Searching for pip Reading https://pypi.python.org/simple/pip/ Download error on https://pypi.python.org/simple/pip/: [Errno 1] _ssl.c:491: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed -- Some packages may not be found! Couldn't find index page for 'pip' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading https://pypi.python.org/simple/ Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:491: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed -- Some packages may not be found! No local packages or download links found for pip error: Could not find suitable distribution for Requirement.parse('pip')
一度コマンドを打ってあげると、ホームディレクトリに「.cloudmonkey」ディレクトリができる
$ cloudmonkey ☁ Apache CloudStack cloudmonkey 5.0.0. Type help or ? to list commands. > quit Bye! $ ll ~/.cloudmonkey/ total 12 -rw-rw-r-- 1 matsui matsui 354 Mar 26 10:30 config -rw------- 1 matsui matsui 5 Mar 26 10:32 history -rw-rw-r-- 1 matsui matsui 828 Mar 26 10:32 log
$ vi ~/.cloudmonkey/config [user] secretkey = apikey = [server] path = /client/api host = localhost protocol = http port = 8080 timeout = 3600
コマンド式と、対話式両方で実行できる
$ cloudmonkey list virtualmachines
$ cloudmonkey ☁ Apache CloudStack cloudmonkey 5.0.0. Type help or ? to list commands. > list virtualmachines