Path: blob/develop/awscli/customizations/codedeploy/codedeploy.py
1567 views
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License"). You3# may not use this file except in compliance with the License. A copy of4# the License is located at5#6# http://aws.amazon.com/apache2.0/7#8# or in the "license" file accompanying this file. This file is9# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF10# ANY KIND, either express or implied. See the License for the specific11# language governing permissions and limitations under the License.1213from awscli.customizations import utils14from awscli.customizations.codedeploy.locationargs import \15modify_revision_arguments16from awscli.customizations.codedeploy.push import Push17from awscli.customizations.codedeploy.register import Register18from awscli.customizations.codedeploy.deregister import Deregister19from awscli.customizations.codedeploy.install import Install20from awscli.customizations.codedeploy.uninstall import Uninstall212223def initialize(cli):24"""25The entry point for CodeDeploy high level commands.26"""27cli.register(28'building-command-table.main',29change_name30)31cli.register(32'building-command-table.deploy',33inject_commands34)35cli.register(36'building-argument-table.deploy.get-application-revision',37modify_revision_arguments38)39cli.register(40'building-argument-table.deploy.register-application-revision',41modify_revision_arguments42)43cli.register(44'building-argument-table.deploy.create-deployment',45modify_revision_arguments46)474849def change_name(command_table, session, **kwargs):50"""51Change all existing 'aws codedeploy' commands to 'aws deploy' commands.52"""53utils.rename_command(command_table, 'codedeploy', 'deploy')545556def inject_commands(command_table, session, **kwargs):57"""58Inject custom 'aws deploy' commands.59"""60command_table['push'] = Push(session)61command_table['register'] = Register(session)62command_table['deregister'] = Deregister(session)63command_table['install'] = Install(session)64command_table['uninstall'] = Uninstall(session)656667