Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/awscli/handlers.py
1566 views
1
# Copyright 2013 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
"""Builtin CLI extensions.
14
15
This is a collection of built in CLI extensions that can be automatically
16
registered with the event system.
17
18
"""
19
20
from awscli.argprocess import ParamShorthandParser
21
from awscli.customizations import datapipeline
22
from awscli.customizations.addexamples import add_examples
23
from awscli.customizations.argrename import register_arg_renames
24
from awscli.customizations.assumerole import register_assume_role_provider
25
from awscli.customizations.awslambda import register_lambda_create_function
26
from awscli.customizations.cliinputjson import register_cli_input_json
27
from awscli.customizations.cloudformation import (
28
initialize as cloudformation_init,
29
)
30
from awscli.customizations.cloudfront import register as register_cloudfront
31
from awscli.customizations.cloudsearch import initialize as cloudsearch_init
32
from awscli.customizations.cloudsearchdomain import register_cloudsearchdomain
33
from awscli.customizations.cloudtrail import initialize as cloudtrail_init
34
from awscli.customizations.codeartifact import register_codeartifact_commands
35
from awscli.customizations.codecommit import initialize as codecommit_init
36
from awscli.customizations.codedeploy.codedeploy import (
37
initialize as codedeploy_init,
38
)
39
from awscli.customizations.configservice.getstatus import register_get_status
40
from awscli.customizations.configservice.putconfigurationrecorder import (
41
register_modify_put_configuration_recorder,
42
)
43
from awscli.customizations.configservice.rename_cmd import (
44
register_rename_config,
45
)
46
from awscli.customizations.configservice.subscribe import register_subscribe
47
from awscli.customizations.configure.configure import register_configure_cmd
48
from awscli.customizations.dlm.dlm import dlm_initialize
49
from awscli.customizations.dynamodb import register_dynamodb_paginator_fix
50
from awscli.customizations.ec2.addcount import register_count_events
51
from awscli.customizations.ec2.bundleinstance import register_bundleinstance
52
from awscli.customizations.ec2.decryptpassword import ec2_add_priv_launch_key
53
from awscli.customizations.ec2.paginate import register_ec2_page_size_injector
54
from awscli.customizations.ec2.protocolarg import register_protocol_args
55
from awscli.customizations.ec2.runinstances import register_runinstances
56
from awscli.customizations.ec2.secgroupsimplify import register_secgroup
57
from awscli.customizations.ecr import register_ecr_commands
58
from awscli.customizations.ecr_public import register_ecr_public_commands
59
from awscli.customizations.ecs import initialize as ecs_initialize
60
from awscli.customizations.eks import initialize as eks_initialize
61
from awscli.customizations.emr.emr import emr_initialize
62
from awscli.customizations.emrcontainers import (
63
initialize as emrcontainers_initialize,
64
)
65
from awscli.customizations.gamelift import register_gamelift_commands
66
from awscli.customizations.generatecliskeleton import (
67
register_generate_cli_skeleton,
68
)
69
from awscli.customizations.globalargs import register_parse_global_args
70
from awscli.customizations.history import (
71
register_history_commands,
72
register_history_mode,
73
)
74
from awscli.customizations.iamvirtmfa import IAMVMFAWrapper
75
from awscli.customizations.iot import (
76
register_create_keys_and_cert_arguments,
77
register_create_keys_from_csr_arguments,
78
)
79
from awscli.customizations.iot_data import register_custom_endpoint_note
80
from awscli.customizations.kinesis import (
81
register_kinesis_list_streams_pagination_backcompat,
82
)
83
from awscli.customizations.kms import register_fix_kms_create_grant_docs
84
from awscli.customizations.logs import register_logs_commands
85
from awscli.customizations.mturk import register_alias_mturk_command
86
from awscli.customizations.overridesslcommonname import (
87
register_override_ssl_common_name,
88
)
89
from awscli.customizations.paginate import register_pagination
90
from awscli.customizations.preview import register_preview_commands
91
from awscli.customizations.putmetricdata import register_put_metric_data
92
from awscli.customizations.quicksight import (
93
register_quicksight_asset_bundle_customizations,
94
)
95
from awscli.customizations.rds import (
96
register_add_generate_db_auth_token,
97
register_rds_modify_split,
98
)
99
from awscli.customizations.rekognition import (
100
register_rekognition_detect_labels,
101
)
102
from awscli.customizations.removals import register_removals
103
from awscli.customizations.route53 import register_create_hosted_zone_doc_fix
104
from awscli.customizations.s3.s3 import s3_plugin_initialize
105
from awscli.customizations.s3errormsg import register_s3_error_msg
106
from awscli.customizations.s3events import register_event_stream_arg, register_document_expires_string
107
from awscli.customizations.sagemaker import (
108
register_alias_sagemaker_runtime_command,
109
)
110
from awscli.customizations.scalarparse import register_scalar_parser
111
from awscli.customizations.servicecatalog import (
112
register_servicecatalog_commands,
113
)
114
from awscli.customizations.sessendemail import register_ses_send_email
115
from awscli.customizations.sessionmanager import register_ssm_session
116
from awscli.customizations.sms_voice import register_sms_voice_hide
117
from awscli.customizations.socialmessaging import register_alias_socialmessaging_command
118
from awscli.customizations.streamingoutputarg import add_streaming_output_arg
119
from awscli.customizations.toplevelbool import register_bool_params
120
from awscli.customizations.translate import (
121
register_translate_import_terminology,
122
)
123
from awscli.customizations.waiters import register_add_waiters
124
from awscli.paramfile import register_uri_param_handler
125
126
127
def awscli_initialize(event_handlers):
128
event_handlers.register('session-initialized', register_uri_param_handler)
129
param_shorthand = ParamShorthandParser()
130
event_handlers.register('process-cli-arg', param_shorthand)
131
# The s3 error message needs to registered before the
132
# generic error handler.
133
register_s3_error_msg(event_handlers)
134
# # The following will get fired for every option we are
135
# # documenting. It will attempt to add an example_fn on to
136
# # the parameter object if the parameter supports shorthand
137
# # syntax. The documentation event handlers will then use
138
# # the examplefn to generate the sample shorthand syntax
139
# # in the docs. Registering here should ensure that this
140
# # handler gets called first but it still feels a bit brittle.
141
# event_handlers.register('doc-option-example.*.*.*',
142
# param_shorthand.add_example_fn)
143
event_handlers.register('doc-examples.*.*', add_examples)
144
register_cli_input_json(event_handlers)
145
event_handlers.register(
146
'building-argument-table.*', add_streaming_output_arg
147
)
148
register_count_events(event_handlers)
149
event_handlers.register(
150
'building-argument-table.ec2.get-password-data',
151
ec2_add_priv_launch_key,
152
)
153
register_parse_global_args(event_handlers)
154
register_pagination(event_handlers)
155
register_secgroup(event_handlers)
156
register_bundleinstance(event_handlers)
157
s3_plugin_initialize(event_handlers)
158
register_runinstances(event_handlers)
159
register_removals(event_handlers)
160
register_preview_commands(event_handlers)
161
register_rds_modify_split(event_handlers)
162
register_rekognition_detect_labels(event_handlers)
163
register_add_generate_db_auth_token(event_handlers)
164
register_put_metric_data(event_handlers)
165
register_ses_send_email(event_handlers)
166
IAMVMFAWrapper(event_handlers)
167
register_arg_renames(event_handlers)
168
register_configure_cmd(event_handlers)
169
cloudtrail_init(event_handlers)
170
register_ecr_commands(event_handlers)
171
register_ecr_public_commands(event_handlers)
172
register_bool_params(event_handlers)
173
register_protocol_args(event_handlers)
174
datapipeline.register_customizations(event_handlers)
175
cloudsearch_init(event_handlers)
176
emr_initialize(event_handlers)
177
emrcontainers_initialize(event_handlers)
178
eks_initialize(event_handlers)
179
ecs_initialize(event_handlers)
180
register_cloudsearchdomain(event_handlers)
181
register_generate_cli_skeleton(event_handlers)
182
register_assume_role_provider(event_handlers)
183
register_add_waiters(event_handlers)
184
codedeploy_init(event_handlers)
185
register_subscribe(event_handlers)
186
register_get_status(event_handlers)
187
register_rename_config(event_handlers)
188
register_scalar_parser(event_handlers)
189
register_lambda_create_function(event_handlers)
190
register_fix_kms_create_grant_docs(event_handlers)
191
register_create_hosted_zone_doc_fix(event_handlers)
192
register_modify_put_configuration_recorder(event_handlers)
193
register_codeartifact_commands(event_handlers)
194
codecommit_init(event_handlers)
195
register_custom_endpoint_note(event_handlers)
196
event_handlers.register(
197
'building-argument-table.iot.create-keys-and-certificate',
198
register_create_keys_and_cert_arguments,
199
)
200
event_handlers.register(
201
'building-argument-table.iot.create-certificate-from-csr',
202
register_create_keys_from_csr_arguments,
203
)
204
register_cloudfront(event_handlers)
205
register_gamelift_commands(event_handlers)
206
register_ec2_page_size_injector(event_handlers)
207
cloudformation_init(event_handlers)
208
register_alias_mturk_command(event_handlers)
209
register_alias_sagemaker_runtime_command(event_handlers)
210
register_alias_socialmessaging_command(event_handlers)
211
register_servicecatalog_commands(event_handlers)
212
register_translate_import_terminology(event_handlers)
213
register_history_mode(event_handlers)
214
register_history_commands(event_handlers)
215
register_event_stream_arg(event_handlers)
216
register_document_expires_string(event_handlers)
217
dlm_initialize(event_handlers)
218
register_ssm_session(event_handlers)
219
register_sms_voice_hide(event_handlers)
220
register_dynamodb_paginator_fix(event_handlers)
221
register_override_ssl_common_name(event_handlers)
222
register_kinesis_list_streams_pagination_backcompat(event_handlers)
223
register_quicksight_asset_bundle_customizations(event_handlers)
224
register_logs_commands(event_handlers)
225
226