dynect_rest 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/dynect_rest.rb +1 -0
- data/lib/dynect_rest/resource.rb +9 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/dynect_rest.rb
CHANGED
data/lib/dynect_rest/resource.rb
CHANGED
@@ -69,7 +69,14 @@ class DynectRest
|
|
69
69
|
record =~ /^#{resource_path(:full)}\/#{fqdn}\/(\d+)$/
|
70
70
|
raw_rr_list << self.get(fqdn, $1)
|
71
71
|
end
|
72
|
-
raw_rr_list.length
|
72
|
+
case raw_rr_list.length
|
73
|
+
when 0
|
74
|
+
raise DynectRest::Exceptions::RequestFailed, "Cannot find #{record_type} record for #{fqdn}"
|
75
|
+
when 1
|
76
|
+
raw_rr_list[0]
|
77
|
+
else
|
78
|
+
raw_rr_list
|
79
|
+
end
|
73
80
|
end
|
74
81
|
end
|
75
82
|
|
@@ -85,7 +92,7 @@ class DynectRest
|
|
85
92
|
|
86
93
|
def save(replace=false)
|
87
94
|
if record_id
|
88
|
-
@dynect.put("#{resource_path}/#{@fqdn}/#{
|
95
|
+
@dynect.put("#{resource_path}/#{@fqdn}/#{record_id}", self)
|
89
96
|
else
|
90
97
|
if replace == true || replace == :replace
|
91
98
|
@dynect.put("#{resource_path}/#{@fqdn}", self)
|