getServers method

Future<GetServersResponse> getServers({
  1. int? maxResults,
  2. String? nextToken,
  3. List<VmServerAddress>? vmServerAddressList,
})

Describes the servers in your server catalog.

Before you can describe your servers, you must import them using ImportServerCatalog.

May throw UnauthorizedOperationException. May throw InvalidParameterException. May throw MissingRequiredParameterException. May throw InternalError.

Parameter maxResults : The maximum number of results to return in a single call. The default value is 50. To retrieve the remaining results, make another call with the returned NextToken value.

Parameter nextToken : The token for the next set of results.

Parameter vmServerAddressList : The server addresses.

Implementation

Future<GetServersResponse> getServers({
  int? maxResults,
  String? nextToken,
  List<VmServerAddress>? vmServerAddressList,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSServerMigrationService_V2016_10_24.GetServers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (vmServerAddressList != null)
        'vmServerAddressList': vmServerAddressList,
    },
  );

  return GetServersResponse.fromJson(jsonResponse.body);
}