====== 01 cloudmonkey ====== CloudStackのAPIを簡単に叩けるツール [[https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+cloudmonkey+CLI|CloudStack cloudmonkey CLI]] ===== ①pip用意 ===== [[01_linux:12_ツール:02_pipのインストール|]] ==== CentOS 5の場合 ==== === Python用意 === ※Python 2.5以上が必要なので、CentOS 5の場合は、 [[01_linux:01_net:33_centos5にpython2.6インストール|]]で新しいPythonを用意 ===== ②インストール ===== # pip install cloudmonkey ==== CentOS 5などで証明書のエラーが出る場合 ==== こちらで対応 [[50_dialy:2014:01:29|]] # 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') ===== ③コマンド ===== ==== 設定ファイル用意 ==== === 1.一度コマンド実行 === 一度コマンドを打ってあげると、ホームディレクトリに「.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 === 2.コンフィグファイルを修正する === $ vi ~/.cloudmonkey/config [user] secretkey = apikey = [server] path = /client/api host = localhost protocol = http port = 8080 timeout = 3600 === 3.実行方法 === コマンド式と、対話式両方で実行できる == コマンド式 == $ cloudmonkey list virtualmachines == 対話式 == $ cloudmonkey ☁ Apache CloudStack  cloudmonkey 5.0.0. Type help or ? to list commands. > list virtualmachines