databricks-sdk 0.50.0__py3-none-any.whl → 0.51.0__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.
Potentially problematic release.
This version of databricks-sdk might be problematic. Click here for more details.
- databricks/sdk/__init__.py +15 -5
- databricks/sdk/config.py +2 -3
- databricks/sdk/credentials_provider.py +61 -15
- databricks/sdk/oidc_token_supplier.py +28 -0
- databricks/sdk/service/apps.py +8 -10
- databricks/sdk/service/billing.py +3 -3
- databricks/sdk/service/catalog.py +51 -4
- databricks/sdk/service/cleanrooms.py +9 -14
- databricks/sdk/service/compute.py +131 -6
- databricks/sdk/service/dashboards.py +23 -28
- databricks/sdk/service/jobs.py +73 -18
- databricks/sdk/service/oauth2.py +8 -13
- databricks/sdk/service/serving.py +11 -14
- databricks/sdk/service/settings.py +214 -125
- databricks/sdk/service/sql.py +876 -12
- databricks/sdk/service/vectorsearch.py +355 -159
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.50.0.dist-info → databricks_sdk-0.51.0.dist-info}/METADATA +11 -11
- {databricks_sdk-0.50.0.dist-info → databricks_sdk-0.51.0.dist-info}/RECORD +23 -22
- {databricks_sdk-0.50.0.dist-info → databricks_sdk-0.51.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.50.0.dist-info → databricks_sdk-0.51.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.50.0.dist-info → databricks_sdk-0.51.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.50.0.dist-info → databricks_sdk-0.51.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/sql.py
CHANGED
|
@@ -61,6 +61,18 @@ class AccessControl:
|
|
|
61
61
|
)
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
class Aggregation(Enum):
|
|
65
|
+
|
|
66
|
+
AVG = "AVG"
|
|
67
|
+
COUNT = "COUNT"
|
|
68
|
+
COUNT_DISTINCT = "COUNT_DISTINCT"
|
|
69
|
+
MAX = "MAX"
|
|
70
|
+
MEDIAN = "MEDIAN"
|
|
71
|
+
MIN = "MIN"
|
|
72
|
+
STDDEV = "STDDEV"
|
|
73
|
+
SUM = "SUM"
|
|
74
|
+
|
|
75
|
+
|
|
64
76
|
@dataclass
|
|
65
77
|
class Alert:
|
|
66
78
|
condition: Optional[AlertCondition] = None
|
|
@@ -306,6 +318,17 @@ class AlertConditionThreshold:
|
|
|
306
318
|
return cls(value=_from_dict(d, "value", AlertOperandValue))
|
|
307
319
|
|
|
308
320
|
|
|
321
|
+
class AlertEvaluationState(Enum):
|
|
322
|
+
"""UNSPECIFIED - default unspecify value for proto enum, do not use it in the code UNKNOWN - alert
|
|
323
|
+
not yet evaluated TRIGGERED - alert is triggered OK - alert is not triggered ERROR - alert
|
|
324
|
+
evaluation failed"""
|
|
325
|
+
|
|
326
|
+
ERROR = "ERROR"
|
|
327
|
+
OK = "OK"
|
|
328
|
+
TRIGGERED = "TRIGGERED"
|
|
329
|
+
UNKNOWN = "UNKNOWN"
|
|
330
|
+
|
|
331
|
+
|
|
309
332
|
@dataclass
|
|
310
333
|
class AlertOperandColumn:
|
|
311
334
|
name: Optional[str] = None
|
|
@@ -609,6 +632,394 @@ class AlertState(Enum):
|
|
|
609
632
|
UNKNOWN = "UNKNOWN"
|
|
610
633
|
|
|
611
634
|
|
|
635
|
+
@dataclass
|
|
636
|
+
class AlertV2:
|
|
637
|
+
create_time: Optional[str] = None
|
|
638
|
+
"""The timestamp indicating when the alert was created."""
|
|
639
|
+
|
|
640
|
+
custom_description: Optional[str] = None
|
|
641
|
+
"""Custom description for the alert. support mustache template."""
|
|
642
|
+
|
|
643
|
+
custom_summary: Optional[str] = None
|
|
644
|
+
"""Custom summary for the alert. support mustache template."""
|
|
645
|
+
|
|
646
|
+
display_name: Optional[str] = None
|
|
647
|
+
"""The display name of the alert."""
|
|
648
|
+
|
|
649
|
+
evaluation: Optional[AlertV2Evaluation] = None
|
|
650
|
+
|
|
651
|
+
id: Optional[str] = None
|
|
652
|
+
"""UUID identifying the alert."""
|
|
653
|
+
|
|
654
|
+
lifecycle_state: Optional[LifecycleState] = None
|
|
655
|
+
"""Indicates whether the query is trashed."""
|
|
656
|
+
|
|
657
|
+
owner_user_name: Optional[str] = None
|
|
658
|
+
"""The owner's username. This field is set to "Unavailable" if the user has been deleted."""
|
|
659
|
+
|
|
660
|
+
parent_path: Optional[str] = None
|
|
661
|
+
"""The workspace path of the folder containing the alert. Can only be set on create, and cannot be
|
|
662
|
+
updated."""
|
|
663
|
+
|
|
664
|
+
query_text: Optional[str] = None
|
|
665
|
+
"""Text of the query to be run."""
|
|
666
|
+
|
|
667
|
+
run_as_user_name: Optional[str] = None
|
|
668
|
+
"""The run as username. This field is set to "Unavailable" if the user has been deleted."""
|
|
669
|
+
|
|
670
|
+
schedule: Optional[CronSchedule] = None
|
|
671
|
+
|
|
672
|
+
update_time: Optional[str] = None
|
|
673
|
+
"""The timestamp indicating when the alert was updated."""
|
|
674
|
+
|
|
675
|
+
warehouse_id: Optional[str] = None
|
|
676
|
+
"""ID of the SQL warehouse attached to the alert."""
|
|
677
|
+
|
|
678
|
+
def as_dict(self) -> dict:
|
|
679
|
+
"""Serializes the AlertV2 into a dictionary suitable for use as a JSON request body."""
|
|
680
|
+
body = {}
|
|
681
|
+
if self.create_time is not None:
|
|
682
|
+
body["create_time"] = self.create_time
|
|
683
|
+
if self.custom_description is not None:
|
|
684
|
+
body["custom_description"] = self.custom_description
|
|
685
|
+
if self.custom_summary is not None:
|
|
686
|
+
body["custom_summary"] = self.custom_summary
|
|
687
|
+
if self.display_name is not None:
|
|
688
|
+
body["display_name"] = self.display_name
|
|
689
|
+
if self.evaluation:
|
|
690
|
+
body["evaluation"] = self.evaluation.as_dict()
|
|
691
|
+
if self.id is not None:
|
|
692
|
+
body["id"] = self.id
|
|
693
|
+
if self.lifecycle_state is not None:
|
|
694
|
+
body["lifecycle_state"] = self.lifecycle_state.value
|
|
695
|
+
if self.owner_user_name is not None:
|
|
696
|
+
body["owner_user_name"] = self.owner_user_name
|
|
697
|
+
if self.parent_path is not None:
|
|
698
|
+
body["parent_path"] = self.parent_path
|
|
699
|
+
if self.query_text is not None:
|
|
700
|
+
body["query_text"] = self.query_text
|
|
701
|
+
if self.run_as_user_name is not None:
|
|
702
|
+
body["run_as_user_name"] = self.run_as_user_name
|
|
703
|
+
if self.schedule:
|
|
704
|
+
body["schedule"] = self.schedule.as_dict()
|
|
705
|
+
if self.update_time is not None:
|
|
706
|
+
body["update_time"] = self.update_time
|
|
707
|
+
if self.warehouse_id is not None:
|
|
708
|
+
body["warehouse_id"] = self.warehouse_id
|
|
709
|
+
return body
|
|
710
|
+
|
|
711
|
+
def as_shallow_dict(self) -> dict:
|
|
712
|
+
"""Serializes the AlertV2 into a shallow dictionary of its immediate attributes."""
|
|
713
|
+
body = {}
|
|
714
|
+
if self.create_time is not None:
|
|
715
|
+
body["create_time"] = self.create_time
|
|
716
|
+
if self.custom_description is not None:
|
|
717
|
+
body["custom_description"] = self.custom_description
|
|
718
|
+
if self.custom_summary is not None:
|
|
719
|
+
body["custom_summary"] = self.custom_summary
|
|
720
|
+
if self.display_name is not None:
|
|
721
|
+
body["display_name"] = self.display_name
|
|
722
|
+
if self.evaluation:
|
|
723
|
+
body["evaluation"] = self.evaluation
|
|
724
|
+
if self.id is not None:
|
|
725
|
+
body["id"] = self.id
|
|
726
|
+
if self.lifecycle_state is not None:
|
|
727
|
+
body["lifecycle_state"] = self.lifecycle_state
|
|
728
|
+
if self.owner_user_name is not None:
|
|
729
|
+
body["owner_user_name"] = self.owner_user_name
|
|
730
|
+
if self.parent_path is not None:
|
|
731
|
+
body["parent_path"] = self.parent_path
|
|
732
|
+
if self.query_text is not None:
|
|
733
|
+
body["query_text"] = self.query_text
|
|
734
|
+
if self.run_as_user_name is not None:
|
|
735
|
+
body["run_as_user_name"] = self.run_as_user_name
|
|
736
|
+
if self.schedule:
|
|
737
|
+
body["schedule"] = self.schedule
|
|
738
|
+
if self.update_time is not None:
|
|
739
|
+
body["update_time"] = self.update_time
|
|
740
|
+
if self.warehouse_id is not None:
|
|
741
|
+
body["warehouse_id"] = self.warehouse_id
|
|
742
|
+
return body
|
|
743
|
+
|
|
744
|
+
@classmethod
|
|
745
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2:
|
|
746
|
+
"""Deserializes the AlertV2 from a dictionary."""
|
|
747
|
+
return cls(
|
|
748
|
+
create_time=d.get("create_time", None),
|
|
749
|
+
custom_description=d.get("custom_description", None),
|
|
750
|
+
custom_summary=d.get("custom_summary", None),
|
|
751
|
+
display_name=d.get("display_name", None),
|
|
752
|
+
evaluation=_from_dict(d, "evaluation", AlertV2Evaluation),
|
|
753
|
+
id=d.get("id", None),
|
|
754
|
+
lifecycle_state=_enum(d, "lifecycle_state", LifecycleState),
|
|
755
|
+
owner_user_name=d.get("owner_user_name", None),
|
|
756
|
+
parent_path=d.get("parent_path", None),
|
|
757
|
+
query_text=d.get("query_text", None),
|
|
758
|
+
run_as_user_name=d.get("run_as_user_name", None),
|
|
759
|
+
schedule=_from_dict(d, "schedule", CronSchedule),
|
|
760
|
+
update_time=d.get("update_time", None),
|
|
761
|
+
warehouse_id=d.get("warehouse_id", None),
|
|
762
|
+
)
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
@dataclass
|
|
766
|
+
class AlertV2Evaluation:
|
|
767
|
+
comparison_operator: Optional[ComparisonOperator] = None
|
|
768
|
+
"""Operator used for comparison in alert evaluation."""
|
|
769
|
+
|
|
770
|
+
empty_result_state: Optional[AlertEvaluationState] = None
|
|
771
|
+
"""Alert state if result is empty."""
|
|
772
|
+
|
|
773
|
+
last_evaluated_at: Optional[str] = None
|
|
774
|
+
"""Timestamp of the last evaluation."""
|
|
775
|
+
|
|
776
|
+
notification: Optional[AlertV2Notification] = None
|
|
777
|
+
"""User or Notification Destination to notify when alert is triggered."""
|
|
778
|
+
|
|
779
|
+
source: Optional[AlertV2OperandColumn] = None
|
|
780
|
+
"""Source column from result to use to evaluate alert"""
|
|
781
|
+
|
|
782
|
+
state: Optional[AlertEvaluationState] = None
|
|
783
|
+
"""Latest state of alert evaluation."""
|
|
784
|
+
|
|
785
|
+
threshold: Optional[AlertV2Operand] = None
|
|
786
|
+
"""Threshold to user for alert evaluation, can be a column or a value."""
|
|
787
|
+
|
|
788
|
+
def as_dict(self) -> dict:
|
|
789
|
+
"""Serializes the AlertV2Evaluation into a dictionary suitable for use as a JSON request body."""
|
|
790
|
+
body = {}
|
|
791
|
+
if self.comparison_operator is not None:
|
|
792
|
+
body["comparison_operator"] = self.comparison_operator.value
|
|
793
|
+
if self.empty_result_state is not None:
|
|
794
|
+
body["empty_result_state"] = self.empty_result_state.value
|
|
795
|
+
if self.last_evaluated_at is not None:
|
|
796
|
+
body["last_evaluated_at"] = self.last_evaluated_at
|
|
797
|
+
if self.notification:
|
|
798
|
+
body["notification"] = self.notification.as_dict()
|
|
799
|
+
if self.source:
|
|
800
|
+
body["source"] = self.source.as_dict()
|
|
801
|
+
if self.state is not None:
|
|
802
|
+
body["state"] = self.state.value
|
|
803
|
+
if self.threshold:
|
|
804
|
+
body["threshold"] = self.threshold.as_dict()
|
|
805
|
+
return body
|
|
806
|
+
|
|
807
|
+
def as_shallow_dict(self) -> dict:
|
|
808
|
+
"""Serializes the AlertV2Evaluation into a shallow dictionary of its immediate attributes."""
|
|
809
|
+
body = {}
|
|
810
|
+
if self.comparison_operator is not None:
|
|
811
|
+
body["comparison_operator"] = self.comparison_operator
|
|
812
|
+
if self.empty_result_state is not None:
|
|
813
|
+
body["empty_result_state"] = self.empty_result_state
|
|
814
|
+
if self.last_evaluated_at is not None:
|
|
815
|
+
body["last_evaluated_at"] = self.last_evaluated_at
|
|
816
|
+
if self.notification:
|
|
817
|
+
body["notification"] = self.notification
|
|
818
|
+
if self.source:
|
|
819
|
+
body["source"] = self.source
|
|
820
|
+
if self.state is not None:
|
|
821
|
+
body["state"] = self.state
|
|
822
|
+
if self.threshold:
|
|
823
|
+
body["threshold"] = self.threshold
|
|
824
|
+
return body
|
|
825
|
+
|
|
826
|
+
@classmethod
|
|
827
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2Evaluation:
|
|
828
|
+
"""Deserializes the AlertV2Evaluation from a dictionary."""
|
|
829
|
+
return cls(
|
|
830
|
+
comparison_operator=_enum(d, "comparison_operator", ComparisonOperator),
|
|
831
|
+
empty_result_state=_enum(d, "empty_result_state", AlertEvaluationState),
|
|
832
|
+
last_evaluated_at=d.get("last_evaluated_at", None),
|
|
833
|
+
notification=_from_dict(d, "notification", AlertV2Notification),
|
|
834
|
+
source=_from_dict(d, "source", AlertV2OperandColumn),
|
|
835
|
+
state=_enum(d, "state", AlertEvaluationState),
|
|
836
|
+
threshold=_from_dict(d, "threshold", AlertV2Operand),
|
|
837
|
+
)
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
@dataclass
|
|
841
|
+
class AlertV2Notification:
|
|
842
|
+
notify_on_ok: Optional[bool] = None
|
|
843
|
+
"""Whether to notify alert subscribers when alert returns back to normal."""
|
|
844
|
+
|
|
845
|
+
retrigger_seconds: Optional[int] = None
|
|
846
|
+
"""Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it
|
|
847
|
+
can be triggered again. If 0 or not specified, the alert will not be triggered again."""
|
|
848
|
+
|
|
849
|
+
subscriptions: Optional[List[AlertV2Subscription]] = None
|
|
850
|
+
|
|
851
|
+
def as_dict(self) -> dict:
|
|
852
|
+
"""Serializes the AlertV2Notification into a dictionary suitable for use as a JSON request body."""
|
|
853
|
+
body = {}
|
|
854
|
+
if self.notify_on_ok is not None:
|
|
855
|
+
body["notify_on_ok"] = self.notify_on_ok
|
|
856
|
+
if self.retrigger_seconds is not None:
|
|
857
|
+
body["retrigger_seconds"] = self.retrigger_seconds
|
|
858
|
+
if self.subscriptions:
|
|
859
|
+
body["subscriptions"] = [v.as_dict() for v in self.subscriptions]
|
|
860
|
+
return body
|
|
861
|
+
|
|
862
|
+
def as_shallow_dict(self) -> dict:
|
|
863
|
+
"""Serializes the AlertV2Notification into a shallow dictionary of its immediate attributes."""
|
|
864
|
+
body = {}
|
|
865
|
+
if self.notify_on_ok is not None:
|
|
866
|
+
body["notify_on_ok"] = self.notify_on_ok
|
|
867
|
+
if self.retrigger_seconds is not None:
|
|
868
|
+
body["retrigger_seconds"] = self.retrigger_seconds
|
|
869
|
+
if self.subscriptions:
|
|
870
|
+
body["subscriptions"] = self.subscriptions
|
|
871
|
+
return body
|
|
872
|
+
|
|
873
|
+
@classmethod
|
|
874
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2Notification:
|
|
875
|
+
"""Deserializes the AlertV2Notification from a dictionary."""
|
|
876
|
+
return cls(
|
|
877
|
+
notify_on_ok=d.get("notify_on_ok", None),
|
|
878
|
+
retrigger_seconds=d.get("retrigger_seconds", None),
|
|
879
|
+
subscriptions=_repeated_dict(d, "subscriptions", AlertV2Subscription),
|
|
880
|
+
)
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
@dataclass
|
|
884
|
+
class AlertV2Operand:
|
|
885
|
+
column: Optional[AlertV2OperandColumn] = None
|
|
886
|
+
|
|
887
|
+
value: Optional[AlertV2OperandValue] = None
|
|
888
|
+
|
|
889
|
+
def as_dict(self) -> dict:
|
|
890
|
+
"""Serializes the AlertV2Operand into a dictionary suitable for use as a JSON request body."""
|
|
891
|
+
body = {}
|
|
892
|
+
if self.column:
|
|
893
|
+
body["column"] = self.column.as_dict()
|
|
894
|
+
if self.value:
|
|
895
|
+
body["value"] = self.value.as_dict()
|
|
896
|
+
return body
|
|
897
|
+
|
|
898
|
+
def as_shallow_dict(self) -> dict:
|
|
899
|
+
"""Serializes the AlertV2Operand into a shallow dictionary of its immediate attributes."""
|
|
900
|
+
body = {}
|
|
901
|
+
if self.column:
|
|
902
|
+
body["column"] = self.column
|
|
903
|
+
if self.value:
|
|
904
|
+
body["value"] = self.value
|
|
905
|
+
return body
|
|
906
|
+
|
|
907
|
+
@classmethod
|
|
908
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2Operand:
|
|
909
|
+
"""Deserializes the AlertV2Operand from a dictionary."""
|
|
910
|
+
return cls(
|
|
911
|
+
column=_from_dict(d, "column", AlertV2OperandColumn), value=_from_dict(d, "value", AlertV2OperandValue)
|
|
912
|
+
)
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
@dataclass
|
|
916
|
+
class AlertV2OperandColumn:
|
|
917
|
+
aggregation: Optional[Aggregation] = None
|
|
918
|
+
|
|
919
|
+
display: Optional[str] = None
|
|
920
|
+
|
|
921
|
+
name: Optional[str] = None
|
|
922
|
+
|
|
923
|
+
def as_dict(self) -> dict:
|
|
924
|
+
"""Serializes the AlertV2OperandColumn into a dictionary suitable for use as a JSON request body."""
|
|
925
|
+
body = {}
|
|
926
|
+
if self.aggregation is not None:
|
|
927
|
+
body["aggregation"] = self.aggregation.value
|
|
928
|
+
if self.display is not None:
|
|
929
|
+
body["display"] = self.display
|
|
930
|
+
if self.name is not None:
|
|
931
|
+
body["name"] = self.name
|
|
932
|
+
return body
|
|
933
|
+
|
|
934
|
+
def as_shallow_dict(self) -> dict:
|
|
935
|
+
"""Serializes the AlertV2OperandColumn into a shallow dictionary of its immediate attributes."""
|
|
936
|
+
body = {}
|
|
937
|
+
if self.aggregation is not None:
|
|
938
|
+
body["aggregation"] = self.aggregation
|
|
939
|
+
if self.display is not None:
|
|
940
|
+
body["display"] = self.display
|
|
941
|
+
if self.name is not None:
|
|
942
|
+
body["name"] = self.name
|
|
943
|
+
return body
|
|
944
|
+
|
|
945
|
+
@classmethod
|
|
946
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2OperandColumn:
|
|
947
|
+
"""Deserializes the AlertV2OperandColumn from a dictionary."""
|
|
948
|
+
return cls(
|
|
949
|
+
aggregation=_enum(d, "aggregation", Aggregation), display=d.get("display", None), name=d.get("name", None)
|
|
950
|
+
)
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
@dataclass
|
|
954
|
+
class AlertV2OperandValue:
|
|
955
|
+
bool_value: Optional[bool] = None
|
|
956
|
+
|
|
957
|
+
double_value: Optional[float] = None
|
|
958
|
+
|
|
959
|
+
string_value: Optional[str] = None
|
|
960
|
+
|
|
961
|
+
def as_dict(self) -> dict:
|
|
962
|
+
"""Serializes the AlertV2OperandValue into a dictionary suitable for use as a JSON request body."""
|
|
963
|
+
body = {}
|
|
964
|
+
if self.bool_value is not None:
|
|
965
|
+
body["bool_value"] = self.bool_value
|
|
966
|
+
if self.double_value is not None:
|
|
967
|
+
body["double_value"] = self.double_value
|
|
968
|
+
if self.string_value is not None:
|
|
969
|
+
body["string_value"] = self.string_value
|
|
970
|
+
return body
|
|
971
|
+
|
|
972
|
+
def as_shallow_dict(self) -> dict:
|
|
973
|
+
"""Serializes the AlertV2OperandValue into a shallow dictionary of its immediate attributes."""
|
|
974
|
+
body = {}
|
|
975
|
+
if self.bool_value is not None:
|
|
976
|
+
body["bool_value"] = self.bool_value
|
|
977
|
+
if self.double_value is not None:
|
|
978
|
+
body["double_value"] = self.double_value
|
|
979
|
+
if self.string_value is not None:
|
|
980
|
+
body["string_value"] = self.string_value
|
|
981
|
+
return body
|
|
982
|
+
|
|
983
|
+
@classmethod
|
|
984
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2OperandValue:
|
|
985
|
+
"""Deserializes the AlertV2OperandValue from a dictionary."""
|
|
986
|
+
return cls(
|
|
987
|
+
bool_value=d.get("bool_value", None),
|
|
988
|
+
double_value=d.get("double_value", None),
|
|
989
|
+
string_value=d.get("string_value", None),
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
@dataclass
|
|
994
|
+
class AlertV2Subscription:
|
|
995
|
+
destination_id: Optional[str] = None
|
|
996
|
+
|
|
997
|
+
user_email: Optional[str] = None
|
|
998
|
+
|
|
999
|
+
def as_dict(self) -> dict:
|
|
1000
|
+
"""Serializes the AlertV2Subscription into a dictionary suitable for use as a JSON request body."""
|
|
1001
|
+
body = {}
|
|
1002
|
+
if self.destination_id is not None:
|
|
1003
|
+
body["destination_id"] = self.destination_id
|
|
1004
|
+
if self.user_email is not None:
|
|
1005
|
+
body["user_email"] = self.user_email
|
|
1006
|
+
return body
|
|
1007
|
+
|
|
1008
|
+
def as_shallow_dict(self) -> dict:
|
|
1009
|
+
"""Serializes the AlertV2Subscription into a shallow dictionary of its immediate attributes."""
|
|
1010
|
+
body = {}
|
|
1011
|
+
if self.destination_id is not None:
|
|
1012
|
+
body["destination_id"] = self.destination_id
|
|
1013
|
+
if self.user_email is not None:
|
|
1014
|
+
body["user_email"] = self.user_email
|
|
1015
|
+
return body
|
|
1016
|
+
|
|
1017
|
+
@classmethod
|
|
1018
|
+
def from_dict(cls, d: Dict[str, Any]) -> AlertV2Subscription:
|
|
1019
|
+
"""Deserializes the AlertV2Subscription from a dictionary."""
|
|
1020
|
+
return cls(destination_id=d.get("destination_id", None), user_email=d.get("user_email", None))
|
|
1021
|
+
|
|
1022
|
+
|
|
612
1023
|
@dataclass
|
|
613
1024
|
class BaseChunkInfo:
|
|
614
1025
|
"""Describes metadata for a particular chunk, within a result set; this structure is used both
|
|
@@ -948,6 +1359,18 @@ class ColumnInfoTypeName(Enum):
|
|
|
948
1359
|
USER_DEFINED_TYPE = "USER_DEFINED_TYPE"
|
|
949
1360
|
|
|
950
1361
|
|
|
1362
|
+
class ComparisonOperator(Enum):
|
|
1363
|
+
|
|
1364
|
+
EQUAL = "EQUAL"
|
|
1365
|
+
GREATER_THAN = "GREATER_THAN"
|
|
1366
|
+
GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL"
|
|
1367
|
+
IS_NOT_NULL = "IS_NOT_NULL"
|
|
1368
|
+
IS_NULL = "IS_NULL"
|
|
1369
|
+
LESS_THAN = "LESS_THAN"
|
|
1370
|
+
LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL"
|
|
1371
|
+
NOT_EQUAL = "NOT_EQUAL"
|
|
1372
|
+
|
|
1373
|
+
|
|
951
1374
|
@dataclass
|
|
952
1375
|
class CreateAlert:
|
|
953
1376
|
name: str
|
|
@@ -1012,11 +1435,17 @@ class CreateAlert:
|
|
|
1012
1435
|
class CreateAlertRequest:
|
|
1013
1436
|
alert: Optional[CreateAlertRequestAlert] = None
|
|
1014
1437
|
|
|
1438
|
+
auto_resolve_display_name: Optional[bool] = None
|
|
1439
|
+
"""If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
|
|
1440
|
+
alert's display name conflicts with an existing alert's display name."""
|
|
1441
|
+
|
|
1015
1442
|
def as_dict(self) -> dict:
|
|
1016
1443
|
"""Serializes the CreateAlertRequest into a dictionary suitable for use as a JSON request body."""
|
|
1017
1444
|
body = {}
|
|
1018
1445
|
if self.alert:
|
|
1019
1446
|
body["alert"] = self.alert.as_dict()
|
|
1447
|
+
if self.auto_resolve_display_name is not None:
|
|
1448
|
+
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1020
1449
|
return body
|
|
1021
1450
|
|
|
1022
1451
|
def as_shallow_dict(self) -> dict:
|
|
@@ -1024,12 +1453,17 @@ class CreateAlertRequest:
|
|
|
1024
1453
|
body = {}
|
|
1025
1454
|
if self.alert:
|
|
1026
1455
|
body["alert"] = self.alert
|
|
1456
|
+
if self.auto_resolve_display_name is not None:
|
|
1457
|
+
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1027
1458
|
return body
|
|
1028
1459
|
|
|
1029
1460
|
@classmethod
|
|
1030
1461
|
def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequest:
|
|
1031
1462
|
"""Deserializes the CreateAlertRequest from a dictionary."""
|
|
1032
|
-
return cls(
|
|
1463
|
+
return cls(
|
|
1464
|
+
alert=_from_dict(d, "alert", CreateAlertRequestAlert),
|
|
1465
|
+
auto_resolve_display_name=d.get("auto_resolve_display_name", None),
|
|
1466
|
+
)
|
|
1033
1467
|
|
|
1034
1468
|
|
|
1035
1469
|
@dataclass
|
|
@@ -1121,13 +1555,43 @@ class CreateAlertRequestAlert:
|
|
|
1121
1555
|
)
|
|
1122
1556
|
|
|
1123
1557
|
|
|
1558
|
+
@dataclass
|
|
1559
|
+
class CreateAlertV2Request:
|
|
1560
|
+
alert: Optional[AlertV2] = None
|
|
1561
|
+
|
|
1562
|
+
def as_dict(self) -> dict:
|
|
1563
|
+
"""Serializes the CreateAlertV2Request into a dictionary suitable for use as a JSON request body."""
|
|
1564
|
+
body = {}
|
|
1565
|
+
if self.alert:
|
|
1566
|
+
body["alert"] = self.alert.as_dict()
|
|
1567
|
+
return body
|
|
1568
|
+
|
|
1569
|
+
def as_shallow_dict(self) -> dict:
|
|
1570
|
+
"""Serializes the CreateAlertV2Request into a shallow dictionary of its immediate attributes."""
|
|
1571
|
+
body = {}
|
|
1572
|
+
if self.alert:
|
|
1573
|
+
body["alert"] = self.alert
|
|
1574
|
+
return body
|
|
1575
|
+
|
|
1576
|
+
@classmethod
|
|
1577
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateAlertV2Request:
|
|
1578
|
+
"""Deserializes the CreateAlertV2Request from a dictionary."""
|
|
1579
|
+
return cls(alert=_from_dict(d, "alert", AlertV2))
|
|
1580
|
+
|
|
1581
|
+
|
|
1124
1582
|
@dataclass
|
|
1125
1583
|
class CreateQueryRequest:
|
|
1584
|
+
auto_resolve_display_name: Optional[bool] = None
|
|
1585
|
+
"""If true, automatically resolve query display name conflicts. Otherwise, fail the request if the
|
|
1586
|
+
query's display name conflicts with an existing query's display name."""
|
|
1587
|
+
|
|
1126
1588
|
query: Optional[CreateQueryRequestQuery] = None
|
|
1127
1589
|
|
|
1128
1590
|
def as_dict(self) -> dict:
|
|
1129
1591
|
"""Serializes the CreateQueryRequest into a dictionary suitable for use as a JSON request body."""
|
|
1130
1592
|
body = {}
|
|
1593
|
+
if self.auto_resolve_display_name is not None:
|
|
1594
|
+
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1131
1595
|
if self.query:
|
|
1132
1596
|
body["query"] = self.query.as_dict()
|
|
1133
1597
|
return body
|
|
@@ -1135,6 +1599,8 @@ class CreateQueryRequest:
|
|
|
1135
1599
|
def as_shallow_dict(self) -> dict:
|
|
1136
1600
|
"""Serializes the CreateQueryRequest into a shallow dictionary of its immediate attributes."""
|
|
1137
1601
|
body = {}
|
|
1602
|
+
if self.auto_resolve_display_name is not None:
|
|
1603
|
+
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1138
1604
|
if self.query:
|
|
1139
1605
|
body["query"] = self.query
|
|
1140
1606
|
return body
|
|
@@ -1142,7 +1608,10 @@ class CreateQueryRequest:
|
|
|
1142
1608
|
@classmethod
|
|
1143
1609
|
def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequest:
|
|
1144
1610
|
"""Deserializes the CreateQueryRequest from a dictionary."""
|
|
1145
|
-
return cls(
|
|
1611
|
+
return cls(
|
|
1612
|
+
auto_resolve_display_name=d.get("auto_resolve_display_name", None),
|
|
1613
|
+
query=_from_dict(d, "query", CreateQueryRequestQuery),
|
|
1614
|
+
)
|
|
1146
1615
|
|
|
1147
1616
|
|
|
1148
1617
|
@dataclass
|
|
@@ -1581,12 +2050,60 @@ class CreateWidget:
|
|
|
1581
2050
|
def from_dict(cls, d: Dict[str, Any]) -> CreateWidget:
|
|
1582
2051
|
"""Deserializes the CreateWidget from a dictionary."""
|
|
1583
2052
|
return cls(
|
|
1584
|
-
dashboard_id=d.get("dashboard_id", None),
|
|
1585
|
-
id=d.get("id", None),
|
|
1586
|
-
options=_from_dict(d, "options", WidgetOptions),
|
|
1587
|
-
text=d.get("text", None),
|
|
1588
|
-
visualization_id=d.get("visualization_id", None),
|
|
1589
|
-
width=d.get("width", None),
|
|
2053
|
+
dashboard_id=d.get("dashboard_id", None),
|
|
2054
|
+
id=d.get("id", None),
|
|
2055
|
+
options=_from_dict(d, "options", WidgetOptions),
|
|
2056
|
+
text=d.get("text", None),
|
|
2057
|
+
visualization_id=d.get("visualization_id", None),
|
|
2058
|
+
width=d.get("width", None),
|
|
2059
|
+
)
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
@dataclass
|
|
2063
|
+
class CronSchedule:
|
|
2064
|
+
pause_status: Optional[SchedulePauseStatus] = None
|
|
2065
|
+
"""Indicate whether this schedule is paused or not."""
|
|
2066
|
+
|
|
2067
|
+
quartz_cron_schedule: Optional[str] = None
|
|
2068
|
+
"""A cron expression using quartz syntax that specifies the schedule for this pipeline. Should use
|
|
2069
|
+
the quartz format described here:
|
|
2070
|
+
http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html"""
|
|
2071
|
+
|
|
2072
|
+
timezone_id: Optional[str] = None
|
|
2073
|
+
"""A Java timezone id. The schedule will be resolved using this timezone. This will be combined
|
|
2074
|
+
with the quartz_cron_schedule to determine the schedule. See
|
|
2075
|
+
https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html
|
|
2076
|
+
for details."""
|
|
2077
|
+
|
|
2078
|
+
def as_dict(self) -> dict:
|
|
2079
|
+
"""Serializes the CronSchedule into a dictionary suitable for use as a JSON request body."""
|
|
2080
|
+
body = {}
|
|
2081
|
+
if self.pause_status is not None:
|
|
2082
|
+
body["pause_status"] = self.pause_status.value
|
|
2083
|
+
if self.quartz_cron_schedule is not None:
|
|
2084
|
+
body["quartz_cron_schedule"] = self.quartz_cron_schedule
|
|
2085
|
+
if self.timezone_id is not None:
|
|
2086
|
+
body["timezone_id"] = self.timezone_id
|
|
2087
|
+
return body
|
|
2088
|
+
|
|
2089
|
+
def as_shallow_dict(self) -> dict:
|
|
2090
|
+
"""Serializes the CronSchedule into a shallow dictionary of its immediate attributes."""
|
|
2091
|
+
body = {}
|
|
2092
|
+
if self.pause_status is not None:
|
|
2093
|
+
body["pause_status"] = self.pause_status
|
|
2094
|
+
if self.quartz_cron_schedule is not None:
|
|
2095
|
+
body["quartz_cron_schedule"] = self.quartz_cron_schedule
|
|
2096
|
+
if self.timezone_id is not None:
|
|
2097
|
+
body["timezone_id"] = self.timezone_id
|
|
2098
|
+
return body
|
|
2099
|
+
|
|
2100
|
+
@classmethod
|
|
2101
|
+
def from_dict(cls, d: Dict[str, Any]) -> CronSchedule:
|
|
2102
|
+
"""Deserializes the CronSchedule from a dictionary."""
|
|
2103
|
+
return cls(
|
|
2104
|
+
pause_status=_enum(d, "pause_status", SchedulePauseStatus),
|
|
2105
|
+
quartz_cron_schedule=d.get("quartz_cron_schedule", None),
|
|
2106
|
+
timezone_id=d.get("timezone_id", None),
|
|
1590
2107
|
)
|
|
1591
2108
|
|
|
1592
2109
|
|
|
@@ -2614,7 +3131,7 @@ class EndpointInfo:
|
|
|
2614
3131
|
Supported values: - Must be unique within an org. - Must be less than 100 characters."""
|
|
2615
3132
|
|
|
2616
3133
|
num_active_sessions: Optional[int] = None
|
|
2617
|
-
"""current number of active sessions for the warehouse"""
|
|
3134
|
+
"""Deprecated. current number of active sessions for the warehouse"""
|
|
2618
3135
|
|
|
2619
3136
|
num_clusters: Optional[int] = None
|
|
2620
3137
|
"""current number of clusters running for the service"""
|
|
@@ -3419,7 +3936,7 @@ class GetWarehouseResponse:
|
|
|
3419
3936
|
Supported values: - Must be unique within an org. - Must be less than 100 characters."""
|
|
3420
3937
|
|
|
3421
3938
|
num_active_sessions: Optional[int] = None
|
|
3422
|
-
"""current number of active sessions for the warehouse"""
|
|
3939
|
+
"""Deprecated. current number of active sessions for the warehouse"""
|
|
3423
3940
|
|
|
3424
3941
|
num_clusters: Optional[int] = None
|
|
3425
3942
|
"""current number of clusters running for the service"""
|
|
@@ -4270,6 +4787,160 @@ class ListAlertsResponseAlert:
|
|
|
4270
4787
|
)
|
|
4271
4788
|
|
|
4272
4789
|
|
|
4790
|
+
@dataclass
|
|
4791
|
+
class ListAlertsV2Response:
|
|
4792
|
+
next_page_token: Optional[str] = None
|
|
4793
|
+
|
|
4794
|
+
results: Optional[List[ListAlertsV2ResponseAlert]] = None
|
|
4795
|
+
|
|
4796
|
+
def as_dict(self) -> dict:
|
|
4797
|
+
"""Serializes the ListAlertsV2Response into a dictionary suitable for use as a JSON request body."""
|
|
4798
|
+
body = {}
|
|
4799
|
+
if self.next_page_token is not None:
|
|
4800
|
+
body["next_page_token"] = self.next_page_token
|
|
4801
|
+
if self.results:
|
|
4802
|
+
body["results"] = [v.as_dict() for v in self.results]
|
|
4803
|
+
return body
|
|
4804
|
+
|
|
4805
|
+
def as_shallow_dict(self) -> dict:
|
|
4806
|
+
"""Serializes the ListAlertsV2Response into a shallow dictionary of its immediate attributes."""
|
|
4807
|
+
body = {}
|
|
4808
|
+
if self.next_page_token is not None:
|
|
4809
|
+
body["next_page_token"] = self.next_page_token
|
|
4810
|
+
if self.results:
|
|
4811
|
+
body["results"] = self.results
|
|
4812
|
+
return body
|
|
4813
|
+
|
|
4814
|
+
@classmethod
|
|
4815
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListAlertsV2Response:
|
|
4816
|
+
"""Deserializes the ListAlertsV2Response from a dictionary."""
|
|
4817
|
+
return cls(
|
|
4818
|
+
next_page_token=d.get("next_page_token", None),
|
|
4819
|
+
results=_repeated_dict(d, "results", ListAlertsV2ResponseAlert),
|
|
4820
|
+
)
|
|
4821
|
+
|
|
4822
|
+
|
|
4823
|
+
@dataclass
|
|
4824
|
+
class ListAlertsV2ResponseAlert:
|
|
4825
|
+
create_time: Optional[str] = None
|
|
4826
|
+
"""The timestamp indicating when the alert was created."""
|
|
4827
|
+
|
|
4828
|
+
custom_description: Optional[str] = None
|
|
4829
|
+
"""Custom description for the alert. support mustache template."""
|
|
4830
|
+
|
|
4831
|
+
custom_summary: Optional[str] = None
|
|
4832
|
+
"""Custom summary for the alert. support mustache template."""
|
|
4833
|
+
|
|
4834
|
+
display_name: Optional[str] = None
|
|
4835
|
+
"""The display name of the alert."""
|
|
4836
|
+
|
|
4837
|
+
evaluation: Optional[AlertV2Evaluation] = None
|
|
4838
|
+
|
|
4839
|
+
id: Optional[str] = None
|
|
4840
|
+
"""UUID identifying the alert."""
|
|
4841
|
+
|
|
4842
|
+
lifecycle_state: Optional[LifecycleState] = None
|
|
4843
|
+
"""Indicates whether the query is trashed."""
|
|
4844
|
+
|
|
4845
|
+
owner_user_name: Optional[str] = None
|
|
4846
|
+
"""The owner's username. This field is set to "Unavailable" if the user has been deleted."""
|
|
4847
|
+
|
|
4848
|
+
query_text: Optional[str] = None
|
|
4849
|
+
"""Text of the query to be run."""
|
|
4850
|
+
|
|
4851
|
+
run_as_user_name: Optional[str] = None
|
|
4852
|
+
"""The run as username. This field is set to "Unavailable" if the user has been deleted."""
|
|
4853
|
+
|
|
4854
|
+
schedule: Optional[CronSchedule] = None
|
|
4855
|
+
|
|
4856
|
+
update_time: Optional[str] = None
|
|
4857
|
+
"""The timestamp indicating when the alert was updated."""
|
|
4858
|
+
|
|
4859
|
+
warehouse_id: Optional[str] = None
|
|
4860
|
+
"""ID of the SQL warehouse attached to the alert."""
|
|
4861
|
+
|
|
4862
|
+
def as_dict(self) -> dict:
|
|
4863
|
+
"""Serializes the ListAlertsV2ResponseAlert into a dictionary suitable for use as a JSON request body."""
|
|
4864
|
+
body = {}
|
|
4865
|
+
if self.create_time is not None:
|
|
4866
|
+
body["create_time"] = self.create_time
|
|
4867
|
+
if self.custom_description is not None:
|
|
4868
|
+
body["custom_description"] = self.custom_description
|
|
4869
|
+
if self.custom_summary is not None:
|
|
4870
|
+
body["custom_summary"] = self.custom_summary
|
|
4871
|
+
if self.display_name is not None:
|
|
4872
|
+
body["display_name"] = self.display_name
|
|
4873
|
+
if self.evaluation:
|
|
4874
|
+
body["evaluation"] = self.evaluation.as_dict()
|
|
4875
|
+
if self.id is not None:
|
|
4876
|
+
body["id"] = self.id
|
|
4877
|
+
if self.lifecycle_state is not None:
|
|
4878
|
+
body["lifecycle_state"] = self.lifecycle_state.value
|
|
4879
|
+
if self.owner_user_name is not None:
|
|
4880
|
+
body["owner_user_name"] = self.owner_user_name
|
|
4881
|
+
if self.query_text is not None:
|
|
4882
|
+
body["query_text"] = self.query_text
|
|
4883
|
+
if self.run_as_user_name is not None:
|
|
4884
|
+
body["run_as_user_name"] = self.run_as_user_name
|
|
4885
|
+
if self.schedule:
|
|
4886
|
+
body["schedule"] = self.schedule.as_dict()
|
|
4887
|
+
if self.update_time is not None:
|
|
4888
|
+
body["update_time"] = self.update_time
|
|
4889
|
+
if self.warehouse_id is not None:
|
|
4890
|
+
body["warehouse_id"] = self.warehouse_id
|
|
4891
|
+
return body
|
|
4892
|
+
|
|
4893
|
+
def as_shallow_dict(self) -> dict:
|
|
4894
|
+
"""Serializes the ListAlertsV2ResponseAlert into a shallow dictionary of its immediate attributes."""
|
|
4895
|
+
body = {}
|
|
4896
|
+
if self.create_time is not None:
|
|
4897
|
+
body["create_time"] = self.create_time
|
|
4898
|
+
if self.custom_description is not None:
|
|
4899
|
+
body["custom_description"] = self.custom_description
|
|
4900
|
+
if self.custom_summary is not None:
|
|
4901
|
+
body["custom_summary"] = self.custom_summary
|
|
4902
|
+
if self.display_name is not None:
|
|
4903
|
+
body["display_name"] = self.display_name
|
|
4904
|
+
if self.evaluation:
|
|
4905
|
+
body["evaluation"] = self.evaluation
|
|
4906
|
+
if self.id is not None:
|
|
4907
|
+
body["id"] = self.id
|
|
4908
|
+
if self.lifecycle_state is not None:
|
|
4909
|
+
body["lifecycle_state"] = self.lifecycle_state
|
|
4910
|
+
if self.owner_user_name is not None:
|
|
4911
|
+
body["owner_user_name"] = self.owner_user_name
|
|
4912
|
+
if self.query_text is not None:
|
|
4913
|
+
body["query_text"] = self.query_text
|
|
4914
|
+
if self.run_as_user_name is not None:
|
|
4915
|
+
body["run_as_user_name"] = self.run_as_user_name
|
|
4916
|
+
if self.schedule:
|
|
4917
|
+
body["schedule"] = self.schedule
|
|
4918
|
+
if self.update_time is not None:
|
|
4919
|
+
body["update_time"] = self.update_time
|
|
4920
|
+
if self.warehouse_id is not None:
|
|
4921
|
+
body["warehouse_id"] = self.warehouse_id
|
|
4922
|
+
return body
|
|
4923
|
+
|
|
4924
|
+
@classmethod
|
|
4925
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListAlertsV2ResponseAlert:
|
|
4926
|
+
"""Deserializes the ListAlertsV2ResponseAlert from a dictionary."""
|
|
4927
|
+
return cls(
|
|
4928
|
+
create_time=d.get("create_time", None),
|
|
4929
|
+
custom_description=d.get("custom_description", None),
|
|
4930
|
+
custom_summary=d.get("custom_summary", None),
|
|
4931
|
+
display_name=d.get("display_name", None),
|
|
4932
|
+
evaluation=_from_dict(d, "evaluation", AlertV2Evaluation),
|
|
4933
|
+
id=d.get("id", None),
|
|
4934
|
+
lifecycle_state=_enum(d, "lifecycle_state", LifecycleState),
|
|
4935
|
+
owner_user_name=d.get("owner_user_name", None),
|
|
4936
|
+
query_text=d.get("query_text", None),
|
|
4937
|
+
run_as_user_name=d.get("run_as_user_name", None),
|
|
4938
|
+
schedule=_from_dict(d, "schedule", CronSchedule),
|
|
4939
|
+
update_time=d.get("update_time", None),
|
|
4940
|
+
warehouse_id=d.get("warehouse_id", None),
|
|
4941
|
+
)
|
|
4942
|
+
|
|
4943
|
+
|
|
4273
4944
|
class ListOrder(Enum):
|
|
4274
4945
|
|
|
4275
4946
|
CREATED_AT = "created_at"
|
|
@@ -6185,6 +6856,12 @@ class RunAsRole(Enum):
|
|
|
6185
6856
|
VIEWER = "viewer"
|
|
6186
6857
|
|
|
6187
6858
|
|
|
6859
|
+
class SchedulePauseStatus(Enum):
|
|
6860
|
+
|
|
6861
|
+
PAUSED = "PAUSED"
|
|
6862
|
+
UNPAUSED = "UNPAUSED"
|
|
6863
|
+
|
|
6864
|
+
|
|
6188
6865
|
@dataclass
|
|
6189
6866
|
class ServiceError:
|
|
6190
6867
|
error_code: Optional[ServiceErrorCode] = None
|
|
@@ -6993,6 +7670,52 @@ class UpdateAlertRequestAlert:
|
|
|
6993
7670
|
)
|
|
6994
7671
|
|
|
6995
7672
|
|
|
7673
|
+
@dataclass
|
|
7674
|
+
class UpdateAlertV2Request:
|
|
7675
|
+
update_mask: str
|
|
7676
|
+
"""The field mask must be a single string, with multiple fields separated by commas (no spaces).
|
|
7677
|
+
The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
|
|
7678
|
+
(e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
|
|
7679
|
+
as only the entire collection field can be specified. Field names must exactly match the
|
|
7680
|
+
resource field names.
|
|
7681
|
+
|
|
7682
|
+
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
7683
|
+
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
|
|
7684
|
+
API changes in the future."""
|
|
7685
|
+
|
|
7686
|
+
alert: Optional[AlertV2] = None
|
|
7687
|
+
|
|
7688
|
+
id: Optional[str] = None
|
|
7689
|
+
"""UUID identifying the alert."""
|
|
7690
|
+
|
|
7691
|
+
def as_dict(self) -> dict:
|
|
7692
|
+
"""Serializes the UpdateAlertV2Request into a dictionary suitable for use as a JSON request body."""
|
|
7693
|
+
body = {}
|
|
7694
|
+
if self.alert:
|
|
7695
|
+
body["alert"] = self.alert.as_dict()
|
|
7696
|
+
if self.id is not None:
|
|
7697
|
+
body["id"] = self.id
|
|
7698
|
+
if self.update_mask is not None:
|
|
7699
|
+
body["update_mask"] = self.update_mask
|
|
7700
|
+
return body
|
|
7701
|
+
|
|
7702
|
+
def as_shallow_dict(self) -> dict:
|
|
7703
|
+
"""Serializes the UpdateAlertV2Request into a shallow dictionary of its immediate attributes."""
|
|
7704
|
+
body = {}
|
|
7705
|
+
if self.alert:
|
|
7706
|
+
body["alert"] = self.alert
|
|
7707
|
+
if self.id is not None:
|
|
7708
|
+
body["id"] = self.id
|
|
7709
|
+
if self.update_mask is not None:
|
|
7710
|
+
body["update_mask"] = self.update_mask
|
|
7711
|
+
return body
|
|
7712
|
+
|
|
7713
|
+
@classmethod
|
|
7714
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertV2Request:
|
|
7715
|
+
"""Deserializes the UpdateAlertV2Request from a dictionary."""
|
|
7716
|
+
return cls(alert=_from_dict(d, "alert", AlertV2), id=d.get("id", None), update_mask=d.get("update_mask", None))
|
|
7717
|
+
|
|
7718
|
+
|
|
6996
7719
|
@dataclass
|
|
6997
7720
|
class UpdateQueryRequest:
|
|
6998
7721
|
update_mask: str
|
|
@@ -7902,18 +8625,25 @@ class AlertsAPI:
|
|
|
7902
8625
|
def __init__(self, api_client):
|
|
7903
8626
|
self._api = api_client
|
|
7904
8627
|
|
|
7905
|
-
def create(
|
|
8628
|
+
def create(
|
|
8629
|
+
self, *, alert: Optional[CreateAlertRequestAlert] = None, auto_resolve_display_name: Optional[bool] = None
|
|
8630
|
+
) -> Alert:
|
|
7906
8631
|
"""Create an alert.
|
|
7907
8632
|
|
|
7908
8633
|
Creates an alert.
|
|
7909
8634
|
|
|
7910
8635
|
:param alert: :class:`CreateAlertRequestAlert` (optional)
|
|
8636
|
+
:param auto_resolve_display_name: bool (optional)
|
|
8637
|
+
If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
|
|
8638
|
+
alert's display name conflicts with an existing alert's display name.
|
|
7911
8639
|
|
|
7912
8640
|
:returns: :class:`Alert`
|
|
7913
8641
|
"""
|
|
7914
8642
|
body = {}
|
|
7915
8643
|
if alert is not None:
|
|
7916
8644
|
body["alert"] = alert.as_dict()
|
|
8645
|
+
if auto_resolve_display_name is not None:
|
|
8646
|
+
body["auto_resolve_display_name"] = auto_resolve_display_name
|
|
7917
8647
|
headers = {
|
|
7918
8648
|
"Accept": "application/json",
|
|
7919
8649
|
"Content-Type": "application/json",
|
|
@@ -8193,6 +8923,133 @@ class AlertsLegacyAPI:
|
|
|
8193
8923
|
self._api.do("PUT", f"/api/2.0/preview/sql/alerts/{alert_id}", body=body, headers=headers)
|
|
8194
8924
|
|
|
8195
8925
|
|
|
8926
|
+
class AlertsV2API:
|
|
8927
|
+
"""TODO: Add description"""
|
|
8928
|
+
|
|
8929
|
+
def __init__(self, api_client):
|
|
8930
|
+
self._api = api_client
|
|
8931
|
+
|
|
8932
|
+
def create_alert(self, *, alert: Optional[AlertV2] = None) -> AlertV2:
|
|
8933
|
+
"""Create an alert.
|
|
8934
|
+
|
|
8935
|
+
Create Alert
|
|
8936
|
+
|
|
8937
|
+
:param alert: :class:`AlertV2` (optional)
|
|
8938
|
+
|
|
8939
|
+
:returns: :class:`AlertV2`
|
|
8940
|
+
"""
|
|
8941
|
+
body = {}
|
|
8942
|
+
if alert is not None:
|
|
8943
|
+
body["alert"] = alert.as_dict()
|
|
8944
|
+
headers = {
|
|
8945
|
+
"Accept": "application/json",
|
|
8946
|
+
"Content-Type": "application/json",
|
|
8947
|
+
}
|
|
8948
|
+
|
|
8949
|
+
res = self._api.do("POST", "/api/2.0/alerts", body=body, headers=headers)
|
|
8950
|
+
return AlertV2.from_dict(res)
|
|
8951
|
+
|
|
8952
|
+
def get_alert(self, id: str) -> AlertV2:
|
|
8953
|
+
"""Get an alert.
|
|
8954
|
+
|
|
8955
|
+
Gets an alert.
|
|
8956
|
+
|
|
8957
|
+
:param id: str
|
|
8958
|
+
|
|
8959
|
+
:returns: :class:`AlertV2`
|
|
8960
|
+
"""
|
|
8961
|
+
|
|
8962
|
+
headers = {
|
|
8963
|
+
"Accept": "application/json",
|
|
8964
|
+
}
|
|
8965
|
+
|
|
8966
|
+
res = self._api.do("GET", f"/api/2.0/alerts/{id}", headers=headers)
|
|
8967
|
+
return AlertV2.from_dict(res)
|
|
8968
|
+
|
|
8969
|
+
def list_alerts(
|
|
8970
|
+
self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
8971
|
+
) -> Iterator[ListAlertsV2ResponseAlert]:
|
|
8972
|
+
"""List alerts.
|
|
8973
|
+
|
|
8974
|
+
Gets a list of alerts accessible to the user, ordered by creation time.
|
|
8975
|
+
|
|
8976
|
+
:param page_size: int (optional)
|
|
8977
|
+
:param page_token: str (optional)
|
|
8978
|
+
|
|
8979
|
+
:returns: Iterator over :class:`ListAlertsV2ResponseAlert`
|
|
8980
|
+
"""
|
|
8981
|
+
|
|
8982
|
+
query = {}
|
|
8983
|
+
if page_size is not None:
|
|
8984
|
+
query["page_size"] = page_size
|
|
8985
|
+
if page_token is not None:
|
|
8986
|
+
query["page_token"] = page_token
|
|
8987
|
+
headers = {
|
|
8988
|
+
"Accept": "application/json",
|
|
8989
|
+
}
|
|
8990
|
+
|
|
8991
|
+
while True:
|
|
8992
|
+
json = self._api.do("GET", "/api/2.0/alerts", query=query, headers=headers)
|
|
8993
|
+
if "results" in json:
|
|
8994
|
+
for v in json["results"]:
|
|
8995
|
+
yield ListAlertsV2ResponseAlert.from_dict(v)
|
|
8996
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
8997
|
+
return
|
|
8998
|
+
query["page_token"] = json["next_page_token"]
|
|
8999
|
+
|
|
9000
|
+
def trash_alert(self, id: str):
|
|
9001
|
+
"""Delete an alert.
|
|
9002
|
+
|
|
9003
|
+
Moves an alert to the trash. Trashed alerts immediately disappear from list views, and can no longer
|
|
9004
|
+
trigger. You can restore a trashed alert through the UI. A trashed alert is permanently deleted after
|
|
9005
|
+
30 days.
|
|
9006
|
+
|
|
9007
|
+
:param id: str
|
|
9008
|
+
|
|
9009
|
+
|
|
9010
|
+
"""
|
|
9011
|
+
|
|
9012
|
+
headers = {
|
|
9013
|
+
"Accept": "application/json",
|
|
9014
|
+
}
|
|
9015
|
+
|
|
9016
|
+
self._api.do("DELETE", f"/api/2.0/alerts/{id}", headers=headers)
|
|
9017
|
+
|
|
9018
|
+
def update_alert(self, id: str, update_mask: str, *, alert: Optional[AlertV2] = None) -> AlertV2:
|
|
9019
|
+
"""Update an alert.
|
|
9020
|
+
|
|
9021
|
+
Update alert
|
|
9022
|
+
|
|
9023
|
+
:param id: str
|
|
9024
|
+
UUID identifying the alert.
|
|
9025
|
+
:param update_mask: str
|
|
9026
|
+
The field mask must be a single string, with multiple fields separated by commas (no spaces). The
|
|
9027
|
+
field path is relative to the resource object, using a dot (`.`) to navigate sub-fields (e.g.,
|
|
9028
|
+
`author.given_name`). Specification of elements in sequence or map fields is not allowed, as only
|
|
9029
|
+
the entire collection field can be specified. Field names must exactly match the resource field
|
|
9030
|
+
names.
|
|
9031
|
+
|
|
9032
|
+
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
9033
|
+
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the API
|
|
9034
|
+
changes in the future.
|
|
9035
|
+
:param alert: :class:`AlertV2` (optional)
|
|
9036
|
+
|
|
9037
|
+
:returns: :class:`AlertV2`
|
|
9038
|
+
"""
|
|
9039
|
+
body = {}
|
|
9040
|
+
if alert is not None:
|
|
9041
|
+
body["alert"] = alert.as_dict()
|
|
9042
|
+
if update_mask is not None:
|
|
9043
|
+
body["update_mask"] = update_mask
|
|
9044
|
+
headers = {
|
|
9045
|
+
"Accept": "application/json",
|
|
9046
|
+
"Content-Type": "application/json",
|
|
9047
|
+
}
|
|
9048
|
+
|
|
9049
|
+
res = self._api.do("PATCH", f"/api/2.0/alerts/{id}", body=body, headers=headers)
|
|
9050
|
+
return AlertV2.from_dict(res)
|
|
9051
|
+
|
|
9052
|
+
|
|
8196
9053
|
class DashboardWidgetsAPI:
|
|
8197
9054
|
"""This is an evolving API that facilitates the addition and removal of widgets from existing dashboards
|
|
8198
9055
|
within the Databricks Workspace. Data structures may change over time."""
|
|
@@ -8678,16 +9535,23 @@ class QueriesAPI:
|
|
|
8678
9535
|
def __init__(self, api_client):
|
|
8679
9536
|
self._api = api_client
|
|
8680
9537
|
|
|
8681
|
-
def create(
|
|
9538
|
+
def create(
|
|
9539
|
+
self, *, auto_resolve_display_name: Optional[bool] = None, query: Optional[CreateQueryRequestQuery] = None
|
|
9540
|
+
) -> Query:
|
|
8682
9541
|
"""Create a query.
|
|
8683
9542
|
|
|
8684
9543
|
Creates a query.
|
|
8685
9544
|
|
|
9545
|
+
:param auto_resolve_display_name: bool (optional)
|
|
9546
|
+
If true, automatically resolve query display name conflicts. Otherwise, fail the request if the
|
|
9547
|
+
query's display name conflicts with an existing query's display name.
|
|
8686
9548
|
:param query: :class:`CreateQueryRequestQuery` (optional)
|
|
8687
9549
|
|
|
8688
9550
|
:returns: :class:`Query`
|
|
8689
9551
|
"""
|
|
8690
9552
|
body = {}
|
|
9553
|
+
if auto_resolve_display_name is not None:
|
|
9554
|
+
body["auto_resolve_display_name"] = auto_resolve_display_name
|
|
8691
9555
|
if query is not None:
|
|
8692
9556
|
body["query"] = query.as_dict()
|
|
8693
9557
|
headers = {
|