associateVirtualInterface method
Associates a virtual interface with a specified link aggregation group (LAG) or connection. Connectivity to AWS is temporarily interrupted as the virtual interface is being migrated. If the target connection or LAG has an associated virtual interface with a conflicting VLAN number or a conflicting IP address, the operation fails.
Virtual interfaces associated with a hosted connection cannot be associated with a LAG; hosted connections must be migrated along with their virtual interfaces using AssociateHostedConnection.
To reassociate a virtual interface to a new connection or LAG, the requester must own either the virtual interface itself or the connection to which the virtual interface is currently associated. Additionally, the requester must own the connection or LAG for the association.
May throw DirectConnectServerException. May throw DirectConnectClientException.
Parameter connectionId
:
The ID of the LAG or connection.
Parameter virtualInterfaceId
:
The ID of the virtual interface.
Implementation
Future<VirtualInterface> associateVirtualInterface({
required String connectionId,
required String virtualInterfaceId,
}) async {
ArgumentError.checkNotNull(connectionId, 'connectionId');
ArgumentError.checkNotNull(virtualInterfaceId, 'virtualInterfaceId');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'OvertureService.AssociateVirtualInterface'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'connectionId': connectionId,
'virtualInterfaceId': virtualInterfaceId,
},
);
return VirtualInterface.fromJson(jsonResponse.body);
}