U
    W+d                     @   sX   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 G dd deZdS )	    N)json)AWSQueryConnection)
RegionInfo)JSONResponseError)
exceptionsc                -       s  e Zd ZdZdZdZdZdZdZe	Z
ejejejejejejejejejejejejejejejejejejejejej ej!ej"ej#ej$ej%ej&ej'ej(ej)ej*ej+ej,ej-ej.ej/ej0ej1ej2ej3ej4ej5ej6ej7d,Z8 fdd	Z9d
d Z:dAddZ;dBddZ<dd Z=dCddZ>dDddZ?dEddZ@dd ZAdd ZBdd ZCdd  ZDd!d" ZEd#d$ ZFd%d& ZGd'd( ZHd)d* ZIdFd+d,ZJdGd-d.ZKdHd/d0ZLdId1d2ZMdJd3d4ZNdKd5d6ZOdLd7d8ZPd9d: ZQdMd;d<ZRdNd=d>ZSd?d@ ZT  ZUS )OCodeDeployConnectiona  
    AWS CodeDeploy **Overview**
    This is the AWS CodeDeploy API Reference. This guide provides
    descriptions of the AWS CodeDeploy APIs. For additional
    information, see the `AWS CodeDeploy User Guide`_.
    **Using the APIs**
    You can use the AWS CodeDeploy APIs to work with the following
    items:


    + Applications , which are unique identifiers that AWS CodeDeploy
      uses to ensure that the correct combinations of revisions,
      deployment configurations, and deployment groups are being
      referenced during deployments. You can work with applications by
      calling CreateApplication, DeleteApplication, GetApplication,
      ListApplications, BatchGetApplications, and UpdateApplication to
      create, delete, and get information about applications, and to
      change information about an application, respectively.
    + Deployment configurations , which are sets of deployment rules
      and deployment success and failure conditions that AWS CodeDeploy
      uses during deployments. You can work with deployment
      configurations by calling CreateDeploymentConfig,
      DeleteDeploymentConfig, GetDeploymentConfig, and
      ListDeploymentConfigs to create, delete, and get information about
      deployment configurations, respectively.
    + Deployment groups , which represent groups of Amazon EC2
      instances to which application revisions can be deployed. You can
      work with deployment groups by calling CreateDeploymentGroup,
      DeleteDeploymentGroup, GetDeploymentGroup, ListDeploymentGroups,
      and UpdateDeploymentGroup to create, delete, and get information
      about single and multiple deployment groups, and to change
      information about a deployment group, respectively.
    + Deployment instances (also known simply as instances ), which
      represent Amazon EC2 instances to which application revisions are
      deployed. Deployment instances are identified by their Amazon EC2
      tags or Auto Scaling group names. Deployment instances belong to
      deployment groups. You can work with deployment instances by
      calling GetDeploymentInstance and ListDeploymentInstances to get
      information about single and multiple deployment instances,
      respectively.
    + Deployments , which represent the process of deploying revisions
      to deployment groups. You can work with deployments by calling
      CreateDeployment, GetDeployment, ListDeployments,
      BatchGetDeployments, and StopDeployment to create and get
      information about deployments, and to stop a deployment,
      respectively.
    + Application revisions (also known simply as revisions ), which
      are archive files that are stored in Amazon S3 buckets or GitHub
      repositories. These revisions contain source content (such as
      source code, web pages, executable files, any deployment scripts,
      and similar) along with an Application Specification file (AppSpec
      file). (The AppSpec file is unique to AWS CodeDeploy; it defines a
      series of deployment actions that you want AWS CodeDeploy to
      execute.) An application revision is uniquely identified by its
      Amazon S3 object key and its ETag, version, or both. Application
      revisions are deployed to deployment groups. You can work with
      application revisions by calling GetApplicationRevision,
      ListApplicationRevisions, and RegisterApplicationRevision to get
      information about application revisions and to inform AWS
      CodeDeploy about an application revision, respectively.
    z
