deleteBGPPeer method

Future<DeleteBGPPeerResponse> deleteBGPPeer({
  1. int? asn,
  2. int? asnLong,
  3. String? bgpPeerId,
  4. String? customerAddress,
  5. String? virtualInterfaceId,
})

Deletes the specified BGP peer on the specified virtual interface with the specified customer address and ASN.

You cannot delete the last BGP peer from a virtual interface.

May throw DirectConnectClientException. May throw DirectConnectServerException.

Parameter asn : The autonomous system number (ASN). The valid range is from 1 to 2147483646 for Border Gateway Protocol (BGP) configuration. If you provide a number greater than the maximum, an error is returned. Use asnLong instead.

  • You can use asnLong or asn, but not both. We recommend using asnLong as it supports a greater pool of numbers.
  • If you provide a value in the same API call for both asn and asnLong, the API will only accept the value for asnLong.
  • If you enter a 4-byte ASN for the asn parameter, the API returns an error.
  • If you are using a 2-byte ASN, the API response will include the 2-byte value for both the asn and asnLong fields.

Parameter asnLong : The long ASN for the BGP peer to be deleted from a Direct Connect virtual interface. The valid range is from 1 to 4294967294 for BGP configuration.

Note the following limitations when using asnLong:

  • You can use asnLong or asn, but not both. We recommend using asnLong as it supports a greater pool of numbers.
  • asnLong accepts any valid ASN value, regardless if it's 2-byte or 4-byte.
  • When using a 4-byte asnLong, the API response returns 0 for the legacy asn attribute since 4-byte ASN values exceed the maximum supported value of 2,147,483,647.
  • If you are using a 2-byte ASN, the API response will include the 2-byte value for both the asn and asnLong fields.
  • If you provide a value in the same API call for both asn and asnLong, the API will only accept the value for asnLong.

Parameter bgpPeerId : The ID of the BGP peer.

Parameter customerAddress : The IP address assigned to the customer interface.

Parameter virtualInterfaceId : The ID of the virtual interface.

Implementation

Future<DeleteBGPPeerResponse> deleteBGPPeer({
  int? asn,
  int? asnLong,
  String? bgpPeerId,
  String? customerAddress,
  String? virtualInterfaceId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.DeleteBGPPeer'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (asn != null) 'asn': asn,
      if (asnLong != null) 'asnLong': asnLong,
      if (bgpPeerId != null) 'bgpPeerId': bgpPeerId,
      if (customerAddress != null) 'customerAddress': customerAddress,
      if (virtualInterfaceId != null)
        'virtualInterfaceId': virtualInterfaceId,
    },
  );

  return DeleteBGPPeerResponse.fromJson(jsonResponse.body);
}