Skip to content

put_link_flows

put_link_flows(
    gateway_id: GatewayId,
    link_id: LinkId,
    lock_token: LockToken,
    flows: FlowList,
    *,
    config_overrides: Optional[RTBFabricClientConfig] = 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 updateId before lockToken is 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

>>> 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.
>>> 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.
>>> 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/rtb_fabric.py
def put_link_flows(
    self,
    gateway_id: "capo_rtbfabric.types.gateway_id.GatewayId",
    link_id: "capo_rtbfabric.types.link_id.LinkId",
    lock_token: "capo_rtbfabric.types.lock_token.LockToken",
    flows: "capo_rtbfabric.types.flow_list.FlowList",
    *,
    config_overrides: Optional[RTBFabricClientConfig] = None,
    client_token: Optional["capo_rtbfabric.types.client_token.ClientToken"] = None,
) -> "capo_rtbfabric.types.put_link_flows_response.PutLinkFlowsResponse":
    """<p>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.</p>

    Args:
        gateway_id: <p>The unique identifier of the gateway.</p>
        link_id: <p>The unique identifier of the link.</p>
        client_token: <p>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 <code>updateId</code> before <code>lockToken</code> is checked.</p>
        lock_token: <p>The concurrency token that you read from GetLink. If the link changed since that read, by any operation, the call fails with ConflictException.</p>
        flows: <p>The link's flows, replacing the current ones. An empty list removes every flow.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request could not be completed because you exceeded a service quota.</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:
        Attach a filter module in one sequential flow

        >>> 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.

        >>> 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.

        >>> 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=[])
    """

    def _handler(
        req: "OperationRequest[capo_rtbfabric.types.put_link_flows_request.PutLinkFlowsRequest]",
    ) -> OperationResponse[
        "capo_rtbfabric.types.put_link_flows_response.PutLinkFlowsResponse"
    ]:
        import capo_rtbfabric._operations.rtb_fabric.put_link_flows

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutLinkFlows")
    )
    input_: capo_rtbfabric.types.put_link_flows_request.PutLinkFlowsRequest = {
        "gateway_id": gateway_id,
        "link_id": link_id,
        "lock_token": lock_token,
        "flows": flows,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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