2014-10-06z	us-east-1z"codedeploy.us-east-1.amazonaws.comZ
codedeployZCodeDeploy_20141006),InvalidDeploymentIdException#InvalidDeploymentGroupNameException&DeploymentConfigAlreadyExistsExceptionInvalidRoleExceptionRoleRequiredException%DeploymentGroupAlreadyExistsException&DeploymentConfigLimitExceededExceptionInvalidNextTokenException$InvalidDeploymentConfigNameExceptionInvalidSortByExceptionInstanceDoesNotExistException'InvalidMinimumHealthyHostValueException!ApplicationLimitExceededException ApplicationNameRequiredExceptionInvalidEC2TagExceptionDeploymentDoesNotExistException DeploymentLimitExceededExceptionInvalidInstanceStatusExceptionRevisionRequiredException InvalidBucketNameFilterException%DeploymentGroupLimitExceededException$DeploymentGroupDoesNotExistException%DeploymentConfigNameRequiredException#DeploymentAlreadyCompletedExceptionRevisionDoesNotExistException$DeploymentGroupNameRequiredExceptionDeploymentIdRequiredException%DeploymentConfigDoesNotExistException!BucketNameFilterRequiredExceptionInvalidTimeRangeException ApplicationDoesNotExistExceptionInvalidRevisionExceptionInvalidSortOrderExceptionInvalidOperationException InvalidAutoScalingGroupExceptionInvalidApplicationNameExceptionDescriptionTooLongException!ApplicationAlreadyExistsException#InvalidDeployedStateFilterExceptionDeploymentNotStartedExceptionDeploymentConfigInUseExceptionInstanceIdRequiredExceptionInvalidKeyPrefixFilterException InvalidDeploymentStatusExceptionc                    sZ   | dd }|s t| | j| j}d|ks4|d d kr>|j|d< tt| jf | || _d S )Nregionhost)	popr   DefaultRegionNameDefaultRegionEndpointendpointsuperr   __init__r4   )selfkwargsr4   	__class__ :/tmp/pip-unpacked-wheel-dlxw5sjy/boto/codedeploy/layer1.pyr;      s    
zCodeDeployConnection.__init__c                 C   s   dgS )Nzhmac-v4r@   )r<   r@   r@   rA   _required_auth_capability   s    z.CodeDeployConnection._required_auth_capabilityNc                 C   s(   i }|dk	r||d< | j dt|dS )z
        Gets information about one or more applications.

        :type application_names: list
        :param application_names: A list of application names, with multiple
            application names separated by spaces.

        NZapplicationNamesZBatchGetApplicationsactionbodymake_requestr   dumps)r<   Zapplication_namesparamsr@   r@   rA   batch_get_applications   s    	z+CodeDeployConnection.batch_get_applicationsc                 C   s(   i }|dk	r||d< | j dt|dS )z
        Gets information about one or more deployments.

        :type deployment_ids: list
        :param deployment_ids: A list of deployment IDs, with multiple
            deployment IDs separated by spaces.

        NZdeploymentIdsZBatchGetDeploymentsrC   rF   )r<   Zdeployment_idsrI   r@   r@   rA   batch_get_deployments   s    	z*CodeDeployConnection.batch_get_deploymentsc                 C   s   d|i}| j dt|dS )z
        Creates a new application.

        :type application_name: string
        :param application_name: The name of the application. This name must be
            unique within the AWS user account.

        applicationNameZCreateApplicationrC   rF   r<   application_namerI   r@   r@   rA   create_application   s    	z'CodeDeployConnection.create_applicationc                 C   sl   d|i}|dk	r||d< |dk	r(||d< |dk	r8||d< |dk	rH||d< |dk	rX||d< | j dt|d	S )
