allocatePublicVirtualInterface method

Future<VirtualInterface> allocatePublicVirtualInterface({
  1. required String connectionId,
  2. required NewPublicVirtualInterfaceAllocation newPublicVirtualInterfaceAllocation,
  3. required String ownerAccount,
})

Provisions a public virtual interface to be owned by the specified Amazon Web Services account.

The owner of a connection calls this function to provision a public virtual interface to be owned by the specified Amazon Web Services account.

Virtual interfaces created using this function must be confirmed by the owner using ConfirmPublicVirtualInterface. Until this step has been completed, the virtual interface is in the confirming state and is not available to handle traffic.

When creating an IPv6 public virtual interface, omit the Amazon address and customer address. IPv6 addresses are automatically assigned from the Amazon pool of IPv6 addresses; you cannot specify custom IPv6 addresses.

May throw DirectConnectClientException. May throw DirectConnectServerException. May throw DuplicateTagKeysException. May throw TooManyTagsException.

Parameter connectionId : The ID of the connection on which the public virtual interface is provisioned.

Parameter newPublicVirtualInterfaceAllocation : Information about the public virtual interface.

Parameter ownerAccount : The ID of the Amazon Web Services account that owns the public virtual interface.

Implementation

Future<VirtualInterface> allocatePublicVirtualInterface({
  required String connectionId,
  required NewPublicVirtualInterfaceAllocation
      newPublicVirtualInterfaceAllocation,
  required String ownerAccount,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.AllocatePublicVirtualInterface'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'connectionId': connectionId,
      'newPublicVirtualInterfaceAllocation':
          newPublicVirtualInterfaceAllocation,
      'ownerAccount': ownerAccount,
    },
  );

  return VirtualInterface.fromJson(jsonResponse.body);
}