Net::CloudStack - Bindings for the CloudStack API
Version 0.01005
use Net::CloudStack; my $api = Net::CloudStack->new( base_url => 'http://...', api_path => 'client/api?', api_key => '<your api key>', secret_key => '<your secret key>', xml_json => 'json', #response format.you can select json or xml. xml is default. send_request => 'yes', #yes or no. #When you select yes,you can get response. #If you don't want to get response(only generating url),please input no. ); # CloudStack API Methods $api->proc($cmd, $opt); $api->proc("listVirtualMachines"); $api->proc("listVirtualMachines","id=123"); $api->proc("deployVirtualMachine","serviceofferingid=1&templateid=1&zoneid=1"); # some IDs are depend on your environment. # Original Methods print $api->url; # print generated url print $api->response; # print API response
This module supports all CloudStack commands,basically you can use methods as following,
$api->some_command("parm1=$parm1&parm2=$parm2")
Please refer API Reference in following Developer's Guide:CloudStack.
http://docs.cloud.com/CloudStack_Documentation/Developer%27s_Guide%3A_CloudStack
Followings are some examples for API command,
$api->proc("listVirtualMachines") $api->proc("listVirtualMachines","id=$id")
$api->proc("deployVirtualMachine","serviceoffeingid=$serviceoffeingid&templateid=$templateid&zoneid=$zoneid")
$api->proc("startVirtualMachine","id=$id") $api->proc("stopVirtualMachine","id=$id")
Followings are some examples for original command,
$api->test()
This method prints each defined attributes(base_url,api_path,api_key,secret_key,send_request,xml_json).
$api->url()
This method prints generated URL that is send to CloudStack API.
$api->response()
This method prints response from CloudStack API.
Shugo Numano, <snumano at cpan.org>
<snumano at cpan.org>
@shugonumano
Please report any bugs or feature requests to bug-net-cloudstack at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-CloudStack. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-cloudstack at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::CloudStack
You can also look for information at:
Developer's Guide:CloudStack
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-CloudStack
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-CloudStack
CPAN Ratings
http://cpanratings.perl.org/d/Net-CloudStack
Search CPAN
http://search.cpan.org/dist/Net-CloudStack/
Copyright 2011 Shugo Numano.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Net::CloudStack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::CloudStack
CPAN shell
perl -MCPAN -e shell install Net::CloudStack
For more information on module installation, please visit the detailed CPAN module installation guide.