a  
        Deploys an application revision to the specified deployment
        group.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type deployment_group_name: string
        :param deployment_group_name: The deployment group's name.

        :type revision: dict
        :param revision: The type of revision to deploy, along with information
            about the revision's location.

        :type deployment_config_name: string
        :param deployment_config_name: The name of an existing deployment
            configuration within the AWS user account.
        If not specified, the value configured in the deployment group will be
            used as the default. If the deployment group does not have a
            deployment configuration associated with it, then
            CodeDeployDefault.OneAtATime will be used by default.

        :type description: string
        :param description: A comment about the deployment.

        :type ignore_application_stop_failures: boolean
        :param ignore_application_stop_failures: If set to true, then if the
            deployment causes the ApplicationStop deployment lifecycle event to
            fail to a specific instance, the deployment will not be considered
            to have failed to that instance at that point and will continue on
            to the BeforeInstall deployment lifecycle event.
        If set to false or not specified, then if the deployment causes the
            ApplicationStop deployment lifecycle event to fail to a specific
            instance, the deployment will stop to that instance, and the
            deployment to that instance will be considered to have failed.

        rL   NdeploymentGroupNamerevisiondeploymentConfigNamedescriptionZignoreApplicationStopFailuresZCreateDeploymentrC   rF   )r<   rN   deployment_group_namerQ   deployment_config_namerS   Z ignore_application_stop_failuresrI   r@   r@   rA   create_deployment   s    *z&CodeDeployConnection.create_deploymentc                 C   s,   d|i}|dk	r||d< | j dt|dS )a  
        Creates a new deployment configuration.

        :type deployment_config_name: string
        :param deployment_config_name: The name of the deployment configuration
            to create.

        :type minimum_healthy_hosts: dict
        :param minimum_healthy_hosts: The minimum number of healthy instances
            that should be available at any time during the deployment. There
            are two parameters expected in the input: type and value.
        The type parameter takes either of the following values:


        + HOST_COUNT: The value parameter represents the minimum number of
              healthy instances, as an absolute value.
        + FLEET_PERCENT: The value parameter represents the minimum number of
              healthy instances, as a percentage of the total number of instances
              in the deployment. If you specify FLEET_PERCENT, then at the start
              of the deployment AWS CodeDeploy converts the percentage to the
              equivalent number of instances and rounds fractional instances up.


        The value parameter takes an integer.

        For example, to set a minimum of 95% healthy instances, specify a type
            of FLEET_PERCENT and a value of 95.

        rR   NZminimumHealthyHostsZCreateDeploymentConfigrC   rF   )r<   rU   Zminimum_healthy_hostsrI   r@   r@   rA   create_deployment_config  s    z-CodeDeployConnection.create_deployment_configc                 C   s^   ||d}|dk	r||d< |dk	r*||d< |dk	r:||d< |dk	rJ||d< | j dt|dS )	a  
        Creates a new deployment group for application revisions to be
        deployed to.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type deployment_group_name: string
        :param deployment_group_name: The name of an existing deployment group
            for the specified application.

        :type deployment_config_name: string
        :param deployment_config_name: If specified, the deployment
            configuration name must be one of the predefined values, or it can
            be a custom deployment configuration:

        + CodeDeployDefault.AllAtOnce deploys an application revision to up to
              all of the Amazon EC2 instances at once. The overall deployment
              succeeds if the application revision deploys to at least one of the
              instances. The overall deployment fails after the application
              revision fails to deploy to all of the instances. For example, for
              9 instances, deploy to up to all 9 instances at once. The overall
              deployment succeeds if any of the 9 instances is successfully
              deployed to, and it fails if all 9 instances fail to be deployed
              to.
        + CodeDeployDefault.HalfAtATime deploys to up to half of the instances
              at a time (with fractions rounded down). The overall deployment
              succeeds if the application revision deploys to at least half of
              the instances (with fractions rounded up); otherwise, the
              deployment fails. For example, for 9 instances, deploy to up to 4
              instances at a time. The overall deployment succeeds if 5 or more
              instances are successfully deployed to; otherwise, the deployment
              fails. Note that the deployment may successfully deploy to some
              instances, even if the overall deployment fails.
        + CodeDeployDefault.OneAtATime deploys the application revision to only
              one of the instances at a time. The overall deployment succeeds if
              the application revision deploys to all of the instances. The
              overall deployment fails after the application revision first fails
              to deploy to any one instance. For example, for 9 instances, deploy
              to one instance at a time. The overall deployment succeeds if all 9
              instances are successfully deployed to, and it fails if any of one
              of the 9 instances fail to be deployed to. Note that the deployment
              may successfully deploy to some instances, even if the overall
              deployment fails. This is the default deployment configuration if a
              configuration isn't specified for either the deployment or the
              deployment group.


        To create a custom deployment configuration, call the create deployment
            configuration operation.

        :type ec_2_tag_filters: list
        :param ec_2_tag_filters: The Amazon EC2 tags to filter on.

        :type auto_scaling_groups: list
        :param auto_scaling_groups: A list of associated Auto Scaling groups.

        :type service_role_arn: string
        :param service_role_arn: A service role ARN that allows AWS CodeDeploy
            to act on the user's behalf when interacting with AWS services.

        rL   rP   NrR   ec2TagFiltersautoScalingGroupsserviceRoleArnZCreateDeploymentGrouprC   rF   )r<   rN   rT   rU   ec_2_tag_filtersauto_scaling_groupsservice_role_arnrI   r@   r@   rA   create_deployment_group+  s    Fz,CodeDeployConnection.create_deployment_groupc                 C   s   d|i}| j dt|dS )z
        Deletes an application.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        rL   ZDeleteApplicationrC   rF   rM   r@   r@   rA   delete_application  s    	z'CodeDeployConnection.delete_applicationc                 C   s   d|i}| j dt|dS )ay  
        Deletes a deployment configuration.

        A deployment configuration cannot be deleted if it is
        currently in use. Also, predefined configurations cannot be
        deleted.

        :type deployment_config_name: string
        :param deployment_config_name: The name of an existing deployment
            configuration within the AWS user account.

        rR   ZDeleteDeploymentConfigrC   rF   r<   rU   rI   r@   r@   rA   delete_deployment_config  s    z-CodeDeployConnection.delete_deployment_configc                 C   s   ||d}| j dt|dS )az  
        Deletes a deployment group.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type deployment_group_name: string
        :param deployment_group_name: The name of an existing deployment group
            for the specified application.

        rX   ZDeleteDeploymentGrouprC   rF   r<   rN   rT   rI   r@   r@   rA   delete_deployment_group  s    z,CodeDeployConnection.delete_deployment_groupc                 C   s   d|i}| j dt|dS )z
        Gets information about an application.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        rL   ZGetApplicationrC   rF   rM   r@   r@   rA   get_application  s    	z$CodeDeployConnection.get_applicationc                 C   s   ||d}| j dt|dS )a{  
        Gets information about an application revision.

        :type application_name: string
        :param application_name: The name of the application that corresponds
            to the revision.

        :type revision: dict
        :param revision: Information about the application revision to get,
            including the revision's type and its location.

        rL   rQ   ZGetApplicationRevisionrC   rF   )r<   rN   rQ   rI   r@   r@   rA   get_application_revision  s    z-CodeDeployConnection.get_application_revisionc                 C   s   d|i}| j dt|dS )z
        Gets information about a deployment.

        :type deployment_id: string
        :param deployment_id: An existing deployment ID within the AWS user
            account.

        deploymentIdZGetDeploymentrC   rF   r<   deployment_idrI   r@   r@   rA   get_deployment  s    	z#CodeDeployConnection.get_deploymentc                 C   s   d|i}| j dt|dS )z
        Gets information about a deployment configuration.

        :type deployment_config_name: string
        :param deployment_config_name: The name of an existing deployment
            configuration within the AWS user account.

        rR   ZGetDeploymentConfigrC   rF   ra   r@   r@   rA   get_deployment_config  s    	z*CodeDeployConnection.get_deployment_configc                 C   s   ||d}| j dt|dS )a  
        Gets information about a deployment group.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type deployment_group_name: string
        :param deployment_group_name: The name of an existing deployment group
            for the specified application.

        rX   ZGetDeploymentGrouprC   rF   rc   r@   r@   rA   get_deployment_group  s    z)CodeDeployConnection.get_deployment_groupc                 C   s   ||d}| j dt|dS )a\  
        Gets information about an Amazon EC2 instance as part of a
        deployment.

        :type deployment_id: string
        :param deployment_id: The unique ID of a deployment.

        :type instance_id: string
        :param instance_id: The unique ID of an Amazon EC2 instance in the
            deployment's deployment group.

        )rh   Z
