Skip to content

Commit

Permalink
Merge branch 'release-1.35.32'
Browse files Browse the repository at this point in the history
* release-1.35.32:
  Bumping version to 1.35.32
  Add changelog entries from botocore
  S3 bucket names rename project (#4291)
  • Loading branch information
aws-sdk-python-automation committed Oct 2, 2024
2 parents aaa09a4 + d4e5f9e commit 81b3ed4
Show file tree
Hide file tree
Showing 23 changed files with 164 additions and 101 deletions.
47 changes: 47 additions & 0 deletions .changes/1.35.32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"category": "``appstream``",
"description": "[``botocore``] Added support for Automatic Time Zone Redirection on Amazon AppStream 2.0",
"type": "api-change"
},
{
"category": "``b2bi``",
"description": "[``botocore``] Added and updated APIs to support outbound EDI transformations",
"type": "api-change"
},
{
"category": "``bedrock-agent-runtime``",
"description": "[``botocore``] Added raw model response and usage metrics to PreProcessing and PostProcessing Trace",
"type": "api-change"
},
{
"category": "``bedrock-runtime``",
"description": "[``botocore``] Added new fields to Amazon Bedrock Guardrails trace",
"type": "api-change"
},
{
"category": "``iotdeviceadvisor``",
"description": "[``botocore``] Add clientToken attribute and implement idempotency for CreateSuiteDefinition.",
"type": "api-change"
},
{
"category": "``ivs-realtime``",
"description": "[``botocore``] Adds new Stage Health EventErrorCodes applicable to RTMP(S) broadcasts. Bug Fix: Enforces that EncoderConfiguration Video height and width must be even-number values.",
"type": "api-change"
},
{
"category": "``s3``",
"description": "[``botocore``] This release introduces a header representing the minimum object size limit for Lifecycle transitions.",
"type": "api-change"
},
{
"category": "``sagemaker``",
"description": "[``botocore``] releasing builtinlcc to public",
"type": "api-change"
},
{
"category": "``workspaces``",
"description": "[``botocore``] WSP is being rebranded to become DCV.",
"type": "api-change"
}
]
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
CHANGELOG
=========

1.35.32
=======

* api-change:``appstream``: [``botocore``] Added support for Automatic Time Zone Redirection on Amazon AppStream 2.0
* api-change:``b2bi``: [``botocore``] Added and updated APIs to support outbound EDI transformations
* api-change:``bedrock-agent-runtime``: [``botocore``] Added raw model response and usage metrics to PreProcessing and PostProcessing Trace
* api-change:``bedrock-runtime``: [``botocore``] Added new fields to Amazon Bedrock Guardrails trace
* api-change:``iotdeviceadvisor``: [``botocore``] Add clientToken attribute and implement idempotency for CreateSuiteDefinition.
* api-change:``ivs-realtime``: [``botocore``] Adds new Stage Health EventErrorCodes applicable to RTMP(S) broadcasts. Bug Fix: Enforces that EncoderConfiguration Video height and width must be even-number values.
* api-change:``s3``: [``botocore``] This release introduces a header representing the minimum object size limit for Lifecycle transitions.
* api-change:``sagemaker``: [``botocore``] releasing builtinlcc to public
* api-change:``workspaces``: [``botocore``] WSP is being rebranded to become DCV.


1.35.31
=======

Expand Down
2 changes: 1 addition & 1 deletion boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from boto3.session import Session

__author__ = 'Amazon Web Services'
__version__ = '1.35.31'
__version__ = '1.35.32'


# The default Boto3 session; autoloaded when needed.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/guide/clients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ from its list of possible waiters::
Then to actually start waiting, you must call the waiter's ``wait()`` method
with the method's appropriate parameters passed in::

# Begin waiting for the S3 bucket, mybucket, to exist
s3_bucket_exists_waiter.wait(Bucket='mybucket')
# Begin waiting for the S3 bucket, amzn-s3-demo-bucket, to exist
s3_bucket_exists_waiter.wait(Bucket='amzn-s3-demo-bucket')

Multithreading or multiprocessing with clients
----------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions docs/source/guide/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ the following conditions:

* **Batch actions (see below)**::

s3.Bucket('my-bucket').objects.delete()
s3.Bucket('amzn-s3-demo-bucket').objects.delete()

