Skip to content

allocate_hosted_connection async

allocate_hosted_connection(
    connection_id: ConnectionId,
    owner_account: OwnerAccount,
    bandwidth: Bandwidth,
    connection_name: ConnectionName,
    vlan: VLAN,
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
    tags: Optional[TagList] = None,
) -> Connection

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. Amazon Web Services polices the hosted connection for the specified capacity and the Direct Connect Partner must also police the hosted connection for the specified capacity.

Intended for use by Direct Connect Partners only.

Parameters:

  • connection_id (ConnectionId) –

    The ID of the interconnect or LAG.

  • owner_account (OwnerAccount) –

    The ID of the Amazon Web Services account ID of the customer for the connection.

  • bandwidth (Bandwidth) –

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

  • connection_name (ConnectionName) –

    The name of the hosted connection.

  • vlan (VLAN) –

    The dedicated VLAN provisioned to the hosted connection.

  • tags (Optional[TagList], default: None ) –

    The tags associated with the connection.

Raises:

Source code in docs_src/capo_direct_connect/_services/async_direct_connect.py
async def allocate_hosted_connection(
    self,
    connection_id: "capo_direct_connect.types.connection_id.ConnectionId",
    owner_account: "capo_direct_connect.types.owner_account.OwnerAccount",
    bandwidth: "capo_direct_connect.types.bandwidth.Bandwidth",
    connection_name: "capo_direct_connect.types.connection_name.ConnectionName",
    vlan: "capo_direct_connect.types.vlan.VLAN",
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
    tags: Optional["capo_direct_connect.types.tag_list.TagList"] = None,
) -> "capo_direct_connect.types.connection.Connection":
    """<p>Creates a hosted connection on the specified interconnect or a link aggregation group (LAG) of interconnects.</p> <p>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. Amazon Web Services polices the hosted connection for the specified capacity and the Direct Connect Partner must also police the hosted connection for the specified capacity.</p> <note> <p>Intended for use by Direct Connect Partners only.</p> </note>

    Args:
        connection_id: <p>The ID of the interconnect or LAG.</p>
        owner_account: <p>The ID of the Amazon Web Services account ID of the customer for the connection.</p>
        bandwidth: <p>The bandwidth of the connection. The possible values are 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps, 10Gbps, and 25Gbps. Note that only those Direct Connect Partners who have met specific requirements are allowed to create a 1Gbps, 2Gbps, 5Gbps, 10Gbps, or 25Gbps hosted connection. </p>
        connection_name: <p>The name of the hosted connection.</p>
        vlan: <p>The dedicated VLAN provisioned to the hosted connection.</p>
        tags: <p>The tags associated with the connection.</p>

    Raises:
        capo_direct_connect.errors.direct_connect_client_exception.DirectConnectClientException: <p>One or more parameters are not valid.</p>
        capo_direct_connect.errors.direct_connect_server_exception.DirectConnectServerException: <p>A server-side error occurred.</p>
        capo_direct_connect.errors.duplicate_tag_keys_exception.DuplicateTagKeysException: <p>A tag key was specified more than once.</p>
        capo_direct_connect.errors.too_many_tags_exception.TooManyTagsException: <p>You have reached the limit on the number of tags that can be assigned.</p>
        capo_direct_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_direct_connect.types.allocate_hosted_connection_request.AllocateHostedConnectionRequest]",
    ) -> AsyncOperationResponse["capo_direct_connect.types.connection.Connection"]:
        import capo_direct_connect._operations.overture_service.allocate_hosted_connection

        (
            output,
            http_response,
        ) = await capo_direct_connect._operations.overture_service.allocate_hosted_connection.async_allocate_hosted_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AllocateHostedConnection")
    )
    input_: capo_direct_connect.types.allocate_hosted_connection_request.AllocateHostedConnectionRequest = {
        "connection_id": connection_id,
        "owner_account": owner_account,
        "bandwidth": bandwidth,
        "connection_name": connection_name,
        "vlan": vlan,
    }
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output