removeEndpoints method

Future<void> removeEndpoints({
  1. required String endpointGroupArn,
  2. required List<EndpointIdentifier> endpointIdentifiers,
})

Remove endpoints from an endpoint group.

The RemoveEndpoints API operation is the recommended option for removing endpoints. The alternative is to remove endpoints by updating an endpoint group by using the UpdateEndpointGroup API operation. There are two advantages to using AddEndpoints to remove endpoints instead:

  • It's more convenient, because you only need to specify the endpoints that you want to remove. With the UpdateEndpointGroup API operation, you must specify all of the endpoints in the endpoint group except the ones that you want to remove from the group.
  • It's faster, because Global Accelerator doesn't need to resolve any endpoints. With the UpdateEndpointGroup API operation, Global Accelerator must resolve all of the endpoints that remain in the group.

May throw AccessDeniedException. May throw EndpointGroupNotFoundException. May throw InternalServiceErrorException. May throw InvalidArgumentException. May throw TransactionInProgressException.

Parameter endpointGroupArn : The Amazon Resource Name (ARN) of the endpoint group.

Parameter endpointIdentifiers : The identifiers of the endpoints that you want to remove.

Implementation

Future<void> removeEndpoints({
  required String endpointGroupArn,
  required List<EndpointIdentifier> endpointIdentifiers,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GlobalAccelerator_V20180706.RemoveEndpoints'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndpointGroupArn': endpointGroupArn,
      'EndpointIdentifiers': endpointIdentifiers,
    },
  );
}