@databricks/sdk-uc-resourcequotas 0.1.0-dev.3 → 0.1.0-dev.4
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/v1/model.d.ts +20 -19
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +21 -21
- package/dist/v1/model.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 +4 -5
- package/src/v1/client.ts +0 -155
- package/src/v1/index.ts +0 -13
- package/src/v1/model.ts +0 -111
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/dist/v1/model.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/** The type of Unity Catalog securable. */
|
|
3
|
-
export declare
|
|
4
|
-
CATALOG
|
|
5
|
-
SCHEMA
|
|
6
|
-
TABLE
|
|
7
|
-
STORAGE_CREDENTIAL
|
|
8
|
-
EXTERNAL_LOCATION
|
|
9
|
-
FUNCTION
|
|
10
|
-
SHARE
|
|
11
|
-
PROVIDER
|
|
12
|
-
RECIPIENT
|
|
13
|
-
CLEAN_ROOM
|
|
14
|
-
METASTORE
|
|
15
|
-
PIPELINE
|
|
16
|
-
VOLUME
|
|
17
|
-
CONNECTION
|
|
18
|
-
CREDENTIAL
|
|
19
|
-
EXTERNAL_METADATA
|
|
3
|
+
export declare const SecurableType: {
|
|
4
|
+
readonly CATALOG: "CATALOG";
|
|
5
|
+
readonly SCHEMA: "SCHEMA";
|
|
6
|
+
readonly TABLE: "TABLE";
|
|
7
|
+
readonly STORAGE_CREDENTIAL: "STORAGE_CREDENTIAL";
|
|
8
|
+
readonly EXTERNAL_LOCATION: "EXTERNAL_LOCATION";
|
|
9
|
+
readonly FUNCTION: "FUNCTION";
|
|
10
|
+
readonly SHARE: "SHARE";
|
|
11
|
+
readonly PROVIDER: "PROVIDER";
|
|
12
|
+
readonly RECIPIENT: "RECIPIENT";
|
|
13
|
+
readonly CLEAN_ROOM: "CLEAN_ROOM";
|
|
14
|
+
readonly METASTORE: "METASTORE";
|
|
15
|
+
readonly PIPELINE: "PIPELINE";
|
|
16
|
+
readonly VOLUME: "VOLUME";
|
|
17
|
+
readonly CONNECTION: "CONNECTION";
|
|
18
|
+
readonly CREDENTIAL: "CREDENTIAL";
|
|
19
|
+
readonly EXTERNAL_METADATA: "EXTERNAL_METADATA";
|
|
20
20
|
/** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
|
|
21
|
-
STAGING_TABLE
|
|
22
|
-
}
|
|
21
|
+
readonly STAGING_TABLE: "STAGING_TABLE";
|
|
22
|
+
};
|
|
23
|
+
export type SecurableType = (typeof SecurableType)[keyof typeof SecurableType] | (string & {});
|
|
23
24
|
export interface GetQuotaRequest {
|
|
24
25
|
/** Securable type of the quota parent. */
|
|
25
26
|
parentSecurableType?: string | undefined;
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,2CAA2C;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,2CAA2C;AAE3C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;IAiBxB,wEAAwE;;CAEhE,CAAC;AACX,MAAM,MAAM,aAAa,GACrB,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,GAClD,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAA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,27 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
/** The type of Unity Catalog securable. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
|
|
5
|
+
export const SecurableType = {
|
|
6
|
+
CATALOG: 'CATALOG',
|
|
7
|
+
SCHEMA: 'SCHEMA',
|
|
8
|
+
TABLE: 'TABLE',
|
|
9
|
+
STORAGE_CREDENTIAL: 'STORAGE_CREDENTIAL',
|
|
10
|
+
EXTERNAL_LOCATION: 'EXTERNAL_LOCATION',
|
|
11
|
+
FUNCTION: 'FUNCTION',
|
|
12
|
+
SHARE: 'SHARE',
|
|
13
|
+
PROVIDER: 'PROVIDER',
|
|
14
|
+
RECIPIENT: 'RECIPIENT',
|
|
15
|
+
CLEAN_ROOM: 'CLEAN_ROOM',
|
|
16
|
+
METASTORE: 'METASTORE',
|
|
17
|
+
PIPELINE: 'PIPELINE',
|
|
18
|
+
VOLUME: 'VOLUME',
|
|
19
|
+
CONNECTION: 'CONNECTION',
|
|
20
|
+
CREDENTIAL: 'CREDENTIAL',
|
|
21
|
+
EXTERNAL_METADATA: 'EXTERNAL_METADATA',
|
|
22
22
|
/** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
STAGING_TABLE: 'STAGING_TABLE',
|
|
24
|
+
};
|
|
25
25
|
export const unmarshalGetQuotaResponseSchema = z
|
|
26
26
|
.object({
|
|
27
27
|
quota_info: z.lazy(() => unmarshalQuotaInfoSchema).optional(),
|
|
@@ -40,7 +40,7 @@ export const unmarshalListQuotasResponseSchema = z
|
|
|
40
40
|
}));
|
|
41
41
|
export const unmarshalQuotaInfoSchema = z
|
|
42
42
|
.object({
|
|
43
|
-
parent_securable_type: z.
|
|
43
|
+
parent_securable_type: z.string().optional(),
|
|
44
44
|
parent_full_name: z.string().optional(),
|
|
45
45
|
quota_name: z.string().optional(),
|
|
46
46
|
quota_count: z.number().optional(),
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,2CAA2C;AAC3C,MAAM,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,2CAA2C;AAC3C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,iBAAiB,EAAE,mBAAmB;IACtC,wEAAwE;IACxE,aAAa,EAAE,eAAe;CACtB,CAAC;AAmDX,MAAM,CAAC,MAAM,+BAA+B,GAAgC,CAAC;KAC1E,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,IAA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E,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
|
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,MAAM,aAAa,CAAC;AAGlC,0EAA0E;AAC1E,6EAA6E;AAC7E,gEAAgE;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAC;AAQpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6C,EAC7C,OAAqB;IAErB,MAAM,IAAI,GAAY;QACpB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;QACjE,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,IAAI;YACxC,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC;QACF,GAAG,CAAC,OAA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AAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,KAAc,EACd,MAAuB;IAEvB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO;IACT,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,0CAA0C;QAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;YAC1E,kBAAkB,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;SAAM,IACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,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-resourcequotas",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.4",
|
|
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": {
|
|
@@ -29,9 +28,9 @@
|
|
|
29
28
|
"author": "Databricks",
|
|
30
29
|
"license": "Apache-2.0",
|
|
31
30
|
"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.
|
|
31
|
+
"@databricks/sdk-auth": ">=0.1.0-dev.5 <1.0.0",
|
|
32
|
+
"@databricks/sdk-core": ">=0.1.0-dev.6 <1.0.0",
|
|
33
|
+
"@databricks/sdk-options": ">=0.1.0-dev.5 <1.0.0",
|
|
35
34
|
"@js-temporal/polyfill": "^0.5.0",
|
|
36
35
|
"json-bigint": "^1.0.0",
|
|
37
36
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,155 +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
|
-
parseResponse,
|
|
16
|
-
} from './utils';
|
|
17
|
-
import pkgJson from '../../package.json' with {type: 'json'};
|
|
18
|
-
import type {
|
|
19
|
-
GetQuotaRequest,
|
|
20
|
-
GetQuotaResponse,
|
|
21
|
-
ListQuotasRequest,
|
|
22
|
-
ListQuotasResponse,
|
|
23
|
-
QuotaInfo,
|
|
24
|
-
} from './model';
|
|
25
|
-
import {
|
|
26
|
-
unmarshalGetQuotaResponseSchema,
|
|
27
|
-
unmarshalListQuotasResponseSchema,
|
|
28
|
-
} from './model';
|
|
29
|
-
|
|
30
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
31
|
-
const PACKAGE_SEGMENT = {
|
|
32
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
33
|
-
value: pkgJson.version,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export class ResourceQuotasClient {
|
|
37
|
-
private readonly host: string;
|
|
38
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
39
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
40
|
-
// request.
|
|
41
|
-
private readonly workspaceId: string | undefined;
|
|
42
|
-
private readonly httpClient: HttpClient;
|
|
43
|
-
private readonly logger: Logger;
|
|
44
|
-
// User-Agent header value. Composed once at construction from
|
|
45
|
-
// createDefault() merged with this package's identity and the active
|
|
46
|
-
// credential's name.
|
|
47
|
-
private readonly userAgent: string;
|
|
48
|
-
|
|
49
|
-
constructor(options: ClientOptions) {
|
|
50
|
-
if (options.host === undefined) {
|
|
51
|
-
throw new Error('Host is required.');
|
|
52
|
-
}
|
|
53
|
-
this.host = options.host.replace(/\/$/, '');
|
|
54
|
-
this.workspaceId = options.workspaceId;
|
|
55
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
56
|
-
const info = createDefault()
|
|
57
|
-
.with(PACKAGE_SEGMENT)
|
|
58
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
59
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
60
|
-
this.userAgent = info.toString();
|
|
61
|
-
this.httpClient = newHttpClient(options);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* The GetQuota API returns usage information for a single resource quota, defined as a
|
|
66
|
-
* child-parent pair. This API also refreshes the quota count if it is out of date.
|
|
67
|
-
* Refreshes are triggered asynchronously. The updated count might not be returned in the first call.
|
|
68
|
-
*/
|
|
69
|
-
async getQuota(
|
|
70
|
-
req: GetQuotaRequest,
|
|
71
|
-
options?: CallOptions
|
|
72
|
-
): Promise<GetQuotaResponse> {
|
|
73
|
-
const url = `${this.host}/api/2.1/unity-catalog/resource-quotas/${req.parentSecurableType ?? ''}/${req.parentFullName ?? ''}/${req.quotaName ?? ''}`;
|
|
74
|
-
let resp: GetQuotaResponse | undefined;
|
|
75
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
76
|
-
const headers = new Headers();
|
|
77
|
-
if (this.workspaceId !== undefined) {
|
|
78
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
79
|
-
}
|
|
80
|
-
headers.set('User-Agent', this.userAgent);
|
|
81
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
82
|
-
const respBody = await executeHttpCall({
|
|
83
|
-
request: httpReq,
|
|
84
|
-
httpClient: this.httpClient,
|
|
85
|
-
logger: this.logger,
|
|
86
|
-
});
|
|
87
|
-
resp = parseResponse(respBody, unmarshalGetQuotaResponseSchema);
|
|
88
|
-
};
|
|
89
|
-
await executeCall(call, options);
|
|
90
|
-
if (resp === undefined) {
|
|
91
|
-
throw new Error('operation completed without a result.');
|
|
92
|
-
}
|
|
93
|
-
return resp;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* ListQuotas returns all quota values under the metastore. There are no SLAs on the freshness of the counts
|
|
98
|
-
* returned. This API does not trigger a refresh of quota counts.
|
|
99
|
-
*
|
|
100
|
-
* PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero results while still providing a next_page_token.
|
|
101
|
-
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
102
|
-
*/
|
|
103
|
-
async listQuota(
|
|
104
|
-
req: ListQuotasRequest,
|
|
105
|
-
options?: CallOptions
|
|
106
|
-
): Promise<ListQuotasResponse> {
|
|
107
|
-
const url = `${this.host}/api/2.1/unity-catalog/resource-quotas/all-resource-quotas`;
|
|
108
|
-
const params = new URLSearchParams();
|
|
109
|
-
if (req.maxResults !== undefined) {
|
|
110
|
-
params.append('max_results', String(req.maxResults));
|
|
111
|
-
}
|
|
112
|
-
if (req.pageToken !== undefined) {
|
|
113
|
-
params.append('page_token', req.pageToken);
|
|
114
|
-
}
|
|
115
|
-
const query = params.toString();
|
|
116
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
117
|
-
let resp: ListQuotasResponse | undefined;
|
|
118
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
119
|
-
const headers = new Headers();
|
|
120
|
-
if (this.workspaceId !== undefined) {
|
|
121
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
122
|
-
}
|
|
123
|
-
headers.set('User-Agent', this.userAgent);
|
|
124
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
125
|
-
const respBody = await executeHttpCall({
|
|
126
|
-
request: httpReq,
|
|
127
|
-
httpClient: this.httpClient,
|
|
128
|
-
logger: this.logger,
|
|
129
|
-
});
|
|
130
|
-
resp = parseResponse(respBody, unmarshalListQuotasResponseSchema);
|
|
131
|
-
};
|
|
132
|
-
await executeCall(call, options);
|
|
133
|
-
if (resp === undefined) {
|
|
134
|
-
throw new Error('operation completed without a result.');
|
|
135
|
-
}
|
|
136
|
-
return resp;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async *listQuotaIter(
|
|
140
|
-
req: ListQuotasRequest,
|
|
141
|
-
options?: CallOptions
|
|
142
|
-
): AsyncGenerator<QuotaInfo> {
|
|
143
|
-
const pageReq: ListQuotasRequest = {...req};
|
|
144
|
-
for (;;) {
|
|
145
|
-
const resp = await this.listQuota(pageReq, options);
|
|
146
|
-
for (const item of resp.quotas ?? []) {
|
|
147
|
-
yield item;
|
|
148
|
-
}
|
|
149
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
pageReq.pageToken = resp.nextPageToken;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {ResourceQuotasClient} from './client';
|
|
4
|
-
|
|
5
|
-
export {SecurableType} from './model';
|
|
6
|
-
|
|
7
|
-
export type {
|
|
8
|
-
GetQuotaRequest,
|
|
9
|
-
GetQuotaResponse,
|
|
10
|
-
ListQuotasRequest,
|
|
11
|
-
ListQuotasResponse,
|
|
12
|
-
QuotaInfo,
|
|
13
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
/** The type of Unity Catalog securable. */
|
|
6
|
-
export enum SecurableType {
|
|
7
|
-
CATALOG = 'CATALOG',
|
|
8
|
-
SCHEMA = 'SCHEMA',
|
|
9
|
-
TABLE = 'TABLE',
|
|
10
|
-
STORAGE_CREDENTIAL = 'STORAGE_CREDENTIAL',
|
|
11
|
-
EXTERNAL_LOCATION = 'EXTERNAL_LOCATION',
|
|
12
|
-
FUNCTION = 'FUNCTION',
|
|
13
|
-
SHARE = 'SHARE',
|
|
14
|
-
PROVIDER = 'PROVIDER',
|
|
15
|
-
RECIPIENT = 'RECIPIENT',
|
|
16
|
-
CLEAN_ROOM = 'CLEAN_ROOM',
|
|
17
|
-
METASTORE = 'METASTORE',
|
|
18
|
-
PIPELINE = 'PIPELINE',
|
|
19
|
-
VOLUME = 'VOLUME',
|
|
20
|
-
CONNECTION = 'CONNECTION',
|
|
21
|
-
CREDENTIAL = 'CREDENTIAL',
|
|
22
|
-
EXTERNAL_METADATA = 'EXTERNAL_METADATA',
|
|
23
|
-
/** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
|
|
24
|
-
STAGING_TABLE = 'STAGING_TABLE',
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface GetQuotaRequest {
|
|
28
|
-
/** Securable type of the quota parent. */
|
|
29
|
-
parentSecurableType?: string | undefined;
|
|
30
|
-
/** Full name of the parent resource. Provide the metastore ID if the parent is a metastore. */
|
|
31
|
-
parentFullName?: string | undefined;
|
|
32
|
-
/** Name of the quota. Follows the pattern of the quota type, with "-quota" added as a suffix. */
|
|
33
|
-
quotaName?: string | undefined;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface GetQuotaResponse {
|
|
37
|
-
/** The returned QuotaInfo. */
|
|
38
|
-
quotaInfo?: QuotaInfo | undefined;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ListQuotasRequest {
|
|
42
|
-
/** The number of quotas to return. */
|
|
43
|
-
maxResults?: number | undefined;
|
|
44
|
-
/** Opaque token for the next page of results. */
|
|
45
|
-
pageToken?: string | undefined;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ListQuotasResponse {
|
|
49
|
-
/** An array of returned QuotaInfos. */
|
|
50
|
-
quotas?: QuotaInfo[] | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
53
|
-
* __page_token__ should be set to this value for the next request.
|
|
54
|
-
*/
|
|
55
|
-
nextPageToken?: string | undefined;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface QuotaInfo {
|
|
59
|
-
/** The quota parent securable type. */
|
|
60
|
-
parentSecurableType?: SecurableType | undefined;
|
|
61
|
-
/** Name of the parent resource. Returns metastore ID if the parent is a metastore. */
|
|
62
|
-
parentFullName?: string | undefined;
|
|
63
|
-
/** The name of the quota. */
|
|
64
|
-
quotaName?: string | undefined;
|
|
65
|
-
/** The current usage of the resource quota. */
|
|
66
|
-
quotaCount?: number | undefined;
|
|
67
|
-
/** The current limit of the resource quota. */
|
|
68
|
-
quotaLimit?: number | undefined;
|
|
69
|
-
/** The timestamp that indicates when the quota count was last updated. */
|
|
70
|
-
lastRefreshedAt?: bigint | undefined;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const unmarshalGetQuotaResponseSchema: z.ZodType<GetQuotaResponse> = z
|
|
74
|
-
.object({
|
|
75
|
-
quota_info: z.lazy(() => unmarshalQuotaInfoSchema).optional(),
|
|
76
|
-
})
|
|
77
|
-
.transform(d => ({
|
|
78
|
-
quotaInfo: d.quota_info,
|
|
79
|
-
}));
|
|
80
|
-
|
|
81
|
-
export const unmarshalListQuotasResponseSchema: z.ZodType<ListQuotasResponse> =
|
|
82
|
-
z
|
|
83
|
-
.object({
|
|
84
|
-
quotas: z.array(z.lazy(() => unmarshalQuotaInfoSchema)).optional(),
|
|
85
|
-
next_page_token: z.string().optional(),
|
|
86
|
-
})
|
|
87
|
-
.transform(d => ({
|
|
88
|
-
quotas: d.quotas,
|
|
89
|
-
nextPageToken: d.next_page_token,
|
|
90
|
-
}));
|
|
91
|
-
|
|
92
|
-
export const unmarshalQuotaInfoSchema: z.ZodType<QuotaInfo> = z
|
|
93
|
-
.object({
|
|
94
|
-
parent_securable_type: z.enum(SecurableType).optional(),
|
|
95
|
-
parent_full_name: z.string().optional(),
|
|
96
|
-
quota_name: z.string().optional(),
|
|
97
|
-
quota_count: z.number().optional(),
|
|
98
|
-
quota_limit: z.number().optional(),
|
|
99
|
-
last_refreshed_at: z
|
|
100
|
-
.union([z.number(), z.bigint()])
|
|
101
|
-
.transform(v => BigInt(v))
|
|
102
|
-
.optional(),
|
|
103
|
-
})
|
|
104
|
-
.transform(d => ({
|
|
105
|
-
parentSecurableType: d.parent_securable_type,
|
|
106
|
-
parentFullName: d.parent_full_name,
|
|
107
|
-
quotaName: d.quota_name,
|
|
108
|
-
quotaCount: d.quota_count,
|
|
109
|
-
quotaLimit: d.quota_limit,
|
|
110
|
-
lastRefreshedAt: d.last_refreshed_at,
|
|
111
|
-
}));
|
package/src/v1/transport.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Credentials} from '@databricks/sdk-auth';
|
|
4
|
-
import {defaultCredentials} from '@databricks/sdk-auth/credentials';
|
|
5
|
-
import type {
|
|
6
|
-
HttpClient,
|
|
7
|
-
HttpRequest,
|
|
8
|
-
HttpResponse,
|
|
9
|
-
} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newFetchHttpClient} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
12
|
-
|
|
13
|
-
/** Creates a new HTTP client with the given options. */
|
|
14
|
-
export function newHttpClient(options?: ClientOptions): HttpClient {
|
|
15
|
-
const opts = options ?? {};
|
|
16
|
-
|
|
17
|
-
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
18
|
-
// also set, since they would be silently ignored.
|
|
19
|
-
if (opts.httpClient !== undefined) {
|
|
20
|
-
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
'httpClient cannot be combined with credentials or timeout'
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return opts.httpClient;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const credentials = opts.credentials ?? defaultCredentials();
|
|
29
|
-
|
|
30
|
-
const base = newFetchHttpClient();
|
|
31
|
-
let client: HttpClient = new AuthHttpClient(base, credentials);
|
|
32
|
-
|
|
33
|
-
if (opts.timeout !== undefined) {
|
|
34
|
-
client = new TimeoutHttpClient(client, opts.timeout);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return client;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
class AuthHttpClient implements HttpClient {
|
|
42
|
-
constructor(
|
|
43
|
-
private readonly base: HttpClient,
|
|
44
|
-
private readonly credentials: Credentials
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
48
|
-
const authHeaders = await this.credentials.authHeaders();
|
|
49
|
-
// Do not modify the original request.
|
|
50
|
-
const headers = new Headers(request.headers);
|
|
51
|
-
for (const h of authHeaders) {
|
|
52
|
-
headers.set(h.key, h.value);
|
|
53
|
-
}
|
|
54
|
-
return this.base.send({...request, headers});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
class TimeoutHttpClient implements HttpClient {
|
|
60
|
-
constructor(
|
|
61
|
-
private readonly base: HttpClient,
|
|
62
|
-
private readonly timeout: number
|
|
63
|
-
) {}
|
|
64
|
-
|
|
65
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
66
|
-
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
67
|
-
const signal =
|
|
68
|
-
request.signal !== undefined
|
|
69
|
-
? AbortSignal.any([request.signal, timeoutSignal])
|
|
70
|
-
: timeoutSignal;
|
|
71
|
-
return this.base.send({...request, signal});
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/v1/utils.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Options} from '@databricks/sdk-core/ops';
|
|
4
|
-
import {execute} from '@databricks/sdk-core/ops';
|
|
5
|
-
import {ApiError} from '@databricks/sdk-core/apierror';
|
|
6
|
-
import type {
|
|
7
|
-
HttpClient,
|
|
8
|
-
HttpRequest,
|
|
9
|
-
HttpResponse,
|
|
10
|
-
} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
12
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
13
|
-
import JSONBig from 'json-bigint';
|
|
14
|
-
import type {z} from 'zod';
|
|
15
|
-
|
|
16
|
-
// JSON codec that preserves int64 precision. On the way in, large integer
|
|
17
|
-
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
18
|
-
// way out, bigint values are emitted as raw JSON number digits.
|
|
19
|
-
const jsonBigint = JSONBig({useNativeBigInt: true});
|
|
20
|
-
|
|
21
|
-
export interface HttpCallOptions {
|
|
22
|
-
readonly request: HttpRequest;
|
|
23
|
-
readonly httpClient: HttpClient;
|
|
24
|
-
readonly logger: Logger;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Translates public CallOptions to the internal Options shape accepted by
|
|
29
|
-
* execute(). Even though the shapes match today, this isolates the public
|
|
30
|
-
* API from the executor's internal type so they can diverge.
|
|
31
|
-
*/
|
|
32
|
-
export async function executeCall(
|
|
33
|
-
call: (signal?: AbortSignal) => Promise<void>,
|
|
34
|
-
options?: CallOptions
|
|
35
|
-
): Promise<void> {
|
|
36
|
-
const opts: Options = {
|
|
37
|
-
...(options?.retrier !== undefined && {retrier: options.retrier}),
|
|
38
|
-
...(options?.rateLimiter !== undefined && {
|
|
39
|
-
rateLimiter: options.rateLimiter,
|
|
40
|
-
}),
|
|
41
|
-
...(options?.timeout !== undefined && {timeout: options.timeout}),
|
|
42
|
-
};
|
|
43
|
-
return execute(options?.signal, call, opts);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function readAll(
|
|
47
|
-
body: ReadableStream<Uint8Array> | null
|
|
48
|
-
): Promise<Uint8Array> {
|
|
49
|
-
if (body === null) {
|
|
50
|
-
return new Uint8Array(0);
|
|
51
|
-
}
|
|
52
|
-
const reader = body.getReader();
|
|
53
|
-
const chunks: Uint8Array[] = [];
|
|
54
|
-
for (;;) {
|
|
55
|
-
const {done, value} = await reader.read();
|
|
56
|
-
if (done) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
chunks.push(value);
|
|
60
|
-
}
|
|
61
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
62
|
-
const result = new Uint8Array(totalLength);
|
|
63
|
-
let offset = 0;
|
|
64
|
-
for (const chunk of chunks) {
|
|
65
|
-
result.set(chunk, offset);
|
|
66
|
-
offset += chunk.length;
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export async function executeHttpCall(
|
|
72
|
-
opts: HttpCallOptions
|
|
73
|
-
): Promise<Uint8Array> {
|
|
74
|
-
opts.logger.debug('HTTP request', {
|
|
75
|
-
method: opts.request.method,
|
|
76
|
-
url: opts.request.url,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
let resp: HttpResponse;
|
|
80
|
-
try {
|
|
81
|
-
resp = await opts.httpClient.send(opts.request);
|
|
82
|
-
} catch (e: unknown) {
|
|
83
|
-
opts.logger.debug('HTTP request failed');
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const body = await readAll(resp.body);
|
|
88
|
-
|
|
89
|
-
opts.logger.debug('HTTP response', {
|
|
90
|
-
statusCode: resp.statusCode,
|
|
91
|
-
body: new TextDecoder().decode(body),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
95
|
-
if (apiErr !== undefined) {
|
|
96
|
-
throw apiErr;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return body;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function buildHttpRequest(
|
|
103
|
-
method: string,
|
|
104
|
-
url: string,
|
|
105
|
-
headers: Headers,
|
|
106
|
-
signal?: AbortSignal,
|
|
107
|
-
body?: string | ReadableStream<Uint8Array>
|
|
108
|
-
): HttpRequest {
|
|
109
|
-
const req: HttpRequest = {url, method, headers};
|
|
110
|
-
if (body !== undefined) {
|
|
111
|
-
req.body = body;
|
|
112
|
-
}
|
|
113
|
-
if (signal !== undefined) {
|
|
114
|
-
req.signal = signal;
|
|
115
|
-
}
|
|
116
|
-
return req;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
|
|
120
|
-
const text = new TextDecoder().decode(body);
|
|
121
|
-
const parsed: unknown = jsonBigint.parse(text);
|
|
122
|
-
return schema.parse(parsed);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function marshalRequest(data: unknown, schema: z.ZodType): string {
|
|
126
|
-
return jsonBigint.stringify(schema.parse(data));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function flattenQueryParams(
|
|
130
|
-
prefix: string,
|
|
131
|
-
value: unknown,
|
|
132
|
-
params: URLSearchParams
|
|
133
|
-
): void {
|
|
134
|
-
if (value === null || value === undefined) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (Array.isArray(value)) {
|
|
138
|
-
// arrays of objects are not yet supported
|
|
139
|
-
for (const item of value) {
|
|
140
|
-
params.append(prefix, String(item));
|
|
141
|
-
}
|
|
142
|
-
} else if (typeof value === 'object') {
|
|
143
|
-
for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
|
|
144
|
-
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
145
|
-
}
|
|
146
|
-
} else if (
|
|
147
|
-
typeof value === 'string' ||
|
|
148
|
-
typeof value === 'number' ||
|
|
149
|
-
typeof value === 'boolean' ||
|
|
150
|
-
typeof value === 'bigint'
|
|
151
|
-
) {
|
|
152
|
-
params.append(prefix, String(value));
|
|
153
|
-
} else {
|
|
154
|
-
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
155
|
-
}
|
|
156
|
-
}
|