Skip to content

list_deployment_targets async

list_deployment_targets(
    deployment_id: DeploymentId,
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
    next_token: Optional[NextToken] = None,
    target_filters: Optional[TargetFilters] = None,
) -> ListDeploymentTargetsOutput

Returns an array of target IDs that are associated a deployment.

Parameters:

  • deployment_id (DeploymentId) –

    The unique ID of a deployment.

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

    A token identifier returned from the previous ListDeploymentTargets call. It can be used to return the next set of deployment targets in the list.

  • target_filters (Optional[TargetFilters], default: None ) –

    A key used to filter the returned targets. The two valid values are:

    • TargetStatus - A TargetStatus filter string can be Failed, InProgress, Pending, Ready, Skipped, Succeeded, or Unknown.

    • ServerInstanceLabel - A ServerInstanceLabel filter string can be Blue or Green.

Raises:

Source code in docs_src/capo_codedeploy/_services/async_code_deploy.py
async def list_deployment_targets(
    self,
    deployment_id: "capo_codedeploy.types.deployment_id.DeploymentId",
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
    next_token: Optional["capo_codedeploy.types.next_token.NextToken"] = None,
    target_filters: Optional[
        "capo_codedeploy.types.target_filters.TargetFilters"
    ] = None,
) -> "capo_codedeploy.types.list_deployment_targets_output.ListDeploymentTargetsOutput":
    """<p> Returns an array of target IDs that are associated a deployment. </p>

    Args:
        deployment_id: <p> The unique ID of a deployment. </p>
        next_token: <p> A token identifier returned from the previous <code>ListDeploymentTargets</code> call. It can be used to return the next set of deployment targets in the list. </p>
        target_filters: <p> A key used to filter the returned targets. The two valid values are:</p> <ul> <li> <p> <code>TargetStatus</code> - A <code>TargetStatus</code> filter string can be <code>Failed</code>, <code>InProgress</code>, <code>Pending</code>, <code>Ready</code>, <code>Skipped</code>, <code>Succeeded</code>, or <code>Unknown</code>. </p> </li> <li> <p> <code>ServerInstanceLabel</code> - A <code>ServerInstanceLabel</code> filter string can be <code>Blue</code> or <code>Green</code>. </p> </li> </ul>

    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.deployment_does_not_exist_exception.DeploymentDoesNotExistException: <p>The deployment with the user or Amazon Web Services account does not exist.</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_id_required_exception.DeploymentIdRequiredException: <p>At least one deployment ID must be specified.</p>
        capo_codedeploy.errors.deployment_not_started_exception.DeploymentNotStartedException: <p>The specified deployment has not started.</p>
        capo_codedeploy.errors.invalid_deployment_id_exception.InvalidDeploymentIdException: <p>At least one of the deployment IDs was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_deployment_instance_type_exception.InvalidDeploymentInstanceTypeException: <p>An instance type was specified for an in-place deployment. Instance types are supported for blue/green deployments only.</p>
        capo_codedeploy.errors.invalid_instance_status_exception.InvalidInstanceStatusException: <p>The specified instance status does not exist.</p>
        capo_codedeploy.errors.invalid_instance_type_exception.InvalidInstanceTypeException: <p>An invalid instance type was specified for instances in a blue/green deployment. Valid values include "Blue" for an original environment and "Green" for a replacement environment.</p>
        capo_codedeploy.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The next token was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_target_filter_name_exception.InvalidTargetFilterNameException: <p> The target filter name is invalid. </p>
        capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codedeploy.types.list_deployment_targets_input.ListDeploymentTargetsInput]",
    ) -> AsyncOperationResponse[
        "capo_codedeploy.types.list_deployment_targets_output.ListDeploymentTargetsOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.list_deployment_targets

        (
            output,
            http_response,
        ) = await capo_codedeploy._operations.code_deploy_20141006.list_deployment_targets.async_list_deployment_targets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDeploymentTargets")
    )
    input_: capo_codedeploy.types.list_deployment_targets_input.ListDeploymentTargetsInput = {
        "deployment_id": deployment_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if target_filters is not None:
        input_["target_filters"] = target_filters

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output