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.

Files changed (41) hide show
  1. databricks/sdk/__init__.py +121 -104
  2. databricks/sdk/core.py +76 -16
  3. databricks/sdk/dbutils.py +18 -17
  4. databricks/sdk/mixins/compute.py +6 -6
  5. databricks/sdk/mixins/dbfs.py +6 -6
  6. databricks/sdk/oauth.py +28 -14
  7. databricks/sdk/service/{unitycatalog.py → catalog.py} +375 -1146
  8. databricks/sdk/service/{clusters.py → compute.py} +2176 -61
  9. databricks/sdk/service/{dbfs.py → files.py} +6 -6
  10. databricks/sdk/service/{scim.py → iam.py} +567 -27
  11. databricks/sdk/service/jobs.py +44 -34
  12. databricks/sdk/service/{mlflow.py → ml.py} +976 -1071
  13. databricks/sdk/service/oauth2.py +3 -3
  14. databricks/sdk/service/pipelines.py +46 -30
  15. databricks/sdk/service/{deployment.py → provisioning.py} +47 -29
  16. databricks/sdk/service/settings.py +849 -0
  17. databricks/sdk/service/sharing.py +1176 -0
  18. databricks/sdk/service/sql.py +15 -15
  19. databricks/sdk/service/workspace.py +917 -22
  20. databricks/sdk/version.py +1 -1
  21. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/METADATA +3 -1
  22. databricks_sdk-0.1.1.dist-info/RECORD +37 -0
  23. databricks/sdk/service/clusterpolicies.py +0 -399
  24. databricks/sdk/service/commands.py +0 -478
  25. databricks/sdk/service/gitcredentials.py +0 -202
  26. databricks/sdk/service/globalinitscripts.py +0 -262
  27. databricks/sdk/service/instancepools.py +0 -757
  28. databricks/sdk/service/ipaccesslists.py +0 -340
  29. databricks/sdk/service/libraries.py +0 -282
  30. databricks/sdk/service/permissions.py +0 -470
  31. databricks/sdk/service/repos.py +0 -250
  32. databricks/sdk/service/secrets.py +0 -472
  33. databricks/sdk/service/tokenmanagement.py +0 -182
  34. databricks/sdk/service/tokens.py +0 -137
  35. databricks/sdk/service/workspaceconf.py +0 -50
  36. databricks_sdk-0.0.7.dist-info/RECORD +0 -48
  37. /databricks/sdk/service/{endpoints.py → serving.py} +0 -0
  38. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/LICENSE +0 -0
  39. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/NOTICE +0 -0
  40. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/WHEEL +0 -0
  41. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/top_level.txt +0 -0
