@databricks/sdk-networking 0.1.0-dev.4 → 0.2.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/README.md +23 -0
- package/dist/v1/client.d.ts +19 -20
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +182 -143
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +2 -2
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +1 -1
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/model.d.ts +631 -640
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +846 -852
- 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/package.json +9 -4
package/dist/v1/client.js
CHANGED
|
@@ -2,45 +2,39 @@
|
|
|
2
2
|
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
3
|
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
4
4
|
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
5
|
-
import {
|
|
5
|
+
import { resolveClientConfig } from './transport';
|
|
6
6
|
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
7
7
|
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { marshalAccountNetworkPolicySchema, marshalCreateAccountIpAccessListRequestSchema,
|
|
9
|
+
import { marshalAccountNetworkPolicySchema, marshalCreateAccountIpAccessListRequestSchema, marshalCreateIpAccessListRequestSchema, marshalCreateNetworkConnectivityConfigurationSchema, marshalCreateNetworkRequestSchema, marshalCreatePrivateAccessSettingsRequestSchema, marshalCreatePrivateEndpointRuleSchema, marshalCreateVpcEndpointRequestSchema, marshalEndpointSchema, marshalPrivateAccessSettingsSchema, marshalReplaceAccountIpAccessListRequestSchema, marshalReplaceIpAccessListRequestSchema, marshalUpdateAccountIpAccessListRequestSchema, marshalUpdateIpAccessListRequestSchema, marshalUpdatePrivateEndpointRuleSchema, marshalWorkspaceNetworkOptionSchema, unmarshalAccountNetworkPolicySchema, unmarshalCreateAccountIpAccessListResponseSchema, unmarshalCreateIpAccessListResponseSchema, unmarshalDeleteAccountIpAccessListResponseSchema, unmarshalDeleteIpAccessListResponseSchema, unmarshalEndpointSchema, unmarshalGetAccountIpAccessListResponseSchema, unmarshalGetIpAccessListResponseSchema, unmarshalListAccountIpAccessListsResponseSchema, unmarshalListEndpointsResponseSchema, unmarshalListIpAccessListsResponseSchema, unmarshalListNccPrivateEndpointRulesResponseSchema, unmarshalListNetworkConnectivityConfigsResponseSchema, unmarshalListNetworkPoliciesResponseSchema, unmarshalNccPrivateEndpointRuleSchema, unmarshalNetworkConnectivityConfigSchema, unmarshalNetworkSchema, unmarshalPrivateAccessSettingsSchema, unmarshalReplaceAccountIpAccessListResponseSchema, unmarshalReplaceIpAccessListResponseSchema, unmarshalUpdateAccountIpAccessListResponseSchema, unmarshalUpdateIpAccessListResponseSchema, unmarshalVpcEndpointSchema, unmarshalWorkspaceNetworkOptionSchema, } from './model';
|
|
10
10
|
// Package identity segment for this client to be used in the User-Agent header.
|
|
11
11
|
const PACKAGE_SEGMENT = {
|
|
12
12
|
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
13
13
|
value: pkgJson.version,
|
|
14
14
|
};
|
|
15
15
|
export class NetworkingClient {
|
|
16
|
-
|
|
17
|
-
// Fallback for endpoints whose path contains {account_id}. If the request
|
|
18
|
-
// already carries an accountId, that value wins.
|
|
19
|
-
accountId;
|
|
20
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
21
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
22
|
-
// request.
|
|
23
|
-
workspaceId;
|
|
24
|
-
httpClient;
|
|
16
|
+
options;
|
|
25
17
|
logger;
|
|
26
18
|
// User-Agent header value. Composed once at construction from
|
|
27
19
|
// createDefault() merged with this package's identity and the active
|
|
28
20
|
// credential's name.
|
|
29
21
|
userAgent;
|
|
22
|
+
// Memoized configuration. The profile is resolved once, lazily, on the first
|
|
23
|
+
// request, then reused; host, workspaceId/accountId, and credentials are
|
|
24
|
+
// filled from it when not set explicitly on the options.
|
|
25
|
+
config;
|
|
30
26
|
constructor(options) {
|
|
31
|
-
|
|
32
|
-
throw new Error('Host is required.');
|
|
33
|
-
}
|
|
34
|
-
this.host = options.host.replace(/\/$/, '');
|
|
35
|
-
this.accountId = options.accountId;
|
|
36
|
-
this.workspaceId = options.workspaceId;
|
|
27
|
+
this.options = options;
|
|
37
28
|
this.logger = options.logger ?? new NoOpLogger();
|
|
38
29
|
const info = createDefault()
|
|
39
30
|
.with(PACKAGE_SEGMENT)
|
|
40
31
|
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
41
32
|
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
42
33
|
this.userAgent = info.toString();
|
|
43
|
-
|
|
34
|
+
}
|
|
35
|
+
resolveConfig() {
|
|
36
|
+
this.config ??= resolveClientConfig(this.options);
|
|
37
|
+
return this.config;
|
|
44
38
|
}
|
|
45
39
|
/**
|
|
46
40
|
* Creates an IP access list for the account.
|
|
@@ -59,7 +53,8 @@ export class NetworkingClient {
|
|
|
59
53
|
* It can take a few minutes for the changes to take effect.
|
|
60
54
|
*/
|
|
61
55
|
async createAccountIpAccessList(req, options) {
|
|
62
|
-
const
|
|
56
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
57
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/ip-access-lists`;
|
|
63
58
|
const body = marshalRequest(req, marshalCreateAccountIpAccessListRequestSchema);
|
|
64
59
|
let resp;
|
|
65
60
|
const call = async (callSignal) => {
|
|
@@ -68,7 +63,7 @@ export class NetworkingClient {
|
|
|
68
63
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
69
64
|
const respBody = await executeHttpCall({
|
|
70
65
|
request: httpReq,
|
|
71
|
-
httpClient
|
|
66
|
+
httpClient,
|
|
72
67
|
logger: this.logger,
|
|
73
68
|
});
|
|
74
69
|
resp = parseResponse(respBody, unmarshalCreateAccountIpAccessListResponseSchema);
|
|
@@ -81,7 +76,8 @@ export class NetworkingClient {
|
|
|
81
76
|
}
|
|
82
77
|
/** Deletes an IP access list, specified by its list ID. */
|
|
83
78
|
async deleteAccountIpAccessList(req, options) {
|
|
84
|
-
const
|
|
79
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
80
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/ip-access-lists/${req.listId ?? ''}`;
|
|
85
81
|
let resp;
|
|
86
82
|
const call = async (callSignal) => {
|
|
87
83
|
const headers = new Headers();
|
|
@@ -89,7 +85,7 @@ export class NetworkingClient {
|
|
|
89
85
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
90
86
|
const respBody = await executeHttpCall({
|
|
91
87
|
request: httpReq,
|
|
92
|
-
httpClient
|
|
88
|
+
httpClient,
|
|
93
89
|
logger: this.logger,
|
|
94
90
|
});
|
|
95
91
|
resp = parseResponse(respBody, unmarshalDeleteAccountIpAccessListResponseSchema);
|
|
@@ -102,7 +98,8 @@ export class NetworkingClient {
|
|
|
102
98
|
}
|
|
103
99
|
/** Gets an IP access list, specified by its list ID. */
|
|
104
100
|
async getAccountIpAccessList(req, options) {
|
|
105
|
-
const
|
|
101
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
102
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/ip-access-lists/${req.listId ?? ''}`;
|
|
106
103
|
let resp;
|
|
107
104
|
const call = async (callSignal) => {
|
|
108
105
|
const headers = new Headers();
|
|
@@ -110,7 +107,7 @@ export class NetworkingClient {
|
|
|
110
107
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
111
108
|
const respBody = await executeHttpCall({
|
|
112
109
|
request: httpReq,
|
|
113
|
-
httpClient
|
|
110
|
+
httpClient,
|
|
114
111
|
logger: this.logger,
|
|
115
112
|
});
|
|
116
113
|
resp = parseResponse(respBody, unmarshalGetAccountIpAccessListResponseSchema);
|
|
@@ -123,7 +120,8 @@ export class NetworkingClient {
|
|
|
123
120
|
}
|
|
124
121
|
/** Gets all IP access lists for the specified account. */
|
|
125
122
|
async listAccountIpAccessLists(req, options) {
|
|
126
|
-
const
|
|
123
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
124
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/ip-access-lists`;
|
|
127
125
|
let resp;
|
|
128
126
|
const call = async (callSignal) => {
|
|
129
127
|
const headers = new Headers();
|
|
@@ -131,7 +129,7 @@ export class NetworkingClient {
|
|
|
131
129
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
132
130
|
const respBody = await executeHttpCall({
|
|
133
131
|
request: httpReq,
|
|
134
|
-
httpClient
|
|
132
|
+
httpClient,
|
|
135
133
|
logger: this.logger,
|
|
136
134
|
});
|
|
137
135
|
resp = parseResponse(respBody, unmarshalListAccountIpAccessListsResponseSchema);
|
|
@@ -156,7 +154,8 @@ export class NetworkingClient {
|
|
|
156
154
|
* It can take a few minutes for the changes to take effect.
|
|
157
155
|
*/
|
|
158
156
|
async replaceAccountIpAccessList(req, options) {
|
|
159
|
-
const
|
|
157
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
158
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/ip-access-lists/${req.listId ?? ''}`;
|
|
160
159
|
const body = marshalRequest(req, marshalReplaceAccountIpAccessListRequestSchema);
|
|
161
160
|
let resp;
|
|
162
161
|
const call = async (callSignal) => {
|
|
@@ -165,7 +164,7 @@ export class NetworkingClient {
|
|
|
165
164
|
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
166
165
|
const respBody = await executeHttpCall({
|
|
167
166
|
request: httpReq,
|
|
168
|
-
httpClient
|
|
167
|
+
httpClient,
|
|
169
168
|
logger: this.logger,
|
|
170
169
|
});
|
|
171
170
|
resp = parseResponse(respBody, unmarshalReplaceAccountIpAccessListResponseSchema);
|
|
@@ -193,7 +192,8 @@ export class NetworkingClient {
|
|
|
193
192
|
* It can take a few minutes for the changes to take effect.
|
|
194
193
|
*/
|
|
195
194
|
async updateAccountIpAccessList(req, options) {
|
|
196
|
-
const
|
|
195
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
196
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/ip-access-lists/${req.listId ?? ''}`;
|
|
197
197
|
const body = marshalRequest(req, marshalUpdateAccountIpAccessListRequestSchema);
|
|
198
198
|
let resp;
|
|
199
199
|
const call = async (callSignal) => {
|
|
@@ -202,7 +202,7 @@ export class NetworkingClient {
|
|
|
202
202
|
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
203
203
|
const respBody = await executeHttpCall({
|
|
204
204
|
request: httpReq,
|
|
205
|
-
httpClient
|
|
205
|
+
httpClient,
|
|
206
206
|
logger: this.logger,
|
|
207
207
|
});
|
|
208
208
|
resp = parseResponse(respBody, unmarshalUpdateAccountIpAccessListResponseSchema);
|
|
@@ -224,19 +224,20 @@ export class NetworkingClient {
|
|
|
224
224
|
* An endpoint can be used only after it reaches the APPROVED state.
|
|
225
225
|
*/
|
|
226
226
|
async createEndpoint(req, options) {
|
|
227
|
-
const
|
|
227
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
228
|
+
const url = `${host}/api/networking/v1/${req.parent ?? ''}/endpoints`;
|
|
228
229
|
const body = marshalRequest(req.endpoint, marshalEndpointSchema);
|
|
229
230
|
let resp;
|
|
230
231
|
const call = async (callSignal) => {
|
|
231
232
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
232
|
-
if (
|
|
233
|
-
headers.set('X-Databricks-Org-Id',
|
|
233
|
+
if (workspaceId !== undefined) {
|
|
234
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
234
235
|
}
|
|
235
236
|
headers.set('User-Agent', this.userAgent);
|
|
236
237
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
237
238
|
const respBody = await executeHttpCall({
|
|
238
239
|
request: httpReq,
|
|
239
|
-
httpClient
|
|
240
|
+
httpClient,
|
|
240
241
|
logger: this.logger,
|
|
241
242
|
});
|
|
242
243
|
resp = parseResponse(respBody, unmarshalEndpointSchema);
|
|
@@ -253,17 +254,18 @@ export class NetworkingClient {
|
|
|
253
254
|
* in your cloud provider account.
|
|
254
255
|
*/
|
|
255
256
|
async deleteEndpoint(req, options) {
|
|
256
|
-
const
|
|
257
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
258
|
+
const url = `${host}/api/networking/v1/${req.name ?? ''}`;
|
|
257
259
|
const call = async (callSignal) => {
|
|
258
260
|
const headers = new Headers();
|
|
259
|
-
if (
|
|
260
|
-
headers.set('X-Databricks-Org-Id',
|
|
261
|
+
if (workspaceId !== undefined) {
|
|
262
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
261
263
|
}
|
|
262
264
|
headers.set('User-Agent', this.userAgent);
|
|
263
265
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
264
266
|
await executeHttpCall({
|
|
265
267
|
request: httpReq,
|
|
266
|
-
httpClient
|
|
268
|
+
httpClient,
|
|
267
269
|
logger: this.logger,
|
|
268
270
|
});
|
|
269
271
|
};
|
|
@@ -271,18 +273,19 @@ export class NetworkingClient {
|
|
|
271
273
|
}
|
|
272
274
|
/** Gets details of a specific network endpoint. */
|
|
273
275
|
async getEndpoint(req, options) {
|
|
274
|
-
const
|
|
276
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
277
|
+
const url = `${host}/api/networking/v1/${req.name ?? ''}`;
|
|
275
278
|
let resp;
|
|
276
279
|
const call = async (callSignal) => {
|
|
277
280
|
const headers = new Headers();
|
|
278
|
-
if (
|
|
279
|
-
headers.set('X-Databricks-Org-Id',
|
|
281
|
+
if (workspaceId !== undefined) {
|
|
282
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
280
283
|
}
|
|
281
284
|
headers.set('User-Agent', this.userAgent);
|
|
282
285
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
283
286
|
const respBody = await executeHttpCall({
|
|
284
287
|
request: httpReq,
|
|
285
|
-
httpClient
|
|
288
|
+
httpClient,
|
|
286
289
|
logger: this.logger,
|
|
287
290
|
});
|
|
288
291
|
resp = parseResponse(respBody, unmarshalEndpointSchema);
|
|
@@ -295,7 +298,8 @@ export class NetworkingClient {
|
|
|
295
298
|
}
|
|
296
299
|
/** Lists all network connectivity endpoints for the account. */
|
|
297
300
|
async listEndpoints(req, options) {
|
|
298
|
-
const
|
|
301
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
302
|
+
const url = `${host}/api/networking/v1/${req.parent ?? ''}/endpoints`;
|
|
299
303
|
const params = new URLSearchParams();
|
|
300
304
|
if (req.pageToken !== undefined) {
|
|
301
305
|
params.append('page_token', req.pageToken);
|
|
@@ -308,14 +312,14 @@ export class NetworkingClient {
|
|
|
308
312
|
let resp;
|
|
309
313
|
const call = async (callSignal) => {
|
|
310
314
|
const headers = new Headers();
|
|
311
|
-
if (
|
|
312
|
-
headers.set('X-Databricks-Org-Id',
|
|
315
|
+
if (workspaceId !== undefined) {
|
|
316
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
313
317
|
}
|
|
314
318
|
headers.set('User-Agent', this.userAgent);
|
|
315
319
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
316
320
|
const respBody = await executeHttpCall({
|
|
317
321
|
request: httpReq,
|
|
318
|
-
httpClient
|
|
322
|
+
httpClient,
|
|
319
323
|
logger: this.logger,
|
|
320
324
|
});
|
|
321
325
|
resp = parseResponse(respBody, unmarshalListEndpointsResponseSchema);
|
|
@@ -354,19 +358,20 @@ export class NetworkingClient {
|
|
|
354
358
|
* It can take a few minutes for the changes to take effect. **Note**: Your new IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus
|
|
355
359
|
*/
|
|
356
360
|
async createIpAccessList(req, options) {
|
|
357
|
-
const
|
|
358
|
-
const
|
|
361
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
362
|
+
const url = `${host}/api/2.0/ip-access-lists`;
|
|
363
|
+
const body = marshalRequest(req, marshalCreateIpAccessListRequestSchema);
|
|
359
364
|
let resp;
|
|
360
365
|
const call = async (callSignal) => {
|
|
361
366
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
362
|
-
if (
|
|
363
|
-
headers.set('X-Databricks-Org-Id',
|
|
367
|
+
if (workspaceId !== undefined) {
|
|
368
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
364
369
|
}
|
|
365
370
|
headers.set('User-Agent', this.userAgent);
|
|
366
371
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
367
372
|
const respBody = await executeHttpCall({
|
|
368
373
|
request: httpReq,
|
|
369
|
-
httpClient
|
|
374
|
+
httpClient,
|
|
370
375
|
logger: this.logger,
|
|
371
376
|
});
|
|
372
377
|
resp = parseResponse(respBody, unmarshalCreateIpAccessListResponseSchema);
|
|
@@ -379,18 +384,19 @@ export class NetworkingClient {
|
|
|
379
384
|
}
|
|
380
385
|
/** Deletes an IP access list, specified by its list ID. */
|
|
381
386
|
async deleteIpAccessList(req, options) {
|
|
382
|
-
const
|
|
387
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
388
|
+
const url = `${host}/api/2.0/ip-access-lists/${req.listId ?? ''}`;
|
|
383
389
|
let resp;
|
|
384
390
|
const call = async (callSignal) => {
|
|
385
391
|
const headers = new Headers();
|
|
386
|
-
if (
|
|
387
|
-
headers.set('X-Databricks-Org-Id',
|
|
392
|
+
if (workspaceId !== undefined) {
|
|
393
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
388
394
|
}
|
|
389
395
|
headers.set('User-Agent', this.userAgent);
|
|
390
396
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
391
397
|
const respBody = await executeHttpCall({
|
|
392
398
|
request: httpReq,
|
|
393
|
-
httpClient
|
|
399
|
+
httpClient,
|
|
394
400
|
logger: this.logger,
|
|
395
401
|
});
|
|
396
402
|
resp = parseResponse(respBody, unmarshalDeleteIpAccessListResponseSchema);
|
|
@@ -403,18 +409,19 @@ export class NetworkingClient {
|
|
|
403
409
|
}
|
|
404
410
|
/** Gets an IP access list, specified by its list ID. */
|
|
405
411
|
async getIpAccessList(req, options) {
|
|
406
|
-
const
|
|
412
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
413
|
+
const url = `${host}/api/2.0/ip-access-lists/${req.listId ?? ''}`;
|
|
407
414
|
let resp;
|
|
408
415
|
const call = async (callSignal) => {
|
|
409
416
|
const headers = new Headers();
|
|
410
|
-
if (
|
|
411
|
-
headers.set('X-Databricks-Org-Id',
|
|
417
|
+
if (workspaceId !== undefined) {
|
|
418
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
412
419
|
}
|
|
413
420
|
headers.set('User-Agent', this.userAgent);
|
|
414
421
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
415
422
|
const respBody = await executeHttpCall({
|
|
416
423
|
request: httpReq,
|
|
417
|
-
httpClient
|
|
424
|
+
httpClient,
|
|
418
425
|
logger: this.logger,
|
|
419
426
|
});
|
|
420
427
|
resp = parseResponse(respBody, unmarshalGetIpAccessListResponseSchema);
|
|
@@ -427,18 +434,19 @@ export class NetworkingClient {
|
|
|
427
434
|
}
|
|
428
435
|
/** Gets all IP access lists for the specified workspace. */
|
|
429
436
|
async listIpAccessLists(_req, options) {
|
|
430
|
-
const
|
|
437
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
438
|
+
const url = `${host}/api/2.0/ip-access-lists`;
|
|
431
439
|
let resp;
|
|
432
440
|
const call = async (callSignal) => {
|
|
433
441
|
const headers = new Headers();
|
|
434
|
-
if (
|
|
435
|
-
headers.set('X-Databricks-Org-Id',
|
|
442
|
+
if (workspaceId !== undefined) {
|
|
443
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
436
444
|
}
|
|
437
445
|
headers.set('User-Agent', this.userAgent);
|
|
438
446
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
439
447
|
const respBody = await executeHttpCall({
|
|
440
448
|
request: httpReq,
|
|
441
|
-
httpClient
|
|
449
|
+
httpClient,
|
|
442
450
|
logger: this.logger,
|
|
443
451
|
});
|
|
444
452
|
resp = parseResponse(respBody, unmarshalListIpAccessListsResponseSchema);
|
|
@@ -464,19 +472,20 @@ export class NetworkingClient {
|
|
|
464
472
|
* effect until you enable the feature. See :method:workspaceconf/setStatus.
|
|
465
473
|
*/
|
|
466
474
|
async replaceIpAccessList(req, options) {
|
|
467
|
-
const
|
|
468
|
-
const
|
|
475
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
476
|
+
const url = `${host}/api/2.0/ip-access-lists/${req.listId ?? ''}`;
|
|
477
|
+
const body = marshalRequest(req, marshalReplaceIpAccessListRequestSchema);
|
|
469
478
|
let resp;
|
|
470
479
|
const call = async (callSignal) => {
|
|
471
480
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
472
|
-
if (
|
|
473
|
-
headers.set('X-Databricks-Org-Id',
|
|
481
|
+
if (workspaceId !== undefined) {
|
|
482
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
474
483
|
}
|
|
475
484
|
headers.set('User-Agent', this.userAgent);
|
|
476
485
|
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
477
486
|
const respBody = await executeHttpCall({
|
|
478
487
|
request: httpReq,
|
|
479
|
-
httpClient
|
|
488
|
+
httpClient,
|
|
480
489
|
logger: this.logger,
|
|
481
490
|
});
|
|
482
491
|
resp = parseResponse(respBody, unmarshalReplaceIpAccessListResponseSchema);
|
|
@@ -503,19 +512,20 @@ export class NetworkingClient {
|
|
|
503
512
|
* the feature. See :method:workspaceconf/setStatus.
|
|
504
513
|
*/
|
|
505
514
|
async updateIpAccessList(req, options) {
|
|
506
|
-
const
|
|
507
|
-
const
|
|
515
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
516
|
+
const url = `${host}/api/2.0/ip-access-lists/${req.listId ?? ''}`;
|
|
517
|
+
const body = marshalRequest(req, marshalUpdateIpAccessListRequestSchema);
|
|
508
518
|
let resp;
|
|
509
519
|
const call = async (callSignal) => {
|
|
510
520
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
511
|
-
if (
|
|
512
|
-
headers.set('X-Databricks-Org-Id',
|
|
521
|
+
if (workspaceId !== undefined) {
|
|
522
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
513
523
|
}
|
|
514
524
|
headers.set('User-Agent', this.userAgent);
|
|
515
525
|
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
516
526
|
const respBody = await executeHttpCall({
|
|
517
527
|
request: httpReq,
|
|
518
|
-
httpClient
|
|
528
|
+
httpClient,
|
|
519
529
|
logger: this.logger,
|
|
520
530
|
});
|
|
521
531
|
resp = parseResponse(respBody, unmarshalUpdateIpAccessListResponseSchema);
|
|
@@ -538,7 +548,8 @@ export class NetworkingClient {
|
|
|
538
548
|
* See [configure serverless secure connectivity](https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security).
|
|
539
549
|
*/
|
|
540
550
|
async createNetworkConnectivityConfigPublic(req, options) {
|
|
541
|
-
const
|
|
551
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
552
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs`;
|
|
542
553
|
const body = marshalRequest(req.networkConnectivityConfig, marshalCreateNetworkConnectivityConfigurationSchema);
|
|
543
554
|
let resp;
|
|
544
555
|
const call = async (callSignal) => {
|
|
@@ -547,10 +558,10 @@ export class NetworkingClient {
|
|
|
547
558
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
548
559
|
const respBody = await executeHttpCall({
|
|
549
560
|
request: httpReq,
|
|
550
|
-
httpClient
|
|
561
|
+
httpClient,
|
|
551
562
|
logger: this.logger,
|
|
552
563
|
});
|
|
553
|
-
resp = parseResponse(respBody,
|
|
564
|
+
resp = parseResponse(respBody, unmarshalNetworkConnectivityConfigSchema);
|
|
554
565
|
};
|
|
555
566
|
await executeCall(call, options);
|
|
556
567
|
if (resp === undefined) {
|
|
@@ -560,14 +571,15 @@ export class NetworkingClient {
|
|
|
560
571
|
}
|
|
561
572
|
/** Deletes a network connectivity configuration. */
|
|
562
573
|
async deleteNetworkConnectivityConfigPublic(req, options) {
|
|
563
|
-
const
|
|
574
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
575
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}`;
|
|
564
576
|
const call = async (callSignal) => {
|
|
565
577
|
const headers = new Headers();
|
|
566
578
|
headers.set('User-Agent', this.userAgent);
|
|
567
579
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
568
580
|
await executeHttpCall({
|
|
569
581
|
request: httpReq,
|
|
570
|
-
httpClient
|
|
582
|
+
httpClient,
|
|
571
583
|
logger: this.logger,
|
|
572
584
|
});
|
|
573
585
|
};
|
|
@@ -575,7 +587,8 @@ export class NetworkingClient {
|
|
|
575
587
|
}
|
|
576
588
|
/** Gets a network connectivity configuration. */
|
|
577
589
|
async getNetworkConnectivityConfigPublic(req, options) {
|
|
578
|
-
const
|
|
590
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
591
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}`;
|
|
579
592
|
let resp;
|
|
580
593
|
const call = async (callSignal) => {
|
|
581
594
|
const headers = new Headers();
|
|
@@ -583,10 +596,10 @@ export class NetworkingClient {
|
|
|
583
596
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
584
597
|
const respBody = await executeHttpCall({
|
|
585
598
|
request: httpReq,
|
|
586
|
-
httpClient
|
|
599
|
+
httpClient,
|
|
587
600
|
logger: this.logger,
|
|
588
601
|
});
|
|
589
|
-
resp = parseResponse(respBody,
|
|
602
|
+
resp = parseResponse(respBody, unmarshalNetworkConnectivityConfigSchema);
|
|
590
603
|
};
|
|
591
604
|
await executeCall(call, options);
|
|
592
605
|
if (resp === undefined) {
|
|
@@ -596,7 +609,8 @@ export class NetworkingClient {
|
|
|
596
609
|
}
|
|
597
610
|
/** Gets an array of network connectivity configurations. */
|
|
598
611
|
async listNetworkConnectivityConfigsPublic(req, options) {
|
|
599
|
-
const
|
|
612
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
613
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs`;
|
|
600
614
|
const params = new URLSearchParams();
|
|
601
615
|
if (req.pageToken !== undefined) {
|
|
602
616
|
params.append('page_token', req.pageToken);
|
|
@@ -610,7 +624,7 @@ export class NetworkingClient {
|
|
|
610
624
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
611
625
|
const respBody = await executeHttpCall({
|
|
612
626
|
request: httpReq,
|
|
613
|
-
httpClient
|
|
627
|
+
httpClient,
|
|
614
628
|
logger: this.logger,
|
|
615
629
|
});
|
|
616
630
|
resp = parseResponse(respBody, unmarshalListNetworkConnectivityConfigsResponseSchema);
|
|
@@ -644,7 +658,8 @@ export class NetworkingClient {
|
|
|
644
658
|
* endpoint rule. See [serverless private link](https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security/serverless-private-link).
|
|
645
659
|
*/
|
|
646
660
|
async createNccPrivateEndpointRule(req, options) {
|
|
647
|
-
const
|
|
661
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
662
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}/private-endpoint-rules`;
|
|
648
663
|
const body = marshalRequest(req.privateEndpointRule, marshalCreatePrivateEndpointRuleSchema);
|
|
649
664
|
let resp;
|
|
650
665
|
const call = async (callSignal) => {
|
|
@@ -653,7 +668,7 @@ export class NetworkingClient {
|
|
|
653
668
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
654
669
|
const respBody = await executeHttpCall({
|
|
655
670
|
request: httpReq,
|
|
656
|
-
httpClient
|
|
671
|
+
httpClient,
|
|
657
672
|
logger: this.logger,
|
|
658
673
|
});
|
|
659
674
|
resp = parseResponse(respBody, unmarshalNccPrivateEndpointRuleSchema);
|
|
@@ -672,7 +687,8 @@ export class NetworkingClient {
|
|
|
672
687
|
* available to your serverless compute resources.
|
|
673
688
|
*/
|
|
674
689
|
async deleteNccPrivateEndpointRule(req, options) {
|
|
675
|
-
const
|
|
690
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
691
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}/private-endpoint-rules/${req.privateEndpointRuleId ?? ''}`;
|
|
676
692
|
let resp;
|
|
677
693
|
const call = async (callSignal) => {
|
|
678
694
|
const headers = new Headers();
|
|
@@ -680,7 +696,7 @@ export class NetworkingClient {
|
|
|
680
696
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
681
697
|
const respBody = await executeHttpCall({
|
|
682
698
|
request: httpReq,
|
|
683
|
-
httpClient
|
|
699
|
+
httpClient,
|
|
684
700
|
logger: this.logger,
|
|
685
701
|
});
|
|
686
702
|
resp = parseResponse(respBody, unmarshalNccPrivateEndpointRuleSchema);
|
|
@@ -693,7 +709,8 @@ export class NetworkingClient {
|
|
|
693
709
|
}
|
|
694
710
|
/** Gets the private endpoint rule. */
|
|
695
711
|
async getNccPrivateEndpointRule(req, options) {
|
|
696
|
-
const
|
|
712
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
713
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}/private-endpoint-rules/${req.privateEndpointRuleId ?? ''}`;
|
|
697
714
|
let resp;
|
|
698
715
|
const call = async (callSignal) => {
|
|
699
716
|
const headers = new Headers();
|
|
@@ -701,7 +718,7 @@ export class NetworkingClient {
|
|
|
701
718
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
702
719
|
const respBody = await executeHttpCall({
|
|
703
720
|
request: httpReq,
|
|
704
|
-
httpClient
|
|
721
|
+
httpClient,
|
|
705
722
|
logger: this.logger,
|
|
706
723
|
});
|
|
707
724
|
resp = parseResponse(respBody, unmarshalNccPrivateEndpointRuleSchema);
|
|
@@ -714,7 +731,8 @@ export class NetworkingClient {
|
|
|
714
731
|
}
|
|
715
732
|
/** Gets an array of private endpoint rules. */
|
|
716
733
|
async listNccPrivateEndpointRules(req, options) {
|
|
717
|
-
const
|
|
734
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
735
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}/private-endpoint-rules`;
|
|
718
736
|
const params = new URLSearchParams();
|
|
719
737
|
if (req.pageToken !== undefined) {
|
|
720
738
|
params.append('page_token', req.pageToken);
|
|
@@ -728,7 +746,7 @@ export class NetworkingClient {
|
|
|
728
746
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
729
747
|
const respBody = await executeHttpCall({
|
|
730
748
|
request: httpReq,
|
|
731
|
-
httpClient
|
|
749
|
+
httpClient,
|
|
732
750
|
logger: this.logger,
|
|
733
751
|
});
|
|
734
752
|
resp = parseResponse(respBody, unmarshalListNccPrivateEndpointRulesResponseSchema);
|
|
@@ -754,7 +772,8 @@ export class NetworkingClient {
|
|
|
754
772
|
}
|
|
755
773
|
/** Updates a private endpoint rule. Currently only a private endpoint rule to customer-managed resources is allowed to be updated. */
|
|
756
774
|
async updateNccPrivateEndpointRule(req, options) {
|
|
757
|
-
const
|
|
775
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
776
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}/private-endpoint-rules/${req.privateEndpointRuleId ?? ''}`;
|
|
758
777
|
const params = new URLSearchParams();
|
|
759
778
|
if (req.updateMask !== undefined) {
|
|
760
779
|
params.append('update_mask', req.updateMask.toString());
|
|
@@ -769,7 +788,7 @@ export class NetworkingClient {
|
|
|
769
788
|
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
770
789
|
const respBody = await executeHttpCall({
|
|
771
790
|
request: httpReq,
|
|
772
|
-
httpClient
|
|
791
|
+
httpClient,
|
|
773
792
|
logger: this.logger,
|
|
774
793
|
});
|
|
775
794
|
resp = parseResponse(respBody, unmarshalNccPrivateEndpointRuleSchema);
|
|
@@ -785,7 +804,8 @@ export class NetworkingClient {
|
|
|
785
804
|
* environment.
|
|
786
805
|
*/
|
|
787
806
|
async createNetworkPolicyRpc(req, options) {
|
|
788
|
-
const
|
|
807
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
808
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies`;
|
|
789
809
|
const body = marshalRequest(req.networkPolicy, marshalAccountNetworkPolicySchema);
|
|
790
810
|
let resp;
|
|
791
811
|
const call = async (callSignal) => {
|
|
@@ -794,7 +814,7 @@ export class NetworkingClient {
|
|
|
794
814
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
795
815
|
const respBody = await executeHttpCall({
|
|
796
816
|
request: httpReq,
|
|
797
|
-
httpClient
|
|
817
|
+
httpClient,
|
|
798
818
|
logger: this.logger,
|
|
799
819
|
});
|
|
800
820
|
resp = parseResponse(respBody, unmarshalAccountNetworkPolicySchema);
|
|
@@ -807,14 +827,15 @@ export class NetworkingClient {
|
|
|
807
827
|
}
|
|
808
828
|
/** Deletes a network policy. Cannot be called on 'default-policy'. */
|
|
809
829
|
async deleteNetworkPolicyRpc(req, options) {
|
|
810
|
-
const
|
|
830
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
831
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies/${req.networkPolicyId ?? ''}`;
|
|
811
832
|
const call = async (callSignal) => {
|
|
812
833
|
const headers = new Headers();
|
|
813
834
|
headers.set('User-Agent', this.userAgent);
|
|
814
835
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
815
836
|
await executeHttpCall({
|
|
816
837
|
request: httpReq,
|
|
817
|
-
httpClient
|
|
838
|
+
httpClient,
|
|
818
839
|
logger: this.logger,
|
|
819
840
|
});
|
|
820
841
|
};
|
|
@@ -822,7 +843,8 @@ export class NetworkingClient {
|
|
|
822
843
|
}
|
|
823
844
|
/** Gets a network policy. */
|
|
824
845
|
async getNetworkPolicyRpc(req, options) {
|
|
825
|
-
const
|
|
846
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
847
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies/${req.networkPolicyId ?? ''}`;
|
|
826
848
|
let resp;
|
|
827
849
|
const call = async (callSignal) => {
|
|
828
850
|
const headers = new Headers();
|
|
@@ -830,7 +852,7 @@ export class NetworkingClient {
|
|
|
830
852
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
831
853
|
const respBody = await executeHttpCall({
|
|
832
854
|
request: httpReq,
|
|
833
|
-
httpClient
|
|
855
|
+
httpClient,
|
|
834
856
|
logger: this.logger,
|
|
835
857
|
});
|
|
836
858
|
resp = parseResponse(respBody, unmarshalAccountNetworkPolicySchema);
|
|
@@ -843,7 +865,8 @@ export class NetworkingClient {
|
|
|
843
865
|
}
|
|
844
866
|
/** Gets an array of network policies. */
|
|
845
867
|
async listNetworkPoliciesRpc(req, options) {
|
|
846
|
-
const
|
|
868
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
869
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies`;
|
|
847
870
|
const params = new URLSearchParams();
|
|
848
871
|
if (req.pageToken !== undefined) {
|
|
849
872
|
params.append('page_token', req.pageToken);
|
|
@@ -857,7 +880,7 @@ export class NetworkingClient {
|
|
|
857
880
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
858
881
|
const respBody = await executeHttpCall({
|
|
859
882
|
request: httpReq,
|
|
860
|
-
httpClient
|
|
883
|
+
httpClient,
|
|
861
884
|
logger: this.logger,
|
|
862
885
|
});
|
|
863
886
|
resp = parseResponse(respBody, unmarshalListNetworkPoliciesResponseSchema);
|
|
@@ -883,7 +906,8 @@ export class NetworkingClient {
|
|
|
883
906
|
}
|
|
884
907
|
/** Updates a network policy. This allows you to modify the configuration of a network policy. */
|
|
885
908
|
async updateNetworkPolicyRpc(req, options) {
|
|
886
|
-
const
|
|
909
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
910
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies/${req.networkPolicyId ?? ''}`;
|
|
887
911
|
const body = marshalRequest(req.networkPolicy, marshalAccountNetworkPolicySchema);
|
|
888
912
|
let resp;
|
|
889
913
|
const call = async (callSignal) => {
|
|
@@ -892,7 +916,7 @@ export class NetworkingClient {
|
|
|
892
916
|
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
893
917
|
const respBody = await executeHttpCall({
|
|
894
918
|
request: httpReq,
|
|
895
|
-
httpClient
|
|
919
|
+
httpClient,
|
|
896
920
|
logger: this.logger,
|
|
897
921
|
});
|
|
898
922
|
resp = parseResponse(respBody, unmarshalAccountNetworkPolicySchema);
|
|
@@ -905,7 +929,8 @@ export class NetworkingClient {
|
|
|
905
929
|
}
|
|
906
930
|
/** Creates a <Databricks> network configuration that represents an VPC and its resources. The VPC will be used for new <Databricks> clusters. This requires a pre-existing VPC and subnets. */
|
|
907
931
|
async createNetworkPublic(req, options) {
|
|
908
|
-
const
|
|
932
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
933
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/networks`;
|
|
909
934
|
const body = marshalRequest(req, marshalCreateNetworkRequestSchema);
|
|
910
935
|
let resp;
|
|
911
936
|
const call = async (callSignal) => {
|
|
@@ -914,7 +939,7 @@ export class NetworkingClient {
|
|
|
914
939
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
915
940
|
const respBody = await executeHttpCall({
|
|
916
941
|
request: httpReq,
|
|
917
|
-
httpClient
|
|
942
|
+
httpClient,
|
|
918
943
|
logger: this.logger,
|
|
919
944
|
});
|
|
920
945
|
resp = parseResponse(respBody, unmarshalNetworkSchema);
|
|
@@ -932,7 +957,8 @@ export class NetworkingClient {
|
|
|
932
957
|
* internet or only from private endpoints.
|
|
933
958
|
*/
|
|
934
959
|
async createPrivateAccessSettingsPublic(req, options) {
|
|
935
|
-
const
|
|
960
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
961
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/private-access-settings`;
|
|
936
962
|
const body = marshalRequest(req, marshalCreatePrivateAccessSettingsRequestSchema);
|
|
937
963
|
let resp;
|
|
938
964
|
const call = async (callSignal) => {
|
|
@@ -941,10 +967,10 @@ export class NetworkingClient {
|
|
|
941
967
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
942
968
|
const respBody = await executeHttpCall({
|
|
943
969
|
request: httpReq,
|
|
944
|
-
httpClient
|
|
970
|
+
httpClient,
|
|
945
971
|
logger: this.logger,
|
|
946
972
|
});
|
|
947
|
-
resp = parseResponse(respBody,
|
|
973
|
+
resp = parseResponse(respBody, unmarshalPrivateAccessSettingsSchema);
|
|
948
974
|
};
|
|
949
975
|
await executeCall(call, options);
|
|
950
976
|
if (resp === undefined) {
|
|
@@ -966,7 +992,8 @@ export class NetworkingClient {
|
|
|
966
992
|
* [<Databricks> article about PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html).
|
|
967
993
|
*/
|
|
968
994
|
async createVpcEndpointPublic(req, options) {
|
|
969
|
-
const
|
|
995
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
996
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/vpc-endpoints`;
|
|
970
997
|
const body = marshalRequest(req, marshalCreateVpcEndpointRequestSchema);
|
|
971
998
|
let resp;
|
|
972
999
|
const call = async (callSignal) => {
|
|
@@ -975,10 +1002,10 @@ export class NetworkingClient {
|
|
|
975
1002
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
976
1003
|
const respBody = await executeHttpCall({
|
|
977
1004
|
request: httpReq,
|
|
978
|
-
httpClient
|
|
1005
|
+
httpClient,
|
|
979
1006
|
logger: this.logger,
|
|
980
1007
|
});
|
|
981
|
-
resp = parseResponse(respBody,
|
|
1008
|
+
resp = parseResponse(respBody, unmarshalVpcEndpointSchema);
|
|
982
1009
|
};
|
|
983
1010
|
await executeCall(call, options);
|
|
984
1011
|
if (resp === undefined) {
|
|
@@ -992,7 +1019,8 @@ export class NetworkingClient {
|
|
|
992
1019
|
* This operation is available only if your account is on the E2 version of the platform.
|
|
993
1020
|
*/
|
|
994
1021
|
async deleteNetworkPublic(req, options) {
|
|
995
|
-
const
|
|
1022
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1023
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/networks/${req.networkId ?? ''}`;
|
|
996
1024
|
let resp;
|
|
997
1025
|
const call = async (callSignal) => {
|
|
998
1026
|
const headers = new Headers();
|
|
@@ -1000,7 +1028,7 @@ export class NetworkingClient {
|
|
|
1000
1028
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
1001
1029
|
const respBody = await executeHttpCall({
|
|
1002
1030
|
request: httpReq,
|
|
1003
|
-
httpClient
|
|
1031
|
+
httpClient,
|
|
1004
1032
|
logger: this.logger,
|
|
1005
1033
|
});
|
|
1006
1034
|
resp = parseResponse(respBody, unmarshalNetworkSchema);
|
|
@@ -1013,7 +1041,8 @@ export class NetworkingClient {
|
|
|
1013
1041
|
}
|
|
1014
1042
|
/** Deletes a <Databricks> private access settings configuration, both specified by ID. */
|
|
1015
1043
|
async deletePrivateAccessSettingsPublic(req, options) {
|
|
1016
|
-
const
|
|
1044
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1045
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/private-access-settings/${req.privateAccessSettingsId ?? ''}`;
|
|
1017
1046
|
let resp;
|
|
1018
1047
|
const call = async (callSignal) => {
|
|
1019
1048
|
const headers = new Headers();
|
|
@@ -1021,10 +1050,10 @@ export class NetworkingClient {
|
|
|
1021
1050
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
1022
1051
|
const respBody = await executeHttpCall({
|
|
1023
1052
|
request: httpReq,
|
|
1024
|
-
httpClient
|
|
1053
|
+
httpClient,
|
|
1025
1054
|
logger: this.logger,
|
|
1026
1055
|
});
|
|
1027
|
-
resp = parseResponse(respBody,
|
|
1056
|
+
resp = parseResponse(respBody, unmarshalPrivateAccessSettingsSchema);
|
|
1028
1057
|
};
|
|
1029
1058
|
await executeCall(call, options);
|
|
1030
1059
|
if (resp === undefined) {
|
|
@@ -1034,7 +1063,8 @@ export class NetworkingClient {
|
|
|
1034
1063
|
}
|
|
1035
1064
|
/** Deletes a Databricks VPC endpoint configuration. You cannot delete a VPC endpoint configuration that is associated with any workspace. */
|
|
1036
1065
|
async deleteVpcEndpointPublic(req, options) {
|
|
1037
|
-
const
|
|
1066
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1067
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/vpc-endpoints/${req.vpcEndpointId ?? ''}`;
|
|
1038
1068
|
let resp;
|
|
1039
1069
|
const call = async (callSignal) => {
|
|
1040
1070
|
const headers = new Headers();
|
|
@@ -1042,10 +1072,10 @@ export class NetworkingClient {
|
|
|
1042
1072
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
1043
1073
|
const respBody = await executeHttpCall({
|
|
1044
1074
|
request: httpReq,
|
|
1045
|
-
httpClient
|
|
1075
|
+
httpClient,
|
|
1046
1076
|
logger: this.logger,
|
|
1047
1077
|
});
|
|
1048
|
-
resp = parseResponse(respBody,
|
|
1078
|
+
resp = parseResponse(respBody, unmarshalVpcEndpointSchema);
|
|
1049
1079
|
};
|
|
1050
1080
|
await executeCall(call, options);
|
|
1051
1081
|
if (resp === undefined) {
|
|
@@ -1055,7 +1085,8 @@ export class NetworkingClient {
|
|
|
1055
1085
|
}
|
|
1056
1086
|
/** Gets a <Databricks> network configuration, which represents a cloud VPC and its resources. */
|
|
1057
1087
|
async getNetworkPublic(req, options) {
|
|
1058
|
-
const
|
|
1088
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1089
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/networks/${req.networkId ?? ''}`;
|
|
1059
1090
|
let resp;
|
|
1060
1091
|
const call = async (callSignal) => {
|
|
1061
1092
|
const headers = new Headers();
|
|
@@ -1063,7 +1094,7 @@ export class NetworkingClient {
|
|
|
1063
1094
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1064
1095
|
const respBody = await executeHttpCall({
|
|
1065
1096
|
request: httpReq,
|
|
1066
|
-
httpClient
|
|
1097
|
+
httpClient,
|
|
1067
1098
|
logger: this.logger,
|
|
1068
1099
|
});
|
|
1069
1100
|
resp = parseResponse(respBody, unmarshalNetworkSchema);
|
|
@@ -1076,7 +1107,8 @@ export class NetworkingClient {
|
|
|
1076
1107
|
}
|
|
1077
1108
|
/** Gets a <Databricks> private access settings configuration, both specified by ID. */
|
|
1078
1109
|
async getPrivateAccessSettingsPublic(req, options) {
|
|
1079
|
-
const
|
|
1110
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1111
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/private-access-settings/${req.privateAccessSettingsId ?? ''}`;
|
|
1080
1112
|
let resp;
|
|
1081
1113
|
const call = async (callSignal) => {
|
|
1082
1114
|
const headers = new Headers();
|
|
@@ -1084,10 +1116,10 @@ export class NetworkingClient {
|
|
|
1084
1116
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1085
1117
|
const respBody = await executeHttpCall({
|
|
1086
1118
|
request: httpReq,
|
|
1087
|
-
httpClient
|
|
1119
|
+
httpClient,
|
|
1088
1120
|
logger: this.logger,
|
|
1089
1121
|
});
|
|
1090
|
-
resp = parseResponse(respBody,
|
|
1122
|
+
resp = parseResponse(respBody, unmarshalPrivateAccessSettingsSchema);
|
|
1091
1123
|
};
|
|
1092
1124
|
await executeCall(call, options);
|
|
1093
1125
|
if (resp === undefined) {
|
|
@@ -1102,7 +1134,8 @@ export class NetworkingClient {
|
|
|
1102
1134
|
* [AWS PrivateLink](https://aws.amazon.com/privatelink).
|
|
1103
1135
|
*/
|
|
1104
1136
|
async getVpcEndpointPublic(req, options) {
|
|
1105
|
-
const
|
|
1137
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1138
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/vpc-endpoints/${req.vpcEndpointId ?? ''}`;
|
|
1106
1139
|
let resp;
|
|
1107
1140
|
const call = async (callSignal) => {
|
|
1108
1141
|
const headers = new Headers();
|
|
@@ -1110,10 +1143,10 @@ export class NetworkingClient {
|
|
|
1110
1143
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1111
1144
|
const respBody = await executeHttpCall({
|
|
1112
1145
|
request: httpReq,
|
|
1113
|
-
httpClient
|
|
1146
|
+
httpClient,
|
|
1114
1147
|
logger: this.logger,
|
|
1115
1148
|
});
|
|
1116
|
-
resp = parseResponse(respBody,
|
|
1149
|
+
resp = parseResponse(respBody, unmarshalVpcEndpointSchema);
|
|
1117
1150
|
};
|
|
1118
1151
|
await executeCall(call, options);
|
|
1119
1152
|
if (resp === undefined) {
|
|
@@ -1123,7 +1156,8 @@ export class NetworkingClient {
|
|
|
1123
1156
|
}
|
|
1124
1157
|
/** Lists <Databricks> network configurations for an account. */
|
|
1125
1158
|
async listNetworkPublic(req, options) {
|
|
1126
|
-
const
|
|
1159
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1160
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/networks`;
|
|
1127
1161
|
let resp;
|
|
1128
1162
|
const call = async (callSignal) => {
|
|
1129
1163
|
const headers = new Headers();
|
|
@@ -1131,7 +1165,7 @@ export class NetworkingClient {
|
|
|
1131
1165
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1132
1166
|
const respBody = await executeHttpCall({
|
|
1133
1167
|
request: httpReq,
|
|
1134
|
-
httpClient
|
|
1168
|
+
httpClient,
|
|
1135
1169
|
logger: this.logger,
|
|
1136
1170
|
});
|
|
1137
1171
|
resp = {
|
|
@@ -1146,7 +1180,8 @@ export class NetworkingClient {
|
|
|
1146
1180
|
}
|
|
1147
1181
|
/** Lists <Databricks> private access settings for an account. */
|
|
1148
1182
|
async listPrivateAccessSettingsPublic(req, options) {
|
|
1149
|
-
const
|
|
1183
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1184
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/private-access-settings`;
|
|
1150
1185
|
let resp;
|
|
1151
1186
|
const call = async (callSignal) => {
|
|
1152
1187
|
const headers = new Headers();
|
|
@@ -1154,11 +1189,11 @@ export class NetworkingClient {
|
|
|
1154
1189
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1155
1190
|
const respBody = await executeHttpCall({
|
|
1156
1191
|
request: httpReq,
|
|
1157
|
-
httpClient
|
|
1192
|
+
httpClient,
|
|
1158
1193
|
logger: this.logger,
|
|
1159
1194
|
});
|
|
1160
1195
|
resp = {
|
|
1161
|
-
privateAccessSettings: parseResponse(respBody, z.array(z.lazy(() =>
|
|
1196
|
+
privateAccessSettings: parseResponse(respBody, z.array(z.lazy(() => unmarshalPrivateAccessSettingsSchema))),
|
|
1162
1197
|
};
|
|
1163
1198
|
};
|
|
1164
1199
|
await executeCall(call, options);
|
|
@@ -1169,7 +1204,8 @@ export class NetworkingClient {
|
|
|
1169
1204
|
}
|
|
1170
1205
|
/** Lists Databricks VPC endpoint configurations for an account. */
|
|
1171
1206
|
async listVpcEndpointPublic(req, options) {
|
|
1172
|
-
const
|
|
1207
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1208
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/vpc-endpoints`;
|
|
1173
1209
|
let resp;
|
|
1174
1210
|
const call = async (callSignal) => {
|
|
1175
1211
|
const headers = new Headers();
|
|
@@ -1177,11 +1213,11 @@ export class NetworkingClient {
|
|
|
1177
1213
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1178
1214
|
const respBody = await executeHttpCall({
|
|
1179
1215
|
request: httpReq,
|
|
1180
|
-
httpClient
|
|
1216
|
+
httpClient,
|
|
1181
1217
|
logger: this.logger,
|
|
1182
1218
|
});
|
|
1183
1219
|
resp = {
|
|
1184
|
-
vpcEndpoints: parseResponse(respBody, z.array(z.lazy(() =>
|
|
1220
|
+
vpcEndpoints: parseResponse(respBody, z.array(z.lazy(() => unmarshalVpcEndpointSchema))),
|
|
1185
1221
|
};
|
|
1186
1222
|
};
|
|
1187
1223
|
await executeCall(call, options);
|
|
@@ -1197,8 +1233,9 @@ export class NetworkingClient {
|
|
|
1197
1233
|
* Before configuring PrivateLink, read the <Databricks> article about PrivateLink.
|
|
1198
1234
|
*/
|
|
1199
1235
|
async updatePrivateAccessSettingsPublic(req, options) {
|
|
1200
|
-
const
|
|
1201
|
-
const
|
|
1236
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1237
|
+
const url = `${host}/api/2.0/accounts/${req.customerFacingPrivateAccessSettings?.accountId ?? accountId ?? ''}/private-access-settings/${req.customerFacingPrivateAccessSettings?.privateAccessSettingsId ?? ''}`;
|
|
1238
|
+
const body = marshalRequest(req.customerFacingPrivateAccessSettings, marshalPrivateAccessSettingsSchema);
|
|
1202
1239
|
let resp;
|
|
1203
1240
|
const call = async (callSignal) => {
|
|
1204
1241
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
@@ -1206,10 +1243,10 @@ export class NetworkingClient {
|
|
|
1206
1243
|
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
1207
1244
|
const respBody = await executeHttpCall({
|
|
1208
1245
|
request: httpReq,
|
|
1209
|
-
httpClient
|
|
1246
|
+
httpClient,
|
|
1210
1247
|
logger: this.logger,
|
|
1211
1248
|
});
|
|
1212
|
-
resp = parseResponse(respBody,
|
|
1249
|
+
resp = parseResponse(respBody, unmarshalPrivateAccessSettingsSchema);
|
|
1213
1250
|
};
|
|
1214
1251
|
await executeCall(call, options);
|
|
1215
1252
|
if (resp === undefined) {
|
|
@@ -1222,7 +1259,8 @@ export class NetworkingClient {
|
|
|
1222
1259
|
* with 'default-policy' used if no explicit assignment exists.
|
|
1223
1260
|
*/
|
|
1224
1261
|
async getWorkspaceNetworkOptionRpc(req, options) {
|
|
1225
|
-
const
|
|
1262
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1263
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/workspaces/${String(req.workspaceId ?? '')}/network`;
|
|
1226
1264
|
let resp;
|
|
1227
1265
|
const call = async (callSignal) => {
|
|
1228
1266
|
const headers = new Headers();
|
|
@@ -1230,7 +1268,7 @@ export class NetworkingClient {
|
|
|
1230
1268
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
1231
1269
|
const respBody = await executeHttpCall({
|
|
1232
1270
|
request: httpReq,
|
|
1233
|
-
httpClient
|
|
1271
|
+
httpClient,
|
|
1234
1272
|
logger: this.logger,
|
|
1235
1273
|
});
|
|
1236
1274
|
resp = parseResponse(respBody, unmarshalWorkspaceNetworkOptionSchema);
|
|
@@ -1246,7 +1284,8 @@ export class NetworkingClient {
|
|
|
1246
1284
|
* To revert to the default policy, specify 'default-policy' as the network_policy_id.
|
|
1247
1285
|
*/
|
|
1248
1286
|
async updateWorkspaceNetworkOptionRpc(req, options) {
|
|
1249
|
-
const
|
|
1287
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
1288
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/workspaces/${String(req.workspaceId ?? '')}/network`;
|
|
1250
1289
|
const body = marshalRequest(req.workspaceNetworkOption, marshalWorkspaceNetworkOptionSchema);
|
|
1251
1290
|
let resp;
|
|
1252
1291
|
const call = async (callSignal) => {
|
|
@@ -1255,7 +1294,7 @@ export class NetworkingClient {
|
|
|
1255
1294
|
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
1256
1295
|
const respBody = await executeHttpCall({
|
|
1257
1296
|
request: httpReq,
|
|
1258
|
-
httpClient
|
|
1297
|
+
httpClient,
|
|
1259
1298
|
logger: this.logger,
|
|
1260
1299
|
});
|
|
1261
1300
|
resp = parseResponse(respBody, unmarshalWorkspaceNetworkOptionSchema);
|