netdnarws 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -6
- data/VERSION +1 -1
- data/lib/netdnarws/version.rb +1 -1
- data/lib/netdnarws.rb +25 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -13,12 +13,18 @@ api.get("/account.json")
|
|
13
13
|
```
|
14
14
|
|
15
15
|
## Methods
|
16
|
-
It has support for GET
|
16
|
+
It has support for `GET`, `POST`, `PUT` and `DELETE` OAuth 1.0a signed requests.
|
17
17
|
|
18
|
-
Every request can take an optional debug parameter.
|
19
18
|
```ruby
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
#
|
19
|
+
# To create a new Pull Zone
|
20
|
+
api.post("/zones/pull.json", {'name' => 'test_zone', 'url' => 'http://my-test-site.com'})
|
21
|
+
|
22
|
+
# To update an existing zone
|
23
|
+
api.put("/zones/pull.json/1234", {'name' => 'i_didnt_like_test'})
|
24
|
+
|
25
|
+
# To delete a zone
|
26
|
+
api.delete("/zones/pull.json/1234")
|
27
|
+
|
28
|
+
# To purge a file (robots.txt) from cache
|
29
|
+
api.delete("/zones/pull.json/1234/cache", {"file" => "/robots.txt"})
|
24
30
|
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/lib/netdnarws/version.rb
CHANGED
data/lib/netdnarws.rb
CHANGED
@@ -100,5 +100,30 @@ module NetDNARWS
|
|
100
100
|
options[:body] = false
|
101
101
|
self._response_as_json 'delete', uri, options, data
|
102
102
|
end
|
103
|
+
|
104
|
+
def purge zone_id, file_or_files=nil
|
105
|
+
if file_or_files.respond_to? :each
|
106
|
+
responses = Hash.new
|
107
|
+
|
108
|
+
file_or_files.each { |e|
|
109
|
+
responses[e] = self.delete(
|
110
|
+
"/zones/pull.json/#{zone_id}/cache",
|
111
|
+
{'file' => e},
|
112
|
+
:debug_json => true
|
113
|
+
)
|
114
|
+
}
|
115
|
+
return responses
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
unless file_or_files.nil?
|
120
|
+
return self.delete(
|
121
|
+
"/zones/pull.json/#{zone_id}/cache",
|
122
|
+
{'file' => file_or_files}
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
self.delete("/zones/pull.json/#{zone_id}/cache")
|
127
|
+
end
|
103
128
|
end
|
104
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netdnarws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|