Filtering
---------
Expand Down Expand Up @@ -124,11 +124,11 @@ Some collections support batch actions, which are actions that operate
on an entire page of results at a time. They will automatically handle
pagination::

# S3 delete everything in `my-bucket`
# S3 delete everything in `amzn-s3-demo-bucket`
s3 = boto3.resource('s3')
s3.Bucket('my-bucket').objects.delete()
s3.Bucket('amzn-s3-demo-bucket').objects.delete()

.. danger::

The above example will **completely erase all data** in the ``my-bucket``
bucket! Please be careful with batch actions.
The above example will **completely erase all data** in the
``amzn-s3-demo-bucket`` bucket! Please be careful with batch actions.
2 changes: 1 addition & 1 deletion docs/source/guide/error-handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Using Amazon S3 as an example resource service, you can use the client’s excep
client = boto3.resource('s3')
try:
client.create_bucket(BucketName='myTestBucket')
client.create_bucket(BucketName='amzn-s3-demo-bucket')
except client.meta.client.exceptions.BucketAlreadyExists as err:
print("Bucket {} already exists!".format(err.response['Error']['BucketName']))
Expand Down
93 changes: 47 additions & 46 deletions docs/source/guide/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ Boto3's event system.
An introduction to the event system
-----------------------------------

Boto3's event system allows users to register a function to
a specific event. Then once the running program reaches a line that
emits that specific event, Boto3 will call every function
registered to the event in the order in which they were registered.
When Boto3 calls each of these registered functions,
it will call each of them with a specific set of
keyword arguments that are associated with that event.
Then once the registered function
is called, the function may modify the keyword arguments passed to that
function or return a value.
Here is an example of how the event system works::
Boto3's event system allows users to register a function to a specific event.
Then once the running program reaches a line that emits that specific event,
Boto3 will call every function registered to the event in the order in which
they were registered.

When Boto3 calls each of these registered functions, it will call each of them
with a specific set of keyword arguments that are associated with that event.
Then once the registered function is called, the function may modify the
keyword arguments passed to that function or return a value. Here is an
example of how the event system works::

import boto3

Expand All @@ -37,19 +36,19 @@ Here is an example of how the event system works::
def add_my_bucket(params, **kwargs):
# Add the name of the bucket you want to default to.
if 'Bucket' not in params:
params['Bucket'] = 'mybucket'
params['Bucket'] = 'amzn-s3-demo-bucket'

# Register the function to an event
event_system.register('provide-client-params.s3.ListObjectsV2', add_my_bucket)

response = s3.list_objects_v2()

In this example, the handler ``add_my_bucket``
is registered such that the handler will inject the
value ``'mybucket'`` for the ``Bucket`` parameter whenever the
``list_objects_v2`` client call is made without the ``Bucket`` parameter. Note
that if the same ``list_objects_v2`` call is made without the ``Bucket``
parameter and the registered handler, it will result in a validation error.
In this example, the handler ``add_my_bucket`` is registered such that the
handler will inject the value ``'amzn-s3-demo-bucket'`` for the ``Bucket``
parameter whenever the ``list_objects_v2`` client call is made without the
``Bucket`` parameter. Note that if the same ``list_objects_v2`` call is made
without the ``Bucket`` parameter and the registered handler, it will result in
a validation error.

Here are the takeaways from this example:

Expand Down Expand Up @@ -103,11 +102,11 @@ its hierarchical structure::

def add_my_general_bucket(params, **kwargs):
if 'Bucket' not in params:
params['Bucket'] = 'mybucket'
params['Bucket'] = 'amzn-s3-demo-bucket1'

def add_my_specific_bucket(params, **kwargs):
if 'Bucket' not in params:
params['Bucket'] = 'myspecificbucket'
params['Bucket'] = 'amzn-s3-demo-bucket2'

event_system.register('provide-client-params.s3', add_my_general_bucket)
event_system.register('provide-client-params.s3.ListObjectsV2', add_my_specific_bucket)
Expand All @@ -116,17 +115,18 @@ its hierarchical structure::
put_obj_response = s3.put_object(Key='mykey', Body=b'my body')

