kloxo 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 351531770824c1362fa576907f4b3677b3e79597
4
- data.tar.gz: 320575e9651514f20f2ca6aa48f8dadfff3c7b33
3
+ metadata.gz: 3c097a4c8f10d7445cffaa00857c891027d4b1bb
4
+ data.tar.gz: dbc6c46b147b6c03693ec6b4d85c7efe755307f9
5
5
  SHA512:
6
- metadata.gz: 944a48d66caadb3288f8aaf76e13f8b23eff0490fa239fe74a67f90bac5be27946cf93202c1d02ed71425d030df2c9d57c52b24248c477dcd3a5f5bb7ed25483
7
- data.tar.gz: 600e6320e1b3e43e6e1217a4a14cb21a1ead8b56a46034268d90dd6a869fbb2cb463a9e2747c641f3ffebf25bd7f8553c9b1b91492661c2f8edf9ac6b670efba
6
+ metadata.gz: bf91af63b7f88a82a91fcd558a0dc5ea3574c3e556314265942f5e32267d5b22f518914f37818de827bdd155bf43626ce3850d288b58af4a03be175f7477cc35
7
+ data.tar.gz: c0e4144511c0dc18e6f3d3949cf0c09a88267ad2c86ba30140d9edb2de07e01dc179a40f39f6312a5cf1e391e6ec95453612c8ce1281664c52b58ffc73bfeaa2
@@ -8,6 +8,16 @@ module Kloxo
8
8
  require "kloxo/api/resource"
9
9
  require "kloxo/api/resource_response"
10
10
 
11
+ require "kloxo/api/client/add_domain"
12
+ require "kloxo/api/client/add_domain_response"
13
+ require "kloxo/api/client/change_plan"
14
+ require "kloxo/api/client/change_plan_response"
15
+ require "kloxo/api/client/change_password"
16
+ require "kloxo/api/client/change_password_response"
17
+ require "kloxo/api/client/add_bandwidth"
18
+ require "kloxo/api/client/add_bandwidth_response"
19
+ require "kloxo/api/client/delete_domain"
20
+ require "kloxo/api/client/delete_domain_response"
11
21
  require "kloxo/api/client/create"
12
22
  require "kloxo/api/client/create_response"
13
23
  require "kloxo/api/client/delete"
@@ -0,0 +1,25 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class AddBandwidth < Kloxo::API::Request
5
+ attr_accessor :name, :new_limit
6
+
7
+ def initialize params = {}
8
+ self.name = params[:name]
9
+ self.new_limit = params[:new_limit]
10
+ end
11
+
12
+ def param
13
+ {
14
+ "action" => "update",
15
+ "class" => "client",
16
+ "name" => self.name,
17
+ "subaction" => "limit",
18
+ "v-priv-traffic_usage" => self.new_limit
19
+ }.to_param
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class AddBandwidthResponse < Kloxo::API::Response
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,32 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class AddDomain < Kloxo::API::Request
5
+ attr_accessor :parent_name, :domain, :dns_template
6
+
7
+ def initialize params = {}
8
+ self.parent_name = params[:parent_name]
9
+ self.domain = params[:domain]
10
+ self.dns_template = params[:dns_template]
11
+ end
12
+
13
+ def param
14
+ {
15
+ "action" => "add",
16
+ "parent-class" => "client",
17
+ "parent-name" => self.parent_name,
18
+ "class" => "domain",
19
+ "name" => self.domain,
20
+ "v-docroot" => self.domain,
21
+ "v-dnstemplate_name" => self.dns_template,
22
+ "priv_s_ssl_flag_aaa_checked" => "on",
23
+ "v-priv_s_awstats_flag_aaa_checked" => "on",
24
+ "v-priv_s_cgi_flag_aaa_checked" => "on",
25
+ "v-priv_s_php_flag_aaa_checked"=>"on"
26
+ }.to_param
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,9 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class AddDomainResponse < Kloxo::API::Response
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,25 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class ChangePassword < Kloxo::API::Request
5
+ attr_accessor :name, :new_password
6
+
7
+ def initialize params = {}
8
+ self.name = params[:name]
9
+ self.new_password = params[:new_password]
10
+ end
11
+
12
+ def param
13
+ {
14
+ "action" => "update",
15
+ "class" => "client",
16
+ "name" => self.name,
17
+ "subaction" => "password",
18
+ "v-password" => self.new_password
19
+ }.to_param
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class ChangePasswordResponse < Kloxo::API::Response
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,25 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class ChangePlan < Kloxo::API::Request
5
+ attr_accessor :name, :plan
6
+
7
+ def initialize params = {}
8
+ self.name = params[:name]
9
+ self.plan = params[:plan]
10
+ end
11
+
12
+ def param
13
+ {
14
+ "action" => "update",
15
+ "class" => "client",
16
+ "name" => self.name,
17
+ "subaction" => "change_plan",
18
+ "v-resourceplan_name" => self.plan
19
+ }.to_param
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class ChangePlanResponse < Kloxo::API::Response
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,25 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class DeleteDomain < Kloxo::API::Request
5
+ attr_accessor :parent_name, :domain
6
+
7
+ def initialize params = {}
8
+ self.parent_name = params[:parent_name]
9
+ self.domain = params[:domain]
10
+ end
11
+
12
+ def param
13
+ {
14
+ "action" => "delete",
15
+ "parent-class" => "client",
16
+ "parent-name" => self.parent_name,
17
+ "class" => "domain",
18
+ "name" => self.domain
19
+ }.to_param
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module Kloxo
2
+ module API
3
+ module Client
4
+ class DeleteDomainResponse < Kloxo::API::Response
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -13,7 +13,7 @@ module Kloxo
13
13
  "action" => "update",
