lib/solusvm/general.rb in solusvm-0.10.1 vs lib/solusvm/general.rb in solusvm-1.0.0.beta

- old
+ new

@@ -1,30 +1,38 @@ module Solusvm + # Solusvm::General is the class for retrieving general information. class General < Base - def nodes(type) - validate_server_type!(type) - perform_request(:action => 'listnodes', :type => type) - returned_parameters['nodes'].split(',') - end - + + # Lists available templates. + # + # Parameters: + # + # * +type+ - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm] def templates(type) validate_server_type!(type) perform_request(:action => 'listtemplates', :type => type) returned_parameters['templates'].split(',') end - def node_statistics(nodeid) - perform_request(:action => 'node-statistics', :nodeid => nodeid) - returned_parameters + # Lists available plans. + # + # Parameters: + # + # * +type+ - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm] + def plans(type) + validate_server_type!(type) + perform_request(:action => 'listplans', :type => type) + returned_parameters['plans'].split(',') end - # List a nodes available IPs - def node_available_ips(nodeid) - perform_request(:action => 'node-iplist', :nodeid => nodeid) - if statusmsg.match /no available ip/i - [] - else - returned_parameters['ips'].split(',') - end + # Lists available isos. + # + # Parameters: + # + # * +type+ - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm] + def isos(type) + validate_server_type!(type) + perform_request(:action => 'listiso', :type => type) + returned_parameters['iso'].split(',') end end end