deleteTrafficPolicy method

Future<void> deleteTrafficPolicy({
  1. required String id,
  2. required int version,
})

Deletes a traffic policy.

When you delete a traffic policy, Route 53 sets a flag on the policy to indicate that it has been deleted. However, Route 53 never fully deletes the traffic policy. Note the following:

  • Deleted traffic policies aren't listed if you run ListTrafficPolicies.
  • There's no way to get a list of deleted policies.
  • If you retain the ID of the policy, you can get information about the policy, including the traffic policy document, by running GetTrafficPolicy.

May throw NoSuchTrafficPolicy. May throw InvalidInput. May throw TrafficPolicyInUse. May throw ConcurrentModification.

Parameter id : The ID of the traffic policy that you want to delete.

Parameter version : The version number of the traffic policy that you want to delete.

Implementation

Future<void> deleteTrafficPolicy({
  required String id,
  required int version,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    36,
    isRequired: true,
  );
  ArgumentError.checkNotNull(version, 'version');
  _s.validateNumRange(
    'version',
    version,
    1,
    1000,
    isRequired: true,
  );
  await _protocol.send(
    method: 'DELETE',
    requestUri:
        '/2013-04-01/trafficpolicy/${Uri.encodeComponent(id)}/${Uri.encodeComponent(version.toString())}',
    exceptionFnMap: _exceptionFns,
  );
}