

@_handle_container_not_found
def set_metadata(self, container, metadata, clear=False, prefix=None):
    "\n        Accepts a dictionary of metadata key/value pairs and updates the\n        specified container metadata with them.\n\n        If 'clear' is True, any existing metadata is deleted and only the\n        passed metadata is retained. Otherwise, the values passed here update\n        the container's metadata.\n\n        By default, the standard container metadata prefix\n        ('X-Container-Meta-') is prepended to the header name if it isn't\n        present. For non-standard headers, you must include a non-None prefix,\n        such as an empty string.\n        "
    if (prefix is None):
        prefix = CONTAINER_META_PREFIX
    massaged = _massage_metakeys(metadata, prefix)
    new_meta = {
        
    }
    if clear:
        curr_meta = self.api.get_container_metadata(container, prefix=prefix)
        for ckey in curr_meta:
            new_meta[ckey] = ''
    utils.case_insensitive_update(new_meta, massaged)
    name = utils.get_name(container)
    uri = ('/%s' % name)
    (resp, resp_body) = self.api.method_post(uri, headers=new_meta)
    return (200 <= resp.status_code <= 299)

dataset/ETHPy150Open rackspace/pyrax/pyrax/object_storage.py ContainerManager.set_metadata/original