create_link_routing_rule
async
¶
create_link_routing_rule(
client_token: str,
gateway_id: GatewayId,
link_id: LinkId,
priority: RulePriority,
conditions: RuleCondition,
*,
config_overrides: Optional[AsyncRTBFabricClientConfig] = None,
tags: Optional[TagsMap] = None,
) -> CreateLinkRoutingRuleResponse
Creates a routing rule for a link.
Routing rules use priority-based evaluation where lower priority numbers are evaluated first. Each rule specifies conditions that must all match for the rule to apply.
Parameters:
-
client_token(str) –Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.
If you don't provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same
clientToken, but with different parameters, the retry fails with anIdempotentParameterMismatcherror. -
gateway_id(GatewayId) –The unique identifier of the gateway.
-
link_id(LinkId) –The unique identifier of the link.
-
priority(RulePriority) –The 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 conditions for the routing rule. All specified fields must match for the rule to apply. At least one condition field must be set.
-
tags(Optional[TagsMap], default:None) –A map of the key-value pairs of the tag or tags to assign to the resource.
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.
-
ServiceQuotaExceededException–The request could not be completed because you exceeded a service quota.
-
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:
Create a link routing rule Create a routing rule with host header and path prefix conditions
>>> await client.create_link_routing_rule(gateway_id='rtb-gw-12345678', link_id='link-87654321', priority=10, conditions={'hostHeader': 'api.customer.com', 'pathPrefix': '/openrtb/'}, client_token='550e8400-e29b-41d4-a716-446655440000')
Source code in docs_src/capo_rtbfabric/_services/async_rtb_fabric.py
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 | |