addEndpoints method

Future<AddEndpointsResponse> addEndpoints({
  1. required List<EndpointConfiguration> endpointConfigurations,
  2. required String endpointGroupArn,
})

Add endpoints to an endpoint group. The AddEndpoints API operation is the recommended option for adding endpoints. The alternative options are to add endpoints when you create an endpoint group (with the CreateEndpointGroup API) or when you update an endpoint group (with the UpdateEndpointGroup API).

There are two advantages to using AddEndpoints to add endpoints in Global Accelerator:

  • It's faster, because Global Accelerator only has to resolve the new endpoints that you're adding, rather than resolving new and existing endpoints.
  • It's more convenient, because you don't need to specify the current endpoints that are already in the endpoint group, in addition to the new endpoints that you want to add.
For information about endpoint types and requirements for endpoints that you can add to Global Accelerator, see Endpoints for standard accelerators in the Global Accelerator Developer Guide.

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

Parameter endpointConfigurations : The list of endpoint objects.

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

Implementation

Future<AddEndpointsResponse> addEndpoints({
  required List<EndpointConfiguration> endpointConfigurations,
  required String endpointGroupArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GlobalAccelerator_V20180706.AddEndpoints'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndpointConfigurations': endpointConfigurations,
      'EndpointGroupArn': endpointGroupArn,
    },
  );

  return AddEndpointsResponse.fromJson(jsonResponse.body);
}