put_function
¶
put_function(
function_id: __string,
function_type: FunctionType,
*,
config_overrides: Optional[MediaTailorClientConfig] = None,
description: Optional[__string] = None,
http_request_configuration: Optional[HttpRequestConfiguration] = None,
aws_service_request_configuration: Optional[AwsServiceRequestConfiguration] = None,
custom_output_configuration: Optional[CustomOutputConfiguration] = None,
concurrent_executor_configuration: Optional[ConcurrentExecutorConfiguration] = None,
sequential_executor_configuration: Optional[SequentialExecutorConfiguration] = None,
vast_request_configuration: Optional[VastRequestConfiguration] = None,
tags: Optional[__mapOf__string] = None,
) -> PutFunctionResponse
Creates or updates a function. A function defines reusable logic that MediaTailor executes at lifecycle hooks during ad insertion. For more information about functions, see Working with functions in the MediaTailor User Guide.
Parameters:
-
function_id(__string) –The identifier of the function. The identifier must be unique within your account.
-
function_type(FunctionType) –The type of the function, which determines what the function can do at runtime. Valid values:
-
CUSTOM_OUTPUT– Evaluates expressions and produces output bindings with no external calls. -
HTTP_REQUEST– Makes an HTTP call to an external service and evaluates output expressions that can reference the response. -
AWS_SERVICE_REQUEST– Makes an authenticated request to a supported AWS service API and evaluates output expressions that can reference the response. -
VAST_REQUEST– Calls a VAST endpoint, parses the response as VAST, and makes the parsed ads available to output expressions. -
SEQUENTIAL_EXECUTOR– Runs a sequence of child functions in order, passing data between steps through temporary data. -
CONCURRENT_EXECUTOR– Runs a set of child functions in parallel, up to a maximum concurrency, and combines their output when all functions complete.
For more information, see Function types and composition in the MediaTailor User Guide.
-
-
description(Optional[__string], default:None) –A description of the function.
-
http_request_configuration(Optional[HttpRequestConfiguration], default:None) –The configuration for an
HTTP_REQUESTfunction. Specifies the HTTP method, URL, headers, body, timeout, and output expressions. Required whenFunctionTypeisHTTP_REQUEST. -
aws_service_request_configuration(Optional[AwsServiceRequestConfiguration], default:None) –The configuration for an
AWS_SERVICE_REQUESTfunction. You must specify this parameter whenFunctionTypeisAWS_SERVICE_REQUEST. -
custom_output_configuration(Optional[CustomOutputConfiguration], default:None) –The configuration for a
CUSTOM_OUTPUTfunction. Specifies the runtime and output expressions. Required whenFunctionTypeisCUSTOM_OUTPUT. -
concurrent_executor_configuration(Optional[ConcurrentExecutorConfiguration], default:None) –The configuration for a
CONCURRENT_EXECUTORfunction. Specifies the list of child functions to run in parallel, the maximum concurrency, an optional output block, and a timeout. Required whenFunctionTypeisCONCURRENT_EXECUTOR. -
sequential_executor_configuration(Optional[SequentialExecutorConfiguration], default:None) –The configuration for a
SEQUENTIAL_EXECUTORfunction. Specifies the ordered list of child functions to execute, an optional output block, and a timeout. Required whenFunctionTypeisSEQUENTIAL_EXECUTOR. -
vast_request_configuration(Optional[VastRequestConfiguration], default:None) –The configuration for a
VAST_REQUESTfunction. Specifies the HTTP method, URL, headers, body, timeout, and output expressions. Required whenFunctionTypeisVAST_REQUEST. -
tags(Optional[__mapOf__string], default:None) –The tags to assign to the function. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_mediatailor/_services/media_tailor.py
1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 | |