databricks-sdk 0.19.1__py3-none-any.whl → 0.20.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 +8 -1
- databricks/sdk/core.py +4 -2
- databricks/sdk/mixins/workspace.py +2 -1
- databricks/sdk/service/billing.py +22 -1
- databricks/sdk/service/catalog.py +557 -46
- databricks/sdk/service/compute.py +57 -0
- databricks/sdk/service/dashboards.py +1 -0
- databricks/sdk/service/files.py +147 -15
- databricks/sdk/service/iam.py +53 -0
- databricks/sdk/service/jobs.py +147 -135
- databricks/sdk/service/ml.py +57 -0
- databricks/sdk/service/oauth2.py +13 -0
- databricks/sdk/service/pipelines.py +12 -0
- databricks/sdk/service/provisioning.py +30 -0
- databricks/sdk/service/serving.py +73 -35
- databricks/sdk/service/settings.py +41 -0
- databricks/sdk/service/sharing.py +38 -18
- databricks/sdk/service/sql.py +92 -2
- databricks/sdk/service/vectorsearch.py +10 -0
- databricks/sdk/service/workspace.py +34 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.20.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.20.0.dist-info}/RECORD +27 -27
- {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.20.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.20.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.20.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.20.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/sql.py
CHANGED
|
@@ -346,7 +346,6 @@ class ChannelInfo:
|
|
|
346
346
|
|
|
347
347
|
|
|
348
348
|
class ChannelName(Enum):
|
|
349
|
-
"""Name of the channel"""
|
|
350
349
|
|
|
351
350
|
CHANNEL_NAME_CURRENT = 'CHANNEL_NAME_CURRENT'
|
|
352
351
|
CHANNEL_NAME_CUSTOM = 'CHANNEL_NAME_CUSTOM'
|
|
@@ -2008,6 +2007,36 @@ class ListWarehousesResponse:
|
|
|
2008
2007
|
return cls(warehouses=_repeated_dict(d, 'warehouses', EndpointInfo))
|
|
2009
2008
|
|
|
2010
2009
|
|
|
2010
|
+
@dataclass
|
|
2011
|
+
class MultiValuesOptions:
|
|
2012
|
+
"""If specified, allows multiple values to be selected for this parameter. Only applies to dropdown
|
|
2013
|
+
list and query-based dropdown list parameters."""
|
|
2014
|
+
|
|
2015
|
+
prefix: Optional[str] = None
|
|
2016
|
+
"""Character that prefixes each selected parameter value."""
|
|
2017
|
+
|
|
2018
|
+
separator: Optional[str] = None
|
|
2019
|
+
"""Character that separates each selected parameter value. Defaults to a comma."""
|
|
2020
|
+
|
|
2021
|
+
suffix: Optional[str] = None
|
|
2022
|
+
"""Character that suffixes each selected parameter value."""
|
|
2023
|
+
|
|
2024
|
+
def as_dict(self) -> dict:
|
|
2025
|
+
"""Serializes the MultiValuesOptions into a dictionary suitable for use as a JSON request body."""
|
|
2026
|
+
body = {}
|
|
2027
|
+
if self.prefix is not None: body['prefix'] = self.prefix
|
|
2028
|
+
if self.separator is not None: body['separator'] = self.separator
|
|
2029
|
+
if self.suffix is not None: body['suffix'] = self.suffix
|
|
2030
|
+
return body
|
|
2031
|
+
|
|
2032
|
+
@classmethod
|
|
2033
|
+
def from_dict(cls, d: Dict[str, any]) -> MultiValuesOptions:
|
|
2034
|
+
"""Deserializes the MultiValuesOptions from a dictionary."""
|
|
2035
|
+
return cls(prefix=d.get('prefix', None),
|
|
2036
|
+
separator=d.get('separator', None),
|
|
2037
|
+
suffix=d.get('suffix', None))
|
|
2038
|
+
|
|
2039
|
+
|
|
2011
2040
|
class ObjectType(Enum):
|
|
2012
2041
|
"""A singular noun object type."""
|
|
2013
2042
|
|
|
@@ -2064,9 +2093,20 @@ class OwnableObjectType(Enum):
|
|
|
2064
2093
|
|
|
2065
2094
|
@dataclass
|
|
2066
2095
|
class Parameter:
|
|
2096
|
+
enum_options: Optional[str] = None
|
|
2097
|
+
"""List of valid parameter values, newline delimited. Only applies for dropdown list parameters."""
|
|
2098
|
+
|
|
2099
|
+
multi_values_options: Optional[MultiValuesOptions] = None
|
|
2100
|
+
"""If specified, allows multiple values to be selected for this parameter. Only applies to dropdown
|
|
2101
|
+
list and query-based dropdown list parameters."""
|
|
2102
|
+
|
|
2067
2103
|
name: Optional[str] = None
|
|
2068
2104
|
"""The literal parameter marker that appears between double curly braces in the query text."""
|
|
2069
2105
|
|
|
2106
|
+
query_id: Optional[str] = None
|
|
2107
|
+
"""The UUID of the query that provides the parameter values. Only applies for query-based dropdown
|
|
2108
|
+
list parameters."""
|
|
2109
|
+
|
|
2070
2110
|
title: Optional[str] = None
|
|
2071
2111
|
"""The text displayed in a parameter picking widget."""
|
|
2072
2112
|
|
|
@@ -2079,7 +2119,10 @@ class Parameter:
|
|
|
2079
2119
|
def as_dict(self) -> dict:
|
|
2080
2120
|
"""Serializes the Parameter into a dictionary suitable for use as a JSON request body."""
|
|
2081
2121
|
body = {}
|
|
2122
|
+
if self.enum_options is not None: body['enumOptions'] = self.enum_options
|
|
2123
|
+
if self.multi_values_options: body['multiValuesOptions'] = self.multi_values_options.as_dict()
|
|
2082
2124
|
if self.name is not None: body['name'] = self.name
|
|
2125
|
+
if self.query_id is not None: body['queryId'] = self.query_id
|
|
2083
2126
|
if self.title is not None: body['title'] = self.title
|
|
2084
2127
|
if self.type is not None: body['type'] = self.type.value
|
|
2085
2128
|
if self.value: body['value'] = self.value
|
|
@@ -2088,7 +2131,10 @@ class Parameter:
|
|
|
2088
2131
|
@classmethod
|
|
2089
2132
|
def from_dict(cls, d: Dict[str, any]) -> Parameter:
|
|
2090
2133
|
"""Deserializes the Parameter from a dictionary."""
|
|
2091
|
-
return cls(
|
|
2134
|
+
return cls(enum_options=d.get('enumOptions', None),
|
|
2135
|
+
multi_values_options=_from_dict(d, 'multiValuesOptions', MultiValuesOptions),
|
|
2136
|
+
name=d.get('name', None),
|
|
2137
|
+
query_id=d.get('queryId', None),
|
|
2092
2138
|
title=d.get('title', None),
|
|
2093
2139
|
type=_enum(d, 'type', ParameterType),
|
|
2094
2140
|
value=d.get('value', None))
|
|
@@ -2098,7 +2144,9 @@ class ParameterType(Enum):
|
|
|
2098
2144
|
"""Parameters can have several different types."""
|
|
2099
2145
|
|
|
2100
2146
|
DATETIME = 'datetime'
|
|
2147
|
+
ENUM = 'enum'
|
|
2101
2148
|
NUMBER = 'number'
|
|
2149
|
+
QUERY = 'query'
|
|
2102
2150
|
TEXT = 'text'
|
|
2103
2151
|
|
|
2104
2152
|
|
|
@@ -3802,6 +3850,7 @@ class AlertsAPI:
|
|
|
3802
3850
|
if query_id is not None: body['query_id'] = query_id
|
|
3803
3851
|
if rearm is not None: body['rearm'] = rearm
|
|
3804
3852
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3853
|
+
|
|
3805
3854
|
res = self._api.do('POST', '/api/2.0/preview/sql/alerts', body=body, headers=headers)
|
|
3806
3855
|
return Alert.from_dict(res)
|
|
3807
3856
|
|
|
@@ -3817,6 +3866,7 @@ class AlertsAPI:
|
|
|
3817
3866
|
"""
|
|
3818
3867
|
|
|
3819
3868
|
headers = {'Accept': 'application/json', }
|
|
3869
|
+
|
|
3820
3870
|
self._api.do('DELETE', f'/api/2.0/preview/sql/alerts/{alert_id}', headers=headers)
|
|
3821
3871
|
|
|
3822
3872
|
def get(self, alert_id: str) -> Alert:
|
|
@@ -3830,6 +3880,7 @@ class AlertsAPI:
|
|
|
3830
3880
|
"""
|
|
3831
3881
|
|
|
3832
3882
|
headers = {'Accept': 'application/json', }
|
|
3883
|
+
|
|
3833
3884
|
res = self._api.do('GET', f'/api/2.0/preview/sql/alerts/{alert_id}', headers=headers)
|
|
3834
3885
|
return Alert.from_dict(res)
|
|
3835
3886
|
|
|
@@ -3842,6 +3893,7 @@ class AlertsAPI:
|
|
|
3842
3893
|
"""
|
|
3843
3894
|
|
|
3844
3895
|
headers = {'Accept': 'application/json', }
|
|
3896
|
+
|
|
3845
3897
|
res = self._api.do('GET', '/api/2.0/preview/sql/alerts', headers=headers)
|
|
3846
3898
|
return [Alert.from_dict(v) for v in res]
|
|
3847
3899
|
|
|
@@ -3875,6 +3927,7 @@ class AlertsAPI:
|
|
|
3875
3927
|
if query_id is not None: body['query_id'] = query_id
|
|
3876
3928
|
if rearm is not None: body['rearm'] = rearm
|
|
3877
3929
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3930
|
+
|
|
3878
3931
|
self._api.do('PUT', f'/api/2.0/preview/sql/alerts/{alert_id}', body=body, headers=headers)
|
|
3879
3932
|
|
|
3880
3933
|
|
|
@@ -3914,6 +3967,7 @@ class DashboardWidgetsAPI:
|
|
|
3914
3967
|
if visualization_id is not None: body['visualization_id'] = visualization_id
|
|
3915
3968
|
if width is not None: body['width'] = width
|
|
3916
3969
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3970
|
+
|
|
3917
3971
|
res = self._api.do('POST', '/api/2.0/preview/sql/widgets', body=body, headers=headers)
|
|
3918
3972
|
return Widget.from_dict(res)
|
|
3919
3973
|
|
|
@@ -3927,6 +3981,7 @@ class DashboardWidgetsAPI:
|
|
|
3927
3981
|
"""
|
|
3928
3982
|
|
|
3929
3983
|
headers = {'Accept': 'application/json', }
|
|
3984
|
+
|
|
3930
3985
|
self._api.do('DELETE', f'/api/2.0/preview/sql/widgets/{id}', headers=headers)
|
|
3931
3986
|
|
|
3932
3987
|
def update(self,
|
|
@@ -3961,6 +4016,7 @@ class DashboardWidgetsAPI:
|
|
|
3961
4016
|
if visualization_id is not None: body['visualization_id'] = visualization_id
|
|
3962
4017
|
if width is not None: body['width'] = width
|
|
3963
4018
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4019
|
+
|
|
3964
4020
|
res = self._api.do('POST', f'/api/2.0/preview/sql/widgets/{id}', body=body, headers=headers)
|
|
3965
4021
|
return Widget.from_dict(res)
|
|
3966
4022
|
|
|
@@ -4009,6 +4065,7 @@ class DashboardsAPI:
|
|
|
4009
4065
|
if run_as_role is not None: body['run_as_role'] = run_as_role.value
|
|
4010
4066
|
if tags is not None: body['tags'] = [v for v in tags]
|
|
4011
4067
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4068
|
+
|
|
4012
4069
|
res = self._api.do('POST', '/api/2.0/preview/sql/dashboards', body=body, headers=headers)
|
|
4013
4070
|
return Dashboard.from_dict(res)
|
|
4014
4071
|
|
|
@@ -4024,6 +4081,7 @@ class DashboardsAPI:
|
|
|
4024
4081
|
"""
|
|
4025
4082
|
|
|
4026
4083
|
headers = {'Accept': 'application/json', }
|
|
4084
|
+
|
|
4027
4085
|
self._api.do('DELETE', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', headers=headers)
|
|
4028
4086
|
|
|
4029
4087
|
def get(self, dashboard_id: str) -> Dashboard:
|
|
@@ -4037,6 +4095,7 @@ class DashboardsAPI:
|
|
|
4037
4095
|
"""
|
|
4038
4096
|
|
|
4039
4097
|
headers = {'Accept': 'application/json', }
|
|
4098
|
+
|
|
4040
4099
|
res = self._api.do('GET', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', headers=headers)
|
|
4041
4100
|
return Dashboard.from_dict(res)
|
|
4042
4101
|
|
|
@@ -4099,6 +4158,7 @@ class DashboardsAPI:
|
|
|
4099
4158
|
"""
|
|
4100
4159
|
|
|
4101
4160
|
headers = {'Accept': 'application/json', }
|
|
4161
|
+
|
|
4102
4162
|
self._api.do('POST', f'/api/2.0/preview/sql/dashboards/trash/{dashboard_id}', headers=headers)
|
|
4103
4163
|
|
|
4104
4164
|
def update(self,
|
|
@@ -4126,6 +4186,7 @@ class DashboardsAPI:
|
|
|
4126
4186
|
if name is not None: body['name'] = name
|
|
4127
4187
|
if run_as_role is not None: body['run_as_role'] = run_as_role.value
|
|
4128
4188
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4189
|
+
|
|
4129
4190
|
res = self._api.do('POST',
|
|
4130
4191
|
f'/api/2.0/preview/sql/dashboards/{dashboard_id}',
|
|
4131
4192
|
body=body,
|
|
@@ -4156,6 +4217,7 @@ class DataSourcesAPI:
|
|
|
4156
4217
|
"""
|
|
4157
4218
|
|
|
4158
4219
|
headers = {'Accept': 'application/json', }
|
|
4220
|
+
|
|
4159
4221
|
res = self._api.do('GET', '/api/2.0/preview/sql/data_sources', headers=headers)
|
|
4160
4222
|
return [DataSource.from_dict(v) for v in res]
|
|
4161
4223
|
|
|
@@ -4190,6 +4252,7 @@ class DbsqlPermissionsAPI:
|
|
|
4190
4252
|
"""
|
|
4191
4253
|
|
|
4192
4254
|
headers = {'Accept': 'application/json', }
|
|
4255
|
+
|
|
4193
4256
|
res = self._api.do('GET',
|
|
4194
4257
|
f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}',
|
|
4195
4258
|
headers=headers)
|
|
@@ -4217,6 +4280,7 @@ class DbsqlPermissionsAPI:
|
|
|
4217
4280
|
if access_control_list is not None:
|
|
4218
4281
|
body['access_control_list'] = [v.as_dict() for v in access_control_list]
|
|
4219
4282
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4283
|
+
|
|
4220
4284
|
res = self._api.do('POST',
|
|
4221
4285
|
f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}',
|
|
4222
4286
|
body=body,
|
|
@@ -4244,6 +4308,7 @@ class DbsqlPermissionsAPI:
|
|
|
4244
4308
|
body = {}
|
|
4245
4309
|
if new_owner is not None: body['new_owner'] = new_owner
|
|
4246
4310
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4311
|
+
|
|
4247
4312
|
res = self._api.do('POST',
|
|
4248
4313
|
f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}/transfer',
|
|
4249
4314
|
body=body,
|
|
@@ -4311,6 +4376,7 @@ class QueriesAPI:
|
|
|
4311
4376
|
if query is not None: body['query'] = query
|
|
4312
4377
|
if run_as_role is not None: body['run_as_role'] = run_as_role.value
|
|
4313
4378
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4379
|
+
|
|
4314
4380
|
res = self._api.do('POST', '/api/2.0/preview/sql/queries', body=body, headers=headers)
|
|
4315
4381
|
return Query.from_dict(res)
|
|
4316
4382
|
|
|
@@ -4326,6 +4392,7 @@ class QueriesAPI:
|
|
|
4326
4392
|
"""
|
|
4327
4393
|
|
|
4328
4394
|
headers = {'Accept': 'application/json', }
|
|
4395
|
+
|
|
4329
4396
|
self._api.do('DELETE', f'/api/2.0/preview/sql/queries/{query_id}', headers=headers)
|
|
4330
4397
|
|
|
4331
4398
|
def get(self, query_id: str) -> Query:
|
|
@@ -4340,6 +4407,7 @@ class QueriesAPI:
|
|
|
4340
4407
|
"""
|
|
4341
4408
|
|
|
4342
4409
|
headers = {'Accept': 'application/json', }
|
|
4410
|
+
|
|
4343
4411
|
res = self._api.do('GET', f'/api/2.0/preview/sql/queries/{query_id}', headers=headers)
|
|
4344
4412
|
return Query.from_dict(res)
|
|
4345
4413
|
|
|
@@ -4415,6 +4483,7 @@ class QueriesAPI:
|
|
|
4415
4483
|
"""
|
|
4416
4484
|
|
|
4417
4485
|
headers = {'Accept': 'application/json', }
|
|
4486
|
+
|
|
4418
4487
|
self._api.do('POST', f'/api/2.0/preview/sql/queries/trash/{query_id}', headers=headers)
|
|
4419
4488
|
|
|
4420
4489
|
def update(self,
|
|
@@ -4462,6 +4531,7 @@ class QueriesAPI:
|
|
|
4462
4531
|
if query is not None: body['query'] = query
|
|
4463
4532
|
if run_as_role is not None: body['run_as_role'] = run_as_role.value
|
|
4464
4533
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4534
|
+
|
|
4465
4535
|
res = self._api.do('POST', f'/api/2.0/preview/sql/queries/{query_id}', body=body, headers=headers)
|
|
4466
4536
|
return Query.from_dict(res)
|
|
4467
4537
|
|
|
@@ -4552,6 +4622,7 @@ class QueryVisualizationsAPI:
|
|
|
4552
4622
|
if query_id is not None: body['query_id'] = query_id
|
|
4553
4623
|
if type is not None: body['type'] = type
|
|
4554
4624
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4625
|
+
|
|
4555
4626
|
res = self._api.do('POST', '/api/2.0/preview/sql/visualizations', body=body, headers=headers)
|
|
4556
4627
|
return Visualization.from_dict(res)
|
|
4557
4628
|
|
|
@@ -4565,6 +4636,7 @@ class QueryVisualizationsAPI:
|
|
|
4565
4636
|
"""
|
|
4566
4637
|
|
|
4567
4638
|
headers = {'Accept': 'application/json', }
|
|
4639
|
+
|
|
4568
4640
|
self._api.do('DELETE', f'/api/2.0/preview/sql/visualizations/{id}', headers=headers)
|
|
4569
4641
|
|
|
4570
4642
|
def update(self,
|
|
@@ -4602,6 +4674,7 @@ class QueryVisualizationsAPI:
|
|
|
4602
4674
|
if type is not None: body['type'] = type
|
|
4603
4675
|
if updated_at is not None: body['updated_at'] = updated_at
|
|
4604
4676
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4677
|
+
|
|
4605
4678
|
res = self._api.do('POST', f'/api/2.0/preview/sql/visualizations/{id}', body=body, headers=headers)
|
|
4606
4679
|
return Visualization.from_dict(res)
|
|
4607
4680
|
|
|
@@ -4707,6 +4780,7 @@ class StatementExecutionAPI:
|
|
|
4707
4780
|
"""
|
|
4708
4781
|
|
|
4709
4782
|
headers = {}
|
|
4783
|
+
|
|
4710
4784
|
self._api.do('POST', f'/api/2.0/sql/statements/{statement_id}/cancel', headers=headers)
|
|
4711
4785
|
|
|
4712
4786
|
def execute_statement(self,
|
|
@@ -4862,6 +4936,7 @@ class StatementExecutionAPI:
|
|
|
4862
4936
|
if wait_timeout is not None: body['wait_timeout'] = wait_timeout
|
|
4863
4937
|
if warehouse_id is not None: body['warehouse_id'] = warehouse_id
|
|
4864
4938
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
4939
|
+
|
|
4865
4940
|
res = self._api.do('POST', '/api/2.0/sql/statements/', body=body, headers=headers)
|
|
4866
4941
|
return ExecuteStatementResponse.from_dict(res)
|
|
4867
4942
|
|
|
@@ -4884,6 +4959,7 @@ class StatementExecutionAPI:
|
|
|
4884
4959
|
"""
|
|
4885
4960
|
|
|
4886
4961
|
headers = {'Accept': 'application/json', }
|
|
4962
|
+
|
|
4887
4963
|
res = self._api.do('GET', f'/api/2.0/sql/statements/{statement_id}', headers=headers)
|
|
4888
4964
|
return GetStatementResponse.from_dict(res)
|
|
4889
4965
|
|
|
@@ -4906,6 +4982,7 @@ class StatementExecutionAPI:
|
|
|
4906
4982
|
"""
|
|
4907
4983
|
|
|
4908
4984
|
headers = {'Accept': 'application/json', }
|
|
4985
|
+
|
|
4909
4986
|
res = self._api.do('GET',
|
|
4910
4987
|
f'/api/2.0/sql/statements/{statement_id}/result/chunks/{chunk_index}',
|
|
4911
4988
|
headers=headers)
|
|
@@ -5077,6 +5154,7 @@ class WarehousesAPI:
|
|
|
5077
5154
|
if tags is not None: body['tags'] = tags.as_dict()
|
|
5078
5155
|
if warehouse_type is not None: body['warehouse_type'] = warehouse_type.value
|
|
5079
5156
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5157
|
+
|
|
5080
5158
|
op_response = self._api.do('POST', '/api/2.0/sql/warehouses', body=body, headers=headers)
|
|
5081
5159
|
return Wait(self.wait_get_warehouse_running,
|
|
5082
5160
|
response=CreateWarehouseResponse.from_dict(op_response),
|
|
@@ -5126,6 +5204,7 @@ class WarehousesAPI:
|
|
|
5126
5204
|
"""
|
|
5127
5205
|
|
|
5128
5206
|
headers = {'Accept': 'application/json', }
|
|
5207
|
+
|
|
5129
5208
|
self._api.do('DELETE', f'/api/2.0/sql/warehouses/{id}', headers=headers)
|
|
5130
5209
|
|
|
5131
5210
|
def edit(
|
|
@@ -5226,6 +5305,7 @@ class WarehousesAPI:
|
|
|
5226
5305
|
if tags is not None: body['tags'] = tags.as_dict()
|
|
5227
5306
|
if warehouse_type is not None: body['warehouse_type'] = warehouse_type.value
|
|
5228
5307
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5308
|
+
|
|
5229
5309
|
self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/edit', body=body, headers=headers)
|
|
5230
5310
|
return Wait(self.wait_get_warehouse_running, id=id)
|
|
5231
5311
|
|
|
@@ -5275,6 +5355,7 @@ class WarehousesAPI:
|
|
|
5275
5355
|
"""
|
|
5276
5356
|
|
|
5277
5357
|
headers = {'Accept': 'application/json', }
|
|
5358
|
+
|
|
5278
5359
|
res = self._api.do('GET', f'/api/2.0/sql/warehouses/{id}', headers=headers)
|
|
5279
5360
|
return GetWarehouseResponse.from_dict(res)
|
|
5280
5361
|
|
|
@@ -5290,6 +5371,7 @@ class WarehousesAPI:
|
|
|
5290
5371
|
"""
|
|
5291
5372
|
|
|
5292
5373
|
headers = {'Accept': 'application/json', }
|
|
5374
|
+
|
|
5293
5375
|
res = self._api.do('GET',
|
|
5294
5376
|
f'/api/2.0/permissions/warehouses/{warehouse_id}/permissionLevels',
|
|
5295
5377
|
headers=headers)
|
|
@@ -5308,6 +5390,7 @@ class WarehousesAPI:
|
|
|
5308
5390
|
"""
|
|
5309
5391
|
|
|
5310
5392
|
headers = {'Accept': 'application/json', }
|
|
5393
|
+
|
|
5311
5394
|
res = self._api.do('GET', f'/api/2.0/permissions/warehouses/{warehouse_id}', headers=headers)
|
|
5312
5395
|
return WarehousePermissions.from_dict(res)
|
|
5313
5396
|
|
|
@@ -5320,6 +5403,7 @@ class WarehousesAPI:
|
|
|
5320
5403
|
"""
|
|
5321
5404
|
|
|
5322
5405
|
headers = {'Accept': 'application/json', }
|
|
5406
|
+
|
|
5323
5407
|
res = self._api.do('GET', '/api/2.0/sql/config/warehouses', headers=headers)
|
|
5324
5408
|
return GetWorkspaceWarehouseConfigResponse.from_dict(res)
|
|
5325
5409
|
|
|
@@ -5338,6 +5422,7 @@ class WarehousesAPI:
|
|
|
5338
5422
|
query = {}
|
|
5339
5423
|
if run_as_user_id is not None: query['run_as_user_id'] = run_as_user_id
|
|
5340
5424
|
headers = {'Accept': 'application/json', }
|
|
5425
|
+
|
|
5341
5426
|
json = self._api.do('GET', '/api/2.0/sql/warehouses', query=query, headers=headers)
|
|
5342
5427
|
parsed = ListWarehousesResponse.from_dict(json).warehouses
|
|
5343
5428
|
return parsed if parsed is not None else []
|
|
@@ -5361,6 +5446,7 @@ class WarehousesAPI:
|
|
|
5361
5446
|
if access_control_list is not None:
|
|
5362
5447
|
body['access_control_list'] = [v.as_dict() for v in access_control_list]
|
|
5363
5448
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5449
|
+
|
|
5364
5450
|
res = self._api.do('PUT',
|
|
5365
5451
|
f'/api/2.0/permissions/warehouses/{warehouse_id}',
|
|
5366
5452
|
body=body,
|
|
@@ -5422,6 +5508,7 @@ class WarehousesAPI:
|
|
|
5422
5508
|
if sql_configuration_parameters is not None:
|
|
5423
5509
|
body['sql_configuration_parameters'] = sql_configuration_parameters.as_dict()
|
|
5424
5510
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5511
|
+
|
|
5425
5512
|
self._api.do('PUT', '/api/2.0/sql/config/warehouses', body=body, headers=headers)
|
|
5426
5513
|
|
|
5427
5514
|
def start(self, id: str) -> Wait[GetWarehouseResponse]:
|
|
@@ -5438,6 +5525,7 @@ class WarehousesAPI:
|
|
|
5438
5525
|
"""
|
|
5439
5526
|
|
|
5440
5527
|
headers = {'Accept': 'application/json', }
|
|
5528
|
+
|
|
5441
5529
|
self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/start', headers=headers)
|
|
5442
5530
|
return Wait(self.wait_get_warehouse_running, id=id)
|
|
5443
5531
|
|
|
@@ -5458,6 +5546,7 @@ class WarehousesAPI:
|
|
|
5458
5546
|
"""
|
|
5459
5547
|
|
|
5460
5548
|
headers = {'Accept': 'application/json', }
|
|
5549
|
+
|
|
5461
5550
|
self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/stop', headers=headers)
|
|
5462
5551
|
return Wait(self.wait_get_warehouse_stopped, id=id)
|
|
5463
5552
|
|
|
@@ -5484,6 +5573,7 @@ class WarehousesAPI:
|
|
|
5484
5573
|
if access_control_list is not None:
|
|
5485
5574
|
body['access_control_list'] = [v.as_dict() for v in access_control_list]
|
|
5486
5575
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
5576
|
+
|
|
5487
5577
|
res = self._api.do('PATCH',
|
|
5488
5578
|
f'/api/2.0/permissions/warehouses/{warehouse_id}',
|
|
5489
5579
|
body=body,
|
|
@@ -926,6 +926,7 @@ class VectorSearchEndpointsAPI:
|
|
|
926
926
|
if endpoint_type is not None: body['endpoint_type'] = endpoint_type.value
|
|
927
927
|
if name is not None: body['name'] = name
|
|
928
928
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
929
|
+
|
|
929
930
|
op_response = self._api.do('POST', '/api/2.0/vector-search/endpoints', body=body, headers=headers)
|
|
930
931
|
return Wait(self.wait_get_endpoint_vector_search_endpoint_online,
|
|
931
932
|
response=EndpointInfo.from_dict(op_response),
|
|
@@ -947,6 +948,7 @@ class VectorSearchEndpointsAPI:
|
|
|
947
948
|
"""
|
|
948
949
|
|
|
949
950
|
headers = {}
|
|
951
|
+
|
|
950
952
|
self._api.do('DELETE', f'/api/2.0/vector-search/endpoints/{endpoint_name}', headers=headers)
|
|
951
953
|
|
|
952
954
|
def get_endpoint(self, endpoint_name: str) -> EndpointInfo:
|
|
@@ -959,6 +961,7 @@ class VectorSearchEndpointsAPI:
|
|
|
959
961
|
"""
|
|
960
962
|
|
|
961
963
|
headers = {'Accept': 'application/json', }
|
|
964
|
+
|
|
962
965
|
res = self._api.do('GET', f'/api/2.0/vector-search/endpoints/{endpoint_name}', headers=headers)
|
|
963
966
|
return EndpointInfo.from_dict(res)
|
|
964
967
|
|
|
@@ -1038,6 +1041,7 @@ class VectorSearchIndexesAPI:
|
|
|
1038
1041
|
if name is not None: body['name'] = name
|
|
1039
1042
|
if primary_key is not None: body['primary_key'] = primary_key
|
|
1040
1043
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1044
|
+
|
|
1041
1045
|
res = self._api.do('POST', '/api/2.0/vector-search/indexes', body=body, headers=headers)
|
|
1042
1046
|
return CreateVectorIndexResponse.from_dict(res)
|
|
1043
1047
|
|
|
@@ -1056,6 +1060,7 @@ class VectorSearchIndexesAPI:
|
|
|
1056
1060
|
body = {}
|
|
1057
1061
|
if primary_keys is not None: body['primary_keys'] = [v for v in primary_keys]
|
|
1058
1062
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1063
|
+
|
|
1059
1064
|
res = self._api.do('POST',
|
|
1060
1065
|
f'/api/2.0/vector-search/indexes/{name}/delete-data',
|
|
1061
1066
|
body=body,
|
|
@@ -1074,6 +1079,7 @@ class VectorSearchIndexesAPI:
|
|
|
1074
1079
|
"""
|
|
1075
1080
|
|
|
1076
1081
|
headers = {}
|
|
1082
|
+
|
|
1077
1083
|
self._api.do('DELETE', f'/api/2.0/vector-search/indexes/{index_name}', headers=headers)
|
|
1078
1084
|
|
|
1079
1085
|
def get_index(self, index_name: str) -> VectorIndex:
|
|
@@ -1088,6 +1094,7 @@ class VectorSearchIndexesAPI:
|
|
|
1088
1094
|
"""
|
|
1089
1095
|
|
|
1090
1096
|
headers = {'Accept': 'application/json', }
|
|
1097
|
+
|
|
1091
1098
|
res = self._api.do('GET', f'/api/2.0/vector-search/indexes/{index_name}', headers=headers)
|
|
1092
1099
|
return VectorIndex.from_dict(res)
|
|
1093
1100
|
|
|
@@ -1160,6 +1167,7 @@ class VectorSearchIndexesAPI:
|
|
|
1160
1167
|
if query_text is not None: body['query_text'] = query_text
|
|
1161
1168
|
if query_vector is not None: body['query_vector'] = [v for v in query_vector]
|
|
1162
1169
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1170
|
+
|
|
1163
1171
|
res = self._api.do('POST',
|
|
1164
1172
|
f'/api/2.0/vector-search/indexes/{index_name}/query',
|
|
1165
1173
|
body=body,
|
|
@@ -1178,6 +1186,7 @@ class VectorSearchIndexesAPI:
|
|
|
1178
1186
|
"""
|
|
1179
1187
|
|
|
1180
1188
|
headers = {}
|
|
1189
|
+
|
|
1181
1190
|
self._api.do('POST', f'/api/2.0/vector-search/indexes/{index_name}/sync', headers=headers)
|
|
1182
1191
|
|
|
1183
1192
|
def upsert_data_vector_index(self, name: str, inputs_json: str) -> UpsertDataVectorIndexResponse:
|
|
@@ -1195,6 +1204,7 @@ class VectorSearchIndexesAPI:
|
|
|
1195
1204
|
body = {}
|
|
1196
1205
|
if inputs_json is not None: body['inputs_json'] = inputs_json
|
|
1197
1206
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1207
|
+
|
|
1198
1208
|
res = self._api.do('POST',
|
|
1199
1209
|
f'/api/2.0/vector-search/indexes/{name}/upsert-data',
|
|
1200
1210
|
body=body,
|