listInstances method

Future<ListInstancesResponse> listInstances({
  1. List<Filter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the EC2 instances providing user-based subscriptions.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter filters : You can use the following filters to streamline results:

  • Status
  • InstanceId

Parameter maxResults : The maximum number of results to return from a single request.

Parameter nextToken : A token to specify where to start paginating. This is the nextToken from a previously truncated response.

Implementation

Future<ListInstancesResponse> listInstances({
  List<Filter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  final $payload = <String, dynamic>{
    if (filters != null) 'Filters': filters,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/instance/ListInstances',
    exceptionFnMap: _exceptionFns,
  );
  return ListInstancesResponse.fromJson(response);
}