ultrasoap 0.1.3 → 0.1.4
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/README.md +37 -0
- data/lib/client.rb +38 -0
- data/ultrasoap-ruby.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed32a6619b1910dbc065f7257df8c639384bd17f
|
4
|
+
data.tar.gz: 12b0c0f124c4b0fce8d11120b7761ac2473a31d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b13cb8085f5f3bade58dc72ec81c44fb64ab8cf4e9db20e3bc6b1330a055ce648dde1ac03ca22799ed451df9d88f08e163150d13f8746855ba7eaa31aa31896
|
7
|
+
data.tar.gz: 66713ff76083bd02077665c09bc10dc55702b73434a792a10a0373dee529d1d35ce16a8f472d7556bb16b66c34464930c793483ff36fd5846dc3d6a9f95786a2
|
data/README.md
CHANGED
@@ -114,6 +114,8 @@ These functions require less writing and can be used without having to pre-form
|
|
114
114
|
|
115
115
|
All functions return a Nokogiri::Nodeset, just like send_request.
|
116
116
|
|
117
|
+
For a detailed description on response formats, take a look at the NUS API XML SOAP API guide by Neustar.
|
118
|
+
|
117
119
|
The current version supports the following functions:
|
118
120
|
|
119
121
|
```ruby
|
@@ -129,6 +131,41 @@ get_lb_pools(zone, pool_type='SB')
|
|
129
131
|
# - pool_id => the ID of the pool
|
130
132
|
get_pool_records(pool_id)
|
131
133
|
|
134
|
+
# Update data for a Pool Record
|
135
|
+
# Returns true if the update was successful, false otherwise
|
136
|
+
# Parameters:
|
137
|
+
# - pool_record_id
|
138
|
+
# - pool_record_ip
|
139
|
+
# - action:
|
140
|
+
# - "ForceActive-Test"
|
141
|
+
# - "ForceActive-NoTest"
|
142
|
+
# - "ForceFail-Test"
|
143
|
+
# - "ForceFail-NoTest"
|
144
|
+
# - "Normal"
|
145
|
+
# - priority
|
146
|
+
# - fail_over_delay
|
147
|
+
# - ttl
|
148
|
+
update_pool_record(pool_record_id, pool_record_ip, action="Normal", priority="1", fail_over_delay="0", ttl="60")
|
149
|
+
|
150
|
+
# Returns a list of probes for the given pool record
|
151
|
+
# Parameters:
|
152
|
+
# - poolRecordID
|
153
|
+
# - SortBy, possible values are:
|
154
|
+
# PROBEID
|
155
|
+
# PROBEDATA
|
156
|
+
# PROBEFAILSPECS
|
157
|
+
# ACTIVE
|
158
|
+
# POOLID
|
159
|
+
# AGENTFAILSPECS
|
160
|
+
# PROBEWEIGHT
|
161
|
+
# BLEID
|
162
|
+
get_probes_of_pool_record(pool_record_id, sort_by="PROBEDATA")
|
163
|
+
|
164
|
+
# Returns notifications for a pool
|
165
|
+
# Parameters:
|
166
|
+
# - poolID: string
|
167
|
+
get_notifications_of_pool(pool_id)
|
168
|
+
|
132
169
|
```
|
133
170
|
|
134
171
|
More functions are on the way (lookup functions and other stuff).
|
data/lib/client.rb
CHANGED
@@ -170,6 +170,44 @@ module UltraSOAP
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
173
|
+
# Update data for a Pool Record
|
174
|
+
# Returns true if the update was successful, false otherwise
|
175
|
+
# Parameters:
|
176
|
+
# - pool_record_id
|
177
|
+
# - pool_record_ip
|
178
|
+
# - action:
|
179
|
+
# - "ForceActive-Test"
|
180
|
+
# - "ForceActive-NoTest"
|
181
|
+
# - "ForceFail-Test"
|
182
|
+
# - "ForceFail-NoTest"
|
183
|
+
# - "Normal"
|
184
|
+
# - priority
|
185
|
+
# - fail_over_delay
|
186
|
+
# - ttl
|
187
|
+
def update_pool_record(pool_record_id, pool_record_ip, action="Normal", priority="1", fail_over_delay="0", ttl="60")
|
188
|
+
message = {
|
189
|
+
:transaction_ID => (@transaction_id.nil? ? "" : @transaction_id),
|
190
|
+
:pool_record_ID => pool_record_id,
|
191
|
+
:parent_pool_id => "",
|
192
|
+
:child_pool_id => "",
|
193
|
+
:points_to => pool_record_ip,
|
194
|
+
:priority => priority,
|
195
|
+
:fail_over_delay => fail_over_delay,
|
196
|
+
:ttl => ttl,
|
197
|
+
:weight => "", # Weight is only for Traffic Controller
|
198
|
+
:mode => action,
|
199
|
+
:threshold => "1"
|
200
|
+
}
|
201
|
+
|
202
|
+
begin
|
203
|
+
response = self.send_request :update_pool_record, message
|
204
|
+
result = Nokogiri::XML(pool_record_update.to_xml).remove_namespaces!.xpath("//result/text()").to_s
|
205
|
+
return (result == "Successful" ? true : false)
|
206
|
+
rescue Exception => e
|
207
|
+
@logger.error("Error while updating pool record ID #{pool_record_id}: #{e.message}")
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
173
211
|
# Returns a list of probes for the given pool record
|
174
212
|
# Parameters:
|
175
213
|
# - poolRecordID
|
data/ultrasoap-ruby.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'ultrasoap'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.4'
|
4
4
|
s.summary = "Simple Ruby client library for UltraDNS SOAP API"
|
5
5
|
s.description = "Connect to Neustar's UltraDNS SOAP API. FKA ultrasoap-ruby. Any feedback or contribution is appreciated."
|
6
6
|
s.authors = ["Gabriel Sambarino"]
|