Skip to content

list_deployment_instances

list_deployment_instances(
    deployment_id: DeploymentId,
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
    next_token: Optional[NextToken] = None,
    instance_status_filter: Optional[InstanceStatusList] = None,
    instance_type_filter: Optional[InstanceTypeList] = None,
) -> ListDeploymentInstancesOutput

The newer BatchGetDeploymentTargets should be used instead because it works with all compute types. ListDeploymentInstances throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.

Lists the instance for a deployment associated with the user or Amazon Web Services account.

Parameters:

  • deployment_id (DeploymentId) –

    The unique ID of a deployment.

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

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

  • instance_status_filter (Optional[InstanceStatusList], default: None ) –

    A subset of instances to list by status:

    • Pending: Include those instances with pending deployments.

    • InProgress: Include those instances where deployments are still in progress.

    • Succeeded: Include those instances with successful deployments.

    • Failed: Include those instances with failed deployments.

    • Skipped: Include those instances with skipped deployments.

    • Unknown: Include those instances with deployments in an unknown state.

  • instance_type_filter (Optional[InstanceTypeList], default: None ) –

    The set of instances in a blue/green deployment, either those in the original environment ("BLUE") or those in the replacement environment ("GREEN"), for which you want to view instance information.

Raises:

Source code in docs_src/capo_codedeploy/_services/code_deploy.py
def list_deployment_instances(
    self,
    deployment_id: "capo_codedeploy.types.deployment_id.DeploymentId",
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
    next_token: Optional["capo_codedeploy.types.next_token.NextToken"] = None,
    instance_status_filter: Optional[
        "capo_codedeploy.types.instance_status_list.InstanceStatusList"
    ] = None,
    instance_type_filter: Optional[
        "capo_codedeploy.types.instance_type_list.InstanceTypeList"
    ] = None,
) -> "capo_codedeploy.types.list_deployment_instances_output.ListDeploymentInstancesOutput":
    """<note> <p> The newer <code>BatchGetDeploymentTargets</code> should be used instead because it works with all compute types. <code>ListDeploymentInstances</code> throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda. </p> </note> <p> Lists the instance for a deployment associated with the user or Amazon Web Services account. </p>

    Args:
        deployment_id: <p> The unique ID of a deployment. </p>
        next_token: <p>An identifier returned from the previous list deployment instances call. It can be used to return the next set of deployment instances in the list.</p>
        instance_status_filter: <p>A subset of instances to list by status:</p> <ul> <li> <p> <code>Pending</code>: Include those instances with pending deployments.</p> </li> <li> <p> <code>InProgress</code>: Include those instances where deployments are still in progress.</p> </li> <li> <p> <code>Succeeded</code>: Include those instances with successful deployments.</p> </li> <li> <p> <code>Failed</code>: Include those instances with failed deployments.</p> </li> <li> <p> <code>Skipped</code>: Include those instances with skipped deployments.</p> </li> <li> <p> <code>Unknown</code>: Include those instances with deployments in an unknown state.</p> </li> </ul>
        instance_type_filter: <p>The set of instances in a blue/green deployment, either those in the original environment ("BLUE") or those in the replacement environment ("GREEN"), for which you want to view instance information.</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.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_compute_platform_exception.InvalidComputePlatformException: <p>The computePlatform is invalid. The computePlatform should be <code>Lambda</code>, <code>Server</code>, or <code>ECS</code>.</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.
    """

    def _handler(
        req: "OperationRequest[capo_codedeploy.types.list_deployment_instances_input.ListDeploymentInstancesInput]",
    ) -> OperationResponse[
        "capo_codedeploy.types.list_deployment_instances_output.ListDeploymentInstancesOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.list_deployment_instances

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDeploymentInstances")
    )
    input_: capo_codedeploy.types.list_deployment_instances_input.ListDeploymentInstancesInput = {
        "deployment_id": deployment_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if instance_status_filter is not None:
        input_["instance_status_filter"] = instance_status_filter
    if instance_type_filter is not None:
        input_["instance_type_filter"] = instance_type_filter

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