listMicrovms method
Lists MicroVMs in the account with optional filtering by image and version. We recommend using pagination to ensure that the operation returns quickly and successfully.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter imageIdentifier :
Optional filter to list only MicroVMs running the specified image.
Parameter imageVersion :
Optional filter to list only MicroVMs running the specified image version.
Parameter maxResults :
The maximum number of results to return in a single call.
Parameter nextToken :
The pagination token from a previous call. Use this token to retrieve the
next page of results.
Implementation
Future<ListMicrovmsResponse> listMicrovms({
String? imageIdentifier,
String? imageVersion,
int? maxResults,
String? nextToken,
}) async {
final $query = <String, List<String>>{
if (imageIdentifier != null) 'imageIdentifier': [imageIdentifier],
if (imageVersion != null) 'imageVersion': [imageVersion],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/2025-09-09/microvms',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListMicrovmsResponse.fromJson(response);
}