Skip to content

update_link_routing_rule

update_link_routing_rule(
    gateway_id: GatewayId,
    link_id: LinkId,
    rule_id: RuleId,
    priority: RulePriority,
    conditions: RuleCondition,
    *,
    config_overrides: Optional[RTBFabricClientConfig] = None,
) -> UpdateLinkRoutingRuleResponse

Updates a routing rule for a link.

Parameters:

  • gateway_id (GatewayId) –

    The unique identifier of the gateway.

  • link_id (LinkId) –

    The unique identifier of the link.

  • rule_id (RuleId) –

    The unique identifier of the routing rule.

  • priority (RulePriority) –

    The updated priority of the routing rule. Lower numbers are evaluated first. Valid values are 1 to 1000. Priority must be unique among non-deleted rules within a link.

  • conditions (RuleCondition) –

    The updated conditions for the routing rule. All specified fields must match for the rule to apply. At least one condition field must be set.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be completed because of a conflict in the current state of the resource.

  • InternalServerException –

    The request could not be completed because of an internal server error. Try your call again.

  • ResourceNotFoundException –

    The request could not be completed because the resource does not exist.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request could not be completed because it fails satisfy the constraints specified by the service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Update a link routing rule Update the conditions of a routing rule

>>> client.update_link_routing_rule(gateway_id='rtb-gw-12345678', link_id='link-87654321', rule_id='rule-abc123def456', priority=20, conditions={'hostHeader': 'api.customer.com', 'pathPrefix': '/openrtb/'})
Source code in docs_src/capo_rtbfabric/_services/rtb_fabric.py
def update_link_routing_rule(
    self,
    gateway_id: "capo_rtbfabric.types.gateway_id.GatewayId",
    link_id: "capo_rtbfabric.types.link_id.LinkId",
    rule_id: "capo_rtbfabric.types.rule_id.RuleId",
    priority: "capo_rtbfabric.types.rule_priority.RulePriority",
    conditions: "capo_rtbfabric.types.rule_condition.RuleCondition",
    *,
    config_overrides: Optional[RTBFabricClientConfig] = None,
) -> "capo_rtbfabric.types.update_link_routing_rule_response.UpdateLinkRoutingRuleResponse":
    """<p>Updates a routing rule for a link.</p>

    Args:
        gateway_id: <p>The unique identifier of the gateway.</p>
        link_id: <p>The unique identifier of the link.</p>
        rule_id: <p>The unique identifier of the routing rule.</p>
        priority: <p>The updated priority of the routing rule. Lower numbers are evaluated first. Valid values are 1 to 1000. Priority must be unique among non-deleted rules within a link.</p>
        conditions: <p>The updated conditions for the routing rule. All specified fields must match for the rule to apply. At least one condition field must be set.</p>

    Raises:
        capo_rtbfabric.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have sufficient access to perform this action.</p>
        capo_rtbfabric.errors.conflict_exception.ConflictException: <p>The request could not be completed because of a conflict in the current state of the resource.</p>
        capo_rtbfabric.errors.internal_server_exception.InternalServerException: <p>The request could not be completed because of an internal server error. Try your call again.</p>
        capo_rtbfabric.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request could not be completed because the resource does not exist.</p>
        capo_rtbfabric.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_rtbfabric.errors.validation_exception.ValidationException: <p>The request could not be completed because it fails satisfy the constraints specified by the service.</p>
        capo_rtbfabric.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update a link routing rule
        Update the conditions of a routing rule

        >>> client.update_link_routing_rule(gateway_id='rtb-gw-12345678', link_id='link-87654321', rule_id='rule-abc123def456', priority=20, conditions={'hostHeader': 'api.customer.com', 'pathPrefix': '/openrtb/'})
    """

    def _handler(
        req: "OperationRequest[capo_rtbfabric.types.update_link_routing_rule_request.UpdateLinkRoutingRuleRequest]",
    ) -> OperationResponse[
        "capo_rtbfabric.types.update_link_routing_rule_response.UpdateLinkRoutingRuleResponse"
    ]:
        import capo_rtbfabric._operations.rtb_fabric.update_link_routing_rule

        output, http_response = (
            capo_rtbfabric._operations.rtb_fabric.update_link_routing_rule.update_link_routing_rule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLinkRoutingRule")
    )
    input_: capo_rtbfabric.types.update_link_routing_rule_request.UpdateLinkRoutingRuleRequest = {
        "gateway_id": gateway_id,
        "link_id": link_id,
        "rule_id": rule_id,
        "priority": priority,
        "conditions": conditions,
    }

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