dldinternet-opensrs 0.3.0
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 +7 -0
- data/Gemfile +30 -0
- data/Gemfile.lock +223 -0
- data/bin/opensrs +41 -0
- data/dldinternet-opensrs.gemspec +34 -0
- data/lib/dldinternet/opensrs/api/base.rb +41 -0
- data/lib/dldinternet/opensrs/api/domain/get.rb +25 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/get/all_info.rb +35 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/get/domaindns.rb +34 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/get/domainstatus.rb +33 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/get/getdomain.rb +68 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/modify/domainassign_ns.rb +32 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/modify/domainlockstate.rb +34 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/zone/getdnszone.rb +34 -0
- data/lib/dldinternet/opensrs/api/domain/mixins/zone/setdnszone.rb +35 -0
- data/lib/dldinternet/opensrs/api/domain/modify.rb +19 -0
- data/lib/dldinternet/opensrs/api/domain/zone.rb +19 -0
- data/lib/dldinternet/opensrs/api/domain.rb +3 -0
- data/lib/dldinternet/opensrs/api/mixins/cookie.rb +46 -0
- data/lib/dldinternet/opensrs/api/nameservers/get.rb +16 -0
- data/lib/dldinternet/opensrs/api/nameservers/mixins/get/getnameservers.rb +61 -0
- data/lib/dldinternet/opensrs/api/nameservers.rb +1 -0
- data/lib/dldinternet/opensrs/domain/command.rb +27 -0
- data/lib/dldinternet/opensrs/domain/get/command.rb +85 -0
- data/lib/dldinternet/opensrs/domain/get/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/opensrs/domain/mixins/no_commands.rb +12 -0
- data/lib/dldinternet/opensrs/domain/modify/command.rb +40 -0
- data/lib/dldinternet/opensrs/domain/modify/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/opensrs/domain/zone/command.rb +188 -0
- data/lib/dldinternet/opensrs/domain/zone/mixins/no_commands.rb +28 -0
- data/lib/dldinternet/opensrs/main.rb +26 -0
- data/lib/dldinternet/opensrs/mixins/no_commands.rb +10 -0
- data/lib/dldinternet/opensrs/nameservers/command.rb +37 -0
- data/lib/dldinternet/opensrs/nameservers/mixins/no_commands.rb +12 -0
- data/lib/dldinternet/opensrs/version.rb +6 -0
- data/lib/dldinternet/opensrs.rb +2 -0
- metadata +253 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 878aca21bb4d8788de0433465733f21bd5580d66
|
|
4
|
+
data.tar.gz: bf1ac2222e4b434a9222b793701c4758a5fa48f6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 77475a9a0d64cc4593deeee35241d20ad60430f898ddf0052927deccd6abbdc84f722f834180122a70dcfc24f7d135baa057b7132276b10c73eae1e8c194a0b2
|
|
7
|
+
data.tar.gz: 0e3efc872aabc7b347bf3d4c3545142eee32d06ad451963eb26e769b922cd13274e6a599e190144b04d0a5272a655c667641b2603e15e406ec4de97582fb4e83
|
data/Gemfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
source 'https://rubygems.org' do
|
|
2
|
+
|
|
3
|
+
gem 'roodi'
|
|
4
|
+
gem 'rubocop', require: false
|
|
5
|
+
gem 'rubocop-rspec', require: false
|
|
6
|
+
gem 'rubycritic', '>= 2.9.2', :require => false
|
|
7
|
+
gem 'flog', '>= 4.4.0', :require => false
|
|
8
|
+
|
|
9
|
+
group :development, :test, :integration do
|
|
10
|
+
gem 'heckle', :require => false
|
|
11
|
+
|
|
12
|
+
gem 'pry'
|
|
13
|
+
gem 'hoe'
|
|
14
|
+
|
|
15
|
+
gem 'rspec'
|
|
16
|
+
gem 'simplecov'
|
|
17
|
+
gem 'guard'
|
|
18
|
+
gem 'guard-rubocop'
|
|
19
|
+
|
|
20
|
+
gem 'builder'
|
|
21
|
+
gem 'bundler'
|
|
22
|
+
gem 'rake'
|
|
23
|
+
gem 'rubygems-tasks'
|
|
24
|
+
|
|
25
|
+
gem 'dldinternet-mixlib-thor', :path => '../../ws/gems-ws/dldinternet-mixlib-thor', :group => :development
|
|
26
|
+
gem 'dldinternet-mixlib-logging', :path => '../../ws/gems-ws/dldinternet-mixlib-logging', :group => :development
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
gemspec
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ../../ws/gems-ws/dldinternet-mixlib-logging
|
|
3
|
+
specs:
|
|
4
|
+
dldinternet-mixlib-logging (0.7.0)
|
|
5
|
+
logging (~> 2.1, >= 2.1.0)
|
|
6
|
+
|
|
7
|
+
PATH
|
|
8
|
+
remote: ../../ws/gems-ws/dldinternet-mixlib-thor
|
|
9
|
+
specs:
|
|
10
|
+
dldinternet-mixlib-thor (0.2.0)
|
|
11
|
+
awesome_print
|
|
12
|
+
command_line_reporter (~> 3.3, >= 3.3.6)
|
|
13
|
+
dldinternet-mixlib-logging (~> 0.5)
|
|
14
|
+
hashie
|
|
15
|
+
inifile
|
|
16
|
+
paint-shortcuts
|
|
17
|
+
thor (~> 0.19, >= 0)
|
|
18
|
+
|
|
19
|
+
PATH
|
|
20
|
+
remote: .
|
|
21
|
+
specs:
|
|
22
|
+
dldinternet-opensrs (0.3.0)
|
|
23
|
+
awesome_print (> 0)
|
|
24
|
+
command_line_reporter (~> 3.3, >= 3.3.6)
|
|
25
|
+
dldinternet-mixlib-logging (>= 0.7.0)
|
|
26
|
+
dldinternet-mixlib-thor (>= 0.2.0)
|
|
27
|
+
hashie
|
|
28
|
+
inifile (> 0)
|
|
29
|
+
nokogiri
|
|
30
|
+
opensrs (>= 0.3)
|
|
31
|
+
thor (>= 0.19.4)
|
|
32
|
+
|
|
33
|
+
GEM
|
|
34
|
+
remote: https://rubygems.org/
|
|
35
|
+
specs:
|
|
36
|
+
ParseTree (3.0.8)
|
|
37
|
+
RubyInline (>= 3.7.0)
|
|
38
|
+
sexp_processor (>= 3.0.0)
|
|
39
|
+
RubyInline (3.12.4)
|
|
40
|
+
ZenTest (~> 4.3)
|
|
41
|
+
ZenTest (4.11.1)
|
|
42
|
+
addressable (2.5.0)
|
|
43
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
|
44
|
+
ast (2.3.0)
|
|
45
|
+
awesome_print (1.7.0)
|
|
46
|
+
axiom-types (0.1.1)
|
|
47
|
+
descendants_tracker (~> 0.0.4)
|
|
48
|
+
ice_nine (~> 0.11.0)
|
|
49
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
50
|
+
builder (3.2.3)
|
|
51
|
+
codeclimate-engine-rb (0.4.0)
|
|
52
|
+
virtus (~> 1.0)
|
|
53
|
+
coderay (1.1.1)
|
|
54
|
+
coercible (1.0.0)
|
|
55
|
+
descendants_tracker (~> 0.0.1)
|
|
56
|
+
colored (1.2)
|
|
57
|
+
command_line_reporter (3.3.6)
|
|
58
|
+
colored (>= 1.2)
|
|
59
|
+
descendants_tracker (0.0.4)
|
|
60
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
61
|
+
diff-lcs (1.3)
|
|
62
|
+
docile (1.1.5)
|
|
63
|
+
equalizer (0.0.11)
|
|
64
|
+
erubis (2.7.0)
|
|
65
|
+
ffi (1.9.18)
|
|
66
|
+
flay (2.8.1)
|
|
67
|
+
erubis (~> 2.7.0)
|
|
68
|
+
path_expander (~> 1.0)
|
|
69
|
+
ruby_parser (~> 3.0)
|
|
70
|
+
sexp_processor (~> 4.0)
|
|
71
|
+
flog (4.6.1)
|
|
72
|
+
path_expander (~> 1.0)
|
|
73
|
+
ruby_parser (~> 3.1, > 3.1.0)
|
|
74
|
+
sexp_processor (~> 4.8)
|
|
75
|
+
formatador (0.2.5)
|
|
76
|
+
guard (2.14.1)
|
|
77
|
+
formatador (>= 0.2.4)
|
|
78
|
+
listen (>= 2.7, < 4.0)
|
|
79
|
+
lumberjack (~> 1.0)
|
|
80
|
+
nenv (~> 0.1)
|
|
81
|
+
notiffany (~> 0.0)
|
|
82
|
+
pry (>= 0.9.12)
|
|
83
|
+
shellany (~> 0.0)
|
|
84
|
+
thor (>= 0.18.1)
|
|
85
|
+
guard-rubocop (1.2.0)
|
|
86
|
+
guard (~> 2.0)
|
|
87
|
+
rubocop (~> 0.20)
|
|
88
|
+
hashie (3.5.5)
|
|
89
|
+
heckle (1.4.3)
|
|
90
|
+
ParseTree (>= 2.0.0)
|
|
91
|
+
ZenTest (>= 3.5.2)
|
|
92
|
+
hoe (>= 2.3.0)
|
|
93
|
+
ruby2ruby (>= 1.1.6)
|
|
94
|
+
hoe (3.16.0)
|
|
95
|
+
rake (>= 0.8, < 13.0)
|
|
96
|
+
ice_nine (0.11.2)
|
|
97
|
+
inifile (3.0.0)
|
|
98
|
+
json (2.0.3)
|
|
99
|
+
launchy (2.4.3)
|
|
100
|
+
addressable (~> 2.3)
|
|
101
|
+
listen (3.1.5)
|
|
102
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
103
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
|
104
|
+
ruby_dep (~> 1.2)
|
|
105
|
+
little-plugger (1.1.4)
|
|
106
|
+
logging (2.2.0)
|
|
107
|
+
little-plugger (~> 1.1)
|
|
108
|
+
multi_json (~> 1.10)
|
|
109
|
+
lumberjack (1.0.11)
|
|
110
|
+
method_source (0.8.2)
|
|
111
|
+
mini_portile2 (2.1.0)
|
|
112
|
+
multi_json (1.12.1)
|
|
113
|
+
nenv (0.3.0)
|
|
114
|
+
nokogiri (1.7.0.1)
|
|
115
|
+
mini_portile2 (~> 2.1.0)
|
|
116
|
+
notiffany (0.1.1)
|
|
117
|
+
nenv (~> 0.1)
|
|
118
|
+
shellany (~> 0.0)
|
|
119
|
+
opensrs (0.3.8)
|
|
120
|
+
paint (2.0.0)
|
|
121
|
+
paint-shortcuts (2.0.0)
|
|
122
|
+
paint (>= 1.0, < 3.0)
|
|
123
|
+
parser (2.3.3.1)
|
|
124
|
+
ast (~> 2.2)
|
|
125
|
+
path_expander (1.0.1)
|
|
126
|
+
powerpack (0.1.1)
|
|
127
|
+
pry (0.10.4)
|
|
128
|
+
coderay (~> 1.1.0)
|
|
129
|
+
method_source (~> 0.8.1)
|
|
130
|
+
slop (~> 3.4)
|
|
131
|
+
public_suffix (2.0.5)
|
|
132
|
+
rainbow (2.2.1)
|
|
133
|
+
rake (12.0.0)
|
|
134
|
+
rb-fsevent (0.9.8)
|
|
135
|
+
rb-inotify (0.9.8)
|
|
136
|
+
ffi (>= 0.5.0)
|
|
137
|
+
reek (4.5.6)
|
|
138
|
+
codeclimate-engine-rb (~> 0.4.0)
|
|
139
|
+
parser (>= 2.3.1.2, < 2.5)
|
|
140
|
+
rainbow (~> 2.0)
|
|
141
|
+
roodi (5.0.0)
|
|
142
|
+
ruby_parser (~> 3.2, >= 3.2.2)
|
|
143
|
+
rspec (3.5.0)
|
|
144
|
+
rspec-core (~> 3.5.0)
|
|
145
|
+
rspec-expectations (~> 3.5.0)
|
|
146
|
+
rspec-mocks (~> 3.5.0)
|
|
147
|
+
rspec-core (3.5.4)
|
|
148
|
+
rspec-support (~> 3.5.0)
|
|
149
|
+
rspec-expectations (3.5.0)
|
|
150
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
151
|
+
rspec-support (~> 3.5.0)
|
|
152
|
+
rspec-mocks (3.5.0)
|
|
153
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
154
|
+
rspec-support (~> 3.5.0)
|
|
155
|
+
rspec-support (3.5.0)
|
|
156
|
+
rubocop (0.47.1)
|
|
157
|
+
parser (>= 2.3.3.1, < 3.0)
|
|
158
|
+
powerpack (~> 0.1)
|
|
159
|
+
rainbow (>= 1.99.1, < 3.0)
|
|
160
|
+
ruby-progressbar (~> 1.7)
|
|
161
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
162
|
+
rubocop-rspec (1.13.0)
|
|
163
|
+
rubocop (>= 0.42.0)
|
|
164
|
+
ruby-progressbar (1.8.1)
|
|
165
|
+
ruby2ruby (2.3.2)
|
|
166
|
+
ruby_parser (~> 3.1)
|
|
167
|
+
sexp_processor (~> 4.6)
|
|
168
|
+
ruby_dep (1.5.0)
|
|
169
|
+
ruby_parser (3.8.4)
|
|
170
|
+
sexp_processor (~> 4.1)
|
|
171
|
+
rubycritic (3.1.3)
|
|
172
|
+
flay (~> 2.8)
|
|
173
|
+
flog (~> 4.4)
|
|
174
|
+
launchy (= 2.4.3)
|
|
175
|
+
parser (= 2.3.3.1)
|
|
176
|
+
rainbow (~> 2.1)
|
|
177
|
+
reek (~> 4.4)
|
|
178
|
+
ruby_parser (~> 3.8)
|
|
179
|
+
virtus (~> 1.0)
|
|
180
|
+
rubygems-tasks (0.2.4)
|
|
181
|
+
sexp_processor (4.8.0)
|
|
182
|
+
shellany (0.0.1)
|
|
183
|
+
simplecov (0.14.0)
|
|
184
|
+
docile (~> 1.1.0)
|
|
185
|
+
json (>= 1.8, < 3)
|
|
186
|
+
simplecov-html (~> 0.10.0)
|
|
187
|
+
simplecov-html (0.10.0)
|
|
188
|
+
slop (3.6.0)
|
|
189
|
+
thor (0.19.4)
|
|
190
|
+
thread_safe (0.3.6)
|
|
191
|
+
unicode-display_width (1.1.3)
|
|
192
|
+
virtus (1.0.5)
|
|
193
|
+
axiom-types (~> 0.1)
|
|
194
|
+
coercible (~> 1.0)
|
|
195
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
|
196
|
+
equalizer (~> 0.0, >= 0.0.9)
|
|
197
|
+
|
|
198
|
+
PLATFORMS
|
|
199
|
+
ruby
|
|
200
|
+
|
|
201
|
+
DEPENDENCIES
|
|
202
|
+
builder!
|
|
203
|
+
bundler!
|
|
204
|
+
dldinternet-mixlib-logging!
|
|
205
|
+
dldinternet-mixlib-thor!
|
|
206
|
+
dldinternet-opensrs!
|
|
207
|
+
flog (>= 4.4.0)!
|
|
208
|
+
guard!
|
|
209
|
+
guard-rubocop!
|
|
210
|
+
heckle!
|
|
211
|
+
hoe!
|
|
212
|
+
pry!
|
|
213
|
+
rake!
|
|
214
|
+
roodi!
|
|
215
|
+
rspec!
|
|
216
|
+
rubocop!
|
|
217
|
+
rubocop-rspec!
|
|
218
|
+
rubycritic (>= 2.9.2)!
|
|
219
|
+
rubygems-tasks!
|
|
220
|
+
simplecov!
|
|
221
|
+
|
|
222
|
+
BUNDLED WITH
|
|
223
|
+
1.14.6
|
data/bin/opensrs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'rubygems'
|
|
4
|
+
|
|
5
|
+
path = File.dirname(__FILE__)
|
|
6
|
+
if File.exists?("#{path}/../.gitignore")
|
|
7
|
+
%w(dldinternet-mixlib-logging dldinternet-mixlib-thor).each do |mod|
|
|
8
|
+
add_path = File.expand_path(File.join(path, "../../../ws/gems-ws/#{mod}", "lib"))
|
|
9
|
+
$:.unshift(add_path)
|
|
10
|
+
end
|
|
11
|
+
else
|
|
12
|
+
# Borrowing from "whiches" gem ...
|
|
13
|
+
cmd = File.basename(__FILE__, '.rb')
|
|
14
|
+
exes = []
|
|
15
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
|
16
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |pth|
|
|
17
|
+
exts.each { |ext|
|
|
18
|
+
exe = File.join(pth, "#{cmd}#{ext}")
|
|
19
|
+
exes << exe if File.executable? exe
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
if exes.size > 0
|
|
23
|
+
path = File.dirname(exes[0])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
add_path = File.expand_path(File.join(path, "..", "lib"))
|
|
28
|
+
$:.unshift(add_path)
|
|
29
|
+
|
|
30
|
+
require 'dldinternet/opensrs/main'
|
|
31
|
+
|
|
32
|
+
# =====================================================================================================================
|
|
33
|
+
rc = DLDInternet::OpenSRS::Main.start(ARGV)
|
|
34
|
+
if rc.is_a?(Fixnum)
|
|
35
|
+
exit rc
|
|
36
|
+
elsif rc.is_a?(IO)
|
|
37
|
+
exit 0
|
|
38
|
+
else
|
|
39
|
+
puts rc.ai
|
|
40
|
+
exit 0
|
|
41
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
require File.expand_path('lib/dldinternet/opensrs/version', File.dirname(__FILE__))
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |gem|
|
|
6
|
+
gem.name = 'dldinternet-opensrs'
|
|
7
|
+
gem.version = DLDInternet::Opensrs::VERSION
|
|
8
|
+
gem.summary = %q{DLDInternet OpenSRS tools}
|
|
9
|
+
gem.description = %q{DLDInternet OpenSRS tools}
|
|
10
|
+
gem.license = 'Apachev2'
|
|
11
|
+
gem.authors = ['Christo De Lange']
|
|
12
|
+
gem.email = 'rubygems@dldinternet.com'
|
|
13
|
+
gem.homepage = 'https://rubygems.org/gems/dldi-opensrs'
|
|
14
|
+
|
|
15
|
+
gem.files = `git ls-files`.split($/)
|
|
16
|
+
gem.files = gem.files.select{|f| not f.match(%r'(spec|tests?|features?)/') and f.match(%r'(\.rb$|\.gemspec|bin/|Gemfile)') }
|
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
gem.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
gem.add_dependency 'hashie', '>= 0'
|
|
22
|
+
gem.add_dependency 'nokogiri', '>= 0'
|
|
23
|
+
gem.add_dependency 'opensrs', '>= 0.3'
|
|
24
|
+
gem.add_dependency 'thor', '>= 0.19.4'
|
|
25
|
+
gem.add_dependency 'awesome_print', '> 0'
|
|
26
|
+
gem.add_dependency 'inifile', '> 0'
|
|
27
|
+
gem.add_dependency 'dldinternet-mixlib-logging', '>= 0.7.0'
|
|
28
|
+
gem.add_dependency 'dldinternet-mixlib-thor', '>= 0.2.0'
|
|
29
|
+
gem.add_dependency 'command_line_reporter', '~> 3.3', '>= 3.3.6'
|
|
30
|
+
|
|
31
|
+
gem.add_development_dependency 'bundler', '~> 1.0'
|
|
32
|
+
gem.add_development_dependency 'rake', '~> 0.8'
|
|
33
|
+
gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
|
|
34
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'opensrs'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
class Base
|
|
7
|
+
attr_reader :options, :logger
|
|
8
|
+
|
|
9
|
+
def initialize(options, logger=nil)
|
|
10
|
+
@options = options
|
|
11
|
+
@logger = logger
|
|
12
|
+
::OpenSRS::Server.xml_processor = :nokogiri
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def server
|
|
16
|
+
@server ||= ::OpenSRS::Server.new(
|
|
17
|
+
:server => options[:server],
|
|
18
|
+
:username => options[:username],
|
|
19
|
+
:password => options[:password],
|
|
20
|
+
:key => options[:key ],
|
|
21
|
+
:logger => @logger
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
require 'dldinternet/opensrs/api/mixins/cookie'
|
|
26
|
+
include DLDInternet::OpenSRS::API::MixIns::Cookie
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def getResponse(data, key='attributes')
|
|
31
|
+
response = server.call(data)
|
|
32
|
+
# return nil unless response.success
|
|
33
|
+
resp_obj = response.response
|
|
34
|
+
return nil unless resp_obj
|
|
35
|
+
resp_obj[key] || resp_obj['response_text']
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'dldinternet/opensrs/api/base'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
class Get < DLDInternet::OpenSRS::API::Base
|
|
8
|
+
|
|
9
|
+
require 'dldinternet/opensrs/api/domain/mixins/get/getdomain'
|
|
10
|
+
include DLDInternet::OpenSRS::API::Domain::MixIns::Get::GetDomain
|
|
11
|
+
|
|
12
|
+
require 'dldinternet/opensrs/api/domain/mixins/get/domaindns'
|
|
13
|
+
include DLDInternet::OpenSRS::API::Domain::MixIns::Get::DomainDNS
|
|
14
|
+
|
|
15
|
+
require 'dldinternet/opensrs/api/domain/mixins/get/domainstatus'
|
|
16
|
+
include DLDInternet::OpenSRS::API::Domain::MixIns::Get::DomainStatus
|
|
17
|
+
|
|
18
|
+
require 'dldinternet/opensrs/api/domain/mixins/get/all_info'
|
|
19
|
+
include DLDInternet::OpenSRS::API::Domain::MixIns::Get::AllInfo
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Get
|
|
9
|
+
module AllInfo
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def GetAllInfo(domain,cookiep=nil)
|
|
13
|
+
|
|
14
|
+
data = {
|
|
15
|
+
object: 'DOMAIN',
|
|
16
|
+
action: 'GET',
|
|
17
|
+
# cookie: (cookiep || cookie),
|
|
18
|
+
attributes: {
|
|
19
|
+
type: 'all_info',
|
|
20
|
+
domain: domain,
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
data[:cookie] = cookiep if cookiep
|
|
24
|
+
|
|
25
|
+
getResponse(data)
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Get
|
|
9
|
+
module DomainDNS
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def GetDomainNameservers(domain,cookiep=nil,registrant_ip=nil)
|
|
13
|
+
|
|
14
|
+
data = {
|
|
15
|
+
object: 'DOMAIN',
|
|
16
|
+
action: 'GET',
|
|
17
|
+
attributes: {
|
|
18
|
+
type: 'nameservers',
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
data[:cookie] = cookiep if cookiep
|
|
22
|
+
data[:domain] = domain
|
|
23
|
+
data[:registrant_ip] = registrant_ip if registrant_ip
|
|
24
|
+
|
|
25
|
+
getResponse(data)['nameserver_list']
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Get
|
|
9
|
+
module DomainStatus
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def GetDomainStatus(domain,cookiep=nil,registrant_ip=nil)
|
|
13
|
+
|
|
14
|
+
data = {
|
|
15
|
+
object: 'DOMAIN',
|
|
16
|
+
action: 'GET',
|
|
17
|
+
# cookie: (cookiep || cookie),
|
|
18
|
+
attributes: {
|
|
19
|
+
type: 'status',
|
|
20
|
+
domain: domain
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getResponse(data)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Get
|
|
9
|
+
module GetDomain
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def GetDomainListExt(cookiep=nil)
|
|
13
|
+
GetDomainList(cookiep, 'ext_results')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
17
|
+
def GetDomainList(cookiep=nil, attr='domain_list')
|
|
18
|
+
|
|
19
|
+
list = []
|
|
20
|
+
limit = 25
|
|
21
|
+
pn = 0
|
|
22
|
+
pgnos = nil
|
|
23
|
+
page = getdomainpage(nil, cookiep || cookie, nil, nil, limit)
|
|
24
|
+
while page
|
|
25
|
+
list += page[attr]
|
|
26
|
+
pgnos ||= page['count'].to_i/limit
|
|
27
|
+
if page['remainder'].eql?('1') && pn < pgnos
|
|
28
|
+
pn += 1
|
|
29
|
+
page = getdomainpage(nil, cookiep || cookie, nil, pn, limit)
|
|
30
|
+
else
|
|
31
|
+
page = nil
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
list
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
40
|
+
def getdomainpage(domain=nil,cookiep=nil,registrant_ip=nil, page=nil, limit=nil)
|
|
41
|
+
|
|
42
|
+
data = {
|
|
43
|
+
object: 'DOMAIN',
|
|
44
|
+
action: 'GET',
|
|
45
|
+
attributes: {
|
|
46
|
+
type: 'list',
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
data[:cookie] = cookiep if cookiep
|
|
50
|
+
data[:domain] = domain if domain
|
|
51
|
+
data[:registrant_ip] = registrant_ip if registrant_ip
|
|
52
|
+
data[:attributes][:limit] = limit if limit
|
|
53
|
+
data[:attributes][:page] = page if page
|
|
54
|
+
|
|
55
|
+
response = server.call(data)
|
|
56
|
+
return nil unless response.success
|
|
57
|
+
resp_obj = response.response
|
|
58
|
+
return nil unless resp_obj
|
|
59
|
+
resp_obj['attributes']
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Modify
|
|
9
|
+
module DomainAssignNS
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def AssignDomainNameServers(domain,nameservers, cookiep=nil)
|
|
13
|
+
|
|
14
|
+
data = {
|
|
15
|
+
object: 'domain',
|
|
16
|
+
action: 'advanced_update_nameservers',
|
|
17
|
+
cookie: (cookiep || cookie(domain)),
|
|
18
|
+
attributes: {
|
|
19
|
+
op_type: 'assign',
|
|
20
|
+
assign_ns: (nameservers.is_a?(Array) ? nameservers : nameservers.to_s.split(%r{\s*,\s*}))
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
getResponse(data, 'response_text')
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Modify
|
|
9
|
+
module DomainLockState
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def SetDomainLockState(domain,state=1)
|
|
13
|
+
|
|
14
|
+
data = {
|
|
15
|
+
object: 'DOMAIN',
|
|
16
|
+
action: 'MODIFY',
|
|
17
|
+
attributes: {
|
|
18
|
+
type: 'lock_state',
|
|
19
|
+
data: 'status',
|
|
20
|
+
domain: domain,
|
|
21
|
+
lock_state: state,
|
|
22
|
+
affect_domains: 0,
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
getResponse(data, 'response_text')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'hashie/mash'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module OpenSRS
|
|
5
|
+
module API
|
|
6
|
+
module Domain
|
|
7
|
+
module MixIns
|
|
8
|
+
module Zone
|
|
9
|
+
module GetDNSZone
|
|
10
|
+
|
|
11
|
+
# noinspection RubyUnnecessaryReturnValue
|
|
12
|
+
def GetDomainDNSZone(domain,cookiep=nil,registrant_ip=nil)
|
|
13
|
+
|
|
14
|
+
data = {
|
|
15
|
+
object: 'DOMAIN',
|
|
16
|
+
action: 'get_dns_zone',
|
|
17
|
+
attributes: {
|
|
18
|
+
domain: domain,
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
data[:cookie] = cookiep if cookiep
|
|
22
|
+
data[:domain] = domain
|
|
23
|
+
data[:registrant_ip] = registrant_ip if registrant_ip
|
|
24
|
+
|
|
25
|
+
getResponse(data)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|