allocateHostedConnection method

Future<Connection> allocateHostedConnection({
  1. required String bandwidth,
  2. required String connectionId,
  3. required String connectionName,
  4. required String ownerAccount,
  5. required int vlan,
  6. List<Tag>? tags,
})

Creates a hosted connection on the specified interconnect or a link aggregation group (LAG) of interconnects.

Allocates a VLAN number and a specified amount of capacity (bandwidth) for use by a hosted connection on the specified interconnect or LAG of interconnects. AWS polices the hosted connection for the specified capacity and the AWS Direct Connect Partner must also police the hosted connection for the specified capacity.

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

Parameter bandwidth : The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, and 10Gbps. Note that only those AWS Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps or 10Gbps hosted connection.

Parameter connectionId : The ID of the interconnect or LAG.

Parameter connectionName : The name of the hosted connection.

Parameter ownerAccount : The ID of the AWS account ID of the customer for the connection.

Parameter vlan : The dedicated VLAN provisioned to the hosted connection.

Parameter tags : The tags associated with the connection.

Implementation

Future<Connection> allocateHostedConnection({
  required String bandwidth,
  required String connectionId,
  required String connectionName,
  required String ownerAccount,
  required int vlan,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(bandwidth, 'bandwidth');
  ArgumentError.checkNotNull(connectionId, 'connectionId');
  ArgumentError.checkNotNull(connectionName, 'connectionName');
  ArgumentError.checkNotNull(ownerAccount, 'ownerAccount');
  ArgumentError.checkNotNull(vlan, 'vlan');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.AllocateHostedConnection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'bandwidth': bandwidth,
      'connectionId': connectionId,
      'connectionName': connectionName,
      'ownerAccount': ownerAccount,
      'vlan': vlan,
      if (tags != null) 'tags': tags,
    },
  );

  return Connection.fromJson(jsonResponse.body);
}