listServerNeighbors method

Future<ListServerNeighborsResponse> listServerNeighbors({
  1. required String configurationId,
  2. int? maxResults,
  3. List<String>? neighborConfigurationIds,
  4. String? nextToken,
  5. bool? portInformationNeeded,
})

Retrieves a list of servers that are one network hop away from a specified server.

May throw AuthorizationErrorException. May throw InvalidParameterException. May throw InvalidParameterValueException. May throw ServerInternalErrorException. May throw HomeRegionNotSetException.

Parameter configurationId : Configuration ID of the server for which neighbors are being listed.

Parameter maxResults : Maximum number of results to return in a single page of output.

Parameter neighborConfigurationIds : List of configuration IDs to test for one-hop-away.

Parameter nextToken : Token to retrieve the next set of results. For example, if you previously specified 100 IDs for ListServerNeighborsRequest$neighborConfigurationIds but set ListServerNeighborsRequest$maxResults to 10, you received a set of 10 results along with a token. Use that token in this query to get the next set of 10.

Parameter portInformationNeeded : Flag to indicate if port and protocol information is needed as part of the response.

Implementation

Future<ListServerNeighborsResponse> listServerNeighbors({
  required String configurationId,
  int? maxResults,
  List<String>? neighborConfigurationIds,
  String? nextToken,
  bool? portInformationNeeded,
}) async {
  ArgumentError.checkNotNull(configurationId, 'configurationId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSPoseidonService_V2015_11_01.ListServerNeighbors'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'configurationId': configurationId,
      if (maxResults != null) 'maxResults': maxResults,
      if (neighborConfigurationIds != null)
        'neighborConfigurationIds': neighborConfigurationIds,
      if (nextToken != null) 'nextToken': nextToken,
      if (portInformationNeeded != null)
        'portInformationNeeded': portInformationNeeded,
    },
  );

  return ListServerNeighborsResponse.fromJson(jsonResponse.body);
}