databricks-sdk 0.0.7__py3-none-any.whl → 0.1.1__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 +121 -104
- databricks/sdk/core.py +76 -16
- databricks/sdk/dbutils.py +18 -17
- databricks/sdk/mixins/compute.py +6 -6
- databricks/sdk/mixins/dbfs.py +6 -6
- databricks/sdk/oauth.py +28 -14
- databricks/sdk/service/{unitycatalog.py → catalog.py} +375 -1146
- databricks/sdk/service/{clusters.py → compute.py} +2176 -61
- databricks/sdk/service/{dbfs.py → files.py} +6 -6
- databricks/sdk/service/{scim.py → iam.py} +567 -27
- databricks/sdk/service/jobs.py +44 -34
- databricks/sdk/service/{mlflow.py → ml.py} +976 -1071
- databricks/sdk/service/oauth2.py +3 -3
- databricks/sdk/service/pipelines.py +46 -30
- databricks/sdk/service/{deployment.py → provisioning.py} +47 -29
- databricks/sdk/service/settings.py +849 -0
- databricks/sdk/service/sharing.py +1176 -0
- databricks/sdk/service/sql.py +15 -15
- databricks/sdk/service/workspace.py +917 -22
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/METADATA +3 -1
- databricks_sdk-0.1.1.dist-info/RECORD +37 -0
- databricks/sdk/service/clusterpolicies.py +0 -399
- databricks/sdk/service/commands.py +0 -478
- databricks/sdk/service/gitcredentials.py +0 -202
- databricks/sdk/service/globalinitscripts.py +0 -262
- databricks/sdk/service/instancepools.py +0 -757
- databricks/sdk/service/ipaccesslists.py +0 -340
- databricks/sdk/service/libraries.py +0 -282
- databricks/sdk/service/permissions.py +0 -470
- databricks/sdk/service/repos.py +0 -250
- databricks/sdk/service/secrets.py +0 -472
- databricks/sdk/service/tokenmanagement.py +0 -182
- databricks/sdk/service/tokens.py +0 -137
- databricks/sdk/service/workspaceconf.py +0 -50
- databricks_sdk-0.0.7.dist-info/RECORD +0 -48
- /databricks/sdk/service/{endpoints.py → serving.py} +0 -0
- {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/top_level.txt +0 -0
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from typing import Dict, Iterator, List
|
|
6
|
-
|
|
7
|
-
from ._internal import _repeated
|
|
8
|
-
|
|
9
|
-
_LOG = logging.getLogger('databricks.sdk')
|
|
10
|
-
|
|
11
|
-
# all definitions in this file are in alphabetical order
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@dataclass
|
|
15
|
-
class CreateResponse:
|
|
16
|
-
script_id: str = None
|
|
17
|
-
|
|
18
|
-
def as_dict(self) -> dict:
|
|
19
|
-
body = {}
|
|
20
|
-
if self.script_id: body['script_id'] = self.script_id
|
|
21
|
-
return body
|
|
22
|
-
|
|
23
|
-
@classmethod
|
|
24
|
-
def from_dict(cls, d: Dict[str, any]) -> 'CreateResponse':
|
|
25
|
-
return cls(script_id=d.get('script_id', None))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@dataclass
|
|
29
|
-
class Delete:
|
|
30
|
-
"""Delete init script"""
|
|
31
|
-
|
|
32
|
-
script_id: str
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@dataclass
|
|
36
|
-
class Get:
|
|
37
|
-
"""Get an init script"""
|
|
38
|
-
|
|
39
|
-
script_id: str
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@dataclass
|
|
43
|
-
class GlobalInitScriptCreateRequest:
|
|
44
|
-
name: str
|
|
45
|
-
script: str
|
|
46
|
-
enabled: bool = None
|
|
47
|
-
position: int = None
|
|
48
|
-
|
|
49
|
-
def as_dict(self) -> dict:
|
|
50
|
-
body = {}
|
|
51
|
-
if self.enabled: body['enabled'] = self.enabled
|
|
52
|
-
if self.name: body['name'] = self.name
|
|
53
|
-
if self.position: body['position'] = self.position
|
|
54
|
-
if self.script: body['script'] = self.script
|
|
55
|
-
return body
|
|
56
|
-
|
|
57
|
-
@classmethod
|
|
58
|
-
def from_dict(cls, d: Dict[str, any]) -> 'GlobalInitScriptCreateRequest':
|
|
59
|
-
return cls(enabled=d.get('enabled', None),
|
|
60
|
-
name=d.get('name', None),
|
|
61
|
-
position=d.get('position', None),
|
|
62
|
-
script=d.get('script', None))
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@dataclass
|
|
66
|
-
class GlobalInitScriptDetails:
|
|
67
|
-
created_at: int = None
|
|
68
|
-
created_by: str = None
|
|
69
|
-
enabled: bool = None
|
|
70
|
-
name: str = None
|
|
71
|
-
position: int = None
|
|
72
|
-
script_id: str = None
|
|
73
|
-
updated_at: int = None
|
|
74
|
-
updated_by: str = None
|
|
75
|
-
|
|
76
|
-
def as_dict(self) -> dict:
|
|
77
|
-
body = {}
|
|
78
|
-
if self.created_at: body['created_at'] = self.created_at
|
|
79
|
-
if self.created_by: body['created_by'] = self.created_by
|
|
80
|
-
if self.enabled: body['enabled'] = self.enabled
|
|
81
|
-
if self.name: body['name'] = self.name
|
|
82
|
-
if self.position: body['position'] = self.position
|
|
83
|
-
if self.script_id: body['script_id'] = self.script_id
|
|
84
|
-
if self.updated_at: body['updated_at'] = self.updated_at
|
|
85
|
-
if self.updated_by: body['updated_by'] = self.updated_by
|
|
86
|
-
return body
|
|
87
|
-
|
|
88
|
-
@classmethod
|
|
89
|
-
def from_dict(cls, d: Dict[str, any]) -> 'GlobalInitScriptDetails':
|
|
90
|
-
return cls(created_at=d.get('created_at', None),
|
|
91
|
-
created_by=d.get('created_by', None),
|
|
92
|
-
enabled=d.get('enabled', None),
|
|
93
|
-
name=d.get('name', None),
|
|
94
|
-
position=d.get('position', None),
|
|
95
|
-
script_id=d.get('script_id', None),
|
|
96
|
-
updated_at=d.get('updated_at', None),
|
|
97
|
-
updated_by=d.get('updated_by', None))
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@dataclass
|
|
101
|
-
class GlobalInitScriptDetailsWithContent:
|
|
102
|
-
created_at: int = None
|
|
103
|
-
created_by: str = None
|
|
104
|
-
enabled: bool = None
|
|
105
|
-
name: str = None
|
|
106
|
-
position: int = None
|
|
107
|
-
script: str = None
|
|
108
|
-
script_id: str = None
|
|
109
|
-
updated_at: int = None
|
|
110
|
-
updated_by: str = None
|
|
111
|
-
|
|
112
|
-
def as_dict(self) -> dict:
|
|
113
|
-
body = {}
|
|
114
|
-
if self.created_at: body['created_at'] = self.created_at
|
|
115
|
-
if self.created_by: body['created_by'] = self.created_by
|
|
116
|
-
if self.enabled: body['enabled'] = self.enabled
|
|
117
|
-
if self.name: body['name'] = self.name
|
|
118
|
-
if self.position: body['position'] = self.position
|
|
119
|
-
if self.script: body['script'] = self.script
|
|
120
|
-
if self.script_id: body['script_id'] = self.script_id
|
|
121
|
-
if self.updated_at: body['updated_at'] = self.updated_at
|
|
122
|
-
if self.updated_by: body['updated_by'] = self.updated_by
|
|
123
|
-
return body
|
|
124
|
-
|
|
125
|
-
@classmethod
|
|
126
|
-
def from_dict(cls, d: Dict[str, any]) -> 'GlobalInitScriptDetailsWithContent':
|
|
127
|
-
return cls(created_at=d.get('created_at', None),
|
|
128
|
-
created_by=d.get('created_by', None),
|
|
129
|
-
enabled=d.get('enabled', None),
|
|
130
|
-
name=d.get('name', None),
|
|
131
|
-
position=d.get('position', None),
|
|
132
|
-
script=d.get('script', None),
|
|
133
|
-
script_id=d.get('script_id', None),
|
|
134
|
-
updated_at=d.get('updated_at', None),
|
|
135
|
-
updated_by=d.get('updated_by', None))
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
@dataclass
|
|
139
|
-
class GlobalInitScriptUpdateRequest:
|
|
140
|
-
name: str
|
|
141
|
-
script: str
|
|
142
|
-
script_id: str
|
|
143
|
-
enabled: bool = None
|
|
144
|
-
position: int = None
|
|
145
|
-
|
|
146
|
-
def as_dict(self) -> dict:
|
|
147
|
-
body = {}
|
|
148
|
-
if self.enabled: body['enabled'] = self.enabled
|
|
149
|
-
if self.name: body['name'] = self.name
|
|
150
|
-
if self.position: body['position'] = self.position
|
|
151
|
-
if self.script: body['script'] = self.script
|
|
152
|
-
if self.script_id: body['script_id'] = self.script_id
|
|
153
|
-
return body
|
|
154
|
-
|
|
155
|
-
@classmethod
|
|
156
|
-
def from_dict(cls, d: Dict[str, any]) -> 'GlobalInitScriptUpdateRequest':
|
|
157
|
-
return cls(enabled=d.get('enabled', None),
|
|
158
|
-
name=d.get('name', None),
|
|
159
|
-
position=d.get('position', None),
|
|
160
|
-
script=d.get('script', None),
|
|
161
|
-
script_id=d.get('script_id', None))
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
@dataclass
|
|
165
|
-
class ListGlobalInitScriptsResponse:
|
|
166
|
-
scripts: 'List[GlobalInitScriptDetails]' = None
|
|
167
|
-
|
|
168
|
-
def as_dict(self) -> dict:
|
|
169
|
-
body = {}
|
|
170
|
-
if self.scripts: body['scripts'] = [v.as_dict() for v in self.scripts]
|
|
171
|
-
return body
|
|
172
|
-
|
|
173
|
-
@classmethod
|
|
174
|
-
def from_dict(cls, d: Dict[str, any]) -> 'ListGlobalInitScriptsResponse':
|
|
175
|
-
return cls(scripts=_repeated(d, 'scripts', GlobalInitScriptDetails))
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
class GlobalInitScriptsAPI:
|
|
179
|
-
"""The Global Init Scripts API enables Workspace administrators to configure global initialization scripts
|
|
180
|
-
for their workspace. These scripts run on every node in every cluster in the workspace.
|
|
181
|
-
|
|
182
|
-
**Important:** Existing clusters must be restarted to pick up any changes made to global init scripts.
|
|
183
|
-
Global init scripts are run in order. If the init script returns with a bad exit code, the Apache Spark
|
|
184
|
-
container fails to launch and init scripts with later position are skipped. If enough containers fail, the
|
|
185
|
-
entire cluster fails with a `GLOBAL_INIT_SCRIPT_FAILURE` error code."""
|
|
186
|
-
|
|
187
|
-
def __init__(self, api_client):
|
|
188
|
-
self._api = api_client
|
|
189
|
-
|
|
190
|
-
def create(self,
|
|
191
|
-
name: str,
|
|
192
|
-
script: str,
|
|
193
|
-
*,
|
|
194
|
-
enabled: bool = None,
|
|
195
|
-
position: int = None,
|
|
196
|
-
**kwargs) -> CreateResponse:
|
|
197
|
-
"""Create init script.
|
|
198
|
-
|
|
199
|
-
Creates a new global init script in this workspace."""
|
|
200
|
-
request = kwargs.get('request', None)
|
|
201
|
-
if not request: # request is not given through keyed args
|
|
202
|
-
request = GlobalInitScriptCreateRequest(enabled=enabled,
|
|
203
|
-
name=name,
|
|
204
|
-
position=position,
|
|
205
|
-
script=script)
|
|
206
|
-
body = request.as_dict()
|
|
207
|
-
|
|
208
|
-
json = self._api.do('POST', '/api/2.0/global-init-scripts', body=body)
|
|
209
|
-
return CreateResponse.from_dict(json)
|
|
210
|
-
|
|
211
|
-
def delete(self, script_id: str, **kwargs):
|
|
212
|
-
"""Delete init script.
|
|
213
|
-
|
|
214
|
-
Deletes a global init script."""
|
|
215
|
-
request = kwargs.get('request', None)
|
|
216
|
-
if not request: # request is not given through keyed args
|
|
217
|
-
request = Delete(script_id=script_id)
|
|
218
|
-
|
|
219
|
-
self._api.do('DELETE', f'/api/2.0/global-init-scripts/{request.script_id}')
|
|
220
|
-
|
|
221
|
-
def get(self, script_id: str, **kwargs) -> GlobalInitScriptDetailsWithContent:
|
|
222
|
-
"""Get an init script.
|
|
223
|
-
|
|
224
|
-
Gets all the details of a script, including its Base64-encoded contents."""
|
|
225
|
-
request = kwargs.get('request', None)
|
|
226
|
-
if not request: # request is not given through keyed args
|
|
227
|
-
request = Get(script_id=script_id)
|
|
228
|
-
|
|
229
|
-
json = self._api.do('GET', f'/api/2.0/global-init-scripts/{request.script_id}')
|
|
230
|
-
return GlobalInitScriptDetailsWithContent.from_dict(json)
|
|
231
|
-
|
|
232
|
-
def list(self) -> Iterator[GlobalInitScriptDetails]:
|
|
233
|
-
"""Get init scripts.
|
|
234
|
-
|
|
235
|
-
"Get a list of all global init scripts for this workspace. This returns all properties for each script
|
|
236
|
-
but **not** the script contents. To retrieve the contents of a script, use the [get a global init
|
|
237
|
-
script](#operation/get-script) operation."""
|
|
238
|
-
|
|
239
|
-
json = self._api.do('GET', '/api/2.0/global-init-scripts')
|
|
240
|
-
return [GlobalInitScriptDetails.from_dict(v) for v in json.get('scripts', [])]
|
|
241
|
-
|
|
242
|
-
def update(self,
|
|
243
|
-
name: str,
|
|
244
|
-
script: str,
|
|
245
|
-
script_id: str,
|
|
246
|
-
*,
|
|
247
|
-
enabled: bool = None,
|
|
248
|
-
position: int = None,
|
|
249
|
-
**kwargs):
|
|
250
|
-
"""Update init script.
|
|
251
|
-
|
|
252
|
-
Updates a global init script, specifying only the fields to change. All fields are optional.
|
|
253
|
-
Unspecified fields retain their current value."""
|
|
254
|
-
request = kwargs.get('request', None)
|
|
255
|
-
if not request: # request is not given through keyed args
|
|
256
|
-
request = GlobalInitScriptUpdateRequest(enabled=enabled,
|
|
257
|
-
name=name,
|
|
258
|
-
position=position,
|
|
259
|
-
script=script,
|
|
260
|
-
script_id=script_id)
|
|
261
|
-
body = request.as_dict()
|
|
262
|
-
self._api.do('PATCH', f'/api/2.0/global-init-scripts/{request.script_id}', body=body)
|