Skip to content

put_attachment_routing_policy_label async

put_attachment_routing_policy_label(
    core_network_id: CoreNetworkId,
    attachment_id: AttachmentId,
    routing_policy_label: ConstrainedString,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> PutAttachmentRoutingPolicyLabelResponse

Applies a routing policy label to an attachment for traffic routing decisions.

Parameters:

  • core_network_id (CoreNetworkId) –

    The ID of the core network containing the attachment.

  • attachment_id (AttachmentId) –

    The ID of the attachment to apply the routing policy label to.

  • routing_policy_label (ConstrainedString) –

    The routing policy label to apply to the attachment.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def put_attachment_routing_policy_label(
    self,
    core_network_id: "capo_networkmanager.types.core_network_id.CoreNetworkId",
    attachment_id: "capo_networkmanager.types.attachment_id.AttachmentId",
    routing_policy_label: "capo_networkmanager.types.constrained_string.ConstrainedString",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    client_token: Optional[
        "capo_networkmanager.types.client_token.ClientToken"
    ] = None,
) -> "capo_networkmanager.types.put_attachment_routing_policy_label_response.PutAttachmentRoutingPolicyLabelResponse":
    """<p>Applies a routing policy label to an attachment for traffic routing decisions.</p>

    Args:
        core_network_id: <p>The ID of the core network containing the attachment.</p>
        attachment_id: <p>The ID of the attachment to apply the routing policy label to.</p>
        routing_policy_label: <p>The routing policy label to apply to the attachment.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.put_attachment_routing_policy_label_request.PutAttachmentRoutingPolicyLabelRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.put_attachment_routing_policy_label_response.PutAttachmentRoutingPolicyLabelResponse"
    ]:
        import capo_networkmanager._operations.network_manager.put_attachment_routing_policy_label

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.put_attachment_routing_policy_label.async_put_attachment_routing_policy_label(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutAttachmentRoutingPolicyLabel")
    )
    input_: capo_networkmanager.types.put_attachment_routing_policy_label_request.PutAttachmentRoutingPolicyLabelRequest = {
        "core_network_id": core_network_id,
        "attachment_id": attachment_id,
        "routing_policy_label": routing_policy_label,
    }
    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