def upload_download_file_to_ceph(filename): s = IDigBioStorage() keyname, bucket = os.path.basename(filename), "idigbio-downloads" fkey = s.upload(s.get_key(keyname, bucket), filename, content_type='application/zip', public=True) return "http://s.idigbio.org/idigbio-downloads/" + fkey.name
def get_key_object(bucket, name): """Get a key object from Ceph for the requested object. Note that most of the metadata with the key won't be populated until after it has been fetched. """ global STORAGE_HOST storage = IDigBioStorage(host=STORAGE_HOST) logger.debug("Retreiving key for {0}:{1}".format(bucket, name)) key = storage.get_key(name, bucket) return key