def setBucketProperties(self, name, prop): bucket_path = self._getBucketPath(name) path = os.path.join(bucket_path,"global.xml") myDict = {} myDict['Global'] = prop.getDict() xml = DictToXml(myDict) self._writeFile(path,xml.getXml())
def setObjectProperties(self, bucket_name, object_name, prop): object_path = self._getObjectPath(bucket_name,object_name) path = os.path.join(object_path,"object.xml") myDict = {} myDict['Global'] = prop.getDict() xml = DictToXml(myDict) self._writeFile(path,xml.getXml())
def setBucketLocation(self, name, location): bucket_path = self._getBucketPath(name) path = os.path.join(bucket_path,"location.xml") myDict = {} myDict['Location'] = location xml = DictToXml(myDict) self._writeFile(path,xml.getXml())
def setBucketWebsite(self, name , w): bucket_path = self._getBucketPath(name) path = os.path.join(bucket_path,"website.xml") myDict = {} myDict['WebsiteConfiguration'] = w.getDict() xml = DictToXml(myDict) self._writeFile(path,xml.getXml())
def setBucketVersioning(self, name , v): bucket_path = self._getBucketPath(name) path = os.path.join(bucket_path,"versioning.xml") myDict = {} myDict['VersioningConfiguration'] = v.getDict() xml = DictToXml(myDict) self._writeFile(path,xml.getXml())
def setBucketACP(self, name , acp): bucket_path = self._getBucketPath(name) path = os.path.join(bucket_path,"acp.xml") myDict = {} myDict['ACP'] = {} myDict['ACP']['Grant'] = [] for grant in acp.getGrantList(): myDict['ACP']['Grant'].append(grant.getDict()) xml = DictToXml(myDict) self._writeFile(path,xml.getXml())
def setBucketLogging(self, name , log, target, prefix): bucket_path = self._getBucketPath(name) path = os.path.join(bucket_path,"logging.xml") myDict = {} myDict['Logging'] = {} myDict['Logging']['TargetBucket'] = target myDict['Logging']['TargetPrefix'] = prefix myDict['Logging']['TargetGrants'] = {} for grant in log.getGrantList(): myDict['Logging']['TargetGrants']['Grant'].append(grant.getDict()) xml = DictToXml(myDict) self._writeFile(path,xml.getXml())