@databricks/sdk-uc-externallocations 0.1.0-dev.3 → 0.1.0-dev.5
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/README.md +28 -0
- package/dist/v1/client.d.ts +3 -3
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +36 -33
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/model.d.ts +12 -10
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +17 -17
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +30 -2
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +33 -16
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +2 -1
- package/dist/v1/utils.js.map +1 -1
- package/package.json +9 -5
- package/src/v1/client.ts +0 -286
- package/src/v1/index.ts +0 -22
- package/src/v1/model.ts +0 -684
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/dist/v1/utils.js
CHANGED
|
@@ -79,7 +79,8 @@ export function buildHttpRequest(method, url, headers, signal, body) {
|
|
|
79
79
|
}
|
|
80
80
|
export function parseResponse(body, schema) {
|
|
81
81
|
const text = new TextDecoder().decode(body);
|
|
82
|
-
|
|
82
|
+
// 204 responses return an empty body; treat as `{}`.
|
|
83
|
+
const parsed = text === '' ? {} : jsonBigint.parse(text);
|
|
83
84
|
return schema.parse(parsed);
|
|
84
85
|
}
|
|
85
86
|
export function marshalRequest(data, schema) {
|
package/dist/v1/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAQvD,OAAO,OAAO,MA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AK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-uc-externallocations",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
-
"src",
|
|
16
15
|
"LICENSE"
|
|
17
16
|
],
|
|
18
17
|
"scripts": {
|
|
@@ -28,10 +27,15 @@
|
|
|
28
27
|
},
|
|
29
28
|
"author": "Databricks",
|
|
30
29
|
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/databricks/sdk-js.git",
|
|
33
|
+
"directory": "packages/uc/externallocations"
|
|
34
|
+
},
|
|
31
35
|
"dependencies": {
|
|
32
|
-
"@databricks/sdk-auth": ">=0.1.0-dev.
|
|
33
|
-
"@databricks/sdk-core": ">=0.1.0-dev.
|
|
34
|
-
"@databricks/sdk-options": ">=0.1.0-dev.
|
|
36
|
+
"@databricks/sdk-auth": ">=0.1.0-dev.6 <1.0.0",
|
|
37
|
+
"@databricks/sdk-core": ">=0.1.0-dev.7 <1.0.0",
|
|
38
|
+
"@databricks/sdk-options": ">=0.1.0-dev.6 <1.0.0",
|
|
35
39
|
"@js-temporal/polyfill": "^0.5.0",
|
|
36
40
|
"json-bigint": "^1.0.0",
|
|
37
41
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
|
|
4
|
-
import {createDefault} from '@databricks/sdk-core/clientinfo';
|
|
5
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
6
|
-
import {NoOpLogger} from '@databricks/sdk-core/logger';
|
|
7
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
8
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
9
|
-
import type {HttpClient} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newHttpClient} from './transport';
|
|
11
|
-
import {
|
|
12
|
-
buildHttpRequest,
|
|
13
|
-
executeCall,
|
|
14
|
-
executeHttpCall,
|
|
15
|
-
marshalRequest,
|
|
16
|
-
parseResponse,
|
|
17
|
-
} from './utils';
|
|
18
|
-
import pkgJson from '../../package.json' with {type: 'json'};
|
|
19
|
-
import type {
|
|
20
|
-
CreateExternalLocationRequest,
|
|
21
|
-
DeleteExternalLocationRequest,
|
|
22
|
-
DeleteExternalLocationResponse,
|
|
23
|
-
ExternalLocationInfo,
|
|
24
|
-
GetExternalLocationRequest,
|
|
25
|
-
ListExternalLocationsRequest,
|
|
26
|
-
ListExternalLocationsResponse,
|
|
27
|
-
UpdateExternalLocationRequest,
|
|
28
|
-
} from './model';
|
|
29
|
-
import {
|
|
30
|
-
marshalCreateExternalLocationRequestSchema,
|
|
31
|
-
marshalUpdateExternalLocationRequestSchema,
|
|
32
|
-
unmarshalDeleteExternalLocationResponseSchema,
|
|
33
|
-
unmarshalExternalLocationInfoSchema,
|
|
34
|
-
unmarshalListExternalLocationsResponseSchema,
|
|
35
|
-
} from './model';
|
|
36
|
-
|
|
37
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
38
|
-
const PACKAGE_SEGMENT = {
|
|
39
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
40
|
-
value: pkgJson.version,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export class ExternalLocationsClient {
|
|
44
|
-
private readonly host: string;
|
|
45
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
46
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
47
|
-
// request.
|
|
48
|
-
private readonly workspaceId: string | undefined;
|
|
49
|
-
private readonly httpClient: HttpClient;
|
|
50
|
-
private readonly logger: Logger;
|
|
51
|
-
// User-Agent header value. Composed once at construction from
|
|
52
|
-
// createDefault() merged with this package's identity and the active
|
|
53
|
-
// credential's name.
|
|
54
|
-
private readonly userAgent: string;
|
|
55
|
-
|
|
56
|
-
constructor(options: ClientOptions) {
|
|
57
|
-
if (options.host === undefined) {
|
|
58
|
-
throw new Error('Host is required.');
|
|
59
|
-
}
|
|
60
|
-
this.host = options.host.replace(/\/$/, '');
|
|
61
|
-
this.workspaceId = options.workspaceId;
|
|
62
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
63
|
-
const info = createDefault()
|
|
64
|
-
.with(PACKAGE_SEGMENT)
|
|
65
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
66
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
67
|
-
this.userAgent = info.toString();
|
|
68
|
-
this.httpClient = newHttpClient(options);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Creates a new external location entry in the metastore.
|
|
73
|
-
* The caller must be a metastore admin or have the **CREATE_EXTERNAL_LOCATION** privilege on both the metastore and the associated storage credential.
|
|
74
|
-
*/
|
|
75
|
-
async createExternalLocation(
|
|
76
|
-
req: CreateExternalLocationRequest,
|
|
77
|
-
options?: CallOptions
|
|
78
|
-
): Promise<ExternalLocationInfo> {
|
|
79
|
-
const url = `${this.host}/api/2.1/unity-catalog/external-locations`;
|
|
80
|
-
const body = marshalRequest(
|
|
81
|
-
req,
|
|
82
|
-
marshalCreateExternalLocationRequestSchema
|
|
83
|
-
);
|
|
84
|
-
let resp: ExternalLocationInfo | undefined;
|
|
85
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
86
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
87
|
-
if (this.workspaceId !== undefined) {
|
|
88
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
89
|
-
}
|
|
90
|
-
headers.set('User-Agent', this.userAgent);
|
|
91
|
-
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
92
|
-
const respBody = await executeHttpCall({
|
|
93
|
-
request: httpReq,
|
|
94
|
-
httpClient: this.httpClient,
|
|
95
|
-
logger: this.logger,
|
|
96
|
-
});
|
|
97
|
-
resp = parseResponse(respBody, unmarshalExternalLocationInfoSchema);
|
|
98
|
-
};
|
|
99
|
-
await executeCall(call, options);
|
|
100
|
-
if (resp === undefined) {
|
|
101
|
-
throw new Error('operation completed without a result.');
|
|
102
|
-
}
|
|
103
|
-
return resp;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** Deletes the specified external location from the metastore. The caller must be the owner of the external location. */
|
|
107
|
-
async deleteExternalLocation(
|
|
108
|
-
req: DeleteExternalLocationRequest,
|
|
109
|
-
options?: CallOptions
|
|
110
|
-
): Promise<DeleteExternalLocationResponse> {
|
|
111
|
-
const url = `${this.host}/api/2.1/unity-catalog/external-locations/${req.nameArg ?? ''}`;
|
|
112
|
-
const params = new URLSearchParams();
|
|
113
|
-
if (req.force !== undefined) {
|
|
114
|
-
params.append('force', String(req.force));
|
|
115
|
-
}
|
|
116
|
-
const query = params.toString();
|
|
117
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
118
|
-
let resp: DeleteExternalLocationResponse | undefined;
|
|
119
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
120
|
-
const headers = new Headers();
|
|
121
|
-
if (this.workspaceId !== undefined) {
|
|
122
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
123
|
-
}
|
|
124
|
-
headers.set('User-Agent', this.userAgent);
|
|
125
|
-
const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);
|
|
126
|
-
const respBody = await executeHttpCall({
|
|
127
|
-
request: httpReq,
|
|
128
|
-
httpClient: this.httpClient,
|
|
129
|
-
logger: this.logger,
|
|
130
|
-
});
|
|
131
|
-
resp = parseResponse(
|
|
132
|
-
respBody,
|
|
133
|
-
unmarshalDeleteExternalLocationResponseSchema
|
|
134
|
-
);
|
|
135
|
-
};
|
|
136
|
-
await executeCall(call, options);
|
|
137
|
-
if (resp === undefined) {
|
|
138
|
-
throw new Error('operation completed without a result.');
|
|
139
|
-
}
|
|
140
|
-
return resp;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Gets an external location from the metastore.
|
|
145
|
-
* The caller must be either a metastore admin, the owner of the external location, or a user that has some privilege on the external location.
|
|
146
|
-
*/
|
|
147
|
-
async getExternalLocation(
|
|
148
|
-
req: GetExternalLocationRequest,
|
|
149
|
-
options?: CallOptions
|
|
150
|
-
): Promise<ExternalLocationInfo> {
|
|
151
|
-
const url = `${this.host}/api/2.1/unity-catalog/external-locations/${req.nameArg ?? ''}`;
|
|
152
|
-
const params = new URLSearchParams();
|
|
153
|
-
if (req.includeBrowse !== undefined) {
|
|
154
|
-
params.append('include_browse', String(req.includeBrowse));
|
|
155
|
-
}
|
|
156
|
-
const query = params.toString();
|
|
157
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
158
|
-
let resp: ExternalLocationInfo | undefined;
|
|
159
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
160
|
-
const headers = new Headers();
|
|
161
|
-
if (this.workspaceId !== undefined) {
|
|
162
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
163
|
-
}
|
|
164
|
-
headers.set('User-Agent', this.userAgent);
|
|
165
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
166
|
-
const respBody = await executeHttpCall({
|
|
167
|
-
request: httpReq,
|
|
168
|
-
httpClient: this.httpClient,
|
|
169
|
-
logger: this.logger,
|
|
170
|
-
});
|
|
171
|
-
resp = parseResponse(respBody, unmarshalExternalLocationInfoSchema);
|
|
172
|
-
};
|
|
173
|
-
await executeCall(call, options);
|
|
174
|
-
if (resp === undefined) {
|
|
175
|
-
throw new Error('operation completed without a result.');
|
|
176
|
-
}
|
|
177
|
-
return resp;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Gets an array of external locations (__ExternalLocationInfo__ objects) from the metastore.
|
|
182
|
-
* The caller must be a metastore admin, the owner of the external location, or a user that has some privilege on the external location.
|
|
183
|
-
* There is no guarantee of a specific ordering of the elements in the array.
|
|
184
|
-
*
|
|
185
|
-
* NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
|
|
186
|
-
*
|
|
187
|
-
* PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
|
|
188
|
-
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
189
|
-
*/
|
|
190
|
-
async listExternalLocations(
|
|
191
|
-
req: ListExternalLocationsRequest,
|
|
192
|
-
options?: CallOptions
|
|
193
|
-
): Promise<ListExternalLocationsResponse> {
|
|
194
|
-
const url = `${this.host}/api/2.1/unity-catalog/external-locations`;
|
|
195
|
-
const params = new URLSearchParams();
|
|
196
|
-
if (req.includeBrowse !== undefined) {
|
|
197
|
-
params.append('include_browse', String(req.includeBrowse));
|
|
198
|
-
}
|
|
199
|
-
if (req.maxResults !== undefined) {
|
|
200
|
-
params.append('max_results', String(req.maxResults));
|
|
201
|
-
}
|
|
202
|
-
if (req.pageToken !== undefined) {
|
|
203
|
-
params.append('page_token', req.pageToken);
|
|
204
|
-
}
|
|
205
|
-
if (req.includeUnbound !== undefined) {
|
|
206
|
-
params.append('include_unbound', String(req.includeUnbound));
|
|
207
|
-
}
|
|
208
|
-
const query = params.toString();
|
|
209
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
210
|
-
let resp: ListExternalLocationsResponse | undefined;
|
|
211
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
212
|
-
const headers = new Headers();
|
|
213
|
-
if (this.workspaceId !== undefined) {
|
|
214
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
215
|
-
}
|
|
216
|
-
headers.set('User-Agent', this.userAgent);
|
|
217
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
218
|
-
const respBody = await executeHttpCall({
|
|
219
|
-
request: httpReq,
|
|
220
|
-
httpClient: this.httpClient,
|
|
221
|
-
logger: this.logger,
|
|
222
|
-
});
|
|
223
|
-
resp = parseResponse(
|
|
224
|
-
respBody,
|
|
225
|
-
unmarshalListExternalLocationsResponseSchema
|
|
226
|
-
);
|
|
227
|
-
};
|
|
228
|
-
await executeCall(call, options);
|
|
229
|
-
if (resp === undefined) {
|
|
230
|
-
throw new Error('operation completed without a result.');
|
|
231
|
-
}
|
|
232
|
-
return resp;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
async *listExternalLocationsIter(
|
|
236
|
-
req: ListExternalLocationsRequest,
|
|
237
|
-
options?: CallOptions
|
|
238
|
-
): AsyncGenerator<ExternalLocationInfo> {
|
|
239
|
-
const pageReq: ListExternalLocationsRequest = {...req};
|
|
240
|
-
for (;;) {
|
|
241
|
-
const resp = await this.listExternalLocations(pageReq, options);
|
|
242
|
-
for (const item of resp.externalLocations ?? []) {
|
|
243
|
-
yield item;
|
|
244
|
-
}
|
|
245
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
pageReq.pageToken = resp.nextPageToken;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Updates an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin.
|
|
254
|
-
* In the second case, the admin can only update the name of the external location.
|
|
255
|
-
*/
|
|
256
|
-
async updateExternalLocation(
|
|
257
|
-
req: UpdateExternalLocationRequest,
|
|
258
|
-
options?: CallOptions
|
|
259
|
-
): Promise<ExternalLocationInfo> {
|
|
260
|
-
const url = `${this.host}/api/2.1/unity-catalog/external-locations/${req.nameArg ?? ''}`;
|
|
261
|
-
const body = marshalRequest(
|
|
262
|
-
req,
|
|
263
|
-
marshalUpdateExternalLocationRequestSchema
|
|
264
|
-
);
|
|
265
|
-
let resp: ExternalLocationInfo | undefined;
|
|
266
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
267
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
268
|
-
if (this.workspaceId !== undefined) {
|
|
269
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
270
|
-
}
|
|
271
|
-
headers.set('User-Agent', this.userAgent);
|
|
272
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
273
|
-
const respBody = await executeHttpCall({
|
|
274
|
-
request: httpReq,
|
|
275
|
-
httpClient: this.httpClient,
|
|
276
|
-
logger: this.logger,
|
|
277
|
-
});
|
|
278
|
-
resp = parseResponse(respBody, unmarshalExternalLocationInfoSchema);
|
|
279
|
-
};
|
|
280
|
-
await executeCall(call, options);
|
|
281
|
-
if (resp === undefined) {
|
|
282
|
-
throw new Error('operation completed without a result.');
|
|
283
|
-
}
|
|
284
|
-
return resp;
|
|
285
|
-
}
|
|
286
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {ExternalLocationsClient} from './client';
|
|
4
|
-
|
|
5
|
-
export {IsolationMode, SseEncryptionAlgorithm} from './model';
|
|
6
|
-
|
|
7
|
-
export type {
|
|
8
|
-
AwsSqsQueue,
|
|
9
|
-
AzureQueueStorage,
|
|
10
|
-
CreateExternalLocationRequest,
|
|
11
|
-
DeleteExternalLocationRequest,
|
|
12
|
-
DeleteExternalLocationResponse,
|
|
13
|
-
EncryptionDetails,
|
|
14
|
-
ExternalLocationInfo,
|
|
15
|
-
FileEventQueue,
|
|
16
|
-
GcpPubsub,
|
|
17
|
-
GetExternalLocationRequest,
|
|
18
|
-
ListExternalLocationsRequest,
|
|
19
|
-
ListExternalLocationsResponse,
|
|
20
|
-
SseEncryptionDetails,
|
|
21
|
-
UpdateExternalLocationRequest,
|
|
22
|
-
} from './model';
|