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 +4 -4
- data/lib/kloxo.rb +10 -0
- data/lib/kloxo/api/client/add_bandwidth.rb +25 -0
- data/lib/kloxo/api/client/add_bandwidth_response.rb +9 -0
- data/lib/kloxo/api/client/add_domain.rb +32 -0
- data/lib/kloxo/api/client/add_domain_response.rb +9 -0
- data/lib/kloxo/api/client/change_password.rb +25 -0
- data/lib/kloxo/api/client/change_password_response.rb +9 -0
- data/lib/kloxo/api/client/change_plan.rb +25 -0
- data/lib/kloxo/api/client/change_plan_response.rb +9 -0
- data/lib/kloxo/api/client/delete_domain.rb +25 -0
- data/lib/kloxo/api/client/delete_domain_response.rb +9 -0
- data/lib/kloxo/api/client/disable.rb +1 -1
- data/lib/kloxo/api/client/enable.rb +1 -1
- data/lib/kloxo/api/service.rb +32 -0
- data/lib/kloxo/version.rb +1 -1
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c097a4c8f10d7445cffaa00857c891027d4b1bb
|
4
|
+
data.tar.gz: dbc6c46b147b6c03693ec6b4d85c7efe755307f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf91af63b7f88a82a91fcd558a0dc5ea3574c3e556314265942f5e32267d5b22f518914f37818de827bdd155bf43626ce3850d288b58af4a03be175f7477cc35
|
7
|
+
data.tar.gz: c0e4144511c0dc18e6f3d3949cf0c09a88267ad2c86ba30140d9edb2de07e01dc179a40f39f6312a5cf1e391e6ec95453612c8ce1281664c52b58ffc73bfeaa2
|
data/lib/kloxo.rb
CHANGED
@@ -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,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,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,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,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
|
data/lib/kloxo/api/service.rb
CHANGED
@@ -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
|
data/lib/kloxo/version.rb
CHANGED
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.
|
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-
|
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
|