@@ -1,250 +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 _from_dict, _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 CreateRepo:
16
- url: str
17
- provider: str
18
- path: str = None
19
- sparse_checkout: 'SparseCheckout' = None
20
-
21
- def as_dict(self) -> dict:
22
- body = {}
23
- if self.path: body['path'] = self.path
24
- if self.provider: body['provider'] = self.provider
25
- if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout.as_dict()
26
- if self.url: body['url'] = self.url
27
- return body
28
-
29
- @classmethod
30
- def from_dict(cls, d: Dict[str, any]) -> 'CreateRepo':
31
- return cls(path=d.get('path', None),
32
- provider=d.get('provider', None),
33
- sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckout),
34
- url=d.get('url', None))
35
-
36
-
37
- @dataclass
38
- class Delete:
39
- """Delete a repo"""
40
-
41
- repo_id: int
42
-
43
-
44
- @dataclass
45
- class Get:
46
- """Get a repo"""
47
-
48
- repo_id: int
49
-
50
-
51
- @dataclass
52
- class ListRequest:
53
- """Get repos"""
54
-
55
- next_page_token: str = None
56
- path_prefix: str = None
57
-
58
-
59
- @dataclass
60
- class ListReposResponse:
61
- next_page_token: str = None
62
- repos: 'List[RepoInfo]' = None
63
-
64
- def as_dict(self) -> dict:
65
- body = {}
66
- if self.next_page_token: body['next_page_token'] = self.next_page_token
67
- if self.repos: body['repos'] = [v.as_dict() for v in self.repos]
68
- return body
69
-
70
- @classmethod
71
- def from_dict(cls, d: Dict[str, any]) -> 'ListReposResponse':
72
- return cls(next_page_token=d.get('next_page_token', None), repos=_repeated(d, 'repos', RepoInfo))
73
-
74
-
75
- @dataclass
76
- class RepoInfo:
77
- branch: str = None
78
- head_commit_id: str = None
79
- id: int = None
80
- path: str = None
81
- provider: str = None
82
- sparse_checkout: 'SparseCheckout' = None
83
- url: str = None
84
-
85
- def as_dict(self) -> dict:
86
- body = {}
87
- if self.branch: body['branch'] = self.branch
88
- if self.head_commit_id: body['head_commit_id'] = self.head_commit_id
89
- if self.id: body['id'] = self.id
90
- if self.path: body['path'] = self.path
91
- if self.provider: body['provider'] = self.provider
92
- if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout.as_dict()
93
- if self.url: body['url'] = self.url
94
- return body
95
-
96
- @classmethod
97
- def from_dict(cls, d: Dict[str, any]) -> 'RepoInfo':
98
- return cls(branch=d.get('branch', None),
99
- head_commit_id=d.get('head_commit_id', None),
100
- id=d.get('id', None),
101
- path=d.get('path', None),
102
- provider=d.get('provider', None),
103
- sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckout),
104
- url=d.get('url', None))
105
-
106
-
107
- @dataclass
108
- class SparseCheckout:
109
- patterns: 'List[str]' = None
110
-
111
- def as_dict(self) -> dict:
112
- body = {}
113
- if self.patterns: body['patterns'] = [v for v in self.patterns]
114
- return body
115
-
116
- @classmethod
117
- def from_dict(cls, d: Dict[str, any]) -> 'SparseCheckout':
118
- return cls(patterns=d.get('patterns', None))
119
-
120
-
121
- @dataclass
122
- class SparseCheckoutUpdate:
123
- patterns: 'List[str]' = None
124
-
125
- def as_dict(self) -> dict:
126
- body = {}
127
- if self.patterns: body['patterns'] = [v for v in self.patterns]
128
- return body
129
-
130
- @classmethod
131
- def from_dict(cls, d: Dict[str, any]) -> 'SparseCheckoutUpdate':
132
- return cls(patterns=d.get('patterns', None))
133
-
134
-
135
- @dataclass
136
- class UpdateRepo:
137
- repo_id: int
138
- branch: str = None
139
- sparse_checkout: 'SparseCheckoutUpdate' = None
140
- tag: str = None
141
-
142
- def as_dict(self) -> dict:
143
- body = {}
144
- if self.branch: body['branch'] = self.branch
145
- if self.repo_id: body['repo_id'] = self.repo_id
146
- if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout.as_dict()
147
- if self.tag: body['tag'] = self.tag
148
- return body
149
-
150
- @classmethod
151
- def from_dict(cls, d: Dict[str, any]) -> 'UpdateRepo':
152
- return cls(branch=d.get('branch', None),
153
- repo_id=d.get('repo_id', None),
154
- sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckoutUpdate),
155
- tag=d.get('tag', None))
156
-
157
-
158
- class ReposAPI:
159
- """The Repos API allows users to manage their git repos. Users can use the API to access all repos that they
160
- have manage permissions on.
161
-
162
- Databricks Repos is a visual Git client in Databricks. It supports common Git operations such a cloning a
163
- repository, committing and pushing, pulling, branch management, and visual comparison of diffs when
164
- committing.
165
-
166
- Within Repos you can develop code in notebooks or other files and follow data science and engineering code
167
- development best practices using Git for version control, collaboration, and CI/CD."""
168
-
169
- def __init__(self, api_client):
170
- self._api = api_client
171
-
172
- def create(self,
173
- url: str,
174
- provider: str,
175
- *,
176
- path: str = None,
177
- sparse_checkout: SparseCheckout = None,
178
- **kwargs) -> RepoInfo:
179
- """Create a repo.
180
-
181
- Creates a repo in the workspace and links it to the remote Git repo specified. Note that repos created
182
- programmatically must be linked to a remote Git repo, unlike repos created in the browser."""
183
- request = kwargs.get('request', None)
184
- if not request: # request is not given through keyed args
185
- request = CreateRepo(path=path, provider=provider, sparse_checkout=sparse_checkout, url=url)
186
- body = request.as_dict()
187
-
188
- json = self._api.do('POST', '/api/2.0/repos', body=body)
189
- return RepoInfo.from_dict(json)
190
-
191
- def delete(self, repo_id: int, **kwargs):
192
- """Delete a repo.
193
-
194
- Deletes the specified repo."""
195
- request = kwargs.get('request', None)
196
- if not request: # request is not given through keyed args
197
- request = Delete(repo_id=repo_id)
198
-
199
- self._api.do('DELETE', f'/api/2.0/repos/{request.repo_id}')
200
-
201
- def get(self, repo_id: int, **kwargs) -> RepoInfo:
202
- """Get a repo.
203
-
204
- Returns the repo with the given repo ID."""
205
- request = kwargs.get('request', None)
206
- if not request: # request is not given through keyed args
207
- request = Get(repo_id=repo_id)
208
-
209
- json = self._api.do('GET', f'/api/2.0/repos/{request.repo_id}')
210
- return RepoInfo.from_dict(json)
211
-
212
- def list(self, *, next_page_token: str = None, path_prefix: str = None, **kwargs) -> Iterator[RepoInfo]:
213
- """Get repos.
214
-
215
- Returns repos that the calling user has Manage permissions on. Results are paginated with each page
216
- containing twenty repos."""
217
- request = kwargs.get('request', None)
218
- if not request: # request is not given through keyed args
219
- request = ListRequest(next_page_token=next_page_token, path_prefix=path_prefix)
220
-
221
- query = {}
222
- if next_page_token: query['next_page_token'] = request.next_page_token
223
- if path_prefix: query['path_prefix'] = request.path_prefix
224
-
225
- while True:
226
- json = self._api.do('GET', '/api/2.0/repos', query=query)
227
- if 'repos' not in json or not json['repos']:
228
- return
229
- for v in json['repos']:
230
- yield RepoInfo.from_dict(v)
231
- if 'next_page_token' not in json or not json['next_page_token']:
232
- return
233
- query['next_page_token'] = json['next_page_token']
234
-
235
- def update(self,
236
- repo_id: int,
237
- *,
238
- branch: str = None,
239
- sparse_checkout: SparseCheckoutUpdate = None,
240
- tag: str = None,
241
- **kwargs):
242
- """Update a repo.
243
-
244
- Updates the repo to a different branch or tag, or updates the repo to the latest commit on the same
245
- branch."""
246
- request = kwargs.get('request', None)
247
- if not request: # request is not given through keyed args
248
- request = UpdateRepo(branch=branch, repo_id=repo_id, sparse_checkout=sparse_checkout, tag=tag)
249
- body = request.as_dict()
250
- self._api.do('PATCH', f'/api/2.0/repos/{request.repo_id}', body=body)