@databricks/sdk-features 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 +3 -3
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +116 -97
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/model.d.ts +32 -18
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +5 -0
- 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/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @databricks/sdk-features
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
>
|
|
5
|
+
> ## Beta
|
|
6
|
+
>
|
|
7
|
+
> **This SDK is in Beta and is supported for production use cases.** Interfaces might still change slightly before GA (e.g. name standardization and minor ergonomic tweaks). We are keen to hear feedback from early adopters — please [file issues](https://github.com/databricks/sdk-js/issues), and we will address them.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @databricks/sdk-features
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {FeaturesClient} from '@databricks/sdk-features/v1';
|
|
19
|
+
|
|
20
|
+
const client = new FeaturesClient({});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a full getting-started guide, see the [root README](../../README.md).
|
package/dist/v1/client.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { CallOptions } from '@databricks/sdk-options/call';
|
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
3
|
import type { BatchCreateMaterializedFeaturesRequest, BatchCreateMaterializedFeaturesResponse, CreateFeatureRequest, CreateKafkaConfigRequest, CreateMaterializedFeatureRequest, CreateStreamRequest, DeleteFeatureRequest, DeleteKafkaConfigRequest, DeleteMaterializedFeatureRequest, DeleteStreamRequest, Feature, GetFeatureRequest, GetKafkaConfigRequest, GetMaterializedFeatureRequest, GetStreamRequest, KafkaConfig, ListFeaturesRequest, ListFeaturesResponse, ListKafkaConfigsRequest, ListKafkaConfigsResponse, ListMaterializedFeaturesRequest, ListMaterializedFeaturesResponse, ListStreamsRequest, ListStreamsResponse, MaterializedFeature, Stream, UpdateFeatureRequest, UpdateKafkaConfigRequest, UpdateMaterializedFeatureRequest, UpdateStreamRequest } from './model';
|
|
4
4
|
export declare class FeaturesClient {
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly workspaceId;
|
|
7
|
-
private readonly httpClient;
|
|
5
|
+
private readonly options;
|
|
8
6
|
private readonly logger;
|
|
9
7
|
private readonly userAgent;
|
|
8
|
+
private config;
|
|
10
9
|
constructor(options: ClientOptions);
|
|
10
|
+
private resolveConfig;
|
|
11
11
|
/** Batch create materialized features. */
|
|
12
12
|
batchCreateMaterializedFeatures(req: BatchCreateMaterializedFeaturesRequest, options?: CallOptions): Promise<BatchCreateMaterializedFeaturesResponse>;
|
|
13
13
|
/** Create a Feature. */
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAWlE,OAAO,KAAK,EACV,sCAAsC,EACtC,uCAAuC,EACvC,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,mBAAmB,EACnB,OAAO,EACP,iBAAiB,EACjB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAwBjB,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAWlE,OAAO,KAAK,EACV,sCAAsC,EACtC,uCAAuC,EACvC,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,mBAAmB,EACnB,OAAO,EACP,iBAAiB,EACjB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAwBjB,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAIhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAInC,OAAO,CAA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c,CAAC,MAAM,CAAC;IAczB,wBAAwB;IAClB,aAAa,CACjB,GAAG,EAAE,oBAAoB,EACzB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,OAAO,CAAC;IAsCnB;;;;OAIG;IACG,iBAAiB,CACrB,GAAG,EAAE,wBAAwB,EAC7B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,WAAW,CAAC;IAsCvB,oDAAoD;IAC9C,yBAAyB,CAC7B,GAAG,EAAE,gCAAgC,EACrC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,mBAAmB,CAAC;IAyC/B,wEAAwE;IAClE,YAAY,CAChB,GAAG,EAAE,mBAAmB,EACxB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,MAAM,CAAC;CAqCnB"}
|
package/dist/v1/client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 { marshalBatchCreateMaterializedFeaturesRequestSchema, marshalFeatureSchema, marshalKafkaConfigSchema, marshalMaterializedFeatureSchema, marshalStreamSchema, unmarshalBatchCreateMaterializedFeaturesResponseSchema, unmarshalFeatureSchema, unmarshalKafkaConfigSchema, unmarshalListFeaturesResponseSchema, unmarshalListKafkaConfigsResponseSchema, unmarshalListMaterializedFeaturesResponseSchema, unmarshalListStreamsResponseSchema, unmarshalMaterializedFeatureSchema, unmarshalStreamSchema, } from './model';
|
|
@@ -12,46 +12,45 @@ const PACKAGE_SEGMENT = {
|
|
|
12
12
|
value: pkgJson.version,
|
|
13
13
|
};
|
|
14
14
|
export class FeaturesClient {
|
|
15
|
-
|
|
16
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
17
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
18
|
-
// request.
|
|
19
|
-
workspaceId;
|
|
20
|
-
httpClient;
|
|
15
|
+
options;
|
|
21
16
|
logger;
|
|
22
17
|
// User-Agent header value. Composed once at construction from
|
|
23
18
|
// createDefault() merged with this package's identity and the active
|
|
24
19
|
// credential's name.
|
|
25
20
|
userAgent;
|
|
21
|
+
// Memoized configuration. The profile is resolved once, lazily, on the first
|
|
22
|
+
// request, then reused; host, workspaceId/accountId, and credentials are
|
|
23
|
+
// filled from it when not set explicitly on the options.
|
|
24
|
+
config;
|
|
26
25
|
constructor(options) {
|
|
27
|
-
|
|
28
|
-
throw new Error('Host is required.');
|
|
29
|
-
}
|
|
30
|
-
this.host = options.host.replace(/\/$/, '');
|
|
31
|
-
this.workspaceId = options.workspaceId;
|
|
26
|
+
this.options = options;
|
|
32
27
|
this.logger = options.logger ?? new NoOpLogger();
|
|
33
28
|
const info = createDefault()
|
|
34
29
|
.with(PACKAGE_SEGMENT)
|
|
35
30
|
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
36
31
|
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
37
32
|
this.userAgent = info.toString();
|
|
38
|
-
|
|
33
|
+
}
|
|
34
|
+
resolveConfig() {
|
|
35
|
+
this.config ??= resolveClientConfig(this.options);
|
|
36
|
+
return this.config;
|
|
39
37
|
}
|
|
40
38
|
/** Batch create materialized features. */
|
|
41
39
|
async batchCreateMaterializedFeatures(req, options) {
|
|
42
|
-
const
|
|
40
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
41
|
+
const url = `${host}/api/2.0/feature-engineering/materialized-features:batchCreate`;
|
|
43
42
|
const body = marshalRequest(req, marshalBatchCreateMaterializedFeaturesRequestSchema);
|
|
44
43
|
let resp;
|
|
45
44
|
const call = async (callSignal) => {
|
|
46
45
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
47
|
-
if (
|
|
48
|
-
headers.set('X-Databricks-Org-Id',
|
|
46
|
+
if (workspaceId !== undefined) {
|
|
47
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
49
48
|
}
|
|
50
49
|
headers.set('User-Agent', this.userAgent);
|
|
51
50
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
52
51
|
const respBody = await executeHttpCall({
|
|
53
52
|
request: httpReq,
|
|
54
|
-
httpClient
|
|
53
|
+
httpClient,
|
|
55
54
|
logger: this.logger,
|
|
56
55
|
});
|
|
57
56
|
resp = parseResponse(respBody, unmarshalBatchCreateMaterializedFeaturesResponseSchema);
|
|
@@ -64,19 +63,20 @@ export class FeaturesClient {
|
|
|
64
63
|
}
|
|
65
64
|
/** Create a Feature. */
|
|
66
65
|
async createFeature(req, options) {
|
|
67
|
-
const
|
|
66
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
67
|
+
const url = `${host}/api/2.0/feature-engineering/features`;
|
|
68
68
|
const body = marshalRequest(req.feature, marshalFeatureSchema);
|
|
69
69
|
let resp;
|
|
70
70
|
const call = async (callSignal) => {
|
|
71
71
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
72
|
-
if (
|
|
73
|
-
headers.set('X-Databricks-Org-Id',
|
|
72
|
+
if (workspaceId !== undefined) {
|
|
73
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
74
74
|
}
|
|
75
75
|
headers.set('User-Agent', this.userAgent);
|
|
76
76
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
77
77
|
const respBody = await executeHttpCall({
|
|
78
78
|
request: httpReq,
|
|
79
|
-
httpClient
|
|
79
|
+
httpClient,
|
|
80
80
|
logger: this.logger,
|
|
81
81
|
});
|
|
82
82
|
resp = parseResponse(respBody, unmarshalFeatureSchema);
|
|
@@ -93,19 +93,20 @@ export class FeaturesClient {
|
|
|
93
93
|
* Only the creator of the Kafka config can delete it.
|
|
94
94
|
*/
|
|
95
95
|
async createKafkaConfig(req, options) {
|
|
96
|
-
const
|
|
96
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
97
|
+
const url = `${host}/api/2.0/feature-engineering/features/kafka-configs`;
|
|
97
98
|
const body = marshalRequest(req.kafkaConfig, marshalKafkaConfigSchema);
|
|
98
99
|
let resp;
|
|
99
100
|
const call = async (callSignal) => {
|
|
100
101
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
101
|
-
if (
|
|
102
|
-
headers.set('X-Databricks-Org-Id',
|
|
102
|
+
if (workspaceId !== undefined) {
|
|
103
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
103
104
|
}
|
|
104
105
|
headers.set('User-Agent', this.userAgent);
|
|
105
106
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
106
107
|
const respBody = await executeHttpCall({
|
|
107
108
|
request: httpReq,
|
|
108
|
-
httpClient
|
|
109
|
+
httpClient,
|
|
109
110
|
logger: this.logger,
|
|
110
111
|
});
|
|
111
112
|
resp = parseResponse(respBody, unmarshalKafkaConfigSchema);
|
|
@@ -118,19 +119,20 @@ export class FeaturesClient {
|
|
|
118
119
|
}
|
|
119
120
|
/** Create a materialized feature. */
|
|
120
121
|
async createMaterializedFeature(req, options) {
|
|
121
|
-
const
|
|
122
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
123
|
+
const url = `${host}/api/2.0/feature-engineering/materialized-features`;
|
|
122
124
|
const body = marshalRequest(req.materializedFeature, marshalMaterializedFeatureSchema);
|
|
123
125
|
let resp;
|
|
124
126
|
const call = async (callSignal) => {
|
|
125
127
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
126
|
-
if (
|
|
127
|
-
headers.set('X-Databricks-Org-Id',
|
|
128
|
+
if (workspaceId !== undefined) {
|
|
129
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
128
130
|
}
|
|
129
131
|
headers.set('User-Agent', this.userAgent);
|
|
130
132
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
131
133
|
const respBody = await executeHttpCall({
|
|
132
134
|
request: httpReq,
|
|
133
|
-
httpClient
|
|
135
|
+
httpClient,
|
|
134
136
|
logger: this.logger,
|
|
135
137
|
});
|
|
136
138
|
resp = parseResponse(respBody, unmarshalMaterializedFeatureSchema);
|
|
@@ -143,19 +145,20 @@ export class FeaturesClient {
|
|
|
143
145
|
}
|
|
144
146
|
/** Create a Stream, a governed UC entity representing an external streaming data source. */
|
|
145
147
|
async createStream(req, options) {
|
|
146
|
-
const
|
|
148
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
149
|
+
const url = `${host}/api/2.0/feature-engineering/streams`;
|
|
147
150
|
const body = marshalRequest(req.stream, marshalStreamSchema);
|
|
148
151
|
let resp;
|
|
149
152
|
const call = async (callSignal) => {
|
|
150
153
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
151
|
-
if (
|
|
152
|
-
headers.set('X-Databricks-Org-Id',
|
|
154
|
+
if (workspaceId !== undefined) {
|
|
155
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
153
156
|
}
|
|
154
157
|
headers.set('User-Agent', this.userAgent);
|
|
155
158
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
156
159
|
const respBody = await executeHttpCall({
|
|
157
160
|
request: httpReq,
|
|
158
|
-
httpClient
|
|
161
|
+
httpClient,
|
|
159
162
|
logger: this.logger,
|
|
160
163
|
});
|
|
161
164
|
resp = parseResponse(respBody, unmarshalStreamSchema);
|
|
@@ -168,17 +171,18 @@ export class FeaturesClient {
|
|
|
168
171
|
}
|
|
169
172
|
/** Delete a Feature. */
|
|
170
173
|
async deleteFeature(req, options) {
|
|
171
|
-
const
|
|
174
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
175
|
+
const url = `${host}/api/2.0/feature-engineering/features/${req.fullName ?? ''}`;
|
|
172
176
|
const call = async (callSignal) => {
|
|
173
177
|
const headers = new Headers();
|
|
174
|
-
if (
|
|
175
|
-
headers.set('X-Databricks-Org-Id',
|
|
178
|
+
if (workspaceId !== undefined) {
|
|
179
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
176
180
|
}
|
|
177
181
|
headers.set('User-Agent', this.userAgent);
|
|
178
182
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
179
183
|
await executeHttpCall({
|
|
180
184
|
request: httpReq,
|
|
181
|
-
httpClient
|
|
185
|
+
httpClient,
|
|
182
186
|
logger: this.logger,
|
|
183
187
|
});
|
|
184
188
|
};
|
|
@@ -190,17 +194,18 @@ export class FeaturesClient {
|
|
|
190
194
|
* Only the creator of the Kafka config can delete it.
|
|
191
195
|
*/
|
|
192
196
|
async deleteKafkaConfig(req, options) {
|
|
193
|
-
const
|
|
197
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
198
|
+
const url = `${host}/api/2.0/feature-engineering/features/kafka-configs/${req.name ?? ''}`;
|
|
194
199
|
const call = async (callSignal) => {
|
|
195
200
|
const headers = new Headers();
|
|
196
|
-
if (
|
|
197
|
-
headers.set('X-Databricks-Org-Id',
|
|
201
|
+
if (workspaceId !== undefined) {
|
|
202
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
198
203
|
}
|
|
199
204
|
headers.set('User-Agent', this.userAgent);
|
|
200
205
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
201
206
|
await executeHttpCall({
|
|
202
207
|
request: httpReq,
|
|
203
|
-
httpClient
|
|
208
|
+
httpClient,
|
|
204
209
|
logger: this.logger,
|
|
205
210
|
});
|
|
206
211
|
};
|
|
@@ -208,17 +213,18 @@ export class FeaturesClient {
|
|
|
208
213
|
}
|
|
209
214
|
/** Delete a materialized feature. */
|
|
210
215
|
async deleteMaterializedFeature(req, options) {
|
|
211
|
-
const
|
|
216
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
217
|
+
const url = `${host}/api/2.0/feature-engineering/materialized-features/${req.materializedFeatureId ?? ''}`;
|
|
212
218
|
const call = async (callSignal) => {
|
|
213
219
|
const headers = new Headers();
|
|
214
|
-
if (
|
|
215
|
-
headers.set('X-Databricks-Org-Id',
|
|
220
|
+
if (workspaceId !== undefined) {
|
|
221
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
216
222
|
}
|
|
217
223
|
headers.set('User-Agent', this.userAgent);
|
|
218
224
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
219
225
|
await executeHttpCall({
|
|
220
226
|
request: httpReq,
|
|
221
|
-
httpClient
|
|
227
|
+
httpClient,
|
|
222
228
|
logger: this.logger,
|
|
223
229
|
});
|
|
224
230
|
};
|
|
@@ -226,17 +232,18 @@ export class FeaturesClient {
|
|
|
226
232
|
}
|
|
227
233
|
/** Delete a Stream by its full three-part name (catalog.schema.stream). */
|
|
228
234
|
async deleteStream(req, options) {
|
|
229
|
-
const
|
|
235
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
236
|
+
const url = `${host}/api/2.0/feature-engineering/streams/${req.name ?? ''}`;
|
|
230
237
|
const call = async (callSignal) => {
|
|
231
238
|
const headers = new Headers();
|
|
232
|
-
if (
|
|
233
|
-
headers.set('X-Databricks-Org-Id',
|
|
239
|
+
if (workspaceId !== undefined) {
|
|
240
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
234
241
|
}
|
|
235
242
|
headers.set('User-Agent', this.userAgent);
|
|
236
243
|
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
237
244
|
await executeHttpCall({
|
|
238
245
|
request: httpReq,
|
|
239
|
-
httpClient
|
|
246
|
+
httpClient,
|
|
240
247
|
logger: this.logger,
|
|
241
248
|
});
|
|
242
249
|
};
|
|
@@ -244,18 +251,19 @@ export class FeaturesClient {
|
|
|
244
251
|
}
|
|
245
252
|
/** Get a Feature. */
|
|
246
253
|
async getFeature(req, options) {
|
|
247
|
-
const
|
|
254
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
255
|
+
const url = `${host}/api/2.0/feature-engineering/features/${req.fullName ?? ''}`;
|
|
248
256
|
let resp;
|
|
249
257
|
const call = async (callSignal) => {
|
|
250
258
|
const headers = new Headers();
|
|
251
|
-
if (
|
|
252
|
-
headers.set('X-Databricks-Org-Id',
|
|
259
|
+
if (workspaceId !== undefined) {
|
|
260
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
253
261
|
}
|
|
254
262
|
headers.set('User-Agent', this.userAgent);
|
|
255
263
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
256
264
|
const respBody = await executeHttpCall({
|
|
257
265
|
request: httpReq,
|
|
258
|
-
httpClient
|
|
266
|
+
httpClient,
|
|
259
267
|
logger: this.logger,
|
|
260
268
|
});
|
|
261
269
|
resp = parseResponse(respBody, unmarshalFeatureSchema);
|
|
@@ -272,18 +280,19 @@ export class FeaturesClient {
|
|
|
272
280
|
* Only the creator of the Kafka config can delete it.
|
|
273
281
|
*/
|
|
274
282
|
async getKafkaConfig(req, options) {
|
|
275
|
-
const
|
|
283
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
284
|
+
const url = `${host}/api/2.0/feature-engineering/features/kafka-configs/${req.name ?? ''}`;
|
|
276
285
|
let resp;
|
|
277
286
|
const call = async (callSignal) => {
|
|
278
287
|
const headers = new Headers();
|
|
279
|
-
if (
|
|
280
|
-
headers.set('X-Databricks-Org-Id',
|
|
288
|
+
if (workspaceId !== undefined) {
|
|
289
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
281
290
|
}
|
|
282
291
|
headers.set('User-Agent', this.userAgent);
|
|
283
292
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
284
293
|
const respBody = await executeHttpCall({
|
|
285
294
|
request: httpReq,
|
|
286
|
-
httpClient
|
|
295
|
+
httpClient,
|
|
287
296
|
logger: this.logger,
|
|
288
297
|
});
|
|
289
298
|
resp = parseResponse(respBody, unmarshalKafkaConfigSchema);
|
|
@@ -296,18 +305,19 @@ export class FeaturesClient {
|
|
|
296
305
|
}
|
|
297
306
|
/** Get a materialized feature. */
|
|
298
307
|
async getMaterializedFeature(req, options) {
|
|
299
|
-
const
|
|
308
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
309
|
+
const url = `${host}/api/2.0/feature-engineering/materialized-features/${req.materializedFeatureId ?? ''}`;
|
|
300
310
|
let resp;
|
|
301
311
|
const call = async (callSignal) => {
|
|
302
312
|
const headers = new Headers();
|
|
303
|
-
if (
|
|
304
|
-
headers.set('X-Databricks-Org-Id',
|
|
313
|
+
if (workspaceId !== undefined) {
|
|
314
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
305
315
|
}
|
|
306
316
|
headers.set('User-Agent', this.userAgent);
|
|
307
317
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
308
318
|
const respBody = await executeHttpCall({
|
|
309
319
|
request: httpReq,
|
|
310
|
-
httpClient
|
|
320
|
+
httpClient,
|
|
311
321
|
logger: this.logger,
|
|
312
322
|
});
|
|
313
323
|
resp = parseResponse(respBody, unmarshalMaterializedFeatureSchema);
|
|
@@ -320,18 +330,19 @@ export class FeaturesClient {
|
|
|
320
330
|
}
|
|
321
331
|
/** Get a Stream by its full three-part name (catalog.schema.stream). */
|
|
322
332
|
async getStream(req, options) {
|
|
323
|
-
const
|
|
333
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
334
|
+
const url = `${host}/api/2.0/feature-engineering/streams/${req.name ?? ''}`;
|
|
324
335
|
let resp;
|
|
325
336
|
const call = async (callSignal) => {
|
|
326
337
|
const headers = new Headers();
|
|
327
|
-
if (
|
|
328
|
-
headers.set('X-Databricks-Org-Id',
|
|
338
|
+
if (workspaceId !== undefined) {
|
|
339
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
329
340
|
}
|
|
330
341
|
headers.set('User-Agent', this.userAgent);
|
|
331
342
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
332
343
|
const respBody = await executeHttpCall({
|
|
333
344
|
request: httpReq,
|
|
334
|
-
httpClient
|
|
345
|
+
httpClient,
|
|
335
346
|
logger: this.logger,
|
|
336
347
|
});
|
|
337
348
|
resp = parseResponse(respBody, unmarshalStreamSchema);
|
|
@@ -344,7 +355,8 @@ export class FeaturesClient {
|
|
|
344
355
|
}
|
|
345
356
|
/** List Features. */
|
|
346
357
|
async listFeatures(req, options) {
|
|
347
|
-
const
|
|
358
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
359
|
+
const url = `${host}/api/2.0/feature-engineering/features`;
|
|
348
360
|
const params = new URLSearchParams();
|
|
349
361
|
if (req.pageToken !== undefined) {
|
|
350
362
|
params.append('page_token', req.pageToken);
|
|
@@ -363,14 +375,14 @@ export class FeaturesClient {
|
|
|
363
375
|
let resp;
|
|
364
376
|
const call = async (callSignal) => {
|
|
365
377
|
const headers = new Headers();
|
|
366
|
-
if (
|
|
367
|
-
headers.set('X-Databricks-Org-Id',
|
|
378
|
+
if (workspaceId !== undefined) {
|
|
379
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
368
380
|
}
|
|
369
381
|
headers.set('User-Agent', this.userAgent);
|
|
370
382
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
371
383
|
const respBody = await executeHttpCall({
|
|
372
384
|
request: httpReq,
|
|
373
|
-
httpClient
|
|
385
|
+
httpClient,
|
|
374
386
|
logger: this.logger,
|
|
375
387
|
});
|
|
376
388
|
resp = parseResponse(respBody, unmarshalListFeaturesResponseSchema);
|
|
@@ -400,7 +412,8 @@ export class FeaturesClient {
|
|
|
400
412
|
* Only the creator of the Kafka config can delete it.
|
|
401
413
|
*/
|
|
402
414
|
async listKafkaConfigs(req, options) {
|
|
403
|
-
const
|
|
415
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
416
|
+
const url = `${host}/api/2.0/feature-engineering/features/kafka-configs`;
|
|
404
417
|
const params = new URLSearchParams();
|
|
405
418
|
if (req.pageToken !== undefined) {
|
|
406
419
|
params.append('page_token', req.pageToken);
|
|
@@ -413,14 +426,14 @@ export class FeaturesClient {
|
|
|
413
426
|
let resp;
|
|
414
427
|
const call = async (callSignal) => {
|
|
415
428
|
const headers = new Headers();
|
|
416
|
-
if (
|
|
417
|
-
headers.set('X-Databricks-Org-Id',
|
|
429
|
+
if (workspaceId !== undefined) {
|
|
430
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
418
431
|
}
|
|
419
432
|
headers.set('User-Agent', this.userAgent);
|
|
420
433
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
421
434
|
const respBody = await executeHttpCall({
|
|
422
435
|
request: httpReq,
|
|
423
|
-
httpClient
|
|
436
|
+
httpClient,
|
|
424
437
|
logger: this.logger,
|
|
425
438
|
});
|
|
426
439
|
resp = parseResponse(respBody, unmarshalListKafkaConfigsResponseSchema);
|
|
@@ -446,7 +459,8 @@ export class FeaturesClient {
|
|
|
446
459
|
}
|
|
447
460
|
/** List materialized features. */
|
|
448
461
|
async listMaterializedFeatures(req, options) {
|
|
449
|
-
const
|
|
462
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
463
|
+
const url = `${host}/api/2.0/feature-engineering/materialized-features`;
|
|
450
464
|
const params = new URLSearchParams();
|
|
451
465
|
if (req.featureName !== undefined) {
|
|
452
466
|
params.append('feature_name', req.featureName);
|
|
@@ -462,14 +476,14 @@ export class FeaturesClient {
|
|
|
462
476
|
let resp;
|
|
463
477
|
const call = async (callSignal) => {
|
|
464
478
|
const headers = new Headers();
|
|
465
|
-
if (
|
|
466
|
-
headers.set('X-Databricks-Org-Id',
|
|
479
|
+
if (workspaceId !== undefined) {
|
|
480
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
467
481
|
}
|
|
468
482
|
headers.set('User-Agent', this.userAgent);
|
|
469
483
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
470
484
|
const respBody = await executeHttpCall({
|
|
471
485
|
request: httpReq,
|
|
472
|
-
httpClient
|
|
486
|
+
httpClient,
|
|
473
487
|
logger: this.logger,
|
|
474
488
|
});
|
|
475
489
|
resp = parseResponse(respBody, unmarshalListMaterializedFeaturesResponseSchema);
|
|
@@ -495,7 +509,8 @@ export class FeaturesClient {
|
|
|
495
509
|
}
|
|
496
510
|
/** List Streams under a given catalog.schema parent. */
|
|
497
511
|
async listStreams(req, options) {
|
|
498
|
-
const
|
|
512
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
513
|
+
const url = `${host}/api/2.0/feature-engineering/streams`;
|
|
499
514
|
const params = new URLSearchParams();
|
|
500
515
|
if (req.parent !== undefined) {
|
|
501
516
|
params.append('parent', req.parent);
|
|
@@ -511,14 +526,14 @@ export class FeaturesClient {
|
|
|
511
526
|
let resp;
|
|
512
527
|
const call = async (callSignal) => {
|
|
513
528
|
const headers = new Headers();
|
|
514
|
-
if (
|
|
515
|
-
headers.set('X-Databricks-Org-Id',
|
|
529
|
+
if (workspaceId !== undefined) {
|
|
530
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
516
531
|
}
|
|
517
532
|
headers.set('User-Agent', this.userAgent);
|
|
518
533
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
519
534
|
const respBody = await executeHttpCall({
|
|
520
535
|
request: httpReq,
|
|
521
|
-
httpClient
|
|
536
|
+
httpClient,
|
|
522
537
|
logger: this.logger,
|
|
523
538
|
});
|
|
524
539
|
resp = parseResponse(respBody, unmarshalListStreamsResponseSchema);
|
|
@@ -544,7 +559,8 @@ export class FeaturesClient {
|
|
|
544
559
|
}
|
|
545
560
|
/** Update a Feature. */
|
|
546
561
|
async updateFeature(req, options) {
|
|
547
|
-
const
|
|
562
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
563
|
+
const url = `${host}/api/2.0/feature-engineering/features/${req.feature?.fullName ?? ''}`;
|
|
548
564
|
const params = new URLSearchParams();
|
|
549
565
|
if (req.updateMask !== undefined) {
|
|
550
566
|
params.append('update_mask', req.updateMask.toString());
|
|
@@ -555,14 +571,14 @@ export class FeaturesClient {
|
|
|
555
571
|
let resp;
|
|
556
572
|
const call = async (callSignal) => {
|
|
557
573
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
558
|
-
if (
|
|
559
|
-
headers.set('X-Databricks-Org-Id',
|
|
574
|
+
if (workspaceId !== undefined) {
|
|
575
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
560
576
|
}
|
|
561
577
|
headers.set('User-Agent', this.userAgent);
|
|
562
578
|
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
563
579
|
const respBody = await executeHttpCall({
|
|
564
580
|
request: httpReq,
|
|
565
|
-
httpClient
|
|
581
|
+
httpClient,
|
|
566
582
|
logger: this.logger,
|
|
567
583
|
});
|
|
568
584
|
resp = parseResponse(respBody, unmarshalFeatureSchema);
|
|
@@ -579,7 +595,8 @@ export class FeaturesClient {
|
|
|
579
595
|
* Only the creator of the Kafka config can delete it.
|
|
580
596
|
*/
|
|
581
597
|
async updateKafkaConfig(req, options) {
|
|
582
|
-
const
|
|
598
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
599
|
+
const url = `${host}/api/2.0/feature-engineering/features/kafka-configs/${req.kafkaConfig?.name ?? ''}`;
|
|
583
600
|
const params = new URLSearchParams();
|
|
584
601
|
if (req.updateMask !== undefined) {
|
|
585
602
|
params.append('update_mask', req.updateMask.toString());
|
|
@@ -590,14 +607,14 @@ export class FeaturesClient {
|
|
|
590
607
|
let resp;
|
|
591
608
|
const call = async (callSignal) => {
|
|
592
609
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
593
|
-
if (
|
|
594
|
-
headers.set('X-Databricks-Org-Id',
|
|
610
|
+
if (workspaceId !== undefined) {
|
|
611
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
595
612
|
}
|
|
596
613
|
headers.set('User-Agent', this.userAgent);
|
|
597
614
|
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
598
615
|
const respBody = await executeHttpCall({
|
|
599
616
|
request: httpReq,
|
|
600
|
-
httpClient
|
|
617
|
+
httpClient,
|
|
601
618
|
logger: this.logger,
|
|
602
619
|
});
|
|
603
620
|
resp = parseResponse(respBody, unmarshalKafkaConfigSchema);
|
|
@@ -610,7 +627,8 @@ export class FeaturesClient {
|
|
|
610
627
|
}
|
|
611
628
|
/** Update a materialized feature (pause/resume). */
|
|
612
629
|
async updateMaterializedFeature(req, options) {
|
|
613
|
-
const
|
|
630
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
631
|
+
const url = `${host}/api/2.0/feature-engineering/materialized-features/${req.materializedFeature?.materializedFeatureId ?? ''}`;
|
|
614
632
|
const params = new URLSearchParams();
|
|
615
633
|
if (req.updateMask !== undefined) {
|
|
616
634
|
params.append('update_mask', req.updateMask.toString());
|
|
@@ -621,14 +639,14 @@ export class FeaturesClient {
|
|
|
621
639
|
let resp;
|
|
622
640
|
const call = async (callSignal) => {
|
|
623
641
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
624
|
-
if (
|
|
625
|
-
headers.set('X-Databricks-Org-Id',
|
|
642
|
+
if (workspaceId !== undefined) {
|
|
643
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
626
644
|
}
|
|
627
645
|
headers.set('User-Agent', this.userAgent);
|
|
628
646
|
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
629
647
|
const respBody = await executeHttpCall({
|
|
630
648
|
request: httpReq,
|
|
631
|
-
httpClient
|
|
649
|
+
httpClient,
|
|
632
650
|
logger: this.logger,
|
|
633
651
|
});
|
|
634
652
|
resp = parseResponse(respBody, unmarshalMaterializedFeatureSchema);
|
|
@@ -641,7 +659,8 @@ export class FeaturesClient {
|
|
|
641
659
|
}
|
|
642
660
|
/** Update a Stream. Only fields listed in `update_mask` are mutated. */
|
|
643
661
|
async updateStream(req, options) {
|
|
644
|
-
const
|
|
662
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
663
|
+
const url = `${host}/api/2.0/feature-engineering/streams/${req.stream?.name ?? ''}`;
|
|
645
664
|
const params = new URLSearchParams();
|
|
646
665
|
if (req.updateMask !== undefined) {
|
|
647
666
|
params.append('update_mask', req.updateMask.toString());
|
|
@@ -652,14 +671,14 @@ export class FeaturesClient {
|
|
|
652
671
|
let resp;
|
|
653
672
|
const call = async (callSignal) => {
|
|
654
673
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
655
|
-
if (
|
|
656
|
-
headers.set('X-Databricks-Org-Id',
|
|
674
|
+
if (workspaceId !== undefined) {
|
|
675
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
657
676
|
}
|
|
658
677
|
headers.set('User-Agent', this.userAgent);
|
|
659
678
|
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
660
679
|
const respBody = await executeHttpCall({
|
|
661
680
|
request: httpReq,
|
|
662
|
-
httpClient
|
|
681
|
+
httpClient,
|
|
663
682
|
logger: this.logger,
|
|
664
683
|
});
|
|
665
684
|
resp = parseResponse(respBody, unmarshalStreamSchema);
|