In this example, the ``list_objects_v2`` method call will use the
``'myspecificbucket'`` for the bucket instead of ``'mybucket'`` because
the ``add_my_specific_bucket`` method was registered to the
``'provide-client-params.s3.ListObjectsV2'`` event which is more specific than
the ``'provide-client-params.s3'`` event. Thus, the
``'amzn-s3-demo-bucket2'`` for the bucket instead of
``'amzn-s3-demo-bucket1'`` because the ``add_my_specific_bucket`` method was
registered to the ``'provide-client-params.s3.ListObjectsV2'`` event which is
more specific than the ``'provide-client-params.s3'`` event. Thus, the
``add_my_specific_bucket`` function is called before the
``add_my_general_bucket`` function is called when the event is emitted.

However for the ``put_object`` call, the bucket used is ``'mybucket'``. This
is because the event emitted for the ``put_object`` client call is
``'provide-client-params.s3.PutObject'`` and the ``add_my_general_bucket``
method is called via its registration to ``'provide-client-params.s3'``. The
However for the ``put_object`` call, the bucket used is
``'amzn-s3-demo-bucket1'``. This is because the event emitted for the
``put_object`` client call is ``'provide-client-params.s3.PutObject'`` and the
``add_my_general_bucket`` method is called via its registration to
``'provide-client-params.s3'``. The
``'provide-client-params.s3.ListObjectsV2'`` event is never emitted so the
registered ``add_my_specific_bucket`` function is never called.

Expand All @@ -147,7 +147,7 @@ of using wildcards in the event system::

def add_my_wildcard_bucket(params, **kwargs):
if 'Bucket' not in params:
params['Bucket'] = 'mybucket'
params['Bucket'] = 'amzn-s3-demo-bucket'

event_system.register('provide-client-params.s3.*', add_my_wildcard_bucket)
response = s3.list_objects_v2()
Expand Down Expand Up @@ -184,11 +184,11 @@ to another client's event system::

def add_my_bucket(params, **kwargs):
if 'Bucket' not in params:
params['Bucket'] = 'mybucket'
params['Bucket'] = 'amzn-s3-demo-bucket1'

def add_my_other_bucket(params, **kwargs):
if 'Bucket' not in params:
params['Bucket'] = 'myotherbucket'
params['Bucket'] = 'amzn-s3-demo-bucket2'

client1.meta.events.register(
'provide-client-params.s3.ListObjectsV2', add_my_bucket)
Expand All @@ -200,10 +200,10 @@ to another client's event system::


Thanks to the isolation of clients' event systems, ``client1`` will inject
``'mybucket'`` for its ``list_objects_v2`` method call while ``client2`` will
inject ``'myotherbucket'`` for its ``list_objects_v2`` method call because
``add_my_bucket`` was registered to ``client1`` while ``add_my_other_bucket``
was registered to ``client2``.
``'amzn-s3-demo-bucket1'`` for its ``list_objects_v2`` method call while
``client2`` will inject ``'amzn-s3-demo-bucket2'`` for its ``list_objects_v2``
method call because ``add_my_bucket`` was registered to ``client1`` while
``add_my_other_bucket`` was registered to ``client2``.


Boto3 specific events
Expand All @@ -212,13 +212,14 @@ Boto3 specific events
Boto3 emits a set of events that users can register to
customize clients or resources and modify the behavior of method calls.

Here is a table of events that users of Boto3 can register handlers to. More information
about each event can be found in the corresponding sections below:
Here is a table of events that users of Boto3 can register handlers to. More
information about each event can be found in the corresponding sections below:

.. note::

Events with a ``*`` in their order number are conditionally emitted while all others are always emitted.
An explanation of all 3 conditional events is provided below.
Events with a ``*`` in their order number are conditionally emitted while
all others are always emitted. An explanation of all 3 conditional events is
provided below.

``2 *`` - ``creating-resource-class`` is emitted ONLY when using a service resource.

Expand Down Expand Up @@ -440,7 +441,7 @@ about each event can be found in the corresponding sections below:
def add_my_bucket(params, **kwargs):
# Add the name of the bucket you want to default to.
if 'Bucket' not in params:
params['Bucket'] = 'mybucket'
params['Bucket'] = 'amzn-s3-demo-bucket'

