Delete an S3 object. :type bucket: str :param bucket: The name of the bucket. :type key: str :param key: The name of the S3 object to delete. :type extra_args: dict :param extra_args: Extra arguments that may be passed to the DeleteObjec
(self, bucket, key, extra_args=None, subscribers=None)
| 460 | return self._submit_transfer(call_args, CopySubmissionTask) |
| 461 | |
| 462 | def delete(self, bucket, key, extra_args=None, subscribers=None): |
| 463 | """Delete an S3 object. |
| 464 | |
| 465 | :type bucket: str |
| 466 | :param bucket: The name of the bucket. |
| 467 | |
| 468 | :type key: str |
| 469 | :param key: The name of the S3 object to delete. |
| 470 | |
| 471 | :type extra_args: dict |
| 472 | :param extra_args: Extra arguments that may be passed to the |
| 473 | DeleteObject call. |
| 474 | |
| 475 | :type subscribers: list |
| 476 | :param subscribers: A list of subscribers to be invoked during the |
| 477 | process of the transfer request. Note that the ``on_progress`` |
| 478 | callback is not invoked during object deletion. |
| 479 | |
| 480 | :rtype: s3transfer.futures.TransferFuture |
| 481 | :return: Transfer future representing the deletion. |
| 482 | |
| 483 | """ |
| 484 | if extra_args is None: |
| 485 | extra_args = {} |
| 486 | if subscribers is None: |
| 487 | subscribers = [] |
| 488 | self._validate_all_known_args(extra_args, self.ALLOWED_DELETE_ARGS) |
| 489 | self._validate_if_bucket_supported(bucket) |
| 490 | call_args = CallArgs( |
| 491 | bucket=bucket, |
| 492 | key=key, |
| 493 | extra_args=extra_args, |
| 494 | subscribers=subscribers, |
| 495 | ) |
| 496 | return self._submit_transfer(call_args, DeleteSubmissionTask) |
| 497 | |
| 498 | def _validate_if_bucket_supported(self, bucket): |
| 499 | # s3 high level operations don't support some resources |