listServers method
Returns a list of all the servers.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter filterValue :
Specifies the filter value, which is based on the type of server criteria.
For example, if serverCriteria is OS_NAME, and
the filterValue is equal to WindowsServer, then
ListServers returns all of the servers matching the OS name
WindowsServer.
Parameter groupIdFilter :
Specifies the group ID to filter on.
Parameter maxResults :
The maximum number of items to include in the response. The maximum value
is 100.
Parameter nextToken :
The token from a previous call that you use to retrieve the next set of
results. For example, if a previous call to this action returned 100
items, but you set maxResults to 10. You'll receive a set of
10 results along with a token. You then use the returned token to retrieve
the next set of 10.
Parameter serverCriteria :
Criteria for filtering servers.
Parameter sort :
Specifies whether to sort by ascending (ASC) or descending
(DESC) order.
Implementation
Future<ListServersResponse> listServers({
String? filterValue,
List<Group>? groupIdFilter,
int? maxResults,
String? nextToken,
ServerCriteria? serverCriteria,
SortOrder? sort,
}) async {
final $payload = <String, dynamic>{
if (filterValue != null) 'filterValue': filterValue,
if (groupIdFilter != null) 'groupIdFilter': groupIdFilter,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (serverCriteria != null) 'serverCriteria': serverCriteria.value,
if (sort != null) 'sort': sort.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/list-servers',
exceptionFnMap: _exceptionFns,
);
return ListServersResponse.fromJson(response);
}