Skip to content

create_event_bridge_rule_template

create_event_bridge_rule_template(
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    description: Optional[__stringMin0Max1024] = None,
    event_targets: Optional[__listOfEventBridgeRuleTemplateTarget] = None,
    event_type: Optional[EventBridgeRuleTemplateEventType] = None,
    group_identifier: Optional[__stringPatternS] = None,
    name: Optional[__stringMin1Max255PatternS] = None,
    tags: Optional[TagMap] = None,
    request_id: Optional[__stringMin1Max256PatternS] = None,
) -> CreateEventBridgeRuleTemplateResponse

Creates an eventbridge rule template to monitor events and send notifications to your targeted resources.

Parameters:

Raises:

Source code in docs_src/capo_medialive/_services/media_live.py
def create_event_bridge_rule_template(
    self,
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    description: Optional[
        "capo_medialive.types.__string_min0_max1024.__stringMin0Max1024"
    ] = None,
    event_targets: Optional[
        "capo_medialive.types.__list_of_event_bridge_rule_template_target.__listOfEventBridgeRuleTemplateTarget"
    ] = None,
    event_type: Optional[
        "capo_medialive.types.event_bridge_rule_template_event_type.EventBridgeRuleTemplateEventType"
    ] = None,
    group_identifier: Optional[
        "capo_medialive.types.__string_pattern_s.__stringPatternS"
    ] = None,
    name: Optional[
        "capo_medialive.types.__string_min1_max255_pattern_s.__stringMin1Max255PatternS"
    ] = None,
    tags: Optional["capo_medialive.types.tag_map.TagMap"] = None,
    request_id: Optional[
        "capo_medialive.types.__string_min1_max256_pattern_s.__stringMin1Max256PatternS"
    ] = None,
) -> "capo_medialive.types.create_event_bridge_rule_template_response.CreateEventBridgeRuleTemplateResponse":
    """Creates an eventbridge rule template to monitor events and send notifications to your targeted resources.

    Args:
        description: A resource's optional description.
        group_identifier: An eventbridge rule template group's identifier. Can be either be its id or current name.
        name: A resource's name. Names must be unique within the scope of a resource type in a specific region.
        request_id: An ID that you assign to a create request. This ID ensures idempotency when creating resources.

    Raises:
        capo_medialive.errors.bad_request_exception.BadRequestException: Placeholder documentation for BadRequestException
        capo_medialive.errors.conflict_exception.ConflictException: Placeholder documentation for ConflictException
        capo_medialive.errors.forbidden_exception.ForbiddenException: Placeholder documentation for ForbiddenException
        capo_medialive.errors.internal_server_error_exception.InternalServerErrorException: Placeholder documentation for InternalServerErrorException
        capo_medialive.errors.not_found_exception.NotFoundException: Placeholder documentation for NotFoundException
        capo_medialive.errors.too_many_requests_exception.TooManyRequestsException: Placeholder documentation for TooManyRequestsException
        capo_medialive.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_medialive.types.create_event_bridge_rule_template_request.CreateEventBridgeRuleTemplateRequest]",
    ) -> OperationResponse[
        "capo_medialive.types.create_event_bridge_rule_template_response.CreateEventBridgeRuleTemplateResponse"
    ]:
        import capo_medialive._operations.media_live.create_event_bridge_rule_template

        output, http_response = (
            capo_medialive._operations.media_live.create_event_bridge_rule_template.create_event_bridge_rule_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEventBridgeRuleTemplate")
    )
    input_: capo_medialive.types.create_event_bridge_rule_template_request.CreateEventBridgeRuleTemplateRequest = {}
    if description is not None:
        input_["description"] = description
    if event_targets is not None:
        input_["event_targets"] = event_targets
    if event_type is not None:
        input_["event_type"] = event_type
    if group_identifier is not None:
        input_["group_identifier"] = group_identifier
    if name is not None:
        input_["name"] = name
    if tags is not None:
        input_["tags"] = tags
    if request_id is None:
        request_id = str(uuid.uuid4())
    input_["request_id"] = request_id

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