Skip to content

disassociate_connection_from_lag async

disassociate_connection_from_lag(
    connection_id: ConnectionId,
    lag_id: LagId,
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
) -> Connection

Disassociates a connection from a link aggregation group (LAG). The connection is interrupted and re-established as a standalone connection (the connection is not deleted; to delete the connection, use the DeleteConnection request). If the LAG has associated virtual interfaces or hosted connections, they remain associated with the LAG. A disassociated connection owned by an Direct Connect Partner is automatically converted to an interconnect.

If disassociating the connection would cause the LAG to fall below its setting for minimum number of operational connections, the request fails, except when it's the last member of the LAG. If all connections are disassociated, the LAG continues to exist as an empty LAG with no physical connections.

Parameters:

  • connection_id (ConnectionId) –

    The ID of the connection.

  • lag_id (LagId) –

    The ID of the LAG.

Raises:

Source code in docs_src/capo_direct_connect/_services/async_direct_connect.py
async def disassociate_connection_from_lag(
    self,
    connection_id: "capo_direct_connect.types.connection_id.ConnectionId",
    lag_id: "capo_direct_connect.types.lag_id.LagId",
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
) -> "capo_direct_connect.types.connection.Connection":
    """<p>Disassociates a connection from a link aggregation group (LAG). The connection is interrupted and re-established as a standalone connection (the connection is not deleted; to delete the connection, use the <a>DeleteConnection</a> request). If the LAG has associated virtual interfaces or hosted connections, they remain associated with the LAG. A disassociated connection owned by an Direct Connect Partner is automatically converted to an interconnect.</p> <p>If disassociating the connection would cause the LAG to fall below its setting for minimum number of operational connections, the request fails, except when it's the last member of the LAG. If all connections are disassociated, the LAG continues to exist as an empty LAG with no physical connections. </p>

    Args:
        connection_id: <p>The ID of the connection.</p>
        lag_id: <p>The ID of the LAG.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_direct_connect.types.disassociate_connection_from_lag_request.DisassociateConnectionFromLagRequest]",
    ) -> AsyncOperationResponse["capo_direct_connect.types.connection.Connection"]:
        import capo_direct_connect._operations.overture_service.disassociate_connection_from_lag

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateConnectionFromLag")
    )
    input_: capo_direct_connect.types.disassociate_connection_from_lag_request.DisassociateConnectionFromLagRequest = {
        "connection_id": connection_id,
        "lag_id": lag_id,
    }

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