solusvm 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -7,11 +7,6 @@ notifications:
7
7
  on_success: never
8
8
  on_failure: always
9
9
  rvm:
10
- - 1.8.7
11
10
  - 1.9.2
12
11
  - 1.9.3
13
- - ree
14
- - rbx-head
15
- - rbx-18mode
16
- - jruby-18mode
17
12
  - jruby-19mode
data/README.markdown CHANGED
@@ -15,8 +15,7 @@ Rubinius 2.0, and JRuby 1.6.2.
15
15
  Basic Examples
16
16
  --------------
17
17
 
18
- Solusvm.config('api_id', 'api_password', :url => 'http://www.example.com/api')
19
- server = Solusvm::Server.new
18
+ server = Solusvm::Server.new(api_key: 'key', api_id: 'id', url: 'url')
20
19
 
21
20
  # 200 is the id of the virtual server
22
21
  server.shutdown(200) # => true
@@ -152,6 +151,7 @@ Contributors
152
151
  * [Maran H.](http://github.com/maran)
153
152
  * [Joshua Priddle](http://github.com/itspriddle)
154
153
  * [Vince Stratful](http://github.com/Vincepbell)
154
+ * [Rubem Nakamura](http://github.com/rubemz)
155
155
 
156
156
  Note on Patches/Pull Requests
157
157
  -----------------------------
@@ -168,4 +168,4 @@ Note on Patches/Pull Requests
168
168
  Copyright
169
169
  ---------
170
170
 
171
- Copyright (c) 2010-2012 Site5.com. See LICENSE for details.
171
+ Copyright (c) 2010-2013 Site5.com. See LICENSE for details.
data/lib/solusvm.rb CHANGED
@@ -3,28 +3,6 @@ require 'rubygems'
3
3
  require 'xmlsimple'
4
4
  require 'faraday'
5
5
 
6
- module Solusvm
7
- class << self
8
- attr_accessor :api_endpoint, :api_id, :api_key, :api_options
9
-
10
- # Specifies the login and url for making requests
11
- #
12
- # example:
13
- #
14
- # Solusvm.config('id', 'key', :url => 'http://www.example.com/api', :logger => RAILS_LOGGER, :logger_method => :log_info)
15
- #
16
- # Options:
17
- # * <tt>:logger</tt> - Log object used for logging API responses
18
- # * <tt>:logger_method</tt> - The method that performs the logging on the Log object
19
- def config(api_id, api_key, options={})
20
- @api_id = api_id
21
- @api_key = api_key
22
- @api_endpoint = URI.parse(options.delete(:url))
23
- @api_options = options
24
- end
25
- end
26
- end
27
-
28
6
  require 'solusvm/hash'
29
7
  require 'solusvm/base'
30
8
  require 'solusvm/general'
data/lib/solusvm/base.rb CHANGED
@@ -5,6 +5,10 @@ module Solusvm
5
5
 
6
6
  attr_reader :returned_parameters
7
7
 
8
+ def initialize(config = {})
9
+ @config = config
10
+ end
11
+
8
12
  # Prepares and sends the API request to the URL specificed in Solusvm.config
9
13
  #
10
14
  # class MyClass < Base
@@ -20,9 +24,9 @@ module Solusvm
20
24
  # <tt>force_array</tt> - see parse_response
21
25
  def perform_request(options = {}, force_array = false)
22
26
  ca_path = File.join(File.dirname(__FILE__), "..", "cacert.pem")
23
- ssl = {:verify => true, :ca_file => File.expand_path(ca_path)}
27
+ ssl = {verify: true, ca_file: File.expand_path(ca_path)}
24
28
 
25
- response = Faraday.new(:url => api_endpoint, :ssl => ssl) do |c|
29
+ response = Faraday.new(url: api_endpoint, ssl: ssl) do |c|
26
30
  c.params = options.merge(api_login)
27
31
  c.adapter :net_http
28
32
  end.get
@@ -74,20 +78,45 @@ module Solusvm
74
78
  # my_class.create_server("example.com")
75
79
  # my_class.successful? # => true
76
80
  def successful?
77
- returned_parameters["status"] == "success"
81
+ returned_parameters["status"].nil? || returned_parameters["status"] == "success"
78
82
  end
79
83
 
80
- # URI parsed API URL
84
+ # Returns the API endpoint set in the instance configuration. Otherwise,
85
+ # it returns the default configuration.
86
+ #
87
+ # Returns a String
81
88
  def api_endpoint
82
- Solusvm.api_endpoint.dup
89
+ @config.fetch(:url)
90
+ end
91
+
92
+ # Returns the API id set in the instance configuration. Otherwise,
93
+ # it returns the default configuration.
94
+ #
95
+ # Returns a String
96
+ def api_id
97
+ @config.fetch(:api_id)
98
+ end
99
+
100
+ # Returns the API key set in the instance configuration. Otherwise,
101
+ # it returns the default configuration.
102
+ #
103
+ # Returns a String
104
+ def api_key
105
+ @config.fetch(:api_key)
106
+ end
107
+
108
+ def api_options(option)
109
+ if options = @config[:options]
110
+ options[option.to_sym]
111
+ end
83
112
  end
84
113
 
85
114
  def api_login
86
- {:id => Solusvm.api_id, :key => Solusvm.api_key}
115
+ {id: api_id, key: api_key}
87
116
  end
88
117
 
89
118
  def log_messages(options)
90
- logger, logger_method = Solusvm.api_options[:logger], Solusvm.api_options[:logger_method]
119
+ logger, logger_method = api_options(:logger), api_options(:logger_method)
91
120
 
92
121
  if logger && logger.respond_to?(logger_method)
93
122
  logger.send(logger_method, "[Start] => #{options[:action]}")
@@ -107,7 +136,7 @@ module Solusvm
107
136
  def validate_server_type(type, &block)
108
137
  type = type.strip
109
138
 
110
- if valid = VALID_SERVER_TYPES.include?(type)
139
+ if VALID_SERVER_TYPES.include?(type)
111
140
  yield
112
141
  else
113
142
  @returned_parameters = {
@@ -40,9 +40,9 @@ module Solusvm
40
40
  end
41
41
 
42
42
  # Default required options
43
- class_option :api_login, :type => :string, :desc => "API ID; Required.", :aliases => ["-I", "--api-login"]
44
- class_option :api_key, :type => :string, :desc => "API KEY; Required.", :aliases => ["-K", "--api-key"]
45
- class_option :api_url, :type => :string, :desc => "API URL; Required.", :aliases => ["-U", "--api-url"]
43
+ class_option :api_login, type: :string, desc: "API ID; Required.", aliases: ["-I", "--api-login"]
44
+ class_option :api_key, type: :string, desc: "API KEY; Required.", aliases: ["-K", "--api-key"]
45
+ class_option :api_url, type: :string, desc: "API URL; Required.", aliases: ["-U", "--api-url"]
46
46
 
47
47
  no_tasks do
48
48
  def api
@@ -63,16 +63,16 @@ module Solusvm
63
63
 
64
64
  protected
65
65
 
66
- def configure
67
- Solusvm.config(
68
- present_or_exit(:api_login, :id, "api_login required"),
69
- present_or_exit(:api_key, :key, "api_key required"),
70
- :url => present_or_exit(:api_url, :url, "api_url required")
71
- )
66
+ def api_params()
67
+ {
68
+ api_id: present_or_exit(:api_login, :id, "api_login required"),
69
+ api_key: present_or_exit(:api_key, :key, "api_key required"),
70
+ url: present_or_exit(:api_url, :url, "api_url required")
71
+ }
72
72
  end
73
73
 
74
74
  def present_or_exit(options_key, default_option_key, message)
75
75
  options[options_key] || BaseCli.default_option(default_option_key) || (say(message) && raise(SystemExit))
76
76
  end
77
77
  end
78
- end
78
+ end
@@ -2,12 +2,12 @@ module Solusvm
2
2
  class ClientCli < BaseCli
3
3
 
4
4
  desc "create", "Creates a new h"
5
- method_option :username, :type => :string, :desc => "Username", :aliases => ["-u", "--username"]
6
- method_option :password, :type => :string, :desc => "Password", :aliases => ["-p", "--password"]
7
- method_option :email, :type => :string, :desc => "Email", :aliases => ["-e", "--email"]
8
- method_option :firstname, :type => :string, :desc => "Firstname", :aliases => ["-f", "--firstname"]
9
- method_option :lastname, :type => :string, :desc => "Lastname", :aliases => ["-l", "--lastname"]
10
- method_option :company, :type => :string, :desc => "Company", :aliases => ["-c", "--company"]
5
+ method_option :username, type: :string, desc: "Username", aliases: ["-u", "--username"]
6
+ method_option :password, type: :string, desc: "Password", aliases: ["-p", "--password"]
7
+ method_option :email, type: :string, desc: "Email", aliases: ["-e", "--email"]
8
+ method_option :firstname, type: :string, desc: "Firstname", aliases: ["-f", "--firstname"]
9
+ method_option :lastname, type: :string, desc: "Lastname", aliases: ["-l", "--lastname"]
10
+ method_option :company, type: :string, desc: "Company", aliases: ["-c", "--company"]
11
11
  def create
12
12
  output api.create(options)
13
13
  end
@@ -41,9 +41,8 @@ module Solusvm
41
41
 
42
42
  def api
43
43
  @client ||= begin
44
- configure
45
- Solusvm::Client.new
44
+ Solusvm::Client.new(api_params())
46
45
  end
47
46
  end
48
47
  end
49
- end
48
+ end
@@ -20,9 +20,8 @@ module Solusvm
20
20
 
21
21
  def api
22
22
  @general ||= begin
23
- configure
24
- Solusvm::General.new
23
+ Solusvm::General.new(api_params)
25
24
  end
26
25
  end
27
26
  end
28
- end
27
+ end
@@ -35,9 +35,8 @@ module Solusvm
35
35
 
36
36
  def api
37
37
  @node ||= begin
38
- configure
39
- Solusvm::Node.new
38
+ Solusvm::Node.new(api_params)
40
39
  end
41
40
  end
42
41
  end
43
- end
42
+ end
@@ -2,46 +2,46 @@ module Solusvm
2
2
  class ResellerCli < BaseCli
3
3
 
4
4
  desc "create", "Creates a new reseller"
5
- method_option :username, :type => :string, :desc => "Username", :aliases => ["-u", "--username"]
6
- method_option :password, :type => :string, :desc => "Password", :aliases => ["-p", "--password"]
7
- method_option :email, :type => :string, :desc => "Email", :aliases => ["-e", "--email"]
8
- method_option :firstname, :type => :string, :desc => "Firstname", :aliases => ["-f", "--firstname"]
9
- method_option :lastname, :type => :string, :desc => "Lastname", :aliases => ["-l", "--lastname"]
10
- method_option :company, :type => :string, :desc => "Company", :aliases => ["-c", "--company"]
11
- method_option :usernameprefix, :type => :string, :desc => "Prefix for reseller client usernames (optional)", :aliases => ["-up", "--usernameprefix"]
12
- method_option :maxvps, :type => :string, :desc => "Maximum amount of virtual servers (optional)", :aliases => ["-mvps", "--maxvps"]
13
- method_option :maxusers, :type => :string, :desc => "Maximum amount of users (optional)", :aliases => ["-mu", "--maxusers"]
14
- method_option :maxmem, :type => :string, :desc => "Maximum amount of memory (optional)", :aliases => ["-mm", "--maxmem"]
15
- method_option :maxburst, :type => :string, :desc => "Maximum amount of burst memory or swapspace (optional)", :aliases => ["-mb", "--maxburst"]
16
- method_option :maxbw, :type => :string, :desc => "Maximum amount of bandwith (optional)", :aliases => ["-mb", "--maxbw"]
17
- method_option :maxdisk, :type => :string, :desc => "Maximum amount of disk (optional)", :aliases => ["-mb", "--maxdisk"]
18
- method_option :maxipv4, :type => :string, :desc => "Maximum amount of ipv4 addresses (optional)", :aliases => ["-mipv4", "--maxipv4"]
19
- method_option :maxipv6, :type => :string, :desc => "Maximum amount of ipv6 addresses (optional)", :aliases => ["-mipv6", "--maxipv6"]
20
- method_option :nodegroups, :type => :string, :desc => "Comma separated list of node groups (optional)", :aliases => ["-ng", "--nodegroups"]
21
- method_option :mediagroups, :type => :string, :desc => "Comma separated list of media groups (optional)", :aliases => ["-mg", "--mediagroups"]
22
- method_option :openvz, :type => :string, :desc => "y|n Allow building of openvz virtual servers (optional)", :aliases => ["-ovz", "--openvz"]
23
- method_option :xenpv, :type => :string, :desc => "y|n Allow building of xen pv virtual servers (optional)", :aliases => ["-xpv", "--xenpv"]
24
- method_option :xenhvm, :type => :string, :desc => "y|n Allow building of xen hvm virtual servers (optional)", :aliases => ["-xhvm", "--xenhvm"]
25
- method_option :kvm, :type => :string, :desc => "y|n Allow building of kvmvirtual servers (optional)", :aliases => ["-kvm"]
5
+ method_option :username, type: :string, desc: "Username", aliases: ["-u", "--username"]
6
+ method_option :password, type: :string, desc: "Password", aliases: ["-p", "--password"]
7
+ method_option :email, type: :string, desc: "Email", aliases: ["-e", "--email"]
8
+ method_option :firstname, type: :string, desc: "Firstname", aliases: ["-f", "--firstname"]
9
+ method_option :lastname, type: :string, desc: "Lastname", aliases: ["-l", "--lastname"]
10
+ method_option :company, type: :string, desc: "Company", aliases: ["-c", "--company"]
11
+ method_option :usernameprefix, type: :string, desc: "Prefix for reseller client usernames (optional)", aliases: ["-up", "--usernameprefix"]
12
+ method_option :maxvps, type: :string, desc: "Maximum amount of virtual servers (optional)", aliases: ["-mvps", "--maxvps"]
13
+ method_option :maxusers, type: :string, desc: "Maximum amount of users (optional)", aliases: ["-mu", "--maxusers"]
14
+ method_option :maxmem, type: :string, desc: "Maximum amount of memory (optional)", aliases: ["-mm", "--maxmem"]
15
+ method_option :maxburst, type: :string, desc: "Maximum amount of burst memory or swapspace (optional)", aliases: ["-mb", "--maxburst"]
16
+ method_option :maxbw, type: :string, desc: "Maximum amount of bandwith (optional)", aliases: ["-mb", "--maxbw"]
17
+ method_option :maxdisk, type: :string, desc: "Maximum amount of disk (optional)", aliases: ["-mb", "--maxdisk"]
18
+ method_option :maxipv4, type: :string, desc: "Maximum amount of ipv4 addresses (optional)", aliases: ["-mipv4", "--maxipv4"]
19
+ method_option :maxipv6, type: :string, desc: "Maximum amount of ipv6 addresses (optional)", aliases: ["-mipv6", "--maxipv6"]
20
+ method_option :nodegroups, type: :string, desc: "Comma separated list of node groups (optional)", aliases: ["-ng", "--nodegroups"]
21
+ method_option :mediagroups, type: :string, desc: "Comma separated list of media groups (optional)", aliases: ["-mg", "--mediagroups"]
22
+ method_option :openvz, type: :string, desc: "y|n Allow building of openvz virtual servers (optional)", aliases: ["-ovz", "--openvz"]
23
+ method_option :xenpv, type: :string, desc: "y|n Allow building of xen pv virtual servers (optional)", aliases: ["-xpv", "--xenpv"]
24
+ method_option :xenhvm, type: :string, desc: "y|n Allow building of xen hvm virtual servers (optional)", aliases: ["-xhvm", "--xenhvm"]
25
+ method_option :kvm, type: :string, desc: "y|n Allow building of kvmvirtual servers (optional)", aliases: ["-kvm"]
26
26
  def create
27
27
  output api.create(options)
28
28
  end
29
29
 
30
30
  desc "change", "Changes the available resources of a reseller"
31
- method_option :maxvps, :type => :string, :desc => "Maximum amount of virtual servers (optional)", :aliases => ["-mvps", "--maxvps"]
32
- method_option :maxusers, :type => :string, :desc => "Maximum amount of users (optional)", :aliases => ["-mu", "--maxusers"]
33
- method_option :maxmem, :type => :string, :desc => "Maximum amount of memory (optional)", :aliases => ["-mm", "--maxmem"]
34
- method_option :maxburst, :type => :string, :desc => "Maximum amount of burst memory or swapspace (optional)", :aliases => ["-mb", "--maxburst"]
35
- method_option :maxbw, :type => :string, :desc => "Maximum amount of bandwith (optional)", :aliases => ["-mb", "--maxbw"]
36
- method_option :maxdisk, :type => :string, :desc => "Maximum amount of disk (optional)", :aliases => ["-mb", "--maxdisk"]
37
- method_option :maxipv4, :type => :string, :desc => "Maximum amount of ipv4 addresses (optional)", :aliases => ["-mipv4", "--maxipv4"]
38
- method_option :maxipv6, :type => :string, :desc => "Maximum amount of ipv6 addresses (optional)", :aliases => ["-mipv6", "--maxipv6"]
39
- method_option :nodegroups, :type => :string, :desc => "Comma separated list of node groups (optional)", :aliases => ["-ng", "--nodegroups"]
40
- method_option :mediagroups, :type => :string, :desc => "Comma separated list of media groups (optional)", :aliases => ["-mg", "--mediagroups"]
41
- method_option :openvz, :type => :string, :desc => "y|n Allow building of openvz virtual servers (optional)", :aliases => ["-ovz", "--openvz"]
42
- method_option :xenpv, :type => :string, :desc => "y|n Allow building of xen pv virtual servers (optional)", :aliases => ["-xpv", "--xenpv"]
43
- method_option :xenhvm, :type => :string, :desc => "y|n Allow building of xen hvm virtual servers (optional)", :aliases => ["-xhvm", "--xenhvm"]
44
- method_option :kvm, :type => :string, :desc => "y|n Allow building of kvmvirtual servers (optional)", :aliases => ["-kvm"]
31
+ method_option :maxvps, type: :string, desc: "Maximum amount of virtual servers (optional)", aliases: ["-mvps", "--maxvps"]
32
+ method_option :maxusers, type: :string, desc: "Maximum amount of users (optional)", aliases: ["-mu", "--maxusers"]
33
+ method_option :maxmem, type: :string, desc: "Maximum amount of memory (optional)", aliases: ["-mm", "--maxmem"]
34
+ method_option :maxburst, type: :string, desc: "Maximum amount of burst memory or swapspace (optional)", aliases: ["-mb", "--maxburst"]
35
+ method_option :maxbw, type: :string, desc: "Maximum amount of bandwith (optional)", aliases: ["-mb", "--maxbw"]
36
+ method_option :maxdisk, type: :string, desc: "Maximum amount of disk (optional)", aliases: ["-mb", "--maxdisk"]
37
+ method_option :maxipv4, type: :string, desc: "Maximum amount of ipv4 addresses (optional)", aliases: ["-mipv4", "--maxipv4"]
38
+ method_option :maxipv6, type: :string, desc: "Maximum amount of ipv6 addresses (optional)", aliases: ["-mipv6", "--maxipv6"]
39
+ method_option :nodegroups, type: :string, desc: "Comma separated list of node groups (optional)", aliases: ["-ng", "--nodegroups"]
40
+ method_option :mediagroups, type: :string, desc: "Comma separated list of media groups (optional)", aliases: ["-mg", "--mediagroups"]
41
+ method_option :openvz, type: :string, desc: "y|n Allow building of openvz virtual servers (optional)", aliases: ["-ovz", "--openvz"]
42
+ method_option :xenpv, type: :string, desc: "y|n Allow building of xen pv virtual servers (optional)", aliases: ["-xpv", "--xenpv"]
43
+ method_option :xenhvm, type: :string, desc: "y|n Allow building of xen hvm virtual servers (optional)", aliases: ["-xhvm", "--xenhvm"]
44
+ method_option :kvm, type: :string, desc: "y|n Allow building of kvmvirtual servers (optional)", aliases: ["-kvm"]
45
45
  def change_resources
46
46
  output api.change_resources(options)
47
47
  end
@@ -65,9 +65,8 @@ module Solusvm
65
65
 
66
66
  def api
67
67
  @reseller ||= begin
68
- configure
69
- Solusvm::Reseller.new
68
+ Solusvm::Reseller.new(api_params)
70
69
  end
71
70
  end
72
71
  end
73
- end
72
+ end
@@ -102,9 +102,9 @@ module Solusvm
102
102
  end
103
103
 
104
104
  desc "rebuild VSERVERID", "Rebuilds a server"
105
- method_option :template, :type => :string, :desc => "VPS template to boot from", :aliases => ["-t", "--template"]
105
+ method_option :template, type: :string, desc: "VPS template to boot from", aliases: ["-t", "--template"]
106
106
  def rebuild(vserverid)
107
- output api.rebuild(vserverid, {:template => options[:template]})
107
+ output api.rebuild(vserverid, {template: options[:template]})
108
108
  end
109
109
 
110
110
  desc "tun-switcher VSERVERID SWITCH(on|off)", "Enable/Disable TUN/TAP"
@@ -133,16 +133,16 @@ module Solusvm
133
133
  end
134
134
 
135
135
  desc "create HOSTNAME PASSWORD", "Creates a new server"
136
- method_option :plan, :type => :string, :desc => "Plan to use", :aliases => ["-p", "--plan"]
137
- method_option :ips, :type => :string, :desc => "Number of ips to add to the vps", :aliases => ["-i", "--ips"]
138
- method_option :kind, :type => :string, :desc => "Type of VPS (#{Solusvm::Server::VALID_SERVER_TYPES.join(',')})", :aliases => ["-k", "--kind"]
139
- method_option :username, :type => :string, :desc => "The client to put the VPS under", :aliases => ["-u", "--username"]
140
- method_option :template, :type => :string, :desc => "VPS template to boot from", :aliases => ["-t", "--template"]
141
- method_option :node, :type => :string, :desc => "Node to provision on", :aliases => ["-n", "--node"]
136
+ method_option :plan, type: :string, desc: "Plan to use", aliases: ["-p", "--plan"]
137
+ method_option :ips, type: :string, desc: "Number of ips to add to the vps", aliases: ["-i", "--ips"]
138
+ method_option :kind, type: :string, desc: "Type of VPS (#{Solusvm::Server::VALID_SERVER_TYPES.join(',')})", aliases: ["-k", "--kind"]
139
+ method_option :username, type: :string, desc: "The client to put the VPS under", aliases: ["-u", "--username"]
140
+ method_option :template, type: :string, desc: "VPS template to boot from", aliases: ["-t", "--template"]
141
+ method_option :node, type: :string, desc: "Node to provision on", aliases: ["-n", "--node"]
142
142
  def create(hostname, password)
143
143
  output api.create(hostname, password, {
144
- :plan => options[:plan], :ips => options[:ips], :type => options[:kind],
145
- :username => options[:username], :template => options[:template], :node => options[:node]
144
+ plan: options[:plan], ips: options[:ips], type: options[:kind],
145
+ username: options[:username], template: options[:template], node: options[:node]
146
146
  })
147
147
  end
148
148
 
@@ -150,8 +150,7 @@ module Solusvm
150
150
 
151
151
  def api
152
152
  @server ||= begin
153
- configure
154
- Solusvm::Server.new
153
+ Solusvm::Server.new(api_params)
155
154
  end
156
155
  end
157
156
 
@@ -165,4 +164,4 @@ module Solusvm
165
164
  end
166
165
  end
167
166
  end
168
- end
167
+ end
@@ -12,32 +12,32 @@ module Solusvm
12
12
  # * <tt>:lastname</tt>
13
13
  # * <tt>:company</tt>
14
14
  def create(options ={})
15
- perform_request(options.merge(:action => 'client-create')) && returned_parameters
15
+ perform_request(options.merge(action: 'client-create')) && returned_parameters
16
16
  end
17
17
 
18
18
  # Change client password for the solus admin.
19
19
  def change_password(username, new_password)
20
- perform_request({:action => "client-updatepassword", :username => username, :password => new_password})
20
+ perform_request({action: "client-updatepassword", username: username, password: new_password})
21
21
  end
22
22
 
23
23
  # Checks wether a specific client exists.
24
24
  def exists?(username)
25
- perform_request({:action => 'client-checkexists', :username => username})
25
+ perform_request({action: 'client-checkexists', username: username})
26
26
  end
27
27
 
28
28
  # Verify a clients login. Returns true when the specified login is correct.
29
29
  def authenticate(username, password)
30
- perform_request({:action => 'client-authenticate', :username => username, :password => password})
30
+ perform_request({action: 'client-authenticate', username: username, password: password})
31
31
  end
32
32
 
33
33
  # Deletes an existing client.
34
34
  def delete(username)
35
- perform_request({:action => "client-delete", :username => username})
35
+ perform_request({action: "client-delete", username: username})
36
36
  end
37
37
 
38
38
  # Lists existing clients.
39
39
  def list
40
- perform_request({:action => "client-list"}, "client")
40
+ perform_request({action: "client-list"}, "client")
41
41
 
42
42
  if returned_parameters["clients"] && returned_parameters["clients"]["client"]
43
43
  returned_parameters["clients"]["client"]
@@ -9,7 +9,7 @@ module Solusvm
9
9
  # * +type+ - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm]
10
10
  def templates(type)
11
11
  validate_server_type(type) do
12
- perform_request(:action => 'listtemplates', :type => type)
12
+ perform_request(action: 'listtemplates', type: type)
13
13
  parse_returned_params_as_list('templates')
14
14
  end
15
15
  end
@@ -21,7 +21,7 @@ module Solusvm
21
21
  # * +type+ - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm]
22
22
  def plans(type)
23
23
  validate_server_type(type) do
24
- perform_request(:action => 'listplans', :type => type)
24
+ perform_request(action: 'listplans', type: type)
25
25
  parse_returned_params_as_list('plans')
26
26
  end
27
27
  end
@@ -33,7 +33,7 @@ module Solusvm
33
33
  # * +type+ - a valid virtualization type; e.g: [openvz|xen|xen hvm|kvm]
34
34
  def isos(type)
35
35
  validate_server_type(type) do
36
- perform_request(:action => 'listiso', :type => type)
36
+ perform_request(action: 'listiso', type: type)
37
37
  parse_returned_params_as_list('iso')
38
38
  end
39
39
  end