Replaces the rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.
Requires permission to access the ReplaceTopicRule action.
Parameters:
Raises:
Source code in docs_src/capo_iot/_services/io_t.py
| def replace_topic_rule(
self,
rule_name: "capo_iot.types.rule_name.RuleName",
topic_rule_payload: "capo_iot.types.topic_rule_payload.TopicRulePayload",
*,
config_overrides: Optional[IoTClientConfig] = None,
) -> None:
"""<p>Replaces the rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ReplaceTopicRule</a> action.</p>
Args:
rule_name: <p>The name of the rule.</p>
topic_rule_payload: <p>The rule payload.</p>
Raises:
capo_iot.errors.conflicting_resource_update_exception.ConflictingResourceUpdateException: <p>A conflicting resource update exception. This exception is thrown when two pending updates cause a conflict.</p>
capo_iot.errors.internal_exception.InternalException: <p>An unexpected error has occurred.</p>
capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
capo_iot.errors.sql_parse_exception.SqlParseException: <p>The Rule-SQL expression can't be parsed correctly.</p>
capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot.types.replace_topic_rule_request.ReplaceTopicRuleRequest]",
) -> OperationResponse[None]:
import capo_iot._operations.aws_iot_service.replace_topic_rule
output, http_response = (
capo_iot._operations.aws_iot_service.replace_topic_rule.replace_topic_rule(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ReplaceTopicRule")
)
input_: capo_iot.types.replace_topic_rule_request.ReplaceTopicRuleRequest = {
"rule_name": rule_name,
"topic_rule_payload": topic_rule_payload,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|