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
1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 | |