Skip to content

update_connection async

update_connection(
    identifier: ConnectionId,
    *,
    config_overrides: Optional[AsyncInterconnectClientConfig] = None,
    description: Optional[ConnectionDescription] = None,
    bandwidth: Optional[ConnectionBandwidth] = None,
    client_token: Optional[str] = None,
) -> UpdateConnectionResponse

Modifies an existing connection. Currently we support modifications to the connection's description and/or bandwidth.

Parameters:

  • identifier (ConnectionId) –

    The identifier of the Connection that should be updated.

  • description (Optional[ConnectionDescription], default: None ) –

    An updated description to apply to the Connection

  • bandwidth (Optional[ConnectionBandwidth], default: None ) –

    Request a new bandwidth size on the given Connection.

    Note that changes to the size may be subject to additional policy, and does require the remote partner provider to acknowledge and permit this new bandwidth size.

  • client_token (Optional[str], default: None ) –

    Idempotency token used for the request.

Raises:

Examples:

Update Connection Description

>>> await client.update_connection(identifier='mcc-abc12345', description='Changed Description')
Update Connection Bandwidth
>>> await client.update_connection(identifier='mcc-abc12345', bandwidth='2Gbps')
Source code in docs_src/capo_interconnect/_services/async_interconnect.py
async def update_connection(
    self,
    identifier: "capo_interconnect.types.connection_id.ConnectionId",
    *,
    config_overrides: Optional[AsyncInterconnectClientConfig] = None,
    description: Optional[
        "capo_interconnect.types.connection_description.ConnectionDescription"
    ] = None,
    bandwidth: Optional[
        "capo_interconnect.types.connection_bandwidth.ConnectionBandwidth"
    ] = None,
    client_token: Optional[str] = None,
) -> "capo_interconnect.types.update_connection_response.UpdateConnectionResponse":
    """<p>Modifies an existing connection. Currently we support modifications to the connection's description and/or bandwidth.</p>

    Args:
        identifier: <p>The identifier of the <a>Connection</a> that should be updated.</p>
        description: <p>An updated description to apply to the <a>Connection</a> </p>
        bandwidth: <p>Request a new bandwidth size on the given <a>Connection</a>.</p> <p>Note that changes to the size may be subject to additional policy, and does require the remote partner provider to acknowledge and permit this new bandwidth size.</p>
        client_token: <p>Idempotency token used for the request.</p>

    Raises:
        capo_interconnect.errors.access_denied_exception.AccessDeniedException: <p>The calling principal is not allowed to access the specified resource, or the resource does not exist.</p>
        capo_interconnect.errors.interconnect_client_exception.InterconnectClientException: <p>The request was denied due to incorrect client supplied parameters.</p>
        capo_interconnect.errors.interconnect_server_exception.InterconnectServerException: <p>The request resulted in an exception internal to the service.</p>
        capo_interconnect.errors.interconnect_validation_exception.InterconnectValidationException: <p>The input fails to satisfy the constraints specified.</p>
        capo_interconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request specifies a resource that does not exist on the server.</p>
        capo_interconnect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The requested operation would result in the calling principal exceeding their allotted quota.</p>
        capo_interconnect.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_interconnect.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update Connection Description

        >>> await client.update_connection(identifier='mcc-abc12345', description='Changed Description')
        Update Connection Bandwidth

        >>> await client.update_connection(identifier='mcc-abc12345', bandwidth='2Gbps')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_interconnect.types.update_connection_request.UpdateConnectionRequest]",
    ) -> AsyncOperationResponse[
        "capo_interconnect.types.update_connection_response.UpdateConnectionResponse"
    ]:
        import capo_interconnect._operations.interconnect.update_connection

        (
            output,
            http_response,
        ) = await capo_interconnect._operations.interconnect.update_connection.async_update_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_interconnect.types.update_connection_response.UpdateConnectionResponse",
    ) -> dict[str, Any]:
        import capo_interconnect.types.update_connection_response

        return capo_interconnect.types.update_connection_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateConnection", redact_output=_redact_output),
    )
    input_: capo_interconnect.types.update_connection_request.UpdateConnectionRequest = {
        "identifier": identifier
    }
    if description is not None:
        input_["description"] = description
    if bandwidth is not None:
        input_["bandwidth"] = bandwidth
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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