describeInstancesHealth method

Future<DescribeInstancesHealthResult> describeInstancesHealth({
  1. List<InstancesHealthAttribute>? attributeNames,
  2. String? environmentId,
  3. String? environmentName,
  4. String? nextToken,
})

Retrieves detailed information about the health of instances in your AWS Elastic Beanstalk. This operation requires enhanced health reporting.

May throw ElasticBeanstalkServiceException. May throw InvalidRequestException.

Parameter attributeNames : Specifies the response elements you wish to receive. To retrieve all attributes, set to All. If no attribute names are specified, returns a list of instances.

Parameter environmentId : Specify the AWS Elastic Beanstalk environment by ID.

Parameter environmentName : Specify the AWS Elastic Beanstalk environment by name.

Parameter nextToken : Specify the pagination token returned by a previous call.

Implementation

Future<DescribeInstancesHealthResult> describeInstancesHealth({
  List<InstancesHealthAttribute>? attributeNames,
  String? environmentId,
  String? environmentName,
  String? nextToken,
}) async {
  final $request = <String, String>{
    if (attributeNames != null)
      if (attributeNames.isEmpty)
        'AttributeNames': ''
      else
        for (var i1 = 0; i1 < attributeNames.length; i1++)
          'AttributeNames.member.${i1 + 1}': attributeNames[i1].value,
    if (environmentId != null) 'EnvironmentId': environmentId,
    if (environmentName != null) 'EnvironmentName': environmentName,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final $result = await _protocol.send(
    $request,
    action: 'DescribeInstancesHealth',
    version: '2010-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DescribeInstancesHealthResult',
  );
  return DescribeInstancesHealthResult.fromXml($result);
}