File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
tests/functional/sagemaker Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " bugfix" ,
3+ "category" : " sagemaker-runtime" ,
4+ "description" : " Renamed the runtime.sagemaker service to sagemaker-runtime to be more consistent with existing services. The old service name is now aliased to sagemaker-runtime to maintain backwards compatibility."
5+ }
Original file line number Diff line number Diff line change 1+ # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4+ # may not use this file except in compliance with the License. A copy of
5+ # the License is located at
6+ #
7+ # http://aws.amazon.com/apache2.0/
8+ #
9+ # or in the "license" file accompanying this file. This file is
10+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+ # ANY KIND, either express or implied. See the License for the specific
12+ # language governing permissions and limitations under the License.
13+ from awscli .customizations .utils import make_hidden_command_alias
14+
15+
16+ def register_alias_sagemaker_runtime_command (event_emitter ):
17+ event_emitter .register (
18+ 'building-command-table.main' ,
19+ alias_sagemaker_runtime_command
20+ )
21+
22+
23+ def alias_sagemaker_runtime_command (command_table , ** kwargs ):
24+ make_hidden_command_alias (
25+ command_table ,
26+ existing_name = 'sagemaker-runtime' ,
27+ alias_name = 'runtime.sagemaker' ,
28+ )
Original file line number Diff line number Diff line change 7777from awscli .customizations .waiters import register_add_waiters
7878from awscli .customizations .opsworkscm import register_alias_opsworks_cm
7979from awscli .customizations .mturk import register_alias_mturk_command
80+ from awscli .customizations .sagemaker import register_alias_sagemaker_runtime_command
8081from awscli .customizations .servicecatalog import register_servicecatalog_commands
8182
8283
@@ -155,6 +156,7 @@ def awscli_initialize(event_handlers):
155156 cloudformation_init (event_handlers )
156157 register_alias_opsworks_cm (event_handlers )
157158 register_alias_mturk_command (event_handlers )
159+ register_alias_sagemaker_runtime_command (event_handlers )
158160 register_servicecatalog_commands (event_handlers )
159161 register_history_mode (event_handlers )
160162 register_history_commands (event_handlers )
Original file line number Diff line number Diff line change 1+ # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4+ # may not use this file except in compliance with the License. A copy of
5+ # the License is located at
6+ #
7+ # http://aws.amazon.com/apache2.0/
8+ #
9+ # or in the "license" file accompanying this file. This file is
10+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+ # ANY KIND, either express or implied. See the License for the specific
12+ # language governing permissions and limitations under the License.
13+ from awscli .testutils import BaseAWSCommandParamsTest
14+
15+
16+ class TestAlias (BaseAWSCommandParamsTest ):
17+ def test_alias (self ):
18+ # This command was aliased, both should work
19+ command_template = '%s invoke-endpoint --endpoint-name foo --body bar f'
20+ old_command = command_template % 'runtime.sagemaker'
21+ new_command = command_template % 'sagemaker-runtime'
22+ self .run_cmd (old_command , expected_rc = 0 )
23+ self .run_cmd (new_command , expected_rc = 0 )
You can’t perform that action at this time.
0 commit comments