MCPcopy Create free account
hub / github.com/s3tools/s3cmd / SetDistConfig

Method SetDistConfig

S3/CloudFront.py:450–461  ·  view source on GitHub ↗
(self, cfuri, dist_config, etag = None)

Source from the content-addressed store, hash-verified

448 return response
449
450 def SetDistConfig(self, cfuri, dist_config, etag = None):
451 if etag == None:
452 debug("SetDistConfig(): Etag not set. Fetching it first.")
453 etag = self.GetDistConfig(cfuri)['headers']['etag']
454 debug("SetDistConfig(): Etag = %s" % etag)
455 request_body = str(dist_config)
456 debug("SetDistConfig(): request_body: %s" % request_body)
457 headers = SortedDict(ignore_case = True)
458 headers['if-match'] = etag
459 response = self.send_request("SetDistConfig", dist_id = cfuri.dist_id(),
460 body = request_body, headers = headers)
461 return response
462
463 def InvalidateObjects(self, uri, paths, default_index_file, invalidate_default_index_on_cf, invalidate_default_index_root_on_cf):
464 # joseprio: if the user doesn't want to invalidate the default index

Callers 2

ModifyDistributionMethod · 0.95
DeleteDistributionMethod · 0.95

Calls 4

GetDistConfigMethod · 0.95
send_requestMethod · 0.95
SortedDictClass · 0.90
dist_idMethod · 0.80

Tested by

no test coverage detected