startBgpFailoverTest method

Future<StartBgpFailoverTestResponse> startBgpFailoverTest({
  1. required String virtualInterfaceId,
  2. List<String>? bgpPeers,
  3. int? testDurationInMinutes,
})

Starts the virtual interface failover test that verifies your configuration meets your resiliency requirements by placing the BGP peering session in the DOWN state. You can then send traffic to verify that there are no outages.

You can run the test on public, private, transit, and hosted virtual interfaces.

You can use ListVirtualInterfaceTestHistory to view the virtual interface test history.

If you need to stop the test before the test interval completes, use StopBgpFailoverTest.

May throw DirectConnectServerException. May throw DirectConnectClientException.

Parameter virtualInterfaceId : The ID of the virtual interface you want to test.

Parameter bgpPeers : The BGP peers to place in the DOWN state.

Parameter testDurationInMinutes : The time in minutes that the virtual interface failover test will last.

Maximum value: 180 minutes (3 hours).

Default: 180 minutes (3 hours).

Implementation

Future<StartBgpFailoverTestResponse> startBgpFailoverTest({
  required String virtualInterfaceId,
  List<String>? bgpPeers,
  int? testDurationInMinutes,
}) async {
  ArgumentError.checkNotNull(virtualInterfaceId, 'virtualInterfaceId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.StartBgpFailoverTest'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'virtualInterfaceId': virtualInterfaceId,
      if (bgpPeers != null) 'bgpPeers': bgpPeers,
      if (testDurationInMinutes != null)
        'testDurationInMinutes': testDurationInMinutes,
    },
  );

  return StartBgpFailoverTestResponse.fromJson(jsonResponse.body);
}