Skip to content

Commit

Permalink
Merge branch 'release-1.26.157'
Browse files Browse the repository at this point in the history
* release-1.26.157:
  Bumping version to 1.26.157
  Add changelog entries from botocore
  `Metric.put_data` Docs Override (#3673)
  • Loading branch information
aws-sdk-python-automation committed Jun 20, 2023
2 parents d570f7c + b9c6282 commit 185ffb4
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .changes/1.26.157.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"category": "``appflow``",
"description": "[``botocore``] This release adds new API to reset connector metadata cache",
"type": "api-change"
},
{
"category": "``config``",
"description": "[``botocore``] Updated ResourceType enum with new resource types onboarded by AWS Config in May 2023.",
"type": "api-change"
},
{
"category": "``ec2``",
"description": "[``botocore``] Adds support for targeting Dedicated Host allocations by assetIds in AWS Outposts",
"type": "api-change"
},
{
"category": "``lambda``",
"description": "[``botocore``] This release adds RecursiveInvocationException to the Invoke API and InvokeWithResponseStream API.",
"type": "api-change"
},
{
"category": "``redshift``",
"description": "[``botocore``] Added support for custom domain names for Redshift Provisioned clusters. This feature enables customers to create a custom domain name and use ACM to generate fully secure connections to it.",
"type": "api-change"
}
]
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
CHANGELOG
=========

1.26.157
========

* api-change:``appflow``: [``botocore``] This release adds new API to reset connector metadata cache
* api-change:``config``: [``botocore``] Updated ResourceType enum with new resource types onboarded by AWS Config in May 2023.
* api-change:``ec2``: [``botocore``] Adds support for targeting Dedicated Host allocations by assetIds in AWS Outposts
* api-change:``lambda``: [``botocore``] This release adds RecursiveInvocationException to the Invoke API and InvokeWithResponseStream API.
* api-change:``redshift``: [``botocore``] Added support for custom domain names for Redshift Provisioned clusters. This feature enables customers to create a custom domain name and use ACM to generate fully secure connections to it.


1.26.156
========

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.26.156'
__version__ = '1.26.157'


# The default Boto3 session; autoloaded when needed.
Expand Down
26 changes: 23 additions & 3 deletions boto3/docs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@
get_resource_public_actions,
)

PUT_DATA_WARNING_MESSAGE = """
.. warning::
It is recommended to use the :py:meth:`put_metric_data`
:doc:`client method <../../cloudwatch/client/put_metric_data>`
instead. If you would still like to use this resource method,
please make sure that ``MetricData[].MetricName`` is equal to
the metric resource's ``name`` attribute.
"""

WARNING_MESSAGES = {
"Metric": {"put_data": PUT_DATA_WARNING_MESSAGE},
}

IGNORE_PARAMS = {"Metric": {"put_data": ["Namespace"]}}


class ActionDocumenter(NestedDocumenter):
def document_actions(self, section):
Expand All @@ -50,14 +65,17 @@ def document_actions(self, section):
),
intro_link='actions_intro',
)

resource_warnings = WARNING_MESSAGES.get(self._resource_name, {})
for action_name in sorted(resource_actions):
# Create a new DocumentStructure for each action and add contents.
action_doc = DocumentStructure(action_name, target='html')
breadcrumb_section = action_doc.add_new_section('breadcrumb')
breadcrumb_section.style.ref(self._resource_class_name, 'index')
breadcrumb_section.write(f' / Action / {action_name}')
action_doc.add_title_section(action_name)
warning_message = resource_warnings.get(action_name)
if warning_message is not None:
action_doc.add_new_section("warning").write(warning_message)
action_section = action_doc.add_new_section(
action_name,
context={'qualifier': f'{self.class_name}.'},
Expand Down Expand Up @@ -119,8 +137,10 @@ def document_action(
operation_model = service_model.operation_model(
action_model.request.operation
)
ignore_params = get_resource_ignore_params(action_model.request.params)

ignore_params = IGNORE_PARAMS.get(resource_name, {}).get(
action_model.name,
get_resource_ignore_params(action_model.request.params),
)
example_return_value = 'response'
if action_model.resource:
example_return_value = xform_name(action_model.resource.type)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore>=1.29.156,<1.30.0
botocore>=1.29.157,<1.30.0
jmespath>=0.7.1,<2.0.0
s3transfer>=0.6.0,<0.7.0

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


requires = [
'botocore>=1.29.156,<1.30.0',
'botocore>=1.29.157,<1.30.0',
'jmespath>=0.7.1,<2.0.0',
's3transfer>=0.6.0,<0.7.0',
]
Expand Down
46 changes: 46 additions & 0 deletions tests/functional/docs/test_cloudwatch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

from boto3.docs.action import PUT_DATA_WARNING_MESSAGE
from boto3.docs.service import ServiceDocumenter
from boto3.session import Session
from tests.functional.docs import BaseDocsFunctionalTests


class TestCloudWatchMetricPutActionOverrides(BaseDocsFunctionalTests):
def setUp(self):
super().setUp()
self.documenter = ServiceDocumenter(
'cloudwatch',
session=Session(region_name='us-east-1'),
root_docs_path=self.root_services_path,
)
self.generated_contents = self.documenter.document_service()
self.generated_contents = self.generated_contents.decode('utf-8')

def test_put_action_overrides(self):
put_action_contents = self.get_nested_file_contents(
"cloudwatch", "metric", "put_data"
)
# first line is an empty string
self.assert_contains_lines_in_order(
PUT_DATA_WARNING_MESSAGE.splitlines()[1:],
put_action_contents,
)

def test_put_action_override_not_present_in_other_action(self):
put_alarm_contents = self.get_nested_file_contents(
"cloudwatch", "metric", "put_alarm"
)
for line in PUT_DATA_WARNING_MESSAGE.splitlines()[1:]:
self.assertNotIn(line, put_alarm_contents)

0 comments on commit 185ffb4

Please sign in to comment.