Skip to content

update_link

update_link(
    global_network_id: GlobalNetworkId,
    link_id: LinkId,
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    description: Optional[ConstrainedString] = None,
    type: Optional[ConstrainedString] = None,
    bandwidth: Optional[Bandwidth] = None,
    provider: Optional[ConstrainedString] = None,
) -> UpdateLinkResponse

Updates the details for an existing link. To remove information for any of the parameters, specify an empty string.

Parameters:

  • global_network_id (GlobalNetworkId) –

    The ID of the global network.

  • link_id (LinkId) –

    The ID of the link.

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

    A description of the link.

    Constraints: Maximum length of 256 characters.

  • type (Optional[ConstrainedString], default: None ) –

    The type of the link.

    Constraints: Maximum length of 128 characters.

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

    The upload and download speed in Mbps.

  • provider (Optional[ConstrainedString], default: None ) –

    The provider of the link.

    Constraints: Maximum length of 128 characters.

Raises:

Source code in docs_src/capo_networkmanager/_services/network_manager.py
def update_link(
    self,
    global_network_id: "capo_networkmanager.types.global_network_id.GlobalNetworkId",
    link_id: "capo_networkmanager.types.link_id.LinkId",
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    description: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    type: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    bandwidth: Optional["capo_networkmanager.types.bandwidth.Bandwidth"] = None,
    provider: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
) -> "capo_networkmanager.types.update_link_response.UpdateLinkResponse":
    """<p>Updates the details for an existing link. To remove information for any of the parameters, specify an empty string.</p>

    Args:
        global_network_id: <p>The ID of the global network.</p>
        link_id: <p>The ID of the link.</p>
        description: <p>A description of the link.</p> <p>Constraints: Maximum length of 256 characters.</p>
        type: <p>The type of the link.</p> <p>Constraints: Maximum length of 128 characters.</p>
        bandwidth: <p>The upload and download speed in Mbps. </p>
        provider: <p>The provider of the link.</p> <p>Constraints: Maximum length of 128 characters.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service limit was exceeded.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_networkmanager.types.update_link_request.UpdateLinkRequest]",
    ) -> OperationResponse[
        "capo_networkmanager.types.update_link_response.UpdateLinkResponse"
    ]:
        import capo_networkmanager._operations.network_manager.update_link

        output, http_response = (
            capo_networkmanager._operations.network_manager.update_link.update_link(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLink")
    )
    input_: capo_networkmanager.types.update_link_request.UpdateLinkRequest = {
        "global_network_id": global_network_id,
        "link_id": link_id,
    }
    if description is not None:
        input_["description"] = description
    if type is not None:
        input_["type"] = type
    if bandwidth is not None:
        input_["bandwidth"] = bandwidth
    if provider is not None:
        input_["provider"] = provider

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output