Skip to content

list_deployments

list_deployments(
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
    application_name: Optional[ApplicationName] = None,
    deployment_group_name: Optional[DeploymentGroupName] = None,
    external_id: Optional[ExternalId] = None,
    include_only_statuses: Optional[DeploymentStatusList] = None,
    create_time_range: Optional[TimeRange] = None,
    next_token: Optional[NextToken] = None,
) -> ListDeploymentsOutput

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

Parameters:

  • application_name (Optional[ApplicationName], default: None ) –

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

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

  • deployment_group_name (Optional[DeploymentGroupName], default: None ) –

    The name of a deployment group for the specified application.

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

  • external_id (Optional[ExternalId], default: None ) –

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

  • include_only_statuses (Optional[DeploymentStatusList], default: None ) –

    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.

  • create_time_range (Optional[TimeRange], default: None ) –

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

  • next_token (Optional[NextToken], default: None ) –

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

Raises:

Source code in docs_src/capo_codedeploy/_services/code_deploy.py
def list_deployments(
    self,
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
    application_name: Optional[
        "capo_codedeploy.types.application_name.ApplicationName"
    ] = None,
    deployment_group_name: Optional[
        "capo_codedeploy.types.deployment_group_name.DeploymentGroupName"
    ] = None,
    external_id: Optional["capo_codedeploy.types.external_id.ExternalId"] = None,
    include_only_statuses: Optional[
        "capo_codedeploy.types.deployment_status_list.DeploymentStatusList"
    ] = None,
    create_time_range: Optional[
        "capo_codedeploy.types.time_range.TimeRange"
    ] = None,
    next_token: Optional["capo_codedeploy.types.next_token.NextToken"] = None,
) -> "capo_codedeploy.types.list_deployments_output.ListDeploymentsOutput":
    """<p>Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.</p>

    Args:
        application_name: <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p> <note> <p>If <code>applicationName</code> is specified, then <code>deploymentGroupName</code> must be specified. If it is not specified, then <code>deploymentGroupName</code> must not be specified. </p> </note>
        deployment_group_name: <p>The name of a deployment group for the specified application.</p> <note> <p>If <code>deploymentGroupName</code> is specified, then <code>applicationName</code> must be specified. If it is not specified, then <code>applicationName</code> must not be specified. </p> </note>
        external_id: <p>The unique ID of an external resource for returning deployments linked to the external resource.</p>
        include_only_statuses: <p>A subset of deployments to list by status:</p> <ul> <li> <p> <code>Created</code>: Include created deployments in the resulting list.</p> </li> <li> <p> <code>Queued</code>: Include queued deployments in the resulting list.</p> </li> <li> <p> <code>In Progress</code>: Include in-progress deployments in the resulting list.</p> </li> <li> <p> <code>Succeeded</code>: Include successful deployments in the resulting list.</p> </li> <li> <p> <code>Failed</code>: Include failed deployments in the resulting list.</p> </li> <li> <p> <code>Stopped</code>: Include stopped deployments in the resulting list.</p> </li> </ul>
        create_time_range: <p>A time range (start and end) for returning a subset of the list of deployments.</p>
        next_token: <p>An identifier returned from the previous list deployments call. It can be used to return the next set of deployments in the list.</p>

    Raises:
        capo_codedeploy.errors.application_does_not_exist_exception.ApplicationDoesNotExistException: <p>The application does not exist with the user or Amazon Web Services account.</p>
        capo_codedeploy.errors.application_name_required_exception.ApplicationNameRequiredException: <p>The minimum number of required application names was not specified.</p>
        capo_codedeploy.errors.deployment_group_does_not_exist_exception.DeploymentGroupDoesNotExistException: <p>The named deployment group with the user or Amazon Web Services account does not exist.</p>
        capo_codedeploy.errors.deployment_group_name_required_exception.DeploymentGroupNameRequiredException: <p>The deployment group name was not specified.</p>
        capo_codedeploy.errors.invalid_application_name_exception.InvalidApplicationNameException: <p>The application name was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_deployment_group_name_exception.InvalidDeploymentGroupNameException: <p>The deployment group name was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_deployment_status_exception.InvalidDeploymentStatusException: <p>The specified deployment status doesn't exist or cannot be determined.</p>
        capo_codedeploy.errors.invalid_external_id_exception.InvalidExternalIdException: <p>The external ID was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_input_exception.InvalidInputException: <p>The input was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The next token was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_time_range_exception.InvalidTimeRangeException: <p>The specified time range was specified in an invalid format.</p>
        capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codedeploy.types.list_deployments_input.ListDeploymentsInput]",
    ) -> OperationResponse[
        "capo_codedeploy.types.list_deployments_output.ListDeploymentsOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.list_deployments

        output, http_response = (
            capo_codedeploy._operations.code_deploy_20141006.list_deployments.list_deployments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDeployments")
    )
    input_: capo_codedeploy.types.list_deployments_input.ListDeploymentsInput = {}
    if application_name is not None:
        input_["application_name"] = application_name
    if deployment_group_name is not None:
        input_["deployment_group_name"] = deployment_group_name
    if external_id is not None:
        input_["external_id"] = external_id
    if include_only_statuses is not None:
        input_["include_only_statuses"] = include_only_statuses
    if create_time_range is not None:
        input_["create_time_range"] = create_time_range
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output