Class: SolusVM::General

Inherits:
Base
  • Object
show all
Defined in:
lib/solusvm/general.rb

Overview

SolusVM::General is the class for retrieving general information.

Constant Summary

Constants inherited from Base

Base::VALID_SERVER_TYPES

Instance Attribute Summary

Attributes inherited from Base

#returned_parameters

Instance Method Summary collapse

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

#isos(type) ⇒ Object

Public: Lists available ISOS.

type - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm]

Returns an Array.


33
34
35
36
37
38
# File 'lib/solusvm/general.rb', line 33

def isos(type)
  validate_server_type(type) do
    perform_request(action: 'listiso', type: type)
    parse_returned_params_as_list('iso')
  end
end

#plans(type) ⇒ Object

Public: Lists available plans.

type - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm]

Returns an Array.


21
22
23
24
25
26
# File 'lib/solusvm/general.rb', line 21

def plans(type)
  validate_server_type(type) do
    perform_request(action: 'listplans', type: type)
    parse_returned_params_as_list('plans')
  end
end

#templates(type) ⇒ Object

Public: Lists available templates.

type - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm]

Returns an Array.


9
10
11
12
13
14
# File 'lib/solusvm/general.rb', line 9

def templates(type)
  validate_server_type(type) do
    perform_request(action: 'listtemplates', type: type)
    parse_returned_params_as_list('templates')
  end
end