arthur-client 1.4.1055__py3-none-any.whl → 1.4.1186__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.1186.dist-info}/METADATA +1 -1
- {arthur_client-1.4.1055.dist-info → arthur_client-1.4.1186.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.1186.dist-info}/WHEEL +0 -0
@@ -64,7 +64,9 @@ from arthur_client.api_bindings.models.alert import Alert
|
|
64
64
|
from arthur_client.api_bindings.models.alert_bound import AlertBound
|
65
65
|
from arthur_client.api_bindings.models.alert_check_job_spec import AlertCheckJobSpec
|
66
66
|
from arthur_client.api_bindings.models.alert_rule import AlertRule
|
67
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
67
68
|
from arthur_client.api_bindings.models.alert_rule_notification_webhook import AlertRuleNotificationWebhook
|
69
|
+
from arthur_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
68
70
|
from arthur_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
69
71
|
from arthur_client.api_bindings.models.alert_sort import AlertSort
|
70
72
|
from arthur_client.api_bindings.models.alert_webhook_called import AlertWebhookCalled
|
@@ -141,6 +143,7 @@ from arthur_client.api_bindings.models.infinite_pagination import InfinitePagina
|
|
141
143
|
from arthur_client.api_bindings.models.infinite_resource_list_alert import InfiniteResourceListAlert
|
142
144
|
from arthur_client.api_bindings.models.infinite_resource_list_job import InfiniteResourceListJob
|
143
145
|
from arthur_client.api_bindings.models.internal_server_error import InternalServerError
|
146
|
+
from arthur_client.api_bindings.models.interval_unit import IntervalUnit
|
144
147
|
from arthur_client.api_bindings.models.invite_new_user import InviteNewUser
|
145
148
|
from arthur_client.api_bindings.models.items import Items
|
146
149
|
from arthur_client.api_bindings.models.items1 import Items1
|
@@ -166,8 +169,8 @@ from arthur_client.api_bindings.models.list_type import ListType
|
|
166
169
|
from arthur_client.api_bindings.models.metrics_arg_spec import MetricsArgSpec
|
167
170
|
from arthur_client.api_bindings.models.metrics_calculation_job_spec import MetricsCalculationJobSpec
|
168
171
|
from arthur_client.api_bindings.models.metrics_column_list_parameter_schema import MetricsColumnListParameterSchema
|
172
|
+
from arthur_client.api_bindings.models.metrics_column_list_parameter_schema_allowed_column_types_inner import MetricsColumnListParameterSchemaAllowedColumnTypesInner
|
169
173
|
from arthur_client.api_bindings.models.metrics_column_parameter_schema import MetricsColumnParameterSchema
|
170
|
-
from arthur_client.api_bindings.models.metrics_column_parameter_schema_allowed_column_types_inner import MetricsColumnParameterSchemaAllowedColumnTypesInner
|
171
174
|
from arthur_client.api_bindings.models.metrics_dataset_parameter_schema import MetricsDatasetParameterSchema
|
172
175
|
from arthur_client.api_bindings.models.metrics_literal_parameter_schema import MetricsLiteralParameterSchema
|
173
176
|
from arthur_client.api_bindings.models.metrics_query_result import MetricsQueryResult
|
@@ -320,6 +323,7 @@ from arthur_client.api_bindings.models.user_credentials import UserCredentials
|
|
320
323
|
from arthur_client.api_bindings.models.user_service_account_credentials import UserServiceAccountCredentials
|
321
324
|
from arthur_client.api_bindings.models.user_sort import UserSort
|
322
325
|
from arthur_client.api_bindings.models.user_type import UserType
|
326
|
+
from arthur_client.api_bindings.models.validate_alert_rule_query_req import ValidateAlertRuleQueryReq
|
323
327
|
from arthur_client.api_bindings.models.validation_error import ValidationError
|
324
328
|
from arthur_client.api_bindings.models.validation_error_loc_inner import ValidationErrorLocInner
|
325
329
|
from arthur_client.api_bindings.models.webhook import Webhook
|
@@ -21,11 +21,13 @@ from typing import Optional, Union
|
|
21
21
|
from typing_extensions import Annotated
|
22
22
|
from arthur_client.api_bindings.models.alert_bound import AlertBound
|
23
23
|
from arthur_client.api_bindings.models.alert_rule import AlertRule
|
24
|
+
from arthur_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
24
25
|
from arthur_client.api_bindings.models.alert_rule_sort import AlertRuleSort
|
25
26
|
from arthur_client.api_bindings.models.patch_alert_rule import PatchAlertRule
|
26
27
|
from arthur_client.api_bindings.models.post_alert_rule import PostAlertRule
|
27
28
|
from arthur_client.api_bindings.models.resource_list_alert_rule import ResourceListAlertRule
|
28
29
|
from arthur_client.api_bindings.models.sort_order import SortOrder
|
30
|
+
from arthur_client.api_bindings.models.validate_alert_rule_query_req import ValidateAlertRuleQueryReq
|
29
31
|
|
30
32
|
from arthur_client.api_bindings.api_client import ApiClient, RequestSerialized
|
31
33
|
from arthur_client.api_bindings.api_response import ApiResponse
|
@@ -1326,6 +1328,307 @@ class AlertRulesV1Api:
|
|
1326
1328
|
|
1327
1329
|
|
1328
1330
|
|
1331
|
+
@validate_call
|
1332
|
+
def post_alert_rule_query_validation(
|
1333
|
+
self,
|
1334
|
+
model_id: StrictStr,
|
1335
|
+
validate_alert_rule_query_req: ValidateAlertRuleQueryReq,
|
1336
|
+
_request_timeout: Union[
|
1337
|
+
None,
|
1338
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1339
|
+
Tuple[
|
1340
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1341
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1342
|
+
]
|
1343
|
+
] = None,
|
1344
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1345
|
+
_content_type: Optional[StrictStr] = None,
|
1346
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1347
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1348
|
+
) -> AlertRuleSQLValidationResp:
|
1349
|
+
"""Validate A Model Alert Rule Query
|
1350
|
+
|
1351
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
1352
|
+
|
1353
|
+
:param model_id: (required)
|
1354
|
+
:type model_id: str
|
1355
|
+
:param validate_alert_rule_query_req: (required)
|
1356
|
+
:type validate_alert_rule_query_req: ValidateAlertRuleQueryReq
|
1357
|
+
:param _request_timeout: timeout setting for this request. If one
|
1358
|
+
number provided, it will be total request
|
1359
|
+
timeout. It can also be a pair (tuple) of
|
1360
|
+
(connection, read) timeouts.
|
1361
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1362
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1363
|
+
request; this effectively ignores the
|
1364
|
+
authentication in the spec for a single request.
|
1365
|
+
:type _request_auth: dict, optional
|
1366
|
+
:param _content_type: force content-type for the request.
|
1367
|
+
:type _content_type: str, Optional
|
1368
|
+
:param _headers: set to override the headers for a single
|
1369
|
+
request; this effectively ignores the headers
|
1370
|
+
in the spec for a single request.
|
1371
|
+
:type _headers: dict, optional
|
1372
|
+
:param _host_index: set to override the host_index for a single
|
1373
|
+
request; this effectively ignores the host_index
|
1374
|
+
in the spec for a single request.
|
1375
|
+
:type _host_index: int, optional
|
1376
|
+
:return: Returns the result object.
|
1377
|
+
""" # noqa: E501
|
1378
|
+
|
1379
|
+
_param = self._post_alert_rule_query_validation_serialize(
|
1380
|
+
model_id=model_id,
|
1381
|
+
validate_alert_rule_query_req=validate_alert_rule_query_req,
|
1382
|
+
_request_auth=_request_auth,
|
1383
|
+
_content_type=_content_type,
|
1384
|
+
_headers=_headers,
|
1385
|
+
_host_index=_host_index
|
1386
|
+
)
|
1387
|
+
|
1388
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1389
|
+
'200': "AlertRuleSQLValidationResp",
|
1390
|
+
'500': "InternalServerError",
|
1391
|
+
'404': "NotFoundError",
|
1392
|
+
'400': "BadRequestError",
|
1393
|
+
'422': "HTTPValidationError",
|
1394
|
+
}
|
1395
|
+
response_data = self.api_client.call_api(
|
1396
|
+
*_param,
|
1397
|
+
_request_timeout=_request_timeout
|
1398
|
+
)
|
1399
|
+
response_data.read()
|
1400
|
+
return self.api_client.response_deserialize(
|
1401
|
+
response_data=response_data,
|
1402
|
+
response_types_map=_response_types_map,
|
1403
|
+
).data
|
1404
|
+
|
1405
|
+
|
1406
|
+
@validate_call
|
1407
|
+
def post_alert_rule_query_validation_with_http_info(
|
1408
|
+
self,
|
1409
|
+
model_id: StrictStr,
|
1410
|
+
validate_alert_rule_query_req: ValidateAlertRuleQueryReq,
|
1411
|
+
_request_timeout: Union[
|
1412
|
+
None,
|
1413
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1414
|
+
Tuple[
|
1415
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1416
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1417
|
+
]
|
1418
|
+
] = None,
|
1419
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1420
|
+
_content_type: Optional[StrictStr] = None,
|
1421
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1422
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1423
|
+
) -> ApiResponse[AlertRuleSQLValidationResp]:
|
1424
|
+
"""Validate A Model Alert Rule Query
|
1425
|
+
|
1426
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
1427
|
+
|
1428
|
+
:param model_id: (required)
|
1429
|
+
:type model_id: str
|
1430
|
+
:param validate_alert_rule_query_req: (required)
|
1431
|
+
:type validate_alert_rule_query_req: ValidateAlertRuleQueryReq
|
1432
|
+
:param _request_timeout: timeout setting for this request. If one
|
1433
|
+
number provided, it will be total request
|
1434
|
+
timeout. It can also be a pair (tuple) of
|
1435
|
+
(connection, read) timeouts.
|
1436
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1437
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1438
|
+
request; this effectively ignores the
|
1439
|
+
authentication in the spec for a single request.
|
1440
|
+
:type _request_auth: dict, optional
|
1441
|
+
:param _content_type: force content-type for the request.
|
1442
|
+
:type _content_type: str, Optional
|
1443
|
+
:param _headers: set to override the headers for a single
|
1444
|
+
request; this effectively ignores the headers
|
1445
|
+
in the spec for a single request.
|
1446
|
+
:type _headers: dict, optional
|
1447
|
+
:param _host_index: set to override the host_index for a single
|
1448
|
+
request; this effectively ignores the host_index
|
1449
|
+
in the spec for a single request.
|
1450
|
+
:type _host_index: int, optional
|
1451
|
+
:return: Returns the result object.
|
1452
|
+
""" # noqa: E501
|
1453
|
+
|
1454
|
+
_param = self._post_alert_rule_query_validation_serialize(
|
1455
|
+
model_id=model_id,
|
1456
|
+
validate_alert_rule_query_req=validate_alert_rule_query_req,
|
1457
|
+
_request_auth=_request_auth,
|
1458
|
+
_content_type=_content_type,
|
1459
|
+
_headers=_headers,
|
1460
|
+
_host_index=_host_index
|
1461
|
+
)
|
1462
|
+
|
1463
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1464
|
+
'200': "AlertRuleSQLValidationResp",
|
1465
|
+
'500': "InternalServerError",
|
1466
|
+
'404': "NotFoundError",
|
1467
|
+
'400': "BadRequestError",
|
1468
|
+
'422': "HTTPValidationError",
|
1469
|
+
}
|
1470
|
+
response_data = self.api_client.call_api(
|
1471
|
+
*_param,
|
1472
|
+
_request_timeout=_request_timeout
|
1473
|
+
)
|
1474
|
+
response_data.read()
|
1475
|
+
return self.api_client.response_deserialize(
|
1476
|
+
response_data=response_data,
|
1477
|
+
response_types_map=_response_types_map,
|
1478
|
+
)
|
1479
|
+
|
1480
|
+
|
1481
|
+
@validate_call
|
1482
|
+
def post_alert_rule_query_validation_without_preload_content(
|
1483
|
+
self,
|
1484
|
+
model_id: StrictStr,
|
1485
|
+
validate_alert_rule_query_req: ValidateAlertRuleQueryReq,
|
1486
|
+
_request_timeout: Union[
|
1487
|
+
None,
|
1488
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1489
|
+
Tuple[
|
1490
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1491
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1492
|
+
]
|
1493
|
+
] = None,
|
1494
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1495
|
+
_content_type: Optional[StrictStr] = None,
|
1496
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1497
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1498
|
+
) -> RESTResponseType:
|
1499
|
+
"""Validate A Model Alert Rule Query
|
1500
|
+
|
1501
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
1502
|
+
|
1503
|
+
:param model_id: (required)
|
1504
|
+
:type model_id: str
|
1505
|
+
:param validate_alert_rule_query_req: (required)
|
1506
|
+
:type validate_alert_rule_query_req: ValidateAlertRuleQueryReq
|
1507
|
+
:param _request_timeout: timeout setting for this request. If one
|
1508
|
+
number provided, it will be total request
|
1509
|
+
timeout. It can also be a pair (tuple) of
|
1510
|
+
(connection, read) timeouts.
|
1511
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1512
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1513
|
+
request; this effectively ignores the
|
1514
|
+
authentication in the spec for a single request.
|
1515
|
+
:type _request_auth: dict, optional
|
1516
|
+
:param _content_type: force content-type for the request.
|
1517
|
+
:type _content_type: str, Optional
|
1518
|
+
:param _headers: set to override the headers for a single
|
1519
|
+
request; this effectively ignores the headers
|
1520
|
+
in the spec for a single request.
|
1521
|
+
:type _headers: dict, optional
|
1522
|
+
:param _host_index: set to override the host_index for a single
|
1523
|
+
request; this effectively ignores the host_index
|
1524
|
+
in the spec for a single request.
|
1525
|
+
:type _host_index: int, optional
|
1526
|
+
:return: Returns the result object.
|
1527
|
+
""" # noqa: E501
|
1528
|
+
|
1529
|
+
_param = self._post_alert_rule_query_validation_serialize(
|
1530
|
+
model_id=model_id,
|
1531
|
+
validate_alert_rule_query_req=validate_alert_rule_query_req,
|
1532
|
+
_request_auth=_request_auth,
|
1533
|
+
_content_type=_content_type,
|
1534
|
+
_headers=_headers,
|
1535
|
+
_host_index=_host_index
|
1536
|
+
)
|
1537
|
+
|
1538
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1539
|
+
'200': "AlertRuleSQLValidationResp",
|
1540
|
+
'500': "InternalServerError",
|
1541
|
+
'404': "NotFoundError",
|
1542
|
+
'400': "BadRequestError",
|
1543
|
+
'422': "HTTPValidationError",
|
1544
|
+
}
|
1545
|
+
response_data = self.api_client.call_api(
|
1546
|
+
*_param,
|
1547
|
+
_request_timeout=_request_timeout
|
1548
|
+
)
|
1549
|
+
return response_data.response
|
1550
|
+
|
1551
|
+
|
1552
|
+
def _post_alert_rule_query_validation_serialize(
|
1553
|
+
self,
|
1554
|
+
model_id,
|
1555
|
+
validate_alert_rule_query_req,
|
1556
|
+
_request_auth,
|
1557
|
+
_content_type,
|
1558
|
+
_headers,
|
1559
|
+
_host_index,
|
1560
|
+
) -> RequestSerialized:
|
1561
|
+
|
1562
|
+
_host = None
|
1563
|
+
|
1564
|
+
_collection_formats: Dict[str, str] = {
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
_path_params: Dict[str, str] = {}
|
1568
|
+
_query_params: List[Tuple[str, str]] = []
|
1569
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1570
|
+
_form_params: List[Tuple[str, str]] = []
|
1571
|
+
_files: Dict[
|
1572
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1573
|
+
] = {}
|
1574
|
+
_body_params: Optional[bytes] = None
|
1575
|
+
|
1576
|
+
# process the path parameters
|
1577
|
+
if model_id is not None:
|
1578
|
+
_path_params['model_id'] = model_id
|
1579
|
+
# process the query parameters
|
1580
|
+
# process the header parameters
|
1581
|
+
# process the form parameters
|
1582
|
+
# process the body parameter
|
1583
|
+
if validate_alert_rule_query_req is not None:
|
1584
|
+
_body_params = validate_alert_rule_query_req
|
1585
|
+
|
1586
|
+
|
1587
|
+
# set the HTTP header `Accept`
|
1588
|
+
if 'Accept' not in _header_params:
|
1589
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1590
|
+
[
|
1591
|
+
'application/json'
|
1592
|
+
]
|
1593
|
+
)
|
1594
|
+
|
1595
|
+
# set the HTTP header `Content-Type`
|
1596
|
+
if _content_type:
|
1597
|
+
_header_params['Content-Type'] = _content_type
|
1598
|
+
else:
|
1599
|
+
_default_content_type = (
|
1600
|
+
self.api_client.select_header_content_type(
|
1601
|
+
[
|
1602
|
+
'application/json'
|
1603
|
+
]
|
1604
|
+
)
|
1605
|
+
)
|
1606
|
+
if _default_content_type is not None:
|
1607
|
+
_header_params['Content-Type'] = _default_content_type
|
1608
|
+
|
1609
|
+
# authentication setting
|
1610
|
+
_auth_settings: List[str] = [
|
1611
|
+
'OAuth2AuthorizationCode'
|
1612
|
+
]
|
1613
|
+
|
1614
|
+
return self.api_client.param_serialize(
|
1615
|
+
method='POST',
|
1616
|
+
resource_path='/api/v1/models/{model_id}/alert_rule_query_validation',
|
1617
|
+
path_params=_path_params,
|
1618
|
+
query_params=_query_params,
|
1619
|
+
header_params=_header_params,
|
1620
|
+
body=_body_params,
|
1621
|
+
post_params=_form_params,
|
1622
|
+
files=_files,
|
1623
|
+
auth_settings=_auth_settings,
|
1624
|
+
collection_formats=_collection_formats,
|
1625
|
+
_host=_host,
|
1626
|
+
_request_auth=_request_auth
|
1627
|
+
)
|
1628
|
+
|
1629
|
+
|
1630
|
+
|
1631
|
+
|
1329
1632
|
@validate_call
|
1330
1633
|
def post_model_alert_rule(
|
1331
1634
|
self,
|
@@ -2306,6 +2306,7 @@ class DatasetsV1Api:
|
|
2306
2306
|
'200': "AvailableDataset",
|
2307
2307
|
'500': "InternalServerError",
|
2308
2308
|
'404': "NotFoundError",
|
2309
|
+
'400': "BadRequestError",
|
2309
2310
|
'422': "HTTPValidationError",
|
2310
2311
|
}
|
2311
2312
|
response_data = self.api_client.call_api(
|
@@ -2380,6 +2381,7 @@ class DatasetsV1Api:
|
|
2380
2381
|
'200': "AvailableDataset",
|
2381
2382
|
'500': "InternalServerError",
|
2382
2383
|
'404': "NotFoundError",
|
2384
|
+
'400': "BadRequestError",
|
2383
2385
|
'422': "HTTPValidationError",
|
2384
2386
|
}
|
2385
2387
|
response_data = self.api_client.call_api(
|
@@ -2454,6 +2456,7 @@ class DatasetsV1Api:
|
|
2454
2456
|
'200': "AvailableDataset",
|
2455
2457
|
'500': "InternalServerError",
|
2456
2458
|
'404': "NotFoundError",
|
2459
|
+
'400': "BadRequestError",
|
2457
2460
|
'422': "HTTPValidationError",
|
2458
2461
|
}
|
2459
2462
|
response_data = self.api_client.call_api(
|
@@ -14,7 +14,7 @@ Name | Type | Description | Notes
|
|
14
14
|
**parameter_dtype** | [**DType**](DType.md) | Data type of the parameter. |
|
15
15
|
**tag_hints** | [**List[ScopeSchemaTag]**](ScopeSchemaTag.md) | List of tags that are applicable to this parameter. Datasets with columns that have matching tags can be inferred this way. | [optional] [default to []]
|
16
16
|
**source_dataset_parameter_key** | **str** | Name of the parameter that provides the dataset to be used for this column. |
|
17
|
-
**allowed_column_types** | [**List[
|
17
|
+
**allowed_column_types** | [**List[MetricsColumnListParameterSchemaAllowedColumnTypesInner]**](MetricsColumnListParameterSchemaAllowedColumnTypesInner.md) | | [optional]
|
18
18
|
**allow_any_column_type** | **bool** | Indicates if this metric parameter can accept any column type. | [optional] [default to False]
|
19
19
|
|
20
20
|
## Example
|
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
10
10
|
**value** | **float** | The value of the metric that triggered the alert. |
|
11
11
|
**threshold** | **float** | The threshold that triggered the alert. |
|
12
12
|
**bound** | [**AlertBound**](AlertBound.md) | The bound of the alert. |
|
13
|
+
**interval** | [**AlertRuleInterval**](AlertRuleInterval.md) | The interval of the alert rule, commonly '1 day', '1 hour', etc. |
|
13
14
|
**dimensions** | **object** | |
|
14
15
|
**alert_rule_id** | **str** | The alert rule id of the alert. |
|
15
16
|
**job_id** | **str** | | [optional]
|
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
|
|
15
15
|
**bound** | [**AlertBound**](AlertBound.md) | The bound of the alert rule. |
|
16
16
|
**query** | **str** | The query of the alert rule. |
|
17
17
|
**metric_name** | **str** | The name of the metric returned by the alert rule query. |
|
18
|
+
**interval** | [**AlertRuleInterval**](AlertRuleInterval.md) | The interval of the alert rule, commonly '1 day', '1 hour', etc. |
|
18
19
|
**last_updated_by_user** | [**User**](User.md) | | [optional]
|
19
20
|
**notification_webhooks** | [**List[AlertRuleNotificationWebhook]**](AlertRuleNotificationWebhook.md) | Notification webhooks configured for the alert rule. |
|
20
21
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# AlertRuleInterval
|
2
|
+
|
3
|
+
|
4
|
+
## Properties
|
5
|
+
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**unit** | [**IntervalUnit**](IntervalUnit.md) | Unit of time interval. Example: 'minutes'. |
|
9
|
+
**count** | **int** | Number of units in the interval. Example: '5'. |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```python
|
14
|
+
from arthur_client.api_bindings.models.alert_rule_interval import AlertRuleInterval
|
15
|
+
|
16
|
+
# TODO update the JSON string below
|
17
|
+
json = "{}"
|
18
|
+
# create an instance of AlertRuleInterval from a JSON string
|
19
|
+
alert_rule_interval_instance = AlertRuleInterval.from_json(json)
|
20
|
+
# print the JSON string representation of the object
|
21
|
+
print(AlertRuleInterval.to_json())
|
22
|
+
|
23
|
+
# convert the object into a dict
|
24
|
+
alert_rule_interval_dict = alert_rule_interval_instance.to_dict()
|
25
|
+
# create an instance of AlertRuleInterval from a dict
|
26
|
+
alert_rule_interval_from_dict = AlertRuleInterval.from_dict(alert_rule_interval_dict)
|
27
|
+
```
|
28
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
29
|
+
|
30
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# AlertRuleSQLValidationResp
|
2
|
+
|
3
|
+
|
4
|
+
## Properties
|
5
|
+
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**has_metric_timestamp_col** | **bool** | The name of the metric returned by the alert rule query. |
|
9
|
+
**has_metric_value_col** | **bool** | The name of the metric returned by the alert rule query. |
|
10
|
+
**has_time_templates** | **bool** | The name of the metric returned by the alert rule query. |
|
11
|
+
**has_interval_templates** | **bool** | The name of the metric returned by the alert rule query. |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```python
|
16
|
+
from arthur_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
17
|
+
|
18
|
+
# TODO update the JSON string below
|
19
|
+
json = "{}"
|
20
|
+
# create an instance of AlertRuleSQLValidationResp from a JSON string
|
21
|
+
alert_rule_sql_validation_resp_instance = AlertRuleSQLValidationResp.from_json(json)
|
22
|
+
# print the JSON string representation of the object
|
23
|
+
print(AlertRuleSQLValidationResp.to_json())
|
24
|
+
|
25
|
+
# convert the object into a dict
|
26
|
+
alert_rule_sql_validation_resp_dict = alert_rule_sql_validation_resp_instance.to_dict()
|
27
|
+
# create an instance of AlertRuleSQLValidationResp from a dict
|
28
|
+
alert_rule_sql_validation_resp_from_dict = AlertRuleSQLValidationResp.from_dict(alert_rule_sql_validation_resp_dict)
|
29
|
+
```
|
30
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
31
|
+
|
32
|
+
|
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
|
8
8
|
[**get_alert_rule**](AlertRulesV1Api.md#get_alert_rule) | **GET** /api/v1/alert_rules/{alert_rule_id} | Get Alert Rule By Id
|
9
9
|
[**get_model_alert_rules**](AlertRulesV1Api.md#get_model_alert_rules) | **GET** /api/v1/models/{model_id}/alert_rules | Get Model Alert Rules
|
10
10
|
[**patch_alert_rule**](AlertRulesV1Api.md#patch_alert_rule) | **PATCH** /api/v1/alert_rules/{alert_rule_id} | Update Model Alert Rule
|
11
|
+
[**post_alert_rule_query_validation**](AlertRulesV1Api.md#post_alert_rule_query_validation) | **POST** /api/v1/models/{model_id}/alert_rule_query_validation | Validate A Model Alert Rule Query
|
11
12
|
[**post_model_alert_rule**](AlertRulesV1Api.md#post_model_alert_rule) | **POST** /api/v1/models/{model_id}/alert_rules | Create Model Alert Rule
|
12
13
|
|
13
14
|
|
@@ -347,6 +348,88 @@ Name | Type | Description | Notes
|
|
347
348
|
|
348
349
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
349
350
|
|
351
|
+
# **post_alert_rule_query_validation**
|
352
|
+
> AlertRuleSQLValidationResp post_alert_rule_query_validation(model_id, validate_alert_rule_query_req)
|
353
|
+
|
354
|
+
Validate A Model Alert Rule Query
|
355
|
+
|
356
|
+
Validates an alert rule query. Requires model_create_alert_rule permission.
|
357
|
+
|
358
|
+
### Example
|
359
|
+
|
360
|
+
* OAuth Authentication (OAuth2AuthorizationCode):
|
361
|
+
|
362
|
+
```python
|
363
|
+
import arthur_client.api_bindings
|
364
|
+
from arthur_client.api_bindings.models.alert_rule_sql_validation_resp import AlertRuleSQLValidationResp
|
365
|
+
from arthur_client.api_bindings.models.validate_alert_rule_query_req import ValidateAlertRuleQueryReq
|
366
|
+
from arthur_client.api_bindings.rest import ApiException
|
367
|
+
from pprint import pprint
|
368
|
+
|
369
|
+
# Defining the host is optional and defaults to http://localhost
|
370
|
+
# See configuration.py for a list of all supported configuration parameters.
|
371
|
+
configuration = arthur_client.api_bindings.Configuration(
|
372
|
+
host = "http://localhost"
|
373
|
+
)
|
374
|
+
|
375
|
+
# The client must configure the authentication and authorization parameters
|
376
|
+
# in accordance with the API server security policy.
|
377
|
+
# Examples for each auth method are provided below, use the example that
|
378
|
+
# satisfies your auth use case.
|
379
|
+
|
380
|
+
configuration.access_token = os.environ["ACCESS_TOKEN"]
|
381
|
+
|
382
|
+
# Enter a context with an instance of the API client
|
383
|
+
with arthur_client.api_bindings.ApiClient(configuration) as api_client:
|
384
|
+
# Create an instance of the API class
|
385
|
+
api_instance = arthur_client.api_bindings.AlertRulesV1Api(api_client)
|
386
|
+
model_id = 'model_id_example' # str |
|
387
|
+
validate_alert_rule_query_req = arthur_client.api_bindings.ValidateAlertRuleQueryReq() # ValidateAlertRuleQueryReq |
|
388
|
+
|
389
|
+
try:
|
390
|
+
# Validate A Model Alert Rule Query
|
391
|
+
api_response = api_instance.post_alert_rule_query_validation(model_id, validate_alert_rule_query_req)
|
392
|
+
print("The response of AlertRulesV1Api->post_alert_rule_query_validation:\n")
|
393
|
+
pprint(api_response)
|
394
|
+
except Exception as e:
|
395
|
+
print("Exception when calling AlertRulesV1Api->post_alert_rule_query_validation: %s\n" % e)
|
396
|
+
```
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
### Parameters
|
401
|
+
|
402
|
+
|
403
|
+
Name | Type | Description | Notes
|
404
|
+
------------- | ------------- | ------------- | -------------
|
405
|
+
**model_id** | **str**| |
|
406
|
+
**validate_alert_rule_query_req** | [**ValidateAlertRuleQueryReq**](ValidateAlertRuleQueryReq.md)| |
|
407
|
+
|
408
|
+
### Return type
|
409
|
+
|
410
|
+
[**AlertRuleSQLValidationResp**](AlertRuleSQLValidationResp.md)
|
411
|
+
|
412
|
+
### Authorization
|
413
|
+
|
414
|
+
[OAuth2AuthorizationCode](../README.md#OAuth2AuthorizationCode)
|
415
|
+
|
416
|
+
### HTTP request headers
|
417
|
+
|
418
|
+
- **Content-Type**: application/json
|
419
|
+
- **Accept**: application/json
|
420
|
+
|
421
|
+
### HTTP response details
|
422
|
+
|
423
|
+
| Status code | Description | Response headers |
|
424
|
+
|-------------|-------------|------------------|
|
425
|
+
**200** | Successful Response | - |
|
426
|
+
**500** | Internal Server Error | - |
|
427
|
+
**404** | Not Found | - |
|
428
|
+
**400** | Bad Request | - |
|
429
|
+
**422** | Validation Error | - |
|
430
|
+
|
431
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
432
|
+
|
350
433
|
# **post_model_alert_rule**
|
351
434
|
> AlertRule post_model_alert_rule(model_id, post_alert_rule)
|
352
435
|
|
@@ -681,6 +681,7 @@ Name | Type | Description | Notes
|
|
681
681
|
**200** | Successful Response | - |
|
682
682
|
**500** | Internal Server Error | - |
|
683
683
|
**404** | Not Found | - |
|
684
|
+
**400** | Bad Request | - |
|
684
685
|
**422** | Validation Error | - |
|
685
686
|
|
686
687
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# IntervalUnit
|
2
|
+
|
3
|
+
|
4
|
+
## Enum
|
5
|
+
|
6
|
+
* `SECONDS` (value: `'seconds'`)
|
7
|
+
|
8
|
+
* `MINUTES` (value: `'minutes'`)
|
9
|
+
|
10
|
+
* `HOURS` (value: `'hours'`)
|
11
|
+
|
12
|
+
* `DAYS` (value: `'days'`)
|
13
|
+
|
14
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
15
|
+
|
16
|
+
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Name | Type | Description | Notes
|
7
7
|
------------ | ------------- | ------------- | -------------
|
8
8
|
**dtype** | [**DType**](DType.md) | |
|
9
|
-
**object** | [**Dict[str,
|
9
|
+
**object** | [**Dict[str, MetricsColumnListParameterSchemaAllowedColumnTypesInner]**](MetricsColumnListParameterSchemaAllowedColumnTypesInner.md) | |
|
10
10
|
**items** | [**Items1**](Items1.md) | |
|
11
11
|
|
12
12
|
## Example
|
@@ -10,6 +10,10 @@ Name | Type | Description | Notes
|
|
10
10
|
**friendly_name** | **str** | User facing name of the parameter. |
|
11
11
|
**description** | **str** | Description of the parameter. |
|
12
12
|
**parameter_type** | **str** | | [optional] [default to 'column_list']
|
13
|
+
**tag_hints** | [**List[ScopeSchemaTag]**](ScopeSchemaTag.md) | List of tags that are applicable to this parameter. Datasets with columns that have matching tags can be inferred this way. | [optional] [default to []]
|
14
|
+
**source_dataset_parameter_key** | **str** | Name of the parameter that provides the dataset to be used for this column. |
|
15
|
+
**allowed_column_types** | [**List[MetricsColumnListParameterSchemaAllowedColumnTypesInner]**](MetricsColumnListParameterSchemaAllowedColumnTypesInner.md) | | [optional]
|
16
|
+
**allow_any_column_type** | **bool** | Indicates if this metric parameter can accept any column type. | [optional] [default to False]
|
13
17
|
|
14
18
|
## Example
|
15
19
|
|