instanceIdZGetDeploymentInstancerC   rF   )r<   rj   Zinstance_idrI   r@   r@   rA   get_deployment_instance  s    z,CodeDeployConnection.get_deployment_instancec           	      C   s|   d|i}|dk	r||d< |dk	r(||d< |dk	r8||d< |dk	rH||d< |dk	rX||d< |dk	rh||d< | j d	t|d
S )a	  
        Lists information about revisions for an application.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type sort_by: string
        :param sort_by: The column name to sort the list results by:

        + registerTime: Sort the list results by when the revisions were
              registered with AWS CodeDeploy.
        + firstUsedTime: Sort the list results by when the revisions were first
              used by in a deployment.
        + lastUsedTime: Sort the list results by when the revisions were last
              used in a deployment.


        If not specified or set to null, the results will be returned in an
            arbitrary order.

        :type sort_order: string
        :param sort_order: The order to sort the list results by:

        + ascending: Sort the list results in ascending order.
        + descending: Sort the list results in descending order.


        If not specified, the results will be sorted in ascending order.

        If set to null, the results will be sorted in an arbitrary order.

        :type s_3_bucket: string
        :param s_3_bucket: A specific Amazon S3 bucket name to limit the search
            for revisions.
        If set to null, then all of the user's buckets will be searched.

        :type s_3_key_prefix: string
        :param s_3_key_prefix: A specific key prefix for the set of Amazon S3
            objects to limit the search for revisions.

        :type deployed: string
        :param deployed:
        Whether to list revisions based on whether the revision is the target
            revision of an deployment group:


        + include: List revisions that are target revisions of a deployment
              group.
        + exclude: Do not list revisions that are target revisions of a
              deployment group.
        + ignore: List all revisions, regardless of whether they are target
              revisions of a deployment group.

        :type next_token: string
        :param next_token: An identifier that was returned from the previous
            list application revisions call, which can be used to return the
            next set of applications in the list.

        rL   NZsortByZ	sortOrderZs3BucketZs3KeyPrefixdeployed	nextTokenZListApplicationRevisionsrC   rF   )	r<   rN   Zsort_byZ
