MCPcopy Create free account
hub / github.com/aws/aws-cli / _get_make_request_args_put_object

Method _get_make_request_args_put_object

awscli/s3transfer/crt.py:755–800  ·  view source on GitHub ↗
(
        self,
        request_type,
        call_args,
        coordinator,
        future,
        on_done_before_calls,
        on_done_after_calls,
    )

Source from the content-addressed store, hash-verified

753 return invoke_all_callbacks
754
755 def _get_make_request_args_put_object(
756 self,
757 request_type,
758 call_args,
759 coordinator,
760 future,
761 on_done_before_calls,
762 on_done_after_calls,
763 ):
764 send_filepath = None
765 if isinstance(call_args.fileobj, str):
766 send_filepath = call_args.fileobj
767 data_len = self._os_utils.get_file_size(send_filepath)
768 call_args.extra_args["ContentLength"] = data_len
769 else:
770 call_args.extra_args["Body"] = call_args.fileobj
771
772 checksum_config = None
773 if not any(
774 checksum_arg in call_args.extra_args
775 for checksum_arg in FULL_OBJECT_CHECKSUM_ARGS
776 ):
777 checksum_algorithm = call_args.extra_args.pop(
778 'ChecksumAlgorithm', 'CRC64NVME'
779 ).upper()
780 checksum_config = awscrt.s3.S3ChecksumConfig(
781 algorithm=awscrt.s3.S3ChecksumAlgorithm[checksum_algorithm],
782 location=awscrt.s3.S3ChecksumLocation.TRAILER,
783 )
784 # Suppress botocore's automatic MD5 calculation by setting an override
785 # value that will get deleted in the BotocoreCRTRequestSerializer.
786 # As part of the CRT S3 request, we request the CRT S3 client to
787 # automatically add trailing checksums to its uploads.
788 call_args.extra_args["ContentMD5"] = "override-to-be-removed"
789
790 make_request_args = self._default_get_make_request_args(
791 request_type=request_type,
792 call_args=call_args,
793 coordinator=coordinator,
794 future=future,
795 on_done_before_calls=on_done_before_calls,
796 on_done_after_calls=on_done_after_calls,
797 )
798 make_request_args['send_filepath'] = send_filepath
799 make_request_args['checksum_config'] = checksum_config
800 return make_request_args
801
802 def _get_make_request_args_get_object(
803 self,

Callers

nothing calls this directly

Calls 2

get_file_sizeMethod · 0.45

Tested by

no test coverage detected