s3_service_2.py 553 B

1234567891011121314151617
  1. def get_upload_url(self, expiration_time, object_name):
  2. """
  3. Get a presigned url to upload an object
  4. :param expiration_time:
  5. :param object_name:
  6. :return: url as string of the presigned url
  7. """
  8. try:
  9. key_prefix = str(uuid.uuid4())
  10. return self.__generate_pre_signed_url(
  11. expiration_time, object_name, key_prefix, "put_object"
  12. )
  13. except ClientError as client_error:
  14. logger.exception(
  15. NOT_AVAILABLE, client_error,
  16. )
  17. raise InternalServerError(NOT_AVAILABLE)