sort_orderZ
s_3_bucketZs_3_key_prefixro   
next_tokenrI   r@   r@   rA   list_application_revisions  s     @z/CodeDeployConnection.list_application_revisionsc                 C   s(   i }|dk	r||d< | j dt|dS )a6  
        Lists the applications registered within the AWS user account.

        :type next_token: string
        :param next_token: An identifier that was returned from the previous
            list applications call, which can be used to return the next set of
            applications in the list.

        Nrp   ZListApplicationsrC   rF   r<   rq   rI   r@   r@   rA   list_applicationse  s    
z&CodeDeployConnection.list_applicationsc                 C   s(   i }|dk	r||d< | j dt|dS )aZ  
        Lists the deployment configurations within the AWS user
        account.

        :type next_token: string
        :param next_token: An identifier that was returned from the previous
            list deployment configurations call, which can be used to return
            the next set of deployment configurations in the list.

        Nrp   ZListDeploymentConfigsrC   rF   rs   r@   r@   rA   list_deployment_configsu  s    z,CodeDeployConnection.list_deployment_configsc                 C   s,   d|i}|dk	r||d< | j dt|dS )a  
        Lists the deployment groups for an application registered
        within the AWS user account.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type next_token: string
        :param next_token: An identifier that was returned from the previous
            list deployment groups call, which can be used to return the next
            set of deployment groups in the list.

        rL   Nrp   ZListDeploymentGroupsrC   rF   )r<   rN   rq   rI   r@   r@   rA   list_deployment_groups  s    z+CodeDeployConnection.list_deployment_groupsc                 C   s<   d|i}|dk	r||d< |dk	r(||d< | j dt|dS )a  
        Lists the Amazon EC2 instances for a deployment within the AWS
        user account.

        :type deployment_id: string
        :param deployment_id: The unique ID of a deployment.

        :type next_token: string
        :param next_token: An identifier that was returned from the previous
            list deployment instances call, which can be used to return the
            next set of deployment instances in the list.

        :type instance_status_filter: list
        :param instance_status_filter:
        A subset of instances to list, by status:


        + Pending: Include in the resulting list those instances with pending
              deployments.
        + InProgress: Include in the resulting list those instances with in-
              progress deployments.
        + Succeeded: Include in the resulting list those instances with
              succeeded deployments.
        + Failed: Include in the resulting list those instances with failed
              deployments.
        + Skipped: Include in the resulting list those instances with skipped
              deployments.
        + Unknown: Include in the resulting list those instances with
              deployments in an unknown state.

        rh   Nrp   ZinstanceStatusFilterZListDeploymentInstancesrC   rF   )r<   rj   rq   Zinstance_status_filterrI   r@   r@   rA   list_deployment_instances  s    !z.CodeDeployConnection.list_deployment_instancesc                 C   sh   i }|dk	r||d< |dk	r$||d< |dk	r4||d< |dk	rD||d< |dk	rT||d< | j dt|dS )	a  
        Lists the deployments under a deployment group for an
        application registered within the AWS user account.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type deployment_group_name: string
        :param deployment_group_name: The name of an existing deployment group
            for the specified application.

        :type include_only_statuses: list
        :param include_only_statuses: A subset of deployments to list, by
            status:

        + Created: Include in the resulting list created deployments.
        + Queued: Include in the resulting list queued deployments.
        + In Progress: Include in the resulting list in-progress deployments.
        + Succeeded: Include in the resulting list succeeded deployments.
        + Failed: Include in the resulting list failed deployments.
        + Aborted: Include in the resulting list aborted deployments.

        :type create_time_range: dict
        :param create_time_range: A deployment creation start- and end-time
            range for returning a subset of the list of deployments.

        :type next_token: string
        :param next_token: An identifier that was returned from the previous
            list deployments call, which can be used to return the next set of
            deployments in the list.

        NrL   rP   ZincludeOnlyStatusesZcreateTimeRangerp   ZListDeploymentsrC   rF   )r<   rN   rT   Zinclude_only_statusesZcreate_time_rangerq   rI   r@   r@   rA   list_deployments  s    %z%CodeDeployConnection.list_deploymentsc                 C   s.   ||d}|dk	r||d< | j dt|dS )a  
        Registers with AWS CodeDeploy a revision for the specified
        application.

        :type application_name: string
        :param application_name: The name of an existing AWS CodeDeploy
            application within the AWS user account.

        :type description: string
        :param description: A comment about the revision.

        :type revision: dict
        :param revision: Information about the application revision to
            register, including the revision's type and its location.

        rf   NrS   ZRegisterApplicationRevisionrC   rF   )r<   rN   rQ   rS   rI   r@   r@   rA   register_application_revision  s    z2CodeDeployConnection.register_application_revisionc                 C   s   d|i}| j dt|dS )z
        Attempts to stop an ongoing deployment.

        :type deployment_id: string
        :param deployment_id: The unique ID of a deployment.

        rh   ZStopDeploymentrC   rF   ri   r@   r@   rA   stop_deployment  s    z$CodeDeployConnection.stop_deploymentc                 C   s8   i }|dk	r||d< |dk	r$||d< | j dt|dS )ab  
        Changes an existing application's name.

        :type application_name: string
        :param application_name: The current name of the application that you
            want to change.

        :type new_application_name: string
        :param new_application_name: The new name that you want to change the
            application to.

        NrL   ZnewApplicationNameZUpdateApplicationrC   rF   )r<   rN   Znew_application_namerI   r@   r@   rA   update_application  s    z'CodeDeployConnection.update_applicationc           	      C   sn   ||d}|dk	r||d< |dk	r*||d< |dk	r:||d< |dk	rJ||d< |dk	rZ||d< | j dt|d	S )
