forked from aws/aws-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandlers.py
113 lines (109 loc) · 5.7 KB
/
handlers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright 2013 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
#
# http://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.
"""Builtin CLI extensions.
This is a collection of built in CLI extensions that can be automatically
registered with the event system.
"""
from awscli.argprocess import ParamShorthand
from awscli.argprocess import uri_param
from awscli.errorhandler import ErrorHandler
from awscli.customizations.streamingoutputarg import add_streaming_output_arg
from awscli.customizations.addexamples import add_examples
from awscli.customizations.removals import register_removals
from awscli.customizations.ec2addcount import ec2_add_count
from awscli.customizations.paginate import register_pagination
from awscli.customizations.ec2decryptpassword import ec2_add_priv_launch_key
from awscli.customizations.ec2secgroupsimplify import register_secgroup
from awscli.customizations.preview import register_preview_commands
from awscli.customizations.ec2bundleinstance import register_bundleinstance
from awscli.customizations.s3.s3 import s3_plugin_initialize
from awscli.customizations.ec2runinstances import register_runinstances
from awscli.customizations.rds import register_rds_modify_split
from awscli.customizations.putmetricdata import register_put_metric_data
from awscli.customizations.sessendemail import register_ses_send_email
from awscli.customizations.iamvirtmfa import IAMVMFAWrapper
from awscli.customizations.argrename import register_arg_renames
from awscli.customizations.dryrundocs import register_dryrun_docs
from awscli.customizations.route53resourceid import register_resource_id
from awscli.customizations.configure import register_configure_cmd
from awscli.customizations.cloudtrail import initialize as cloudtrail_init
from awscli.customizations.toplevelbool import register_bool_params
from awscli.customizations.ec2protocolarg import register_protocol_args
from awscli.customizations import datapipeline
from awscli.customizations.globalargs import register_parse_global_args
from awscli.customizations.cloudsearch import initialize as cloudsearch_init
from awscli.customizations.emr.emr import emr_initialize
from awscli.customizations.cloudsearchdomain import register_cloudsearchdomain
from awscli.customizations.s3endpoint import register_s3_endpoint
from awscli.customizations.s3errormsg import register_s3_error_msg
from awscli.customizations.cliinputjson import register_cli_input_json
from awscli.customizations.generatecliskeleton import \
register_generate_cli_skeleton
from awscli.customizations.assumerole import register_assume_role_provider
from awscli.customizations.waiters import register_add_waiters
from awscli.customizations.codedeploy import initialize as codedeploy_init
def awscli_initialize(event_handlers):
event_handlers.register('load-cli-arg', uri_param)
param_shorthand = ParamShorthand()
event_handlers.register('process-cli-arg', param_shorthand)
# The s3 error mesage needs to registered before the
# generic error handler.
register_s3_error_msg(event_handlers)
error_handler = ErrorHandler()
event_handlers.register('after-call', error_handler)
# # The following will get fired for every option we are
# # documenting. It will attempt to add an example_fn on to
# # the parameter object if the parameter supports shorthand
# # syntax. The documentation event handlers will then use
# # the examplefn to generate the sample shorthand syntax
# # in the docs. Registering here should ensure that this
# # handler gets called first but it still feels a bit brittle.
# event_handlers.register('doc-option-example.*.*.*',
# param_shorthand.add_example_fn)
event_handlers.register('doc-examples.*.*',
add_examples)
register_cli_input_json(event_handlers)
event_handlers.register('building-argument-table.s3api.*',
add_streaming_output_arg)
event_handlers.register('building-argument-table.ec2.run-instances',
ec2_add_count)
event_handlers.register('building-argument-table.ec2.get-password-data',
ec2_add_priv_launch_key)
register_parse_global_args(event_handlers)
register_pagination(event_handlers)
register_secgroup(event_handlers)
register_bundleinstance(event_handlers)
s3_plugin_initialize(event_handlers)
register_runinstances(event_handlers)
register_removals(event_handlers)
register_preview_commands(event_handlers)
register_rds_modify_split(event_handlers)
register_put_metric_data(event_handlers)
register_ses_send_email(event_handlers)
IAMVMFAWrapper(event_handlers)
register_arg_renames(event_handlers)
register_dryrun_docs(event_handlers)
register_resource_id(event_handlers)
register_configure_cmd(event_handlers)
cloudtrail_init(event_handlers)
register_bool_params(event_handlers)
register_protocol_args(event_handlers)
datapipeline.register_customizations(event_handlers)
cloudsearch_init(event_handlers)
emr_initialize(event_handlers)
register_cloudsearchdomain(event_handlers)
register_s3_endpoint(event_handlers)
register_generate_cli_skeleton(event_handlers)
register_assume_role_provider(event_handlers)
register_add_waiters(event_handlers)
codedeploy_init(event_handlers)