Class: SolusVM::Node
Overview
SolusVM::Node is the class for working with nodes.
Constant Summary
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) available_ips(nodeid)
Retrieves a list of available IPs for a specific node.
-
- (Object) ids(type)
Lists existing nodes ids of a given type.
-
- (Object) list(type)
Lists existing nodes of a given type.
-
- (Object) list_groups
Lists existing node groups.
-
- (Object) statistics(nodeid)
Retrieves statistics from a specific node.
-
- (Object) virtualservers(nodeid)
Lists virtual servers from a specific node.
-
- (Object) xenresources(nodeid)
Retrieves available xen resources from a specific node.
Methods inherited from Base
#api_endpoint, #api_id, #api_key, #api_login, #api_options, #conn, #initialize, #log_messages, #parse_error, #parse_response, #parse_returned_params_as_list, #perform_request, #ssl_option, #statusmsg, #successful?, #validate_server_type
Constructor Details
This class inherits a constructor from SolusVM::Base
Instance Method Details
- (Object) available_ips(nodeid)
Retrieves a list of available IPs for a specific node.
63 64 65 66 67 68 69 70 |
# File 'lib/solusvm/node.rb', line 63 def available_ips(nodeid) perform_request(action: 'node-iplist', nodeid: nodeid) if statusmsg.match /no available ip/i [] else parse_returned_params_as_list('ips') end end |
- (Object) ids(type)
Lists existing nodes ids of a given type.
31 32 33 34 35 36 |
# File 'lib/solusvm/node.rb', line 31 def ids(type) validate_server_type(type) do perform_request(action: 'node-idlist', type: type) parse_returned_params_as_list('nodes') end end |
- (Object) list(type)
Lists existing nodes of a given type.
9 10 11 12 13 14 |
# File 'lib/solusvm/node.rb', line 9 def list(type) validate_server_type(type) do perform_request(action: 'listnodes', type: type) parse_returned_params_as_list('nodes') end end |
- (Object) list_groups
Lists existing node groups
19 20 21 22 23 24 |
# File 'lib/solusvm/node.rb', line 19 def list_groups perform_request(action: 'listnodegroups') # return list of node groups with numeric values excluded returned_parameters['nodegroups'].to_s.split(',').map {|group| group.split('|')[1]} end |
- (Object) statistics(nodeid)
Retrieves statistics from a specific node.
43 44 45 46 |
# File 'lib/solusvm/node.rb', line 43 def statistics(nodeid) perform_request(action: 'node-statistics', nodeid: nodeid) returned_parameters end |
- (Object) virtualservers(nodeid)
Lists virtual servers from a specific node.
77 78 79 80 |
# File 'lib/solusvm/node.rb', line 77 def virtualservers(nodeid) perform_request(action: "node-virtualservers", nodeid: nodeid) returned_parameters["virtualservers"] end |
- (Object) xenresources(nodeid)
Retrieves available xen resources from a specific node.
53 54 55 56 |
# File 'lib/solusvm/node.rb', line 53 def xenresources(nodeid) perform_request(action: 'node-xenresources', nodeid: nodeid) returned_parameters end |