addEndpoints method
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.
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);
}