detachTrafficSources method

Future<void> detachTrafficSources({
  1. required String autoScalingGroupName,
  2. required List<TrafficSourceIdentifier> trafficSources,
})

Detaches one or more traffic sources from the specified Auto Scaling group.

When you detach a traffic source, it enters the Removing state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the traffic source using the DescribeTrafficSources API call. The instances continue to run.

May throw ResourceContentionFault.

Parameter autoScalingGroupName : The name of the Auto Scaling group.

Parameter trafficSources : The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.

Implementation

Future<void> detachTrafficSources({
  required String autoScalingGroupName,
  required List<TrafficSourceIdentifier> trafficSources,
}) async {
  final $request = <String, String>{
    'AutoScalingGroupName': autoScalingGroupName,
    if (trafficSources.isEmpty)
      'TrafficSources': ''
    else
      for (var i1 = 0; i1 < trafficSources.length; i1++)
        for (var e3 in trafficSources[i1].toQueryMap().entries)
          'TrafficSources.member.${i1 + 1}.${e3.key}': e3.value,
  };
  await _protocol.send(
    $request,
    action: 'DetachTrafficSources',
    version: '2011-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DetachTrafficSourcesResult',
  );
}