batchGetDeploymentInstances method

Future<BatchGetDeploymentInstancesOutput> batchGetDeploymentInstances({
  1. required String deploymentId,
  2. required List<String> instanceIds,
})
Returns an array of one or more instances associated with a deployment. This method works with EC2/On-premises and Lambda compute platforms. The newer BatchGetDeploymentTargets works with all compute platforms. The maximum number of instances that can be returned is 25.

May throw BatchLimitExceededException. May throw DeploymentDoesNotExistException. May throw DeploymentIdRequiredException. May throw InstanceIdRequiredException. May throw InvalidComputePlatformException. May throw InvalidDeploymentIdException. May throw InvalidInstanceNameException.

Parameter deploymentId : The unique ID of a deployment.

Parameter instanceIds : The unique IDs of instances used in the deployment. The maximum number of instance IDs you can specify is 25.

Implementation

Future<BatchGetDeploymentInstancesOutput> batchGetDeploymentInstances({
  required String deploymentId,
  required List<String> instanceIds,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.BatchGetDeploymentInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'deploymentId': deploymentId,
      'instanceIds': instanceIds,
    },
  );

  return BatchGetDeploymentInstancesOutput.fromJson(jsonResponse.body);
}