a  
        Changes information about an existing deployment group.

        :type application_name: string
        :param application_name: The application name corresponding to the
            deployment group to update.

        :type current_deployment_group_name: string
        :param current_deployment_group_name: The current name of the existing
            deployment group.

        :type new_deployment_group_name: string
        :param new_deployment_group_name: The new name of the deployment group,
            if you want to change it.

        :type deployment_config_name: string
        :param deployment_config_name: The replacement deployment configuration
            name to use, if you want to change it.

        :type ec_2_tag_filters: list
        :param ec_2_tag_filters: The replacement set of Amazon EC2 tags to
            filter on, if you want to change them.

        :type auto_scaling_groups: list
        :param auto_scaling_groups: The replacement list of Auto Scaling groups
            to be included in the deployment group, if you want to change them.

        :type service_role_arn: string
        :param service_role_arn: A replacement service role's ARN, if you want
            to change it.

        )rL   ZcurrentDeploymentGroupNameNZnewDeploymentGroupNamerR   rY   rZ   r[   ZUpdateDeploymentGrouprC   rF   )	r<   rN   Zcurrent_deployment_group_nameZnew_deployment_group_namerU   r\   r]   r^   rI   r@   r@   rA   update_deployment_group4  s     (z,CodeDeployConnection.update_deployment_groupc           
      C   s   d| j |f | jjdtt|d}| jdddi ||d}| j|d dd}| d	}t	j