14
14
  "class" => "client",
15
15
  "name" => self.name,
16
- "subaction" => "disable",
16
+ "subaction" => "disable"
17
17
  }.to_param
18
18
  end
19
19
 
@@ -13,7 +13,7 @@ module Kloxo
13
13
  "action" => "update",
14
14
  "class" => "client",
15
15
  "name" => self.name,
16
- "subaction" => "enable",
16
+ "subaction" => "enable"
17
17
  }.to_param
18
18
  end
19
19
 
@@ -10,6 +10,8 @@ module Kloxo
10
10
  self.port = params[:port]
11
11
  self.username = params[:username]
12
12
  self.password = params[:password]
13
+
14
+ HTTParty::Basement.default_options.update(verify: false)
13
15
  end
14
16
 
15
17
  def query
@@ -28,6 +30,30 @@ module Kloxo
28
30
  Kloxo::API::Client::CreateResponse.new(response)
29
31
  end
30
32
 
33
+ def add_domain request
34
+ response = HTTParty.post (self.query + request.param)
35
+
36
+ Kloxo::API::Client::AddDomainResponse.new(response)
37
+ end
38
+
39
+ def add_bandwidth request
40
+ response = HTTParty.post (self.query + request.param)
41
+
42
+ Kloxo::API::Client::AddBandwidthResponse.new(response)
43
+ end
44
+
45
+ def change_plan request
46
+ response = HTTParty.post (self.query + request.param)
47
+
48
+ Kloxo::API::Client::ChangePlanResponse.new(response)
49
+ end
50
+
51
+ def delete_domain request
52
+ response = HTTParty.post (self.query + request.param)
53
+
54
+ Kloxo::API::Client::DeleteDomainResponse.new(response)
55
+ end
56
+
31
57
  def resource request
32
58
  response = HTTParty.post (self.query + request.param)
33
59
 
@@ -52,6 +78,12 @@ module Kloxo
52
78
  Kloxo::API::Client::DisableResponse.new(response)
53
79
  end
54
80
 
81
+ def change_password request
82
+ response = HTTParty.post (self.query + request.param)
83
+
84
+ Kloxo::API::Client::ChangePasswordResponse.new(response)
85
+ end
86
+
55
87
  end
56
88
  end
57
89
  end
@@ -1,3 +1,3 @@
1
1
  module Kloxo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kloxo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Abendan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,9 +97,19 @@ files:
97
97
  - bin/setup
98
98
  - kloxo.gemspec
99
99
  - lib/kloxo.rb
100
+ - lib/kloxo/api/client/add_bandwidth.rb
101
+ - lib/kloxo/api/client/add_bandwidth_response.rb
102
+ - lib/kloxo/api/client/add_domain.rb
103
+ - lib/kloxo/api/client/add_domain_response.rb
104
+ - lib/kloxo/api/client/change_password.rb
105
+ - lib/kloxo/api/client/change_password_response.rb
106
+ - lib/kloxo/api/client/change_plan.rb
107
+ - lib/kloxo/api/client/change_plan_response.rb
100
108
  - lib/kloxo/api/client/create.rb
101
109
  - lib/kloxo/api/client/create_response.rb
102
110
  - lib/kloxo/api/client/delete.rb
111
+ - lib/kloxo/api/client/delete_domain.rb
112
+ - lib/kloxo/api/client/delete_domain_response.rb
103
113
  - lib/kloxo/api/client/delete_response.rb
104
114
  - lib/kloxo/api/client/disable.rb
105
115
  - lib/kloxo/api/client/disable_response.rb