ec2_ultradns_updater 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile.lock +26 -25
- data/ec2_ultradns_updater.gemspec +3 -4
- data/lib/ec2_ultradns_updater/ultradns.rb +36 -30
- data/lib/ec2_ultradns_updater/version.rb +1 -1
- metadata +18 -18
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ec2_ultradns_updater (0.0.
|
5
|
-
aws-sdk
|
6
|
-
savon (=
|
7
|
-
wasabi (= 2.
|
4
|
+
ec2_ultradns_updater (0.0.7)
|
5
|
+
aws-sdk (~> 1.5.6)
|
6
|
+
savon (= 1.1.0)
|
7
|
+
wasabi (= 2.5.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
remote: http://gems.github.com/
|
12
12
|
specs:
|
13
|
-
akami (1.
|
13
|
+
akami (1.2.0)
|
14
14
|
gyoku (>= 0.4.0)
|
15
|
-
nokogiri (>= 1.
|
16
|
-
aws-sdk (1.5.
|
15
|
+
nokogiri (>= 1.4.0)
|
16
|
+
aws-sdk (1.5.6)
|
17
17
|
httparty (~> 0.7)
|
18
18
|
json (~> 1.4)
|
19
19
|
nokogiri (>= 1.4.4)
|
@@ -21,38 +21,39 @@ GEM
|
|
21
21
|
builder (3.0.0)
|
22
22
|
diff-lcs (1.1.3)
|
23
23
|
fakeweb (1.3.0)
|
24
|
-
gyoku (0.4.
|
24
|
+
gyoku (0.4.6)
|
25
25
|
builder (>= 2.1.2)
|
26
26
|
httparty (0.8.3)
|
27
27
|
multi_json (~> 1.0)
|
28
28
|
multi_xml
|
29
|
-
httpi (
|
29
|
+
httpi (1.1.1)
|
30
30
|
rack
|
31
31
|
json (1.7.3)
|
32
32
|
multi_json (1.3.6)
|
33
33
|
multi_xml (0.5.1)
|
34
|
-
nokogiri (1.5.
|
35
|
-
nori (1.1.
|
34
|
+
nokogiri (1.5.5)
|
35
|
+
nori (1.1.2)
|
36
36
|
rack (1.4.1)
|
37
37
|
rake (0.9.2.2)
|
38
|
-
rspec (2.
|
39
|
-
rspec-core (~> 2.
|
40
|
-
rspec-expectations (~> 2.
|
41
|
-
rspec-mocks (~> 2.
|
42
|
-
rspec-core (2.
|
43
|
-
rspec-expectations (2.
|
38
|
+
rspec (2.11.0)
|
39
|
+
rspec-core (~> 2.11.0)
|
40
|
+
rspec-expectations (~> 2.11.0)
|
41
|
+
rspec-mocks (~> 2.11.0)
|
42
|
+
rspec-core (2.11.0)
|
43
|
+
rspec-expectations (2.11.1)
|
44
44
|
diff-lcs (~> 1.1.3)
|
45
|
-
rspec-mocks (2.
|
46
|
-
savon (
|
47
|
-
akami (~> 1.0)
|
45
|
+
rspec-mocks (2.11.0)
|
46
|
+
savon (1.1.0)
|
47
|
+
akami (~> 1.2.0)
|
48
48
|
builder (>= 2.1.2)
|
49
|
-
gyoku (
|
50
|
-
httpi (~> 0
|
49
|
+
gyoku (~> 0.4.5)
|
50
|
+
httpi (~> 1.1.0)
|
51
51
|
nokogiri (>= 1.4.0)
|
52
|
-
nori (~> 1.1)
|
53
|
-
wasabi (~> 2.
|
52
|
+
nori (~> 1.1.0)
|
53
|
+
wasabi (~> 2.5.0)
|
54
54
|
uuidtools (2.1.2)
|
55
|
-
wasabi (2.
|
55
|
+
wasabi (2.5.0)
|
56
|
+
httpi (~> 1.0)
|
56
57
|
nokogiri (>= 1.4.0)
|
57
58
|
|
58
59
|
PLATFORMS
|
@@ -21,10 +21,9 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ["lib" ,"bin"]
|
22
22
|
|
23
23
|
|
24
|
-
s.add_runtime_dependency "aws-sdk"
|
25
|
-
|
26
|
-
s.add_runtime_dependency "
|
27
|
-
s.add_runtime_dependency "savon", "0.9.9" # http://savonrb.com/
|
24
|
+
s.add_runtime_dependency "aws-sdk", "~> 1.5.6"
|
25
|
+
s.add_runtime_dependency "wasabi", "2.5.0"
|
26
|
+
s.add_runtime_dependency "savon", "1.1.0" # http://savonrb.com/
|
28
27
|
|
29
28
|
s.add_development_dependency "rake"
|
30
29
|
s.add_development_dependency "rspec"
|
@@ -63,14 +63,14 @@ class Ec2UltraDNSUpdater::UltraDNS
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def network_status?
|
66
|
-
resp = client.request(:
|
66
|
+
resp = client.request(:get_neustar_network_status)
|
67
67
|
@logger.debug(resp)
|
68
68
|
log_error(resp)
|
69
69
|
resp.success?
|
70
70
|
end
|
71
71
|
|
72
72
|
def delete_record_by_guid(guid)
|
73
|
-
resp = client.request(:
|
73
|
+
resp = client.request(:delete_resource_record) {
|
74
74
|
soap.body do |xml|
|
75
75
|
xml.transactionID()
|
76
76
|
xml.guid(guid)
|
@@ -115,12 +115,12 @@ class Ec2UltraDNSUpdater::UltraDNS
|
|
115
115
|
|
116
116
|
guid = get_guid_by_label_and_type(label, type) || ''
|
117
117
|
|
118
|
-
change_method =
|
118
|
+
change_method = :create_resource_record
|
119
119
|
record_opts = {'Type' => type, 'DName' => fixed_label, 'TTL' => DEFAULT_TTL}
|
120
120
|
|
121
121
|
if guid != ''
|
122
122
|
@logger.info "Updating Record Mapping: #{fixed_label} => #{to_value}"
|
123
|
-
change_method =
|
123
|
+
change_method = :update_resource_record # update it
|
124
124
|
record_opts['Guid'] = guid;
|
125
125
|
else
|
126
126
|
# make sure there isn't another record at this label of a different type
|
@@ -129,36 +129,41 @@ class Ec2UltraDNSUpdater::UltraDNS
|
|
129
129
|
record_opts['ZoneName'] = zone;
|
130
130
|
end
|
131
131
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
xml
|
139
|
-
|
140
|
-
xml.
|
141
|
-
|
142
|
-
|
143
|
-
|
132
|
+
begin
|
133
|
+
resp = client.request(change_method) {
|
134
|
+
ns = ''
|
135
|
+
soap.namespaces.each do |k, v|
|
136
|
+
ns = k.gsub(/xmlns:/,'') if v =~ /schema\.ultraservice\.neustar\.com/
|
137
|
+
end
|
138
|
+
soap.body do |xml|
|
139
|
+
xml.transactionID()
|
140
|
+
xml.resourceRecord(record_opts) {
|
141
|
+
xml.tag!("#{ns}:InfoValues", {"Info1Value" => to_value})
|
142
|
+
}
|
143
|
+
end
|
144
|
+
}
|
144
145
|
|
145
|
-
|
146
|
-
|
146
|
+
log_error(resp)
|
147
|
+
resp.success?
|
148
|
+
rescue
|
149
|
+
false
|
150
|
+
end
|
147
151
|
end
|
148
152
|
|
149
153
|
def get_guid_by_label_and_type(label, type)
|
150
154
|
zone = @zone
|
151
155
|
fixed_label = fix_zone_name(label)
|
152
|
-
|
153
|
-
guids_resp = client.request(:
|
156
|
+
|
157
|
+
guids_resp = client.request(:get_resource_record_guid_list) {
|
154
158
|
soap.body do |xml|
|
155
159
|
xml.resourceRecord({
|
156
160
|
"ZoneName" => zone, 'Type' => type, 'DName' => fixed_label
|
157
161
|
})
|
158
162
|
end
|
159
163
|
}
|
160
|
-
log_error(guids_resp)
|
161
164
|
|
165
|
+
log_error(guids_resp)
|
166
|
+
|
162
167
|
begin
|
163
168
|
guid = guids_resp[:get_resource_record_guid_list_response][:resource_record_guid_list][:guid]
|
164
169
|
@logger.debug("guid found: #{guid}")
|
@@ -173,16 +178,16 @@ class Ec2UltraDNSUpdater::UltraDNS
|
|
173
178
|
zone = @zone
|
174
179
|
fixed_label = fix_zone_name(label)
|
175
180
|
|
176
|
-
records_resp = client.request(:v01, 'getResourceRecordsOfDNameByType') {
|
177
|
-
soap.body do |xml|
|
178
|
-
xml.zoneName(zone)
|
179
|
-
xml.rrType(type)
|
180
|
-
xml.hostName(fixed_label)
|
181
|
-
end
|
182
|
-
}
|
183
|
-
log_error(records_resp)
|
184
|
-
|
185
181
|
begin
|
182
|
+
records_resp = client.request('getResourceRecordsOfDNameByType'.snakecase.to_sym) {
|
183
|
+
soap.body do |xml|
|
184
|
+
xml.zoneName(zone)
|
185
|
+
xml.rrType(type)
|
186
|
+
xml.hostName(fixed_label)
|
187
|
+
end
|
188
|
+
}
|
189
|
+
log_error(records_resp)
|
190
|
+
|
186
191
|
records_resp.to_hash[:get_resource_records_of_d_name_by_type_response][:resource_record_list]
|
187
192
|
rescue
|
188
193
|
@logger.debug("Resource Record list is empty")
|
@@ -198,6 +203,7 @@ class Ec2UltraDNSUpdater::UltraDNS
|
|
198
203
|
wsdl.document = ULTRADNS_WSDL_URL
|
199
204
|
wsse.credentials soap_username, soap_password
|
200
205
|
end
|
206
|
+
|
201
207
|
@client
|
202
208
|
end
|
203
209
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ec2_ultradns_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,44 +9,44 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|
16
|
-
requirement: &
|
16
|
+
requirement: &2160885900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 1.5.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2160885900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: wasabi
|
27
|
-
requirement: &
|
27
|
+
requirement: &2160885400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - =
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 2.
|
32
|
+
version: 2.5.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2160885400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: savon
|
38
|
-
requirement: &
|
38
|
+
requirement: &2160884940 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - =
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
43
|
+
version: 1.1.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2160884940
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &2160917060 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2160917060
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &2160916600 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2160916600
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fakeweb
|
71
|
-
requirement: &
|
71
|
+
requirement: &2160916180 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2160916180
|
80
80
|
description: Update your UltraDNS configured CNAMEs to point to EC2 instance public
|
81
81
|
hostnames
|
82
82
|
email:
|