(self, uri, cnames_add = [], comment = None, logging = None, default_root_object = None)
| 357 | return response |
| 358 | |
| 359 | def CreateDistribution(self, uri, cnames_add = [], comment = None, logging = None, default_root_object = None): |
| 360 | dist_config = DistributionConfig() |
| 361 | dist_config.info['Enabled'] = True |
| 362 | dist_config.info['S3Origin']['DNSName'] = uri.host_name() |
| 363 | dist_config.info['CallerReference'] = str(uri) |
| 364 | dist_config.info['DefaultRootObject'] = default_root_object |
| 365 | if comment == None: |
| 366 | dist_config.info['Comment'] = uri.public_url() |
| 367 | else: |
| 368 | dist_config.info['Comment'] = comment |
| 369 | for cname in cnames_add: |
| 370 | if dist_config.info['CNAME'].count(cname) == 0: |
| 371 | dist_config.info['CNAME'].append(cname) |
| 372 | if logging: |
| 373 | dist_config.info['Logging'] = S3UriS3(logging) |
| 374 | request_body = str(dist_config) |
| 375 | debug("CreateDistribution(): request_body: %s" % request_body) |
| 376 | response = self.send_request("CreateDist", body = request_body) |
| 377 | response['distribution'] = Distribution(response['data']) |
| 378 | return response |
| 379 | |
| 380 | def ModifyDistribution(self, cfuri, cnames_add = [], cnames_remove = [], |
| 381 | comment = None, enabled = None, logging = None, |
no test coverage detected