| |jd
kr~|rt|S n8t|}|dd }| j|| j}	|	|j|j|dd S )Nz%s.%szapplication/x-amz-json-1.1)zX-Amz-TargetHostzContent-TypezContent-LengthPOST/)methodpathZ	auth_pathrI   headersdata
   )ZsenderZoverride_num_retrieszutf-8   Z__type)rE   )TargetPrefixr4   r9   strlenZbuild_base_http_requestZ_mexereaddecodebotologdebugstatusr   loadsget_faultsResponseErrorreason)
r<   rD   rE   r   http_requestresponseZresponse_bodyZ	json_bodyZ
fault_nameZexception_classr@   r@   rA   rG   l  s6    
    


z!CodeDeployConnection.make_request)N)N)NNNNN)N)NNNN)NNNNNN)N)N)N)NN)NNNNN)N)NN)NNNNN)V__name__
__module____qualname____doc__Z
APIVersionr7   r8   ZServiceNamer   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r   r;   rB   rJ   rK   rO   rV   rW   r_   r`   rb   rd   re   rg   rk   rl   rm   rn   rr   rt   ru   rv   rw   rx   ry   rz   r{   r|   rG   __classcell__r@   r@   r>   rA   r      s   =0

      
9 
'    
T        
P


  
)      
4 
  
     
8r   )r   Zboto.compatr   Zboto.connectionr   Zboto.regioninfor   Zboto.exceptionr   Zboto.codedeployr   r   r@   r@   r@   rA   <module>   s   