mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-06 06:26:51 +00:00
Some checks failed
Python CI / build (push) Has been cancelled
Co-authored-by: API Team <api-team@thousandeyes.com>
2.6 KiB
2.6 KiB
Rule
Properties
| Name | Type | Description | Notes |
|---|---|---|---|
| rule_id | str | Unique ID of the rule. | [optional] [readonly] |
| rule_name | str | Name of the alert rule. | |
| expression | str | The expression of the alert rule. | |
| direction | AlertDirection | [optional] | |
| notify_on_clear | bool | Send notification when alert clears. | [optional] |
| is_default | bool | If set to `true`, this alert rule becomes the default for its test type and is automatically applied to newly created tests with relevant metrics. Only one default alert rule is allowed per test type. | [optional] |
| alert_type | AlertType | ||
| alert_group_type | AlertGroupType | [optional] | |
| minimum_sources | int | The minimum number of agents or monitors that must meet the specified criteria to trigger the alert. | [optional] |
| minimum_sources_pct | int | The minimum percentage of all assigned agents or monitors that must meet the specified criteria to trigger the alert. | [optional] |
| rounds_violating_mode | AlertRoundsViolationMode | [optional] | |
| rounds_violating_out_of | int | Specifies the divisor (y value) in the “X of Y times” condition. | |
| rounds_violating_required | int | Specifies the numerator (x value) in the “X of Y times” condition. | |
| include_covered_prefixes | bool | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] |
| sensitivity_level | SensitivityLevel | [optional] | |
| severity | Severity | [optional] | |
| notifications | AlertNotification | [optional] | |
| test_ids | List[str] | Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint). | [optional] |
| links | SelfLinks | [optional] |
Example
from thousandeyes_sdk.alerts.models.rule import Rule
# TODO update the JSON string below
json = "{}"
# create an instance of Rule from a JSON string
rule_instance = Rule.from_json(json)
# print the JSON string representation of the object
print(Rule.to_json())
# convert the object into a dict
rule_dict = rule_instance.to_dict()
# create an instance of Rule from a dict
rule_from_dict = Rule.from_dict(rule_dict)