# Register the function to an event
event_system.register('provide-client-params.s3.ListObjectsV2', add_my_bucket)
Expand Down Expand Up @@ -551,13 +552,13 @@ about each event can be found in the corresponding sections below:
# Register the function to an event
event_system.register('request-created.s3.ListObjectsV2', inspect_request_created)

response = s3.list_objects_v2(Bucket='my-bucket')
response = s3.list_objects_v2(Bucket='amzn-s3-demo-bucket')

This should output::

Request Info:
method: GET
url: https://my-bucket.s3 ...
url: https://amzn-s3-demo-bucket.s3 ...
data: ...
params: { ... }
auth_path: ...
Expand Down Expand Up @@ -682,9 +683,9 @@ about each event can be found in the corresponding sections below:
``'after-call.service-name.operation-name'``

:Description:
This event is emitted just after the service client makes an API call.
This event allows developers to postprocess or inspect the API response according to the
specific requirements of their application if needed.
This event is emitted just after the service client makes an API call. This
event allows developers to postprocess or inspect the API response according
to the specific requirements of their application if needed.

:Keyword Arguments Emitted:

Expand Down Expand Up @@ -720,7 +721,7 @@ about each event can be found in the corresponding sections below:
# Register the function to an event
event_system.register('after-call.s3.ListObjectsV2', print_after_call_args)

s3.list_objects_v2(Bucket='my-bucket')
s3.list_objects_v2(Bucket='amzn-s3-demo-bucket')

This should output::

Expand Down
4 changes: 2 additions & 2 deletions docs/source/guide/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Second, while every service now uses the runtime-generated low-level client, som
# High-level connections & resource objects
from boto.s3.bucket import Bucket
s3_conn = boto.connect_s3()
boto2_bucket = Bucket('mybucket')
boto2_bucket = Bucket('amzn-s3-demo-bucket')

s3 = boto3.resource('s3')
boto3_bucket = s3.Bucket('mybucket')
boto3_bucket = s3.Bucket('amzn-s3-demo-bucket')

Installation and configuration
------------------------------
Expand Down
18 changes: 9 additions & 9 deletions docs/source/guide/migrations3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Creating a bucket
Creating a bucket in Boto 2 and Boto3 is very similar, except that in Boto3 all action parameters must be passed via keyword arguments and a bucket configuration must be specified manually::

# Boto 2.x
s3_connection.create_bucket('mybucket')
s3_connection.create_bucket('mybucket', location=Location.USWest)
s3_connection.create_bucket('amzn-s3-demo-bucket')
s3_connection.create_bucket('amzn-s3-demo-bucket', location=Location.USWest)

# Boto3
s3.create_bucket(Bucket='mybucket')
s3.create_bucket(Bucket='mybucket', CreateBucketConfiguration={
s3.create_bucket(Bucket='amzn-s3-demo-bucket')
s3.create_bucket(Bucket='amzn-s3-demo-bucket', CreateBucketConfiguration={
'LocationConstraint': 'us-west-1'})

Storing data
Expand All @@ -39,23 +39,23 @@ Storing data from a file, stream, or string is easy::
key.set_contents_from_file('/tmp/hello.txt')

# Boto3
s3.Object('mybucket', 'hello.txt').put(Body=open('/tmp/hello.txt', 'rb'))
s3.Object('amzn-s3-demo-bucket', 'hello.txt').put(Body=open('/tmp/hello.txt', 'rb'))


Accessing a bucket
------------------
Getting a bucket is easy with Boto3's resources, however these do not automatically validate whether a bucket exists::

# Boto 2.x
bucket = s3_connection.get_bucket('mybucket', validate=False)
exists = s3_connection.lookup('mybucket')
bucket = s3_connection.get_bucket('amzn-s3-demo-bucket', validate=False)
exists = s3_connection.lookup('amzn-s3-demo-bucket')

# Boto3
import botocore
bucket = s3.Bucket('mybucket')
bucket = s3.Bucket('amzn-s3-demo-bucket')
exists = True
try:
s3.meta.client.head_bucket(Bucket='mybucket')
s3.meta.client.head_bucket(Bucket='amzn-s3-demo-bucket')
except botocore.exceptions.ClientError as e:
# If a client error is thrown, then check that it was a 404 error.
# If it was a 404 error, then the bucket does not exist.
Expand Down
Loading

0 comments on commit 81b3ed4

Please sign in to comment.