Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated BatchGetDeploymentInstances. The maximum number of targets that can be returned is 25.
The type of targets returned depends on the deployment's compute platform or deployment method:
-
EC2/On-premises: Information about Amazon EC2 instance targets.
-
Lambda: Information about Lambda functions targets.
-
Amazon ECS: Information about Amazon ECS service targets.
-
CloudFormation: Information about targets of blue/green deployments initiated by a CloudFormation stack update.
Parameters:
-
deployment_id
(DeploymentId)
–
The unique ID of a deployment.
-
target_ids
(TargetIdList)
–
The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.
-
For deployments that use the EC2/On-premises compute platform, the target IDs are Amazon EC2 or on-premises instances IDs, and their target type is instanceTarget.
-
For deployments that use the Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is instanceTarget.
-
For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format :. Their target type is ecsTarget.
-
For deployments that are deployed with CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is cloudFormationTarget.
Raises:
Source code in docs_src/capo_codedeploy/_services/code_deploy.py
| def batch_get_deployment_targets(
self,
deployment_id: "capo_codedeploy.types.deployment_id.DeploymentId",
target_ids: "capo_codedeploy.types.target_id_list.TargetIdList",
*,
config_overrides: Optional[CodeDeployClientConfig] = None,
) -> "capo_codedeploy.types.batch_get_deployment_targets_output.BatchGetDeploymentTargetsOutput":
"""<p> Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated <code>BatchGetDeploymentInstances</code>. The maximum number of targets that can be returned is 25.</p> <p> The type of targets returned depends on the deployment's compute platform or deployment method: </p> <ul> <li> <p> <b>EC2/On-premises</b>: Information about Amazon EC2 instance targets. </p> </li> <li> <p> <b>Lambda</b>: Information about Lambda functions targets. </p> </li> <li> <p> <b>Amazon ECS</b>: Information about Amazon ECS service targets. </p> </li> <li> <p> <b>CloudFormation</b>: Information about targets of blue/green deployments initiated by a CloudFormation stack update.</p> </li> </ul>
Args:
deployment_id: <p> The unique ID of a deployment. </p>
target_ids: <p> The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.</p> <ul> <li> <p> For deployments that use the EC2/On-premises compute platform, the target IDs are Amazon EC2 or on-premises instances IDs, and their target type is <code>instanceTarget</code>. </p> </li> <li> <p> For deployments that use the Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is <code>instanceTarget</code>. </p> </li> <li> <p> For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format <code><clustername>:<servicename></code>. Their target type is <code>ecsTarget</code>. </p> </li> <li> <p> For deployments that are deployed with CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is <code>cloudFormationTarget</code>. </p> </li> </ul>
Raises:
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_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.deployment_target_does_not_exist_exception.DeploymentTargetDoesNotExistException: <p> The provided target ID does not belong to the attempted deployment. </p>
capo_codedeploy.errors.deployment_target_id_required_exception.DeploymentTargetIdRequiredException: <p> A deployment target ID was not provided. </p>
capo_codedeploy.errors.deployment_target_list_size_exceeded_exception.DeploymentTargetListSizeExceededException: <p> The maximum number of targets that can be associated with an Amazon ECS or Lambda deployment was exceeded. The target list of both types of deployments must have exactly one item. This exception does not apply to EC2/On-premises deployments. </p>
capo_codedeploy.errors.instance_does_not_exist_exception.InstanceDoesNotExistException: <p>The specified instance does not exist in the deployment group.</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_target_id_exception.InvalidDeploymentTargetIdException: <p> The target ID provided was not valid. </p>
capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_codedeploy.types.batch_get_deployment_targets_input.BatchGetDeploymentTargetsInput]",
) -> OperationResponse[
"capo_codedeploy.types.batch_get_deployment_targets_output.BatchGetDeploymentTargetsOutput"
]:
import capo_codedeploy._operations.code_deploy_20141006.batch_get_deployment_targets
output, http_response = (
capo_codedeploy._operations.code_deploy_20141006.batch_get_deployment_targets.batch_get_deployment_targets(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("BatchGetDeploymentTargets")
)
input_: capo_codedeploy.types.batch_get_deployment_targets_input.BatchGetDeploymentTargetsInput = {
"deployment_id": deployment_id,
"target_ids": target_ids,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|