Ejemplo n.º 1
0
 def create_pull_zone(self):
     """
     We will use the NetDNA RWS Library
     https://developer.netdna.com/docs/sample-code/python/
     https://developer.netdna.com/api/docs#pcreatePullZone
     """
     api = NetDNA(self.rws_alias, self.rws_key, self.rws_secret)
     createZone = api.post(
         "/zones/pull.json",
         {
             "name": self.bucket_name[:10],
             "url": "http://%s.objects.dreamhost.com" % (self.bucket_name,),
             "compress": "1",
         },
     )
     self.cdn_url = createZone["data"]["pullzone"]["tmp_url"]
     print createZone