splicer-dynect 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/splicer/dynect/client.rb +4 -2
- data/lib/splicer/dynect/provider.rb +6 -0
- data/lib/splicer/dynect/version.rb +1 -1
- data/splicer-dynect.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjE2OTY5ZTg1OGI3ODE2ZTAwNmRiN2RiYWQwMDNiNTM4MjYxZWQ5ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWI3YTVkMTk3MWIyYTkzYjcwOTQzNjRjMjNjYjhhOWZiNjkwZTk5Mg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGQ3MzlhNWQ1OGExZDI2ZmMxZDcyMmUzNDk5N2Q4NDJjZTEzNjNlNTMwNmU4
|
10
|
+
NGY5M2RmOGRlNzA2YmM1ZTY5Yjk1YTI3ODY3ZWM0NjA1MWM2ZjUyYTFiZjdi
|
11
|
+
ZGQ0MmNjMWY1Mzk2MmQxODUwM2QxMThkNmZmZWFmZjAxNjFjM2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGRiZDUxODdjYjMzNjNmMWU4NGJlZjhkZGY5MGFmNWYxZTMxYmVhNWE3ZWYz
|
14
|
+
N2Y5NmY0M2MzODE1OWNlMDU2NTU4NjhiZGQ3ZTUzMmI1YWUzNGY5MGMwMWZm
|
15
|
+
ZmM1ZTBmZWNjYTQ5YWVmYjMwYWZlMDk1OGYzYTg2ZDYwMWZiYmY=
|
@@ -90,7 +90,6 @@ module Splicer
|
|
90
90
|
# @return [Boolean] True if successful
|
91
91
|
def noop
|
92
92
|
return false unless logged_in?
|
93
|
-
|
94
93
|
put('Session')
|
95
94
|
true
|
96
95
|
end
|
@@ -118,8 +117,11 @@ module Splicer
|
|
118
117
|
# @raise [Splicer::Errors::RequestError] when the request fails
|
119
118
|
# @return [Hash]
|
120
119
|
def execute(args={})
|
121
|
-
|
120
|
+
response = RestClient::Request.execute(args)
|
121
|
+
Splicer.logger.debug "[SPLICER][DYNECT] method=#{args[:method]} url=#{args[:url]} response=#{response}"
|
122
|
+
JSON.parse(response)
|
122
123
|
rescue RestClient::Exception => error
|
124
|
+
Splicer.logger.error "[SPLICER][DYNECT] method=#{args[:method]} url=#{args[:url]} response=#{error.response} message=#{error.message}"
|
123
125
|
raise Splicer::Errors::RequestError.new(error)
|
124
126
|
end
|
125
127
|
|
@@ -11,6 +11,7 @@ module Splicer
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def create_zone(zone)
|
14
|
+
Splicer.logger.debug "[SPLICER][DYNECT] creating zone: #{zone.name}"
|
14
15
|
client.login
|
15
16
|
|
16
17
|
client.post "Zone/#{zone.name}", rname: "admin@#{zone.name}", ttl: zone.ttl
|
@@ -38,11 +39,13 @@ module Splicer
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def rewrite_zone(zone)
|
42
|
+
Splicer.logger.debug "[SPLICER][DYNECT] rewriting zone: #{zone.name}"
|
41
43
|
delete_zone(zone)
|
42
44
|
create_zone(zone)
|
43
45
|
end
|
44
46
|
|
45
47
|
def delete_zone(zone)
|
48
|
+
Splicer.logger.debug "[SPLICER][DYNECT] deleting zone: #{zone.name}"
|
46
49
|
client.login
|
47
50
|
get_zone(zone)
|
48
51
|
client.delete "Zone/#{zone.name}"
|
@@ -51,6 +54,7 @@ module Splicer
|
|
51
54
|
end
|
52
55
|
|
53
56
|
def delete_record_in_zone(record, zone)
|
57
|
+
Splicer.logger.debug "[SPLICER][DYNECT] deleting a record in zone: #{record.type} - #{zone.name}"
|
54
58
|
client.login
|
55
59
|
id = find_record_id(record, zone)
|
56
60
|
return false unless id
|
@@ -63,6 +67,7 @@ module Splicer
|
|
63
67
|
end
|
64
68
|
|
65
69
|
def update_record_in_zone(record, zone)
|
70
|
+
Splicer.logger.debug "[SPLICER][DYNECT] updating a record in zone: #{record.type} - #{zone.name}"
|
66
71
|
client.login
|
67
72
|
update_record(record, zone)
|
68
73
|
publish_zone(zone)
|
@@ -71,6 +76,7 @@ module Splicer
|
|
71
76
|
end
|
72
77
|
|
73
78
|
def create_record_in_zone(record, zone)
|
79
|
+
Splicer.logger.debug "[SPLICER][DYNECT] creating a record in zone: #{record.type} - #{zone.name}"
|
74
80
|
client.login
|
75
81
|
create_record(record, zone)
|
76
82
|
publish_zone(zone)
|
data/splicer-dynect.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency('splicer', '~> 1.
|
21
|
+
spec.add_dependency('splicer', '~> 1.2')
|
22
22
|
spec.add_dependency('rest-client')
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splicer-dynect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: splicer
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rest-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|