@databricks/sdk-uc-volumes 0.34.0 → 0.36.0
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.
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +80 -76
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +208 -255
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -7
- package/dist/v1/index.js +4 -7
- package/dist/v1/model.d.ts +185 -183
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +152 -192
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +21 -17
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +60 -69
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +18 -14
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +76 -103
- package/dist/v1/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/v1/index.d.ts.map +0 -1
- package/dist/v1/index.js.map +0 -1
package/dist/v1/client.js
CHANGED
|
@@ -1,258 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { resolveClientConfig } from "./transport.js";
|
|
2
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
3
|
+
import { name, version } from "../package.js";
|
|
4
|
+
import { marshalCreateVolumeRequestSchema, marshalUpdateVolumeRequestSchema, unmarshalDeleteVolumeResponseSchema, unmarshalListVolumesResponseSchema, unmarshalVolumeInfoSchema } from "./model.js";
|
|
5
|
+
import { VERSION } from "@databricks/sdk-auth";
|
|
6
|
+
import { createDefault } from "@databricks/sdk-core/clientinfo";
|
|
7
|
+
import { NoOpLogger } from "@databricks/sdk-core/logger";
|
|
8
|
+
|
|
9
|
+
//#region src/v1/client.ts
|
|
10
10
|
const PACKAGE_SEGMENT = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
key: "sdk-js-" + name.replace(/^@[^/]+\/sdk-/, ""),
|
|
12
|
+
value: version
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const pageReq = { ...req };
|
|
212
|
-
for (;;) {
|
|
213
|
-
const resp = await this.listVolumes(pageReq, options);
|
|
214
|
-
for (const item of resp.volumes ?? []) {
|
|
215
|
-
yield item;
|
|
216
|
-
}
|
|
217
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
pageReq.pageToken = resp.nextPageToken;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Updates the specified volume under the specified parent catalog and schema.
|
|
225
|
-
*
|
|
226
|
-
* The caller must be a metastore admin or an owner of the volume.
|
|
227
|
-
* For the latter case, the caller must also be the owner or have the **USE_CATALOG**
|
|
228
|
-
* privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
|
|
229
|
-
*
|
|
230
|
-
* Currently only the name, the owner or the comment of the volume could be updated.
|
|
231
|
-
*/
|
|
232
|
-
async updateVolume(req, options) {
|
|
233
|
-
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
234
|
-
const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ''}`;
|
|
235
|
-
const body = marshalRequest(req, marshalUpdateVolumeRequestSchema);
|
|
236
|
-
let resp;
|
|
237
|
-
const call = async (callSignal) => {
|
|
238
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
239
|
-
if (workspaceId !== undefined) {
|
|
240
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
241
|
-
}
|
|
242
|
-
headers.set('User-Agent', this.userAgent);
|
|
243
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
244
|
-
const respBody = await executeHttpCall({
|
|
245
|
-
request: httpReq,
|
|
246
|
-
httpClient,
|
|
247
|
-
logger: this.logger,
|
|
248
|
-
});
|
|
249
|
-
resp = parseResponse(respBody, unmarshalVolumeInfoSchema);
|
|
250
|
-
};
|
|
251
|
-
await executeCall(call, options);
|
|
252
|
-
if (resp === undefined) {
|
|
253
|
-
throw new Error('operation completed without a result.');
|
|
254
|
-
}
|
|
255
|
-
return resp;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
14
|
+
var VolumesClient = class {
|
|
15
|
+
options;
|
|
16
|
+
logger;
|
|
17
|
+
userAgent;
|
|
18
|
+
config;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
22
|
+
this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
|
|
23
|
+
key: "sdk-js-auth",
|
|
24
|
+
value: VERSION
|
|
25
|
+
}).with({
|
|
26
|
+
key: "auth",
|
|
27
|
+
value: options.credentials?.name() ?? "default"
|
|
28
|
+
}).toString();
|
|
29
|
+
}
|
|
30
|
+
resolveConfig() {
|
|
31
|
+
this.config ??= resolveClientConfig(this.options);
|
|
32
|
+
return this.config;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new volume.
|
|
36
|
+
*
|
|
37
|
+
* The user could create either an external volume or a managed volume. An external volume
|
|
38
|
+
* will be created in the specified external location, while a managed volume
|
|
39
|
+
* will be located in the default location which is specified by the parent schema,
|
|
40
|
+
* or the parent catalog, or the Metastore.
|
|
41
|
+
*
|
|
42
|
+
* For the volume creation to succeed, the user must satisfy following conditions:
|
|
43
|
+
* - The caller must be a metastore admin, or be the owner of the parent catalog and schema,
|
|
44
|
+
* or have the **USE_CATALOG** privilege on the parent catalog
|
|
45
|
+
* and the **USE_SCHEMA** privilege on the parent schema.
|
|
46
|
+
* - The caller must have **CREATE VOLUME** privilege on the parent schema.
|
|
47
|
+
*
|
|
48
|
+
* For an external volume, following conditions also need to satisfy
|
|
49
|
+
* - The caller must have **CREATE EXTERNAL VOLUME** privilege on the external location.
|
|
50
|
+
* - There are no other tables, nor volumes existing in the specified storage location.
|
|
51
|
+
* - The specified storage location is not under the location of other tables, nor volumes,
|
|
52
|
+
* or catalogs or schemas.
|
|
53
|
+
*/
|
|
54
|
+
async createVolume(req, options) {
|
|
55
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
56
|
+
const url = `${host}/api/2.1/unity-catalog/volumes`;
|
|
57
|
+
const body = marshalRequest(req, marshalCreateVolumeRequestSchema);
|
|
58
|
+
let resp;
|
|
59
|
+
const call = async (callSignal) => {
|
|
60
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
61
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
62
|
+
headers.set("User-Agent", this.userAgent);
|
|
63
|
+
resp = parseResponse(await executeHttpCall({
|
|
64
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
65
|
+
httpClient,
|
|
66
|
+
logger: this.logger
|
|
67
|
+
}), unmarshalVolumeInfoSchema);
|
|
68
|
+
};
|
|
69
|
+
await executeCall(call, options);
|
|
70
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
71
|
+
return resp;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Deletes a volume from the specified parent catalog and schema.
|
|
75
|
+
*
|
|
76
|
+
* The caller must be a metastore admin or an owner of the volume.
|
|
77
|
+
* For the latter case, the caller must also be the owner or have the **USE_CATALOG**
|
|
78
|
+
* privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
|
|
79
|
+
*/
|
|
80
|
+
async deleteVolume(req, options) {
|
|
81
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
82
|
+
const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ""}`;
|
|
83
|
+
let resp;
|
|
84
|
+
const call = async (callSignal) => {
|
|
85
|
+
const headers = new Headers();
|
|
86
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
87
|
+
headers.set("User-Agent", this.userAgent);
|
|
88
|
+
resp = parseResponse(await executeHttpCall({
|
|
89
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
90
|
+
httpClient,
|
|
91
|
+
logger: this.logger
|
|
92
|
+
}), unmarshalDeleteVolumeResponseSchema);
|
|
93
|
+
};
|
|
94
|
+
await executeCall(call, options);
|
|
95
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
96
|
+
return resp;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Gets a volume from the metastore for a specific catalog and schema.
|
|
100
|
+
*
|
|
101
|
+
* The caller must be a metastore admin or an owner of (or have the **READ VOLUME**
|
|
102
|
+
* privilege on) the volume.
|
|
103
|
+
* For the latter case, the caller must also be the owner or have the **USE_CATALOG**
|
|
104
|
+
* privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
|
|
105
|
+
*/
|
|
106
|
+
async getVolume(req, options) {
|
|
107
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
108
|
+
const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ""}`;
|
|
109
|
+
const params = new URLSearchParams();
|
|
110
|
+
if (req.includeBrowse !== void 0) params.append("include_browse", String(req.includeBrowse));
|
|
111
|
+
const query = params.toString();
|
|
112
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
113
|
+
let resp;
|
|
114
|
+
const call = async (callSignal) => {
|
|
115
|
+
const headers = new Headers();
|
|
116
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
117
|
+
headers.set("User-Agent", this.userAgent);
|
|
118
|
+
resp = parseResponse(await executeHttpCall({
|
|
119
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
120
|
+
httpClient,
|
|
121
|
+
logger: this.logger
|
|
122
|
+
}), unmarshalVolumeInfoSchema);
|
|
123
|
+
};
|
|
124
|
+
await executeCall(call, options);
|
|
125
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
126
|
+
return resp;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Gets an array of volumes for the current metastore
|
|
130
|
+
* under the parent catalog and schema.
|
|
131
|
+
*
|
|
132
|
+
* The returned volumes are filtered based on the privileges of the calling user.
|
|
133
|
+
* For example, the metastore admin is able to list all the volumes.
|
|
134
|
+
* A regular user needs to be the owner or have the **READ VOLUME** privilege
|
|
135
|
+
* on the volume to receive the volumes in the response.
|
|
136
|
+
* For the latter case, the caller must also be the owner or have the **USE_CATALOG**
|
|
137
|
+
* privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
|
|
138
|
+
*
|
|
139
|
+
* There is no guarantee of a specific ordering of the elements in the array.
|
|
140
|
+
*
|
|
141
|
+
* PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero results while still providing a next_page_token.
|
|
142
|
+
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
143
|
+
*/
|
|
144
|
+
async listVolumes(req, options) {
|
|
145
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
146
|
+
const url = `${host}/api/2.1/unity-catalog/volumes`;
|
|
147
|
+
const params = new URLSearchParams();
|
|
148
|
+
if (req.catalogName !== void 0) params.append("catalog_name", req.catalogName);
|
|
149
|
+
if (req.schemaName !== void 0) params.append("schema_name", req.schemaName);
|
|
150
|
+
if (req.includeBrowse !== void 0) params.append("include_browse", String(req.includeBrowse));
|
|
151
|
+
if (req.maxResults !== void 0) params.append("max_results", String(req.maxResults));
|
|
152
|
+
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
153
|
+
const query = params.toString();
|
|
154
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
155
|
+
let resp;
|
|
156
|
+
const call = async (callSignal) => {
|
|
157
|
+
const headers = new Headers();
|
|
158
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
159
|
+
headers.set("User-Agent", this.userAgent);
|
|
160
|
+
resp = parseResponse(await executeHttpCall({
|
|
161
|
+
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
162
|
+
httpClient,
|
|
163
|
+
logger: this.logger
|
|
164
|
+
}), unmarshalListVolumesResponseSchema);
|
|
165
|
+
};
|
|
166
|
+
await executeCall(call, options);
|
|
167
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
168
|
+
return resp;
|
|
169
|
+
}
|
|
170
|
+
async *listVolumesIter(req, options) {
|
|
171
|
+
const pageReq = { ...req };
|
|
172
|
+
for (;;) {
|
|
173
|
+
const resp = await this.listVolumes(pageReq, options);
|
|
174
|
+
for (const item of resp.volumes ?? []) yield item;
|
|
175
|
+
if (resp.nextPageToken === void 0 || resp.nextPageToken === "") return;
|
|
176
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Updates the specified volume under the specified parent catalog and schema.
|
|
181
|
+
*
|
|
182
|
+
* The caller must be a metastore admin or an owner of the volume.
|
|
183
|
+
* For the latter case, the caller must also be the owner or have the **USE_CATALOG**
|
|
184
|
+
* privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
|
|
185
|
+
*
|
|
186
|
+
* Currently only the name, the owner or the comment of the volume could be updated.
|
|
187
|
+
*/
|
|
188
|
+
async updateVolume(req, options) {
|
|
189
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
190
|
+
const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ""}`;
|
|
191
|
+
const body = marshalRequest(req, marshalUpdateVolumeRequestSchema);
|
|
192
|
+
let resp;
|
|
193
|
+
const call = async (callSignal) => {
|
|
194
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
195
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
196
|
+
headers.set("User-Agent", this.userAgent);
|
|
197
|
+
resp = parseResponse(await executeHttpCall({
|
|
198
|
+
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
199
|
+
httpClient,
|
|
200
|
+
logger: this.logger
|
|
201
|
+
}), unmarshalVolumeInfoSchema);
|
|
202
|
+
};
|
|
203
|
+
await executeCall(call, options);
|
|
204
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
205
|
+
return resp;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
//#endregion
|
|
210
|
+
export { VolumesClient };
|
|
258
211
|
//# sourceMappingURL=client.js.map
|
package/dist/v1/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,OAAO,MAAM,oBAAoB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAW7D,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,mCAAmC,EACnC,kCAAkC,EAClC,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAEjB,gFAAgF;AAChF,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAC1D,KAAK,EAAE,OAAO,CAAC,OAAO;CACvB,CAAC;AAEF,MAAM,OAAO,aAAa;IACP,OAAO,CAAgB;IACvB,MAAM,CAAS;IAChC,8DAA8D;IAC9D,qEAAqE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,cAAc,EAAE,kBAAkB,EAAC,CAAC,CAAC;YAClE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;YAC1E,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC;gBACrC,OAAO,EAAE,OAAO;gBAChB,UAAU;gBACV,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAC;QAC5D,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n CreateVolumeRequest,\n DeleteVolumeRequest,\n DeleteVolumeResponse,\n GetVolumeRequest,\n ListVolumesRequest,\n ListVolumesResponse,\n UpdateVolumeRequest,\n VolumeInfo,\n} from './model';\nimport {\n marshalCreateVolumeRequestSchema,\n marshalUpdateVolumeRequestSchema,\n unmarshalDeleteVolumeResponseSchema,\n unmarshalListVolumesResponseSchema,\n unmarshalVolumeInfoSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class VolumesClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /**\n * Creates a new volume.\n *\n * The user could create either an external volume or a managed volume. An external volume\n * will be created in the specified external location, while a managed volume\n * will be located in the default location which is specified by the parent schema,\n * or the parent catalog, or the Metastore.\n *\n * For the volume creation to succeed, the user must satisfy following conditions:\n * - The caller must be a metastore admin, or be the owner of the parent catalog and schema,\n * or have the **USE_CATALOG** privilege on the parent catalog\n * and the **USE_SCHEMA** privilege on the parent schema.\n * - The caller must have **CREATE VOLUME** privilege on the parent schema.\n *\n * For an external volume, following conditions also need to satisfy\n * - The caller must have **CREATE EXTERNAL VOLUME** privilege on the external location.\n * - There are no other tables, nor volumes existing in the specified storage location.\n * - The specified storage location is not under the location of other tables, nor volumes,\n * or catalogs or schemas.\n */\n async createVolume(\n req: CreateVolumeRequest,\n options?: CallOptions\n ): Promise<VolumeInfo> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/volumes`;\n const body = marshalRequest(req, marshalCreateVolumeRequestSchema);\n let resp: VolumeInfo | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalVolumeInfoSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Deletes a volume from the specified parent catalog and schema.\n *\n * The caller must be a metastore admin or an owner of the volume.\n * For the latter case, the caller must also be the owner or have the **USE_CATALOG**\n * privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.\n */\n async deleteVolume(\n req: DeleteVolumeRequest,\n options?: CallOptions\n ): Promise<DeleteVolumeResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ''}`;\n let resp: DeleteVolumeResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDeleteVolumeResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets a volume from the metastore for a specific catalog and schema.\n *\n * The caller must be a metastore admin or an owner of (or have the **READ VOLUME**\n * privilege on) the volume.\n * For the latter case, the caller must also be the owner or have the **USE_CATALOG**\n * privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.\n */\n async getVolume(\n req: GetVolumeRequest,\n options?: CallOptions\n ): Promise<VolumeInfo> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ''}`;\n const params = new URLSearchParams();\n if (req.includeBrowse !== undefined) {\n params.append('include_browse', String(req.includeBrowse));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: VolumeInfo | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalVolumeInfoSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets an array of volumes for the current metastore\n * under the parent catalog and schema.\n *\n * The returned volumes are filtered based on the privileges of the calling user.\n * For example, the metastore admin is able to list all the volumes.\n * A regular user needs to be the owner or have the **READ VOLUME** privilege\n * on the volume to receive the volumes in the response.\n * For the latter case, the caller must also be the owner or have the **USE_CATALOG**\n * privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.\n *\n * There is no guarantee of a specific ordering of the elements in the array.\n *\n * PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async listVolumes(\n req: ListVolumesRequest,\n options?: CallOptions\n ): Promise<ListVolumesResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/volumes`;\n const params = new URLSearchParams();\n if (req.catalogName !== undefined) {\n params.append('catalog_name', req.catalogName);\n }\n if (req.schemaName !== undefined) {\n params.append('schema_name', req.schemaName);\n }\n if (req.includeBrowse !== undefined) {\n params.append('include_browse', String(req.includeBrowse));\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListVolumesResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalListVolumesResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listVolumesIter(\n req: ListVolumesRequest,\n options?: CallOptions\n ): AsyncGenerator<VolumeInfo> {\n const pageReq: ListVolumesRequest = {...req};\n for (;;) {\n const resp = await this.listVolumes(pageReq, options);\n for (const item of resp.volumes ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Updates the specified volume under the specified parent catalog and schema.\n *\n * The caller must be a metastore admin or an owner of the volume.\n * For the latter case, the caller must also be the owner or have the **USE_CATALOG**\n * privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.\n *\n * Currently only the name, the owner or the comment of the volume could be updated.\n */\n async updateVolume(\n req: UpdateVolumeRequest,\n options?: CallOptions\n ): Promise<VolumeInfo> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/volumes/${req.fullNameArg ?? ''}`;\n const body = marshalRequest(req, marshalUpdateVolumeRequestSchema);\n let resp: VolumeInfo | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalVolumeInfoSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AAqCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,gBAAb,MAA2B;CACzB,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ,aAAa,MAAM,IAAI;GAAU,CAAC,CACjD,UAAU;;CAGlC,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,QAAQ;AACjD,SAAO,KAAK;;;;;;;;;;;;;;;;;;;;;;CAuBd,MAAM,aACJ,KACA,SACqB;EACrB,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,M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|
4
|
-
export { VolumesClient } from './client';
|
|
5
|
-
export { SseEncryptionAlgorithm, VolumeType } from './model';
|
|
6
|
-
export type { CreateVolumeRequest, DeleteVolumeRequest, DeleteVolumeResponse, EncryptionDetails, GetVolumeRequest, ListVolumesRequest, ListVolumesResponse, SseEncryptionDetails, UpdateVolumeRequest, VolumeInfo, } from './model';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { CreateVolumeRequest, DeleteVolumeRequest, DeleteVolumeResponse, EncryptionDetails, GetVolumeRequest, ListVolumesRequest, ListVolumesResponse, SseEncryptionAlgorithm, SseEncryptionDetails, UpdateVolumeRequest, VolumeInfo, VolumeType } from "./model.js";
|
|
2
|
+
import { VolumesClient } from "./client.js";
|
|
3
|
+
export { type CreateVolumeRequest, type DeleteVolumeRequest, type DeleteVolumeResponse, type EncryptionDetails, type GetVolumeRequest, type ListVolumesRequest, type ListVolumesResponse, SseEncryptionAlgorithm, type SseEncryptionDetails, type UpdateVolumeRequest, type VolumeInfo, VolumeType, VolumesClient };
|
package/dist/v1/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { VolumesClient } from './client';
|
|
6
|
-
export { SseEncryptionAlgorithm, VolumeType } from './model';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { SseEncryptionAlgorithm, VolumeType } from "./model.js";
|
|
2
|
+
import { VolumesClient } from "./client.js";
|
|
3
|
+
|
|
4
|
+
export { SseEncryptionAlgorithm, VolumeType, VolumesClient };
|