put_link_flows
async
¶
put_link_flows(
gateway_id: GatewayId,
link_id: LinkId,
lock_token: LockToken,
flows: FlowList,
*,
config_overrides: Optional[AsyncRTBFabricClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> PutLinkFlowsResponse
Replaces a link's flow configuration. The change applies asynchronously. The call returns once the change is accepted, and the link serves its prior flows until the update commits atomically. RTB Fabric validates the request before accepting it, and a request that fails validation changes nothing. After the call, use GetLink. Once the change completes, the link's status is ACTIVE again and its flows show the change.
Parameters:
-
gateway_id(GatewayId) –The unique identifier of the gateway.
-
link_id(LinkId) –The unique identifier of the link.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry with the same token and parameters, you get the original response without an error. If you retry with the same token but different parameters, the call fails with ValidationException. If you don't provide a token, the SDK generates one, and RTB Fabric remembers it for 8 hours. A retry returns the original
updateIdbeforelockTokenis checked. -
lock_token(LockToken) –The concurrency token that you read from GetLink. If the link changed since that read, by any operation, the call fails with ConflictException.
-
flows(FlowList) –The link's flows, replacing the current ones. An empty list removes every flow.
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:
Attach a filter module in one sequential flow
>>> await client.put_link_flows(gateway_id='rtb-gw-a1b2c3d4e5', link_id='link-f6g7h8i9j0', client_token='3f1c2a7e-0b5d-4c1e-9a8f-2d6b7e9c0a14', lock_token='c2VxPTQy', flows=[{'name': 'main', 'pipeline': {'sequential': {'modules': [{'name': 'domain-filter', 'moduleVersionArn': 'arn:aws:rtbfabric:us-east-1::modules/module-a1b2c3d4e5f6g7h8i9j0k1l2m/versions/1.2.0', 'selectedActions': ['FILTER']}]}}}])
Run enrichment modules concurrently in a phased flow
Filters first, then runs two enrichment modules at the same time. The second phase costs the slower of the two modules rather than their sum. Both enrichment modules fail open, so a slow vendor drops its enrichment instead of losing the bid.
>>> await client.put_link_flows(gateway_id='rtb-gw-12345678', link_id='link-87654321', client_token='6b1d84f2-0a97-4e53-b8c1-3d5f7a2e9048', lock_token='lt-7f3a9c2e1b', flows=[{'name': 'default', 'pipeline': {'phased': {'phases': [{'modules': [{'name': 'GeoFilter', 'moduleVersionArn': 'arn:aws:rtbfabric:us-east-1::modules/module-openrtbAttributeFilter/versions/2.0.0', 'failureMode': 'CLOSED', 'configurationValues': '{"filterType":"INCLUDE","filterConfiguration":[{"criteria":[{"path":"$.device.geo.country","values":["USA"]}]}]}'}]}, {'modules': [{'name': 'IVTDetection', 'moduleVersionArn': 'arn:aws:rtbfabric:us-east-1::modules/module-0a1b2c3d4e5f/versions/1.0.0', 'failureMode': 'OPEN', 'configurationValues': '{"threshold":0.7}'}, {'name': 'Viewability', 'moduleVersionArn': 'arn:aws:rtbfabric:us-east-1::modules/module-9f8e7d6c5b4a/versions/1.0.0', 'failureMode': 'OPEN'}]}]}}}])
Detach every module from a link
Puts an empty set of flows. There is no separate detach operation: removal is expressed by putting the flows the caller wants to keep, and keeping none removes all of them.
>>> await client.put_link_flows(gateway_id='rtb-gw-12345678', link_id='link-87654321', client_token='9c4e2a71-5d38-4b0f-8e62-7f1a4c9d3b05', lock_token='lt-7f3a9c2e1b', flows=[])
Source code in docs_src/capo_rtbfabric/_services/async_rtb_fabric.py
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 | |