arthur-client 1.4.1055__py3-none-any.whl → 1.4.1187__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arthur_client/api_bindings/__init__.py +5 -1
- arthur_client/api_bindings/api/alert_rules_v1_api.py +303 -0
- arthur_client/api_bindings/api/datasets_v1_api.py +3 -0
- arthur_client/api_bindings/docs/AggregationSpecSchemaInitArgsInner.md +1 -1
- arthur_client/api_bindings/docs/Alert.md +1 -0
- arthur_client/api_bindings/docs/AlertRule.md +1 -0
- arthur_client/api_bindings/docs/AlertRuleInterval.md +30 -0
- arthur_client/api_bindings/docs/AlertRuleSQLValidationResp.md +32 -0
- arthur_client/api_bindings/docs/AlertRulesV1Api.md +83 -0
- arthur_client/api_bindings/docs/DType.md +2 -0
- arthur_client/api_bindings/docs/DatasetLocatorFieldDataType.md +2 -0
- arthur_client/api_bindings/docs/DatasetsV1Api.md +1 -0
- arthur_client/api_bindings/docs/IntervalUnit.md +16 -0
- arthur_client/api_bindings/docs/Items1.md +1 -1
- arthur_client/api_bindings/docs/MetricsColumnListParameterSchema.md +4 -0
- arthur_client/api_bindings/docs/MetricsColumnListParameterSchemaAllowedColumnTypesInner.md +31 -0
- arthur_client/api_bindings/docs/MetricsColumnParameterSchema.md +1 -1
- arthur_client/api_bindings/docs/ObjectType.md +1 -1
- arthur_client/api_bindings/docs/PatchAlertRule.md +1 -0
- arthur_client/api_bindings/docs/PostAlert.md +1 -0
- arthur_client/api_bindings/docs/PostAlertRule.md +1 -0
- arthur_client/api_bindings/docs/PostMetricsQuery.md +1 -0
- arthur_client/api_bindings/docs/ValidateAlertRuleQueryReq.md +29 -0
- arthur_client/api_bindings/models/__init__.py +5 -1
- arthur_client/api_bindings/models/alert.py +7 -1
- arthur_client/api_bindings/models/alert_rule.py +7 -1
- arthur_client/api_bindings/models/alert_rule_interval.py +90 -0
- arthur_client/api_bindings/models/alert_rule_sql_validation_resp.py +93 -0
- arthur_client/api_bindings/models/d_type.py +1 -0
- arthur_client/api_bindings/models/dataset_locator_field_data_type.py +1 -0
- arthur_client/api_bindings/models/interval_unit.py +39 -0
- arthur_client/api_bindings/models/metrics_column_list_parameter_schema.py +24 -2
- arthur_client/api_bindings/models/{metrics_column_parameter_schema_allowed_column_types_inner.py → metrics_column_list_parameter_schema_allowed_column_types_inner.py} +7 -7
- arthur_client/api_bindings/models/metrics_column_parameter_schema.py +3 -3
- arthur_client/api_bindings/models/object_type.py +3 -3
- arthur_client/api_bindings/models/patch_alert_rule.py +12 -1
- arthur_client/api_bindings/models/post_alert.py +7 -1
- arthur_client/api_bindings/models/post_alert_rule.py +7 -1
- arthur_client/api_bindings/models/post_metrics_query.py +12 -1
- arthur_client/api_bindings/models/validate_alert_rule_query_req.py +87 -0
- arthur_client/api_bindings/test/test_alert.py +6 -0
- arthur_client/api_bindings/test/test_alert_rule.py +6 -0
- arthur_client/api_bindings/test/test_alert_rule_interval.py +54 -0
- arthur_client/api_bindings/test/test_alert_rule_sql_validation_resp.py +58 -0
- arthur_client/api_bindings/test/test_alert_rules_v1_api.py +7 -0
- arthur_client/api_bindings/test/test_created_alerts.py +6 -0
- arthur_client/api_bindings/test/test_infinite_resource_list_alert.py +6 -0
- arthur_client/api_bindings/test/test_interval_unit.py +33 -0
- arthur_client/api_bindings/test/test_metrics_column_list_parameter_schema.py +10 -1
- arthur_client/api_bindings/test/{test_metrics_column_parameter_schema_allowed_column_types_inner.py → test_metrics_column_list_parameter_schema_allowed_column_types_inner.py} +11 -11
- arthur_client/api_bindings/test/test_patch_alert_rule.py +3 -0
- arthur_client/api_bindings/test/test_post_alert.py +6 -0
- arthur_client/api_bindings/test/test_post_alert_rule.py +6 -0
- arthur_client/api_bindings/test/test_post_alerts.py +6 -0
- arthur_client/api_bindings/test/test_post_metrics_query.py +3 -0
- arthur_client/api_bindings/test/test_resource_list_alert_rule.py +6 -0
- arthur_client/api_bindings/test/test_validate_alert_rule_query_req.py +52 -0
- arthur_client/api_bindings_README.md +6 -1
- {arthur_client-1.4.1055.dist-info → arthur_client-1.4.1187.dist-info}/METADATA +1 -1
- {arthur_client-1.4.1055.dist-info → arthur_client-1.4.1187.dist-info}/RECORD +61 -49
- arthur_client/api_bindings/docs/MetricsColumnParameterSchemaAllowedColumnTypesInner.md +0 -31
- {arthur_client-1.4.1055.dist-info → arthur_client-1.4.1187.dist-info}/WHEEL +0 -0
@@ -20,6 +20,7 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from arthur_client.api_bindings.models.alert_bound import AlertBound
|
23
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
23
24
|
from typing import Optional, Set
|
24
25
|
from typing_extensions import Self
|
25
26
|
|
@@ -33,8 +34,9 @@ class PatchAlertRule(BaseModel):
|
|
33
34
|
bound: Optional[AlertBound] = None
|
34
35
|
query: Optional[StrictStr] = None
|
35
36
|
metric_name: Optional[StrictStr] = None
|
37
|
+
interval: Optional[AlertRuleInterval] = None
|
36
38
|
notification_webhook_ids: Optional[List[StrictStr]] = None
|
37
|
-
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "notification_webhook_ids"]
|
39
|
+
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "interval", "notification_webhook_ids"]
|
38
40
|
|
39
41
|
model_config = ConfigDict(
|
40
42
|
populate_by_name=True,
|
@@ -75,6 +77,9 @@ class PatchAlertRule(BaseModel):
|
|
75
77
|
exclude=excluded_fields,
|
76
78
|
exclude_none=True,
|
77
79
|
)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
81
|
+
if self.interval:
|
82
|
+
_dict['interval'] = self.interval.to_dict()
|
78
83
|
# set to None if name (nullable) is None
|
79
84
|
# and model_fields_set contains the field
|
80
85
|
if self.name is None and "name" in self.model_fields_set:
|
@@ -105,6 +110,11 @@ class PatchAlertRule(BaseModel):
|
|
105
110
|
if self.metric_name is None and "metric_name" in self.model_fields_set:
|
106
111
|
_dict['metric_name'] = None
|
107
112
|
|
113
|
+
# set to None if interval (nullable) is None
|
114
|
+
# and model_fields_set contains the field
|
115
|
+
if self.interval is None and "interval" in self.model_fields_set:
|
116
|
+
_dict['interval'] = None
|
117
|
+
|
108
118
|
# set to None if notification_webhook_ids (nullable) is None
|
109
119
|
# and model_fields_set contains the field
|
110
120
|
if self.notification_webhook_ids is None and "notification_webhook_ids" in self.model_fields_set:
|
@@ -128,6 +138,7 @@ class PatchAlertRule(BaseModel):
|
|
128
138
|
"bound": obj.get("bound"),
|
129
139
|
"query": obj.get("query"),
|
130
140
|
"metric_name": obj.get("metric_name"),
|
141
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
131
142
|
"notification_webhook_ids": obj.get("notification_webhook_ids")
|
132
143
|
})
|
133
144
|
return _obj
|
@@ -21,6 +21,7 @@ from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from arthur_client.api_bindings.models.alert_bound import AlertBound
|
24
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
24
25
|
from typing import Optional, Set
|
25
26
|
from typing_extensions import Self
|
26
27
|
|
@@ -33,10 +34,11 @@ class PostAlert(BaseModel):
|
|
33
34
|
value: Union[StrictFloat, StrictInt] = Field(description="The value of the metric that triggered the alert.")
|
34
35
|
threshold: Union[StrictFloat, StrictInt] = Field(description="The threshold that triggered the alert.")
|
35
36
|
bound: AlertBound = Field(description="The bound of the alert.")
|
37
|
+
interval: AlertRuleInterval = Field(description="The interval of the alert rule, commonly '1 day', '1 hour', etc.")
|
36
38
|
dimensions: Optional[Dict[str, Any]]
|
37
39
|
alert_rule_id: StrictStr = Field(description="The alert rule id of the alert.")
|
38
40
|
job_id: Optional[StrictStr] = None
|
39
|
-
__properties: ClassVar[List[str]] = ["description", "timestamp", "value", "threshold", "bound", "dimensions", "alert_rule_id", "job_id"]
|
41
|
+
__properties: ClassVar[List[str]] = ["description", "timestamp", "value", "threshold", "bound", "interval", "dimensions", "alert_rule_id", "job_id"]
|
40
42
|
|
41
43
|
model_config = ConfigDict(
|
42
44
|
populate_by_name=True,
|
@@ -77,6 +79,9 @@ class PostAlert(BaseModel):
|
|
77
79
|
exclude=excluded_fields,
|
78
80
|
exclude_none=True,
|
79
81
|
)
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
83
|
+
if self.interval:
|
84
|
+
_dict['interval'] = self.interval.to_dict()
|
80
85
|
# set to None if description (nullable) is None
|
81
86
|
# and model_fields_set contains the field
|
82
87
|
if self.description is None and "description" in self.model_fields_set:
|
@@ -109,6 +114,7 @@ class PostAlert(BaseModel):
|
|
109
114
|
"value": obj.get("value"),
|
110
115
|
"threshold": obj.get("threshold"),
|
111
116
|
"bound": obj.get("bound"),
|
117
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
112
118
|
"dimensions": obj.get("dimensions"),
|
113
119
|
"alert_rule_id": obj.get("alert_rule_id"),
|
114
120
|
"job_id": obj.get("job_id")
|
@@ -20,6 +20,7 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from arthur_client.api_bindings.models.alert_bound import AlertBound
|
23
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
23
24
|
from typing import Optional, Set
|
24
25
|
from typing_extensions import Self
|
25
26
|
|
@@ -33,8 +34,9 @@ class PostAlertRule(BaseModel):
|
|
33
34
|
bound: AlertBound = Field(description="The bound of the alert rule.")
|
34
35
|
query: StrictStr = Field(description="The query of the alert rule.")
|
35
36
|
metric_name: StrictStr = Field(description="The name of the metric returned by the alert rule query.")
|
37
|
+
interval: AlertRuleInterval = Field(description="The interval of the alert rule, commonly '1 day', '1 hour', etc.")
|
36
38
|
notification_webhook_ids: Optional[List[StrictStr]] = Field(default=None, description="The notification webhook IDs where the alert rule will send alert notification.")
|
37
|
-
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "notification_webhook_ids"]
|
39
|
+
__properties: ClassVar[List[str]] = ["name", "description", "threshold", "bound", "query", "metric_name", "interval", "notification_webhook_ids"]
|
38
40
|
|
39
41
|
model_config = ConfigDict(
|
40
42
|
populate_by_name=True,
|
@@ -75,6 +77,9 @@ class PostAlertRule(BaseModel):
|
|
75
77
|
exclude=excluded_fields,
|
76
78
|
exclude_none=True,
|
77
79
|
)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
81
|
+
if self.interval:
|
82
|
+
_dict['interval'] = self.interval.to_dict()
|
78
83
|
# set to None if description (nullable) is None
|
79
84
|
# and model_fields_set contains the field
|
80
85
|
if self.description is None and "description" in self.model_fields_set:
|
@@ -98,6 +103,7 @@ class PostAlertRule(BaseModel):
|
|
98
103
|
"bound": obj.get("bound"),
|
99
104
|
"query": obj.get("query"),
|
100
105
|
"metric_name": obj.get("metric_name"),
|
106
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
101
107
|
"notification_webhook_ids": obj.get("notification_webhook_ids")
|
102
108
|
})
|
103
109
|
return _obj
|
@@ -19,6 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
22
23
|
from arthur_client.api_bindings.models.post_metrics_query_time_range import PostMetricsQueryTimeRange
|
23
24
|
from arthur_client.api_bindings.models.result_filter import ResultFilter
|
24
25
|
from typing import Optional, Set
|
@@ -30,9 +31,10 @@ class PostMetricsQuery(BaseModel):
|
|
30
31
|
""" # noqa: E501
|
31
32
|
query: StrictStr = Field(description="Query for retrieving the metrics.")
|
32
33
|
time_range: PostMetricsQueryTimeRange = Field(description="Time range to filter the metrics by.")
|
34
|
+
interval: Optional[AlertRuleInterval] = None
|
33
35
|
limit: Optional[StrictInt] = Field(default=50, description="Limit the number of metrics returned. Defaults to 50.")
|
34
36
|
result_filter: Optional[ResultFilter] = None
|
35
|
-
__properties: ClassVar[List[str]] = ["query", "time_range", "limit", "result_filter"]
|
37
|
+
__properties: ClassVar[List[str]] = ["query", "time_range", "interval", "limit", "result_filter"]
|
36
38
|
|
37
39
|
model_config = ConfigDict(
|
38
40
|
populate_by_name=True,
|
@@ -76,9 +78,17 @@ class PostMetricsQuery(BaseModel):
|
|
76
78
|
# override the default output from pydantic by calling `to_dict()` of time_range
|
77
79
|
if self.time_range:
|
78
80
|
_dict['time_range'] = self.time_range.to_dict()
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of interval
|
82
|
+
if self.interval:
|
83
|
+
_dict['interval'] = self.interval.to_dict()
|
79
84
|
# override the default output from pydantic by calling `to_dict()` of result_filter
|
80
85
|
if self.result_filter:
|
81
86
|
_dict['result_filter'] = self.result_filter.to_dict()
|
87
|
+
# set to None if interval (nullable) is None
|
88
|
+
# and model_fields_set contains the field
|
89
|
+
if self.interval is None and "interval" in self.model_fields_set:
|
90
|
+
_dict['interval'] = None
|
91
|
+
|
82
92
|
# set to None if result_filter (nullable) is None
|
83
93
|
# and model_fields_set contains the field
|
84
94
|
if self.result_filter is None and "result_filter" in self.model_fields_set:
|
@@ -98,6 +108,7 @@ class PostMetricsQuery(BaseModel):
|
|
98
108
|
_obj = cls.model_validate({
|
99
109
|
"query": obj.get("query"),
|
100
110
|
"time_range": PostMetricsQueryTimeRange.from_dict(obj["time_range"]) if obj.get("time_range") is not None else None,
|
111
|
+
"interval": AlertRuleInterval.from_dict(obj["interval"]) if obj.get("interval") is not None else None,
|
101
112
|
"limit": obj.get("limit") if obj.get("limit") is not None else 50,
|
102
113
|
"result_filter": ResultFilter.from_dict(obj["result_filter"]) if obj.get("result_filter") is not None else None
|
103
114
|
})
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Arthur Scope
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ValidateAlertRuleQueryReq(BaseModel):
|
26
|
+
"""
|
27
|
+
ValidateAlertRuleQueryReq
|
28
|
+
""" # noqa: E501
|
29
|
+
query: StrictStr = Field(description="The query of the alert rule.")
|
30
|
+
__properties: ClassVar[List[str]] = ["query"]
|
31
|
+
|
32
|
+
model_config = ConfigDict(
|
33
|
+
populate_by_name=True,
|
34
|
+
validate_assignment=True,
|
35
|
+
protected_namespaces=(),
|
36
|
+
)
|
37
|
+
|
38
|
+
|
39
|
+
def to_str(self) -> str:
|
40
|
+
"""Returns the string representation of the model using alias"""
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
|
+
|
43
|
+
def to_json(self) -> str:
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
|
+
return json.dumps(self.to_dict())
|
47
|
+
|
48
|
+
@classmethod
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
|
+
"""Create an instance of ValidateAlertRuleQueryReq from a JSON string"""
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
52
|
+
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
55
|
+
|
56
|
+
This has the following differences from calling pydantic's
|
57
|
+
`self.model_dump(by_alias=True)`:
|
58
|
+
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
60
|
+
were set at model initialization. Other fields with value `None`
|
61
|
+
are ignored.
|
62
|
+
"""
|
63
|
+
excluded_fields: Set[str] = set([
|
64
|
+
])
|
65
|
+
|
66
|
+
_dict = self.model_dump(
|
67
|
+
by_alias=True,
|
68
|
+
exclude=excluded_fields,
|
69
|
+
exclude_none=True,
|
70
|
+
)
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
+
"""Create an instance of ValidateAlertRuleQueryReq from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return cls.model_validate(obj)
|
81
|
+
|
82
|
+
_obj = cls.model_validate({
|
83
|
+
"query": obj.get("query")
|
84
|
+
})
|
85
|
+
return _obj
|
86
|
+
|
87
|
+
|
@@ -40,6 +40,9 @@ class TestAlert(unittest.TestCase):
|
|
40
40
|
value = 1.337,
|
41
41
|
threshold = 1.337,
|
42
42
|
bound = 'upper_bound',
|
43
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
44
|
+
unit = 'seconds',
|
45
|
+
count = 56, ),
|
43
46
|
dimensions = None,
|
44
47
|
alert_rule_id = '',
|
45
48
|
job_id = '',
|
@@ -58,6 +61,9 @@ class TestAlert(unittest.TestCase):
|
|
58
61
|
value = 1.337,
|
59
62
|
threshold = 1.337,
|
60
63
|
bound = 'upper_bound',
|
64
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
65
|
+
unit = 'seconds',
|
66
|
+
count = 56, ),
|
61
67
|
dimensions = None,
|
62
68
|
alert_rule_id = '',
|
63
69
|
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
@@ -45,6 +45,9 @@ class TestAlertRule(unittest.TestCase):
|
|
45
45
|
bound = 'upper_bound',
|
46
46
|
query = '',
|
47
47
|
metric_name = '',
|
48
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
49
|
+
unit = 'seconds',
|
50
|
+
count = 56, ),
|
48
51
|
last_updated_by_user = arthur_client.api_bindings.models.user.User(
|
49
52
|
created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
50
53
|
updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
@@ -75,6 +78,9 @@ class TestAlertRule(unittest.TestCase):
|
|
75
78
|
bound = 'upper_bound',
|
76
79
|
query = '',
|
77
80
|
metric_name = '',
|
81
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
82
|
+
unit = 'seconds',
|
83
|
+
count = 56, ),
|
78
84
|
notification_webhooks = [
|
79
85
|
arthur_client.api_bindings.models.alert_rule_notification_webhook.AlertRuleNotificationWebhook(
|
80
86
|
id = '',
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Arthur Scope
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
18
|
+
|
19
|
+
class TestAlertRuleInterval(unittest.TestCase):
|
20
|
+
"""AlertRuleInterval unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def make_instance(self, include_optional) -> AlertRuleInterval:
|
29
|
+
"""Test AlertRuleInterval
|
30
|
+
include_optional is a boolean, when False only required
|
31
|
+
params are included, when True both required and
|
32
|
+
optional params are included """
|
33
|
+
# uncomment below to create an instance of `AlertRuleInterval`
|
34
|
+
"""
|
35
|
+
model = AlertRuleInterval()
|
36
|
+
if include_optional:
|
37
|
+
return AlertRuleInterval(
|
38
|
+
unit = 'seconds',
|
39
|
+
count = 56
|
40
|
+
)
|
41
|
+
else:
|
42
|
+
return AlertRuleInterval(
|
43
|
+
unit = 'seconds',
|
44
|
+
count = 56,
|
45
|
+
)
|
46
|
+
"""
|
47
|
+
|
48
|
+
def testAlertRuleInterval(self):
|
49
|
+
"""Test AlertRuleInterval"""
|
50
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
51
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
52
|
+
|
53
|
+
if __name__ == '__main__':
|
54
|
+
unittest.main()
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Arthur Scope
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from arthur_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
18
|
+
|
19
|
+
class TestAlertRuleSQLValidationResp(unittest.TestCase):
|
20
|
+
"""AlertRuleSQLValidationResp unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def make_instance(self, include_optional) -> AlertRuleSQLValidationResp:
|
29
|
+
"""Test AlertRuleSQLValidationResp
|
30
|
+
include_optional is a boolean, when False only required
|
31
|
+
params are included, when True both required and
|
32
|
+
optional params are included """
|
33
|
+
# uncomment below to create an instance of `AlertRuleSQLValidationResp`
|
34
|
+
"""
|
35
|
+
model = AlertRuleSQLValidationResp()
|
36
|
+
if include_optional:
|
37
|
+
return AlertRuleSQLValidationResp(
|
38
|
+
has_metric_timestamp_col = True,
|
39
|
+
has_metric_value_col = True,
|
40
|
+
has_time_templates = True,
|
41
|
+
has_interval_templates = True
|
42
|
+
)
|
43
|
+
else:
|
44
|
+
return AlertRuleSQLValidationResp(
|
45
|
+
has_metric_timestamp_col = True,
|
46
|
+
has_metric_value_col = True,
|
47
|
+
has_time_templates = True,
|
48
|
+
has_interval_templates = True,
|
49
|
+
)
|
50
|
+
"""
|
51
|
+
|
52
|
+
def testAlertRuleSQLValidationResp(self):
|
53
|
+
"""Test AlertRuleSQLValidationResp"""
|
54
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
55
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
56
|
+
|
57
|
+
if __name__ == '__main__':
|
58
|
+
unittest.main()
|
@@ -54,6 +54,13 @@ class TestAlertRulesV1Api(unittest.TestCase):
|
|
54
54
|
"""
|
55
55
|
pass
|
56
56
|
|
57
|
+
def test_post_alert_rule_query_validation(self) -> None:
|
58
|
+
"""Test case for post_alert_rule_query_validation
|
59
|
+
|
60
|
+
Validate A Model Alert Rule Query
|
61
|
+
"""
|
62
|
+
pass
|
63
|
+
|
57
64
|
def test_post_model_alert_rule(self) -> None:
|
58
65
|
"""Test case for post_model_alert_rule
|
59
66
|
|
@@ -42,6 +42,9 @@ class TestCreatedAlerts(unittest.TestCase):
|
|
42
42
|
value = 1.337,
|
43
43
|
threshold = 1.337,
|
44
44
|
bound = 'upper_bound',
|
45
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
46
|
+
unit = 'seconds',
|
47
|
+
count = 56, ),
|
45
48
|
dimensions = arthur_client.api_bindings.models.dimensions.dimensions(),
|
46
49
|
alert_rule_id = '',
|
47
50
|
job_id = '',
|
@@ -73,6 +76,9 @@ class TestCreatedAlerts(unittest.TestCase):
|
|
73
76
|
value = 1.337,
|
74
77
|
threshold = 1.337,
|
75
78
|
bound = 'upper_bound',
|
79
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
80
|
+
unit = 'seconds',
|
81
|
+
count = 56, ),
|
76
82
|
dimensions = arthur_client.api_bindings.models.dimensions.dimensions(),
|
77
83
|
alert_rule_id = '',
|
78
84
|
job_id = '',
|
@@ -42,6 +42,9 @@ class TestInfiniteResourceListAlert(unittest.TestCase):
|
|
42
42
|
value = 1.337,
|
43
43
|
threshold = 1.337,
|
44
44
|
bound = 'upper_bound',
|
45
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
46
|
+
unit = 'seconds',
|
47
|
+
count = 56, ),
|
45
48
|
dimensions = arthur_client.api_bindings.models.dimensions.dimensions(),
|
46
49
|
alert_rule_id = '',
|
47
50
|
job_id = '',
|
@@ -66,6 +69,9 @@ class TestInfiniteResourceListAlert(unittest.TestCase):
|
|
66
69
|
value = 1.337,
|
67
70
|
threshold = 1.337,
|
68
71
|
bound = 'upper_bound',
|
72
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
73
|
+
unit = 'seconds',
|
74
|
+
count = 56, ),
|
69
75
|
dimensions = arthur_client.api_bindings.models.dimensions.dimensions(),
|
70
76
|
alert_rule_id = '',
|
71
77
|
job_id = '',
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Arthur Scope
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from arthur_client.api_bindings.models.interval_unit import IntervalUnit
|
18
|
+
|
19
|
+
class TestIntervalUnit(unittest.TestCase):
|
20
|
+
"""IntervalUnit unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def testIntervalUnit(self):
|
29
|
+
"""Test IntervalUnit"""
|
30
|
+
# inst = IntervalUnit()
|
31
|
+
|
32
|
+
if __name__ == '__main__':
|
33
|
+
unittest.main()
|
@@ -39,13 +39,22 @@ class TestMetricsColumnListParameterSchema(unittest.TestCase):
|
|
39
39
|
optional = True,
|
40
40
|
friendly_name = '',
|
41
41
|
description = '',
|
42
|
-
parameter_type = 'column_list'
|
42
|
+
parameter_type = 'column_list',
|
43
|
+
tag_hints = [
|
44
|
+
'llm_context'
|
45
|
+
],
|
46
|
+
source_dataset_parameter_key = '',
|
47
|
+
allowed_column_types = [
|
48
|
+
null
|
49
|
+
],
|
50
|
+
allow_any_column_type = True
|
43
51
|
)
|
44
52
|
else:
|
45
53
|
return MetricsColumnListParameterSchema(
|
46
54
|
parameter_key = '',
|
47
55
|
friendly_name = '',
|
48
56
|
description = '',
|
57
|
+
source_dataset_parameter_key = '',
|
49
58
|
)
|
50
59
|
"""
|
51
60
|
|
@@ -14,10 +14,10 @@
|
|
14
14
|
|
15
15
|
import unittest
|
16
16
|
|
17
|
-
from arthur_client.api_bindings.models.
|
17
|
+
from arthur_client.api_bindings.models.metrics_column_list_parameter_schema_allowed_column_types_inner import MetricsColumnListParameterSchemaAllowedColumnTypesInner
|
18
18
|
|
19
|
-
class
|
20
|
-
"""
|
19
|
+
class TestMetricsColumnListParameterSchemaAllowedColumnTypesInner(unittest.TestCase):
|
20
|
+
"""MetricsColumnListParameterSchemaAllowedColumnTypesInner unit test stubs"""
|
21
21
|
|
22
22
|
def setUp(self):
|
23
23
|
pass
|
@@ -25,16 +25,16 @@ class TestMetricsColumnParameterSchemaAllowedColumnTypesInner(unittest.TestCase)
|
|
25
25
|
def tearDown(self):
|
26
26
|
pass
|
27
27
|
|
28
|
-
def make_instance(self, include_optional) ->
|
29
|
-
"""Test
|
28
|
+
def make_instance(self, include_optional) -> MetricsColumnListParameterSchemaAllowedColumnTypesInner:
|
29
|
+
"""Test MetricsColumnListParameterSchemaAllowedColumnTypesInner
|
30
30
|
include_optional is a boolean, when False only required
|
31
31
|
params are included, when True both required and
|
32
32
|
optional params are included """
|
33
|
-
# uncomment below to create an instance of `
|
33
|
+
# uncomment below to create an instance of `MetricsColumnListParameterSchemaAllowedColumnTypesInner`
|
34
34
|
"""
|
35
|
-
model =
|
35
|
+
model = MetricsColumnListParameterSchemaAllowedColumnTypesInner()
|
36
36
|
if include_optional:
|
37
|
-
return
|
37
|
+
return MetricsColumnListParameterSchemaAllowedColumnTypesInner(
|
38
38
|
dtype = 'undefined',
|
39
39
|
object = {
|
40
40
|
'key' : null
|
@@ -42,7 +42,7 @@ class TestMetricsColumnParameterSchemaAllowedColumnTypesInner(unittest.TestCase)
|
|
42
42
|
items = None
|
43
43
|
)
|
44
44
|
else:
|
45
|
-
return
|
45
|
+
return MetricsColumnListParameterSchemaAllowedColumnTypesInner(
|
46
46
|
dtype = 'undefined',
|
47
47
|
object = {
|
48
48
|
'key' : null
|
@@ -51,8 +51,8 @@ class TestMetricsColumnParameterSchemaAllowedColumnTypesInner(unittest.TestCase)
|
|
51
51
|
)
|
52
52
|
"""
|
53
53
|
|
54
|
-
def
|
55
|
-
"""Test
|
54
|
+
def testMetricsColumnListParameterSchemaAllowedColumnTypesInner(self):
|
55
|
+
"""Test MetricsColumnListParameterSchemaAllowedColumnTypesInner"""
|
56
56
|
# inst_req_only = self.make_instance(include_optional=False)
|
57
57
|
# inst_req_and_optional = self.make_instance(include_optional=True)
|
58
58
|
|
@@ -41,6 +41,9 @@ class TestPatchAlertRule(unittest.TestCase):
|
|
41
41
|
bound = 'upper_bound',
|
42
42
|
query = '',
|
43
43
|
metric_name = '',
|
44
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
45
|
+
unit = 'seconds',
|
46
|
+
count = 56, ),
|
44
47
|
notification_webhook_ids = [
|
45
48
|
''
|
46
49
|
]
|
@@ -40,6 +40,9 @@ class TestPostAlert(unittest.TestCase):
|
|
40
40
|
value = 1.337,
|
41
41
|
threshold = 1.337,
|
42
42
|
bound = 'upper_bound',
|
43
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
44
|
+
unit = 'seconds',
|
45
|
+
count = 56, ),
|
43
46
|
dimensions = None,
|
44
47
|
alert_rule_id = '',
|
45
48
|
job_id = ''
|
@@ -51,6 +54,9 @@ class TestPostAlert(unittest.TestCase):
|
|
51
54
|
value = 1.337,
|
52
55
|
threshold = 1.337,
|
53
56
|
bound = 'upper_bound',
|
57
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
58
|
+
unit = 'seconds',
|
59
|
+
count = 56, ),
|
54
60
|
dimensions = None,
|
55
61
|
alert_rule_id = '',
|
56
62
|
)
|
@@ -41,6 +41,9 @@ class TestPostAlertRule(unittest.TestCase):
|
|
41
41
|
bound = 'upper_bound',
|
42
42
|
query = '',
|
43
43
|
metric_name = '',
|
44
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
45
|
+
unit = 'seconds',
|
46
|
+
count = 56, ),
|
44
47
|
notification_webhook_ids = [
|
45
48
|
''
|
46
49
|
]
|
@@ -52,6 +55,9 @@ class TestPostAlertRule(unittest.TestCase):
|
|
52
55
|
bound = 'upper_bound',
|
53
56
|
query = '',
|
54
57
|
metric_name = '',
|
58
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
59
|
+
unit = 'seconds',
|
60
|
+
count = 56, ),
|
55
61
|
)
|
56
62
|
"""
|
57
63
|
|
@@ -42,6 +42,9 @@ class TestPostAlerts(unittest.TestCase):
|
|
42
42
|
value = 1.337,
|
43
43
|
threshold = 1.337,
|
44
44
|
bound = 'upper_bound',
|
45
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
46
|
+
unit = 'seconds',
|
47
|
+
count = 56, ),
|
45
48
|
dimensions = arthur_client.api_bindings.models.dimensions.dimensions(),
|
46
49
|
alert_rule_id = '',
|
47
50
|
job_id = '', )
|
@@ -56,6 +59,9 @@ class TestPostAlerts(unittest.TestCase):
|
|
56
59
|
value = 1.337,
|
57
60
|
threshold = 1.337,
|
58
61
|
bound = 'upper_bound',
|
62
|
+
interval = arthur_client.api_bindings.models.alert_rule_interval.AlertRuleInterval(
|
63
|
+
unit = 'seconds',
|
64
|
+
count = 56, ),
|
59
65
|
dimensions = arthur_client.api_bindings.models.dimensions.dimensions(),
|
60
66
|
alert_rule_id = '',
|
61
67
|
job_id = '', )
|