Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User agent 2.1: Track S3Transfer usage #4441

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions boto3/s3/inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import copy as python_copy
from functools import partial

from botocore.context import with_current_context
from botocore.exceptions import ClientError
from botocore.useragent import register_feature_id

from boto3 import utils
from boto3.s3.transfer import (
Expand Down Expand Up @@ -104,6 +107,7 @@ def object_summary_load(self, *args, **kwargs):
self.meta.data = response


@with_current_context(partial(register_feature_id, 'S3_TRANSFER'))
def upload_file(
self, Filename, Bucket, Key, ExtraArgs=None, Callback=None, Config=None
):
Expand Down Expand Up @@ -151,6 +155,7 @@ def upload_file(
)


@with_current_context(partial(register_feature_id, 'S3_TRANSFER'))
def download_file(
self, Bucket, Key, Filename, ExtraArgs=None, Callback=None, Config=None
):
Expand Down Expand Up @@ -368,6 +373,7 @@ def object_download_file(
)


@with_current_context(partial(register_feature_id, 'S3_TRANSFER'))
def copy(
self,
CopySource,
Expand Down Expand Up @@ -579,6 +585,7 @@ def object_copy(
)


@with_current_context(partial(register_feature_id, 'S3_TRANSFER'))
def upload_fileobj(
self, Fileobj, Bucket, Key, ExtraArgs=None, Callback=None, Config=None
):
Expand Down Expand Up @@ -738,6 +745,7 @@ def object_upload_fileobj(
)


@with_current_context(partial(register_feature_id, 'S3_TRANSFER'))
def download_fileobj(
self, Bucket, Key, Fileobj, ExtraArgs=None, Callback=None, Config=None
):
Expand Down
Loading