:doc:`CodeDeploy <../../codedeploy>` / Client / list_deployments

****************
list_deployments
****************



.. py:method:: CodeDeploy.Client.list_deployments(**kwargs)

  

  Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeployments>`_  


  **Request Syntax**
  ::

    response = client.list_deployments(
        applicationName='string',
        deploymentGroupName='string',
        externalId='string',
        includeOnlyStatuses=[
            'Created'|'Queued'|'InProgress'|'Baking'|'Succeeded'|'Failed'|'Stopped'|'Ready',
        ],
        createTimeRange={
            'start': datetime(2015, 1, 1),
            'end': datetime(2015, 1, 1)
        },
        nextToken='string'
    )
    
  :type applicationName: string
  :param applicationName: 

    The name of an CodeDeploy application associated with the user or Amazon Web Services account.

     

    .. note::

      

      If ``applicationName`` is specified, then ``deploymentGroupName`` must be specified. If it is not specified, then ``deploymentGroupName`` must not be specified.

      

    

  
  :type deploymentGroupName: string
  :param deploymentGroupName: 

    The name of a deployment group for the specified application.

     

    .. note::

      

      If ``deploymentGroupName`` is specified, then ``applicationName`` must be specified. If it is not specified, then ``applicationName`` must not be specified.

      

    

  
  :type externalId: string
  :param externalId: 

    The unique ID of an external resource for returning deployments linked to the external resource.

    

  
  :type includeOnlyStatuses: list
  :param includeOnlyStatuses: 

    A subset of deployments to list by status:

     

    
    * ``Created``: Include created deployments in the resulting list.
     
    * ``Queued``: Include queued deployments in the resulting list.
     
    * ``In Progress``: Include in-progress deployments in the resulting list.
     
    * ``Succeeded``: Include successful deployments in the resulting list.
     
    * ``Failed``: Include failed deployments in the resulting list.
     
    * ``Stopped``: Include stopped deployments in the resulting list.
    

    

  
    - *(string) --* 

    

  :type createTimeRange: dict
  :param createTimeRange: 

    A time range (start and end) for returning a subset of the list of deployments.

    

  
    - **start** *(datetime) --* 

      The start time of the time range.

       

      .. note::

        

        Specify null to leave the start time open-ended.

        

      

    
    - **end** *(datetime) --* 

      The end time of the time range.

       

      .. note::

        

        Specify null to leave the end time open-ended.

        

      

    
  
  :type nextToken: string
  :param nextToken: 

    An identifier returned from the previous list deployments call. It can be used to return the next set of deployments in the list.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'deployments': [
              'string',
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the output of a ``ListDeployments`` operation.

      
      

      - **deployments** *(list) --* 

        A list of deployment IDs.

        
        

        - *(string) --* 
    
      

      - **nextToken** *(string) --* 

        If a large amount of information is returned, an identifier is also returned. It can be used in a subsequent list deployments call to return the next set of deployments in the list.

        
  
  **Exceptions**
  
  *   :py:class:`CodeDeploy.Client.exceptions.ApplicationNameRequiredException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidApplicationNameException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.ApplicationDoesNotExistException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidDeploymentGroupNameException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.DeploymentGroupDoesNotExistException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.DeploymentGroupNameRequiredException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidTimeRangeException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidDeploymentStatusException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidNextTokenException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidExternalIdException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidInputException`

  