Permalink
Browse files

purge

  • Loading branch information...
1 parent 0589d94 commit 224bfb60fab3095b9e55be7e9703b87a47b94b92 @dlitvakb dlitvakb committed Mar 7, 2013
Showing with 22 additions and 1 deletion.
  1. +21 −0 netdnarws/netdna.py
  2. +1 −1 setup.py
View
@@ -102,3 +102,24 @@ def patch(self, uri, data=dict(), **kwargs):
def delete(self, uri, **kwargs):
return self._response_as_json("delete", uri, **kwargs)
+
+ def purge(self, zone_id, file_or_files=None, **kwargs):
+ if isinstance(file_or_files, list):
+ responses = {}
+ for f in file_or_files:
+ responses[f] = self.delete(
+ '/zones/pull.json/%s/cache' % (zone_id,),
+ params={'file': f},
+ debug_json=True,
+ **kwargs
+ )
+ return responses
+
+ if file_or_files is not None:
+ return self.delete(
+ '/zones/pull.json/%s/cache' % (zone_id,),
+ params={'file': file_or_files},
+ **kwargs
+ )
+
+ return self.delete('/zones/pull.json/%s/cache' % (zone_id,), **kwargs)
View
@@ -4,7 +4,7 @@
setup(
name="netdnarws",
- version="0.2.3",
+ version="0.2.5",
description="A Python REST Client for NetDNA REST Web Services",
author="NetDNA Developer Team",
author_email = "devteam@netdna.com",

0 comments on commit 224bfb6

Please sign in to comment.