def get_file(cloud_name, container_name, object_name): cloud_driver = CLOUD_INFO.get_by_name(cloud_name) get_driver = cloud_driver.driver obj = produce_obj(object_name, container_name, get_driver) return get_driver.download_object_as_stream(obj, chunk_size=65536)
def delete_file(cloud_name, container_name, object_name): cloud_driver = CLOUD_INFO.get_by_name(cloud_name) delete_driver = cloud_driver.driver obj = produce_obj(object_name, container_name, delete_driver) return delete_driver.delete_object(obj)
def put_file(cloud_name, container_name, object_name, file_iter): cloud_driver = CLOUD_INFO.get_by_name(cloud_name) put_driver = cloud_driver.driver container = Container(container_name, {}, put_driver) return put_driver.upload_object_via_stream(file_iter, container, object_name)