@databricks/sdk-logdelivery 0.1.0-dev.2 → 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/client.d.ts +5 -5
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +5 -5
- 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/model.d.ts +31 -27
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +36 -40
- 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 +6 -6
- package/src/v1/client.ts +0 -241
- package/src/v1/index.ts +0 -24
- package/src/v1/model.ts +0 -411
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/src/v1/client.ts
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
|
|
4
|
-
import {createDefault} from '@databricks/sdk-core/clientinfo';
|
|
5
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
6
|
-
import {NoOpLogger} from '@databricks/sdk-core/logger';
|
|
7
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
8
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
9
|
-
import type {HttpClient} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newHttpClient} from './transport';
|
|
11
|
-
import {
|
|
12
|
-
buildHttpRequest,
|
|
13
|
-
executeCall,
|
|
14
|
-
executeHttpCall,
|
|
15
|
-
marshalRequest,
|
|
16
|
-
parseResponse,
|
|
17
|
-
} from './utils';
|
|
18
|
-
import pkgJson from '../../package.json' with {type: 'json'};
|
|
19
|
-
import type {
|
|
20
|
-
CreateLogDeliveryConfigurationRequest,
|
|
21
|
-
CreateLogDeliveryConfigurationRequest_Response,
|
|
22
|
-
GetLogDeliveryConfigurationRequest,
|
|
23
|
-
GetLogDeliveryConfigurationRequest_Response,
|
|
24
|
-
ListLogDeliveryConfigurationRequest,
|
|
25
|
-
ListLogDeliveryConfigurationRequest_Response,
|
|
26
|
-
LogDeliveryConfiguration,
|
|
27
|
-
UpdateLogDeliveryConfigurationRequest,
|
|
28
|
-
UpdateLogDeliveryConfigurationRequest_Response,
|
|
29
|
-
} from './model';
|
|
30
|
-
import {
|
|
31
|
-
marshalCreateLogDeliveryConfigurationRequestSchema,
|
|
32
|
-
marshalUpdateLogDeliveryConfigurationRequestSchema,
|
|
33
|
-
unmarshalCreateLogDeliveryConfigurationRequest_ResponseSchema,
|
|
34
|
-
unmarshalGetLogDeliveryConfigurationRequest_ResponseSchema,
|
|
35
|
-
unmarshalListLogDeliveryConfigurationRequest_ResponseSchema,
|
|
36
|
-
unmarshalUpdateLogDeliveryConfigurationRequest_ResponseSchema,
|
|
37
|
-
} from './model';
|
|
38
|
-
|
|
39
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
40
|
-
const PACKAGE_SEGMENT = {
|
|
41
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
42
|
-
value: pkgJson.version,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export class LogDeliveryClient {
|
|
46
|
-
private readonly host: string;
|
|
47
|
-
// Fallback for endpoints whose path contains {account_id}. If the request
|
|
48
|
-
// already carries an accountId, that value wins.
|
|
49
|
-
private readonly accountId: string | undefined;
|
|
50
|
-
private readonly httpClient: HttpClient;
|
|
51
|
-
private readonly logger: Logger;
|
|
52
|
-
// User-Agent header value. Composed once at construction from
|
|
53
|
-
// createDefault() merged with this package's identity and the active
|
|
54
|
-
// credential's name.
|
|
55
|
-
private readonly userAgent: string;
|
|
56
|
-
|
|
57
|
-
constructor(options: ClientOptions) {
|
|
58
|
-
if (options.host === undefined) {
|
|
59
|
-
throw new Error('Host is required.');
|
|
60
|
-
}
|
|
61
|
-
this.host = options.host.replace(/\/$/, '');
|
|
62
|
-
this.accountId = options.accountId;
|
|
63
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
64
|
-
const info = createDefault()
|
|
65
|
-
.with(PACKAGE_SEGMENT)
|
|
66
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
67
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
68
|
-
this.userAgent = info.toString();
|
|
69
|
-
this.httpClient = newHttpClient(options);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Creates a new <Databricks> log delivery configuration to enable delivery of the specified type of logs to your storage location.
|
|
74
|
-
* This requires that you already created a [credential object](:method:Credentials/Create) (which encapsulates a cross-account service IAM role)
|
|
75
|
-
* and a [storage configuration object](:method:Storage/Create) (which encapsulates an S3 bucket).
|
|
76
|
-
*
|
|
77
|
-
* For full details, including the required IAM role policies and bucket policies,
|
|
78
|
-
* see [Deliver and access billable usage logs](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html)
|
|
79
|
-
* or [Configure audit logging](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html).
|
|
80
|
-
*
|
|
81
|
-
* **Note**: There is a limit on the number of log delivery configurations available per account (each limit applies separately to each log type including billable usage and audit logs).
|
|
82
|
-
* You can create a maximum of two enabled account-level delivery configurations (configurations without a workspace filter) per type.
|
|
83
|
-
* Additionally, you can create two enabled workspace-level delivery configurations per workspace for each log type, which means that the same workspace ID can occur in the workspace filter for no more than two delivery configurations per log type.
|
|
84
|
-
*
|
|
85
|
-
* You cannot delete a log delivery configuration, but you can disable it (see [Enable or disable log delivery configuration](:method:LogDelivery/PatchStatus)).
|
|
86
|
-
*/
|
|
87
|
-
async createLogDeliveryConfiguration(
|
|
88
|
-
req: CreateLogDeliveryConfigurationRequest,
|
|
89
|
-
options?: CallOptions
|
|
90
|
-
): Promise<CreateLogDeliveryConfigurationRequest_Response> {
|
|
91
|
-
const url = `${this.host}/api/2.0/accounts/${req.logDeliveryConfiguration?.accountId ?? this.accountId ?? ''}/log-delivery`;
|
|
92
|
-
const body = marshalRequest(
|
|
93
|
-
req,
|
|
94
|
-
marshalCreateLogDeliveryConfigurationRequestSchema
|
|
95
|
-
);
|
|
96
|
-
let resp: CreateLogDeliveryConfigurationRequest_Response | undefined;
|
|
97
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
98
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
99
|
-
headers.set('User-Agent', this.userAgent);
|
|
100
|
-
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
101
|
-
const respBody = await executeHttpCall({
|
|
102
|
-
request: httpReq,
|
|
103
|
-
httpClient: this.httpClient,
|
|
104
|
-
logger: this.logger,
|
|
105
|
-
});
|
|
106
|
-
resp = parseResponse(
|
|
107
|
-
respBody,
|
|
108
|
-
unmarshalCreateLogDeliveryConfigurationRequest_ResponseSchema
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
await executeCall(call, options);
|
|
112
|
-
if (resp === undefined) {
|
|
113
|
-
throw new Error('operation completed without a result.');
|
|
114
|
-
}
|
|
115
|
-
return resp;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** Gets a <Databricks> log delivery configuration object for an account, both specified by ID. */
|
|
119
|
-
async getLogDeliveryConfiguration(
|
|
120
|
-
req: GetLogDeliveryConfigurationRequest,
|
|
121
|
-
options?: CallOptions
|
|
122
|
-
): Promise<GetLogDeliveryConfigurationRequest_Response> {
|
|
123
|
-
const url = `${this.host}/api/2.0/accounts/${req.accountId ?? this.accountId ?? ''}/log-delivery/${req.configId ?? ''}`;
|
|
124
|
-
let resp: GetLogDeliveryConfigurationRequest_Response | undefined;
|
|
125
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
126
|
-
const headers = new Headers();
|
|
127
|
-
headers.set('User-Agent', this.userAgent);
|
|
128
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
129
|
-
const respBody = await executeHttpCall({
|
|
130
|
-
request: httpReq,
|
|
131
|
-
httpClient: this.httpClient,
|
|
132
|
-
logger: this.logger,
|
|
133
|
-
});
|
|
134
|
-
resp = parseResponse(
|
|
135
|
-
respBody,
|
|
136
|
-
unmarshalGetLogDeliveryConfigurationRequest_ResponseSchema
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
await executeCall(call, options);
|
|
140
|
-
if (resp === undefined) {
|
|
141
|
-
throw new Error('operation completed without a result.');
|
|
142
|
-
}
|
|
143
|
-
return resp;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/** Gets all <Databricks> log delivery configurations associated with an account specified by ID. */
|
|
147
|
-
async listLogDeliveryConfiguration(
|
|
148
|
-
req: ListLogDeliveryConfigurationRequest,
|
|
149
|
-
options?: CallOptions
|
|
150
|
-
): Promise<ListLogDeliveryConfigurationRequest_Response> {
|
|
151
|
-
const url = `${this.host}/api/2.0/accounts/${req.accountId ?? this.accountId ?? ''}/log-delivery`;
|
|
152
|
-
const params = new URLSearchParams();
|
|
153
|
-
if (req.credentialsId !== undefined) {
|
|
154
|
-
params.append('credentials_id', req.credentialsId);
|
|
155
|
-
}
|
|
156
|
-
if (req.storageConfigurationId !== undefined) {
|
|
157
|
-
params.append('storage_configuration_id', req.storageConfigurationId);
|
|
158
|
-
}
|
|
159
|
-
if (req.status !== undefined) {
|
|
160
|
-
params.append('status', req.status);
|
|
161
|
-
}
|
|
162
|
-
if (req.pageToken !== undefined) {
|
|
163
|
-
params.append('page_token', req.pageToken);
|
|
164
|
-
}
|
|
165
|
-
const query = params.toString();
|
|
166
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
167
|
-
let resp: ListLogDeliveryConfigurationRequest_Response | undefined;
|
|
168
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
169
|
-
const headers = new Headers();
|
|
170
|
-
headers.set('User-Agent', this.userAgent);
|
|
171
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
172
|
-
const respBody = await executeHttpCall({
|
|
173
|
-
request: httpReq,
|
|
174
|
-
httpClient: this.httpClient,
|
|
175
|
-
logger: this.logger,
|
|
176
|
-
});
|
|
177
|
-
resp = parseResponse(
|
|
178
|
-
respBody,
|
|
179
|
-
unmarshalListLogDeliveryConfigurationRequest_ResponseSchema
|
|
180
|
-
);
|
|
181
|
-
};
|
|
182
|
-
await executeCall(call, options);
|
|
183
|
-
if (resp === undefined) {
|
|
184
|
-
throw new Error('operation completed without a result.');
|
|
185
|
-
}
|
|
186
|
-
return resp;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async *listLogDeliveryConfigurationIter(
|
|
190
|
-
req: ListLogDeliveryConfigurationRequest,
|
|
191
|
-
options?: CallOptions
|
|
192
|
-
): AsyncGenerator<LogDeliveryConfiguration> {
|
|
193
|
-
const pageReq: ListLogDeliveryConfigurationRequest = {...req};
|
|
194
|
-
for (;;) {
|
|
195
|
-
const resp = await this.listLogDeliveryConfiguration(pageReq, options);
|
|
196
|
-
for (const item of resp.logDeliveryConfigurations ?? []) {
|
|
197
|
-
yield item;
|
|
198
|
-
}
|
|
199
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
pageReq.pageToken = resp.nextPageToken;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Enables or disables a log delivery configuration.
|
|
208
|
-
* Deletion of delivery configurations is not supported, so disable log delivery configurations that are no longer needed.
|
|
209
|
-
* Note that you can't re-enable a delivery configuration if this would violate the delivery configuration limits described under [Create log delivery](:method:LogDelivery/Create).
|
|
210
|
-
*/
|
|
211
|
-
async updateLogDeliveryConfiguration(
|
|
212
|
-
req: UpdateLogDeliveryConfigurationRequest,
|
|
213
|
-
options?: CallOptions
|
|
214
|
-
): Promise<UpdateLogDeliveryConfigurationRequest_Response> {
|
|
215
|
-
const url = `${this.host}/api/2.0/accounts/${req.accountId ?? this.accountId ?? ''}/log-delivery/${req.configId ?? ''}`;
|
|
216
|
-
const body = marshalRequest(
|
|
217
|
-
req,
|
|
218
|
-
marshalUpdateLogDeliveryConfigurationRequestSchema
|
|
219
|
-
);
|
|
220
|
-
let resp: UpdateLogDeliveryConfigurationRequest_Response | undefined;
|
|
221
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
222
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
223
|
-
headers.set('User-Agent', this.userAgent);
|
|
224
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
225
|
-
const respBody = await executeHttpCall({
|
|
226
|
-
request: httpReq,
|
|
227
|
-
httpClient: this.httpClient,
|
|
228
|
-
logger: this.logger,
|
|
229
|
-
});
|
|
230
|
-
resp = parseResponse(
|
|
231
|
-
respBody,
|
|
232
|
-
unmarshalUpdateLogDeliveryConfigurationRequest_ResponseSchema
|
|
233
|
-
);
|
|
234
|
-
};
|
|
235
|
-
await executeCall(call, options);
|
|
236
|
-
if (resp === undefined) {
|
|
237
|
-
throw new Error('operation completed without a result.');
|
|
238
|
-
}
|
|
239
|
-
return resp;
|
|
240
|
-
}
|
|
241
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {LogDeliveryClient} from './client';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
LogDeliveryConfigStatus,
|
|
7
|
-
LogDeliveryOutputFormat,
|
|
8
|
-
LogDeliveryStatusEnum,
|
|
9
|
-
LogDeliveryType,
|
|
10
|
-
} from './model';
|
|
11
|
-
|
|
12
|
-
export type {
|
|
13
|
-
CreateLogDeliveryConfigurationParams,
|
|
14
|
-
CreateLogDeliveryConfigurationRequest,
|
|
15
|
-
CreateLogDeliveryConfigurationRequest_Response,
|
|
16
|
-
GetLogDeliveryConfigurationRequest,
|
|
17
|
-
GetLogDeliveryConfigurationRequest_Response,
|
|
18
|
-
ListLogDeliveryConfigurationRequest,
|
|
19
|
-
ListLogDeliveryConfigurationRequest_Response,
|
|
20
|
-
LogDeliveryConfiguration,
|
|
21
|
-
LogDeliveryStatus,
|
|
22
|
-
UpdateLogDeliveryConfigurationRequest,
|
|
23
|
-
UpdateLogDeliveryConfigurationRequest_Response,
|
|
24
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* *
|
|
7
|
-
* Log Delivery Status
|
|
8
|
-
*
|
|
9
|
-
* `ENABLED`: All dependencies have executed and succeeded
|
|
10
|
-
* `DISABLED`: At least one dependency has succeeded
|
|
11
|
-
*/
|
|
12
|
-
export enum LogDeliveryConfigStatus {
|
|
13
|
-
/** Configuration is enabled */
|
|
14
|
-
ENABLED = 'ENABLED',
|
|
15
|
-
/** Configuration is disabled */
|
|
16
|
-
DISABLED = 'DISABLED',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* *
|
|
21
|
-
* Log Delivery Output Format
|
|
22
|
-
*/
|
|
23
|
-
export enum LogDeliveryOutputFormat {
|
|
24
|
-
/** Deliver CSV files */
|
|
25
|
-
CSV = 'CSV',
|
|
26
|
-
/** Deliver JSON files */
|
|
27
|
-
JSON = 'JSON',
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* *
|
|
32
|
-
* The status string for log delivery. Possible values are:
|
|
33
|
-
* `CREATED`: There were no log delivery attempts since the config was created.
|
|
34
|
-
* `SUCCEEDED`: The latest attempt of log delivery has succeeded completely.
|
|
35
|
-
* `USER_FAILURE`: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage.
|
|
36
|
-
* `SYSTEM_FAILURE`: The latest attempt of log delivery failed because of an <Databricks> internal error. Contact support if it doesn't go away soon.
|
|
37
|
-
* `NOT_FOUND`: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account.
|
|
38
|
-
*/
|
|
39
|
-
export enum LogDeliveryStatusEnum {
|
|
40
|
-
/** Configuration is just created and logs haven't delivered yet */
|
|
41
|
-
CREATED = 'CREATED',
|
|
42
|
-
/** Configuration has succeeded in the last run */
|
|
43
|
-
SUCCEEDED = 'SUCCEEDED',
|
|
44
|
-
/** Configuration has failed in the last run due to user failure */
|
|
45
|
-
USER_FAILURE = 'USER_FAILURE',
|
|
46
|
-
/** Configuration has failed in the last run due to system failure */
|
|
47
|
-
SYSTEM_FAILURE = 'SYSTEM_FAILURE',
|
|
48
|
-
/** Status not found */
|
|
49
|
-
NOT_FOUND = 'NOT_FOUND',
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* *
|
|
54
|
-
* Log Delivery Type
|
|
55
|
-
*/
|
|
56
|
-
export enum LogDeliveryType {
|
|
57
|
-
/** Deliver Billable Usage logs */
|
|
58
|
-
BILLABLE_USAGE = 'BILLABLE_USAGE',
|
|
59
|
-
/** Deliver Audit Logs */
|
|
60
|
-
AUDIT_LOGS = 'AUDIT_LOGS',
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* *
|
|
65
|
-
* Log Delivery Configuration
|
|
66
|
-
*/
|
|
67
|
-
export interface CreateLogDeliveryConfigurationParams {
|
|
68
|
-
/** The unique UUID of log delivery configuration */
|
|
69
|
-
configId?: string | undefined;
|
|
70
|
-
/** The optional human-readable name of the log delivery configuration. Defaults to empty. */
|
|
71
|
-
configName?: string | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Log delivery type. Supported values are:
|
|
74
|
-
* * `BILLABLE_USAGE` — Configure [billable usage log delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). For the CSV schema, see the [View billable usage](https://docs.databricks.com/administration-guide/account-settings/usage.html).
|
|
75
|
-
* * `AUDIT_LOGS` — Configure [audit log delivery](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html). For the JSON schema, see [Configure audit logging](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html)
|
|
76
|
-
*/
|
|
77
|
-
logType?: LogDeliveryType | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* The file type of log delivery.
|
|
80
|
-
* * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the CSV (comma-separated values) format is supported. For the schema, see the [View billable usage](https://docs.databricks.com/administration-guide/account-settings/usage.html)
|
|
81
|
-
* * If `log_type` is `AUDIT_LOGS`, this value must be `JSON`. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html).
|
|
82
|
-
*/
|
|
83
|
-
outputFormat?: LogDeliveryOutputFormat | undefined;
|
|
84
|
-
/** <Databricks> account ID. */
|
|
85
|
-
accountId?: string | undefined;
|
|
86
|
-
/** The ID for a method:credentials/create that represents the AWS IAM role with policy and trust relationship as described in the main billable usage documentation page. See [Configure billable usage delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). */
|
|
87
|
-
credentialsId?: string | undefined;
|
|
88
|
-
/** The ID for a method:storage/create that represents the S3 bucket with bucket policy as described in the main billable usage documentation page. See [Configure billable usage delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). */
|
|
89
|
-
storageConfigurationId?: string | undefined;
|
|
90
|
-
/** Optional filter that specifies workspace IDs to deliver logs for. By default the workspace filter is empty and log delivery applies at the account level, delivering workspace-level logs for all workspaces in your account, plus account level logs. You can optionally set this field to an array of workspace IDs (each one is an `int64`) to which log delivery should apply, in which case only workspace-level logs relating to the specified workspaces are delivered. If you plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won't apply to new workspaces created in the future, and delivery won't include account level logs. For some types of <Databricks> deployments there is only one workspace per account ID, so this field is unnecessary. */
|
|
91
|
-
workspaceIdsFilter?: bigint[] | undefined;
|
|
92
|
-
/** The optional delivery path prefix within Amazon S3 storage. Defaults to empty, which means that logs are delivered to the root of the bucket. This must be a valid S3 object key. This must not start or end with a slash character. */
|
|
93
|
-
deliveryPathPrefix?: string | undefined;
|
|
94
|
-
/** This field applies only if log_type is BILLABLE_USAGE. This is the optional start month and year for delivery, specified in YYYY-MM format. Defaults to current year and month. BILLABLE_USAGE logs are not available for usage before March 2019 (2019-03). */
|
|
95
|
-
deliveryStartTime?: string | undefined;
|
|
96
|
-
/** Status of log delivery configuration. Set to `ENABLED` (enabled) or `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed. */
|
|
97
|
-
status?: LogDeliveryConfigStatus | undefined;
|
|
98
|
-
/** Time in epoch milliseconds when the log delivery configuration was created. */
|
|
99
|
-
creationTime?: bigint | undefined;
|
|
100
|
-
/** Time in epoch milliseconds when the log delivery configuration was updated. */
|
|
101
|
-
updateTime?: bigint | undefined;
|
|
102
|
-
/** The LogDeliveryStatus of this log delivery configuration */
|
|
103
|
-
logDeliveryStatus?: LogDeliveryStatus | undefined;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* *
|
|
108
|
-
* Properties of the new log delivery configuration.
|
|
109
|
-
*/
|
|
110
|
-
export interface CreateLogDeliveryConfigurationRequest {
|
|
111
|
-
logDeliveryConfiguration?: CreateLogDeliveryConfigurationParams | undefined;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
115
|
-
export interface CreateLogDeliveryConfigurationRequest_Response {
|
|
116
|
-
/** The created log delivery configuration */
|
|
117
|
-
logDeliveryConfiguration?: LogDeliveryConfiguration | undefined;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* *
|
|
122
|
-
* Get Log Delivery Configuration
|
|
123
|
-
*/
|
|
124
|
-
export interface GetLogDeliveryConfigurationRequest {
|
|
125
|
-
/** The log delivery configuration id of customer */
|
|
126
|
-
configId?: string | undefined;
|
|
127
|
-
/** <Databricks> account ID. */
|
|
128
|
-
accountId?: string | undefined;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
132
|
-
export interface GetLogDeliveryConfigurationRequest_Response {
|
|
133
|
-
/** The fetched log delivery configuration */
|
|
134
|
-
logDeliveryConfiguration?: LogDeliveryConfiguration | undefined;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* *
|
|
139
|
-
* List Log Delivery Configuration
|
|
140
|
-
*/
|
|
141
|
-
export interface ListLogDeliveryConfigurationRequest {
|
|
142
|
-
/** <Databricks> account ID. */
|
|
143
|
-
accountId?: string | undefined;
|
|
144
|
-
/** The Credentials id to filter the search results with */
|
|
145
|
-
credentialsId?: string | undefined;
|
|
146
|
-
/** The Storage Configuration id to filter the search results with */
|
|
147
|
-
storageConfigurationId?: string | undefined;
|
|
148
|
-
/** The log delivery status to filter the search results with */
|
|
149
|
-
status?: LogDeliveryConfigStatus | undefined;
|
|
150
|
-
/**
|
|
151
|
-
* A page token received from a previous get all budget configurations call. This token can be used to retrieve the subsequent page.
|
|
152
|
-
* Requests first page if absent.
|
|
153
|
-
*/
|
|
154
|
-
pageToken?: string | undefined;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
158
|
-
export interface ListLogDeliveryConfigurationRequest_Response {
|
|
159
|
-
/** Log delivery configurations were returned successfully. */
|
|
160
|
-
logDeliveryConfigurations?: LogDeliveryConfiguration[] | undefined;
|
|
161
|
-
/** Token which can be sent as `page_token` to retrieve the next page of results. If this field is omitted, there are no subsequent budgets. */
|
|
162
|
-
nextPageToken?: string | undefined;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* *
|
|
167
|
-
* Log Delivery Configuration
|
|
168
|
-
*/
|
|
169
|
-
export interface LogDeliveryConfiguration {
|
|
170
|
-
/** The unique UUID of log delivery configuration */
|
|
171
|
-
configId?: string | undefined;
|
|
172
|
-
/** The optional human-readable name of the log delivery configuration. Defaults to empty. */
|
|
173
|
-
configName?: string | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* Log delivery type. Supported values are:
|
|
176
|
-
* * `BILLABLE_USAGE` — Configure [billable usage log delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). For the CSV schema, see the [View billable usage](https://docs.databricks.com/administration-guide/account-settings/usage.html).
|
|
177
|
-
* * `AUDIT_LOGS` — Configure [audit log delivery](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html). For the JSON schema, see [Configure audit logging](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html)
|
|
178
|
-
*/
|
|
179
|
-
logType?: LogDeliveryType | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* The file type of log delivery.
|
|
182
|
-
* * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the CSV (comma-separated values) format is supported. For the schema, see the [View billable usage](https://docs.databricks.com/administration-guide/account-settings/usage.html)
|
|
183
|
-
* * If `log_type` is `AUDIT_LOGS`, this value must be `JSON`. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html).
|
|
184
|
-
*/
|
|
185
|
-
outputFormat?: LogDeliveryOutputFormat | undefined;
|
|
186
|
-
/** <Databricks> account ID. */
|
|
187
|
-
accountId?: string | undefined;
|
|
188
|
-
/** The ID for a method:credentials/create that represents the AWS IAM role with policy and trust relationship as described in the main billable usage documentation page. See [Configure billable usage delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). */
|
|
189
|
-
credentialsId?: string | undefined;
|
|
190
|
-
/** The ID for a method:storage/create that represents the S3 bucket with bucket policy as described in the main billable usage documentation page. See [Configure billable usage delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). */
|
|
191
|
-
storageConfigurationId?: string | undefined;
|
|
192
|
-
/** Optional filter that specifies workspace IDs to deliver logs for. By default the workspace filter is empty and log delivery applies at the account level, delivering workspace-level logs for all workspaces in your account, plus account level logs. You can optionally set this field to an array of workspace IDs (each one is an `int64`) to which log delivery should apply, in which case only workspace-level logs relating to the specified workspaces are delivered. If you plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won't apply to new workspaces created in the future, and delivery won't include account level logs. For some types of <Databricks> deployments there is only one workspace per account ID, so this field is unnecessary. */
|
|
193
|
-
workspaceIdsFilter?: bigint[] | undefined;
|
|
194
|
-
/** The optional delivery path prefix within Amazon S3 storage. Defaults to empty, which means that logs are delivered to the root of the bucket. This must be a valid S3 object key. This must not start or end with a slash character. */
|
|
195
|
-
deliveryPathPrefix?: string | undefined;
|
|
196
|
-
/** This field applies only if log_type is BILLABLE_USAGE. This is the optional start month and year for delivery, specified in YYYY-MM format. Defaults to current year and month. BILLABLE_USAGE logs are not available for usage before March 2019 (2019-03). */
|
|
197
|
-
deliveryStartTime?: string | undefined;
|
|
198
|
-
/** Status of log delivery configuration. Set to `ENABLED` (enabled) or `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed. */
|
|
199
|
-
status?: LogDeliveryConfigStatus | undefined;
|
|
200
|
-
/** Time in epoch milliseconds when the log delivery configuration was created. */
|
|
201
|
-
creationTime?: bigint | undefined;
|
|
202
|
-
/** Time in epoch milliseconds when the log delivery configuration was updated. */
|
|
203
|
-
updateTime?: bigint | undefined;
|
|
204
|
-
/** The LogDeliveryStatus of this log delivery configuration */
|
|
205
|
-
logDeliveryStatus?: LogDeliveryStatus | undefined;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export interface LogDeliveryStatus {
|
|
209
|
-
/**
|
|
210
|
-
* Enum that describes the status. Possible values are:
|
|
211
|
-
* * `CREATED`: There were no log delivery attempts since the config was created.
|
|
212
|
-
* * `SUCCEEDED`: The latest attempt of log delivery has succeeded completely.
|
|
213
|
-
* * `USER_FAILURE`: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage.
|
|
214
|
-
* * `SYSTEM_FAILURE`: The latest attempt of log delivery failed because of an <Databricks> internal error. Contact support if it doesn't go away soon.
|
|
215
|
-
* * `NOT_FOUND`: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account.
|
|
216
|
-
*/
|
|
217
|
-
status?: LogDeliveryStatusEnum | undefined;
|
|
218
|
-
/** The UTC time for the latest log delivery attempt. */
|
|
219
|
-
lastAttemptTime?: string | undefined;
|
|
220
|
-
/** The UTC time for the latest successful log delivery. */
|
|
221
|
-
lastSuccessfulAttemptTime?: string | undefined;
|
|
222
|
-
/** Informative message about the latest log delivery attempt. If the log delivery fails with USER_FAILURE, error details will be provided for fixing misconfigurations in cloud permissions. */
|
|
223
|
-
message?: string | undefined;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* *
|
|
228
|
-
* Update Log Delivery Configuration
|
|
229
|
-
*/
|
|
230
|
-
export interface UpdateLogDeliveryConfigurationRequest {
|
|
231
|
-
/** The log delivery configuration id of customer */
|
|
232
|
-
configId?: string | undefined;
|
|
233
|
-
/** <Databricks> account ID of any type. For non-E2 account types, get your account ID from the [Accounts Console](https://docs.databricks.com/administration-guide/account-settings/usage.html). */
|
|
234
|
-
accountId?: string | undefined;
|
|
235
|
-
/** Status of log delivery configuration. Set to `ENABLED` (enabled) or `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed. */
|
|
236
|
-
status?: LogDeliveryConfigStatus | undefined;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
240
|
-
export interface UpdateLogDeliveryConfigurationRequest_Response {}
|
|
241
|
-
|
|
242
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
243
|
-
export const unmarshalCreateLogDeliveryConfigurationRequest_ResponseSchema: z.ZodType<CreateLogDeliveryConfigurationRequest_Response> =
|
|
244
|
-
z
|
|
245
|
-
.object({
|
|
246
|
-
log_delivery_configuration: z
|
|
247
|
-
.lazy(() => unmarshalLogDeliveryConfigurationSchema)
|
|
248
|
-
.optional(),
|
|
249
|
-
})
|
|
250
|
-
.transform(d => ({
|
|
251
|
-
logDeliveryConfiguration: d.log_delivery_configuration,
|
|
252
|
-
}));
|
|
253
|
-
|
|
254
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
255
|
-
export const unmarshalGetLogDeliveryConfigurationRequest_ResponseSchema: z.ZodType<GetLogDeliveryConfigurationRequest_Response> =
|
|
256
|
-
z
|
|
257
|
-
.object({
|
|
258
|
-
log_delivery_configuration: z
|
|
259
|
-
.lazy(() => unmarshalLogDeliveryConfigurationSchema)
|
|
260
|
-
.optional(),
|
|
261
|
-
})
|
|
262
|
-
.transform(d => ({
|
|
263
|
-
logDeliveryConfiguration: d.log_delivery_configuration,
|
|
264
|
-
}));
|
|
265
|
-
|
|
266
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
267
|
-
export const unmarshalListLogDeliveryConfigurationRequest_ResponseSchema: z.ZodType<ListLogDeliveryConfigurationRequest_Response> =
|
|
268
|
-
z
|
|
269
|
-
.object({
|
|
270
|
-
log_delivery_configurations: z
|
|
271
|
-
.array(z.lazy(() => unmarshalLogDeliveryConfigurationSchema))
|
|
272
|
-
.optional(),
|
|
273
|
-
next_page_token: z.string().optional(),
|
|
274
|
-
})
|
|
275
|
-
.transform(d => ({
|
|
276
|
-
logDeliveryConfigurations: d.log_delivery_configurations,
|
|
277
|
-
nextPageToken: d.next_page_token,
|
|
278
|
-
}));
|
|
279
|
-
|
|
280
|
-
export const unmarshalLogDeliveryConfigurationSchema: z.ZodType<LogDeliveryConfiguration> =
|
|
281
|
-
z
|
|
282
|
-
.object({
|
|
283
|
-
config_id: z.string().optional(),
|
|
284
|
-
config_name: z.string().optional(),
|
|
285
|
-
log_type: z.enum(LogDeliveryType).optional(),
|
|
286
|
-
output_format: z.enum(LogDeliveryOutputFormat).optional(),
|
|
287
|
-
account_id: z.string().optional(),
|
|
288
|
-
credentials_id: z.string().optional(),
|
|
289
|
-
storage_configuration_id: z.string().optional(),
|
|
290
|
-
workspace_ids_filter: z
|
|
291
|
-
.array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))
|
|
292
|
-
.optional(),
|
|
293
|
-
delivery_path_prefix: z.string().optional(),
|
|
294
|
-
delivery_start_time: z.string().optional(),
|
|
295
|
-
status: z.enum(LogDeliveryConfigStatus).optional(),
|
|
296
|
-
creation_time: z
|
|
297
|
-
.union([z.number(), z.bigint()])
|
|
298
|
-
.transform(v => BigInt(v))
|
|
299
|
-
.optional(),
|
|
300
|
-
update_time: z
|
|
301
|
-
.union([z.number(), z.bigint()])
|
|
302
|
-
.transform(v => BigInt(v))
|
|
303
|
-
.optional(),
|
|
304
|
-
log_delivery_status: z
|
|
305
|
-
.lazy(() => unmarshalLogDeliveryStatusSchema)
|
|
306
|
-
.optional(),
|
|
307
|
-
})
|
|
308
|
-
.transform(d => ({
|
|
309
|
-
configId: d.config_id,
|
|
310
|
-
configName: d.config_name,
|
|
311
|
-
logType: d.log_type,
|
|
312
|
-
outputFormat: d.output_format,
|
|
313
|
-
accountId: d.account_id,
|
|
314
|
-
credentialsId: d.credentials_id,
|
|
315
|
-
storageConfigurationId: d.storage_configuration_id,
|
|
316
|
-
workspaceIdsFilter: d.workspace_ids_filter,
|
|
317
|
-
deliveryPathPrefix: d.delivery_path_prefix,
|
|
318
|
-
deliveryStartTime: d.delivery_start_time,
|
|
319
|
-
status: d.status,
|
|
320
|
-
creationTime: d.creation_time,
|
|
321
|
-
updateTime: d.update_time,
|
|
322
|
-
logDeliveryStatus: d.log_delivery_status,
|
|
323
|
-
}));
|
|
324
|
-
|
|
325
|
-
export const unmarshalLogDeliveryStatusSchema: z.ZodType<LogDeliveryStatus> = z
|
|
326
|
-
.object({
|
|
327
|
-
status: z.enum(LogDeliveryStatusEnum).optional(),
|
|
328
|
-
last_attempt_time: z.string().optional(),
|
|
329
|
-
last_successful_attempt_time: z.string().optional(),
|
|
330
|
-
message: z.string().optional(),
|
|
331
|
-
})
|
|
332
|
-
.transform(d => ({
|
|
333
|
-
status: d.status,
|
|
334
|
-
lastAttemptTime: d.last_attempt_time,
|
|
335
|
-
lastSuccessfulAttemptTime: d.last_successful_attempt_time,
|
|
336
|
-
message: d.message,
|
|
337
|
-
}));
|
|
338
|
-
|
|
339
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
340
|
-
export const unmarshalUpdateLogDeliveryConfigurationRequest_ResponseSchema: z.ZodType<UpdateLogDeliveryConfigurationRequest_Response> =
|
|
341
|
-
z.object({});
|
|
342
|
-
|
|
343
|
-
export const marshalCreateLogDeliveryConfigurationParamsSchema: z.ZodType = z
|
|
344
|
-
.object({
|
|
345
|
-
configId: z.string().optional(),
|
|
346
|
-
configName: z.string().optional(),
|
|
347
|
-
logType: z.enum(LogDeliveryType).optional(),
|
|
348
|
-
outputFormat: z.enum(LogDeliveryOutputFormat).optional(),
|
|
349
|
-
accountId: z.string().optional(),
|
|
350
|
-
credentialsId: z.string().optional(),
|
|
351
|
-
storageConfigurationId: z.string().optional(),
|
|
352
|
-
workspaceIdsFilter: z.array(z.bigint()).optional(),
|
|
353
|
-
deliveryPathPrefix: z.string().optional(),
|
|
354
|
-
deliveryStartTime: z.string().optional(),
|
|
355
|
-
status: z.enum(LogDeliveryConfigStatus).optional(),
|
|
356
|
-
creationTime: z.bigint().optional(),
|
|
357
|
-
updateTime: z.bigint().optional(),
|
|
358
|
-
logDeliveryStatus: z.lazy(() => marshalLogDeliveryStatusSchema).optional(),
|
|
359
|
-
})
|
|
360
|
-
.transform(d => ({
|
|
361
|
-
config_id: d.configId,
|
|
362
|
-
config_name: d.configName,
|
|
363
|
-
log_type: d.logType,
|
|
364
|
-
output_format: d.outputFormat,
|
|
365
|
-
account_id: d.accountId,
|
|
366
|
-
credentials_id: d.credentialsId,
|
|
367
|
-
storage_configuration_id: d.storageConfigurationId,
|
|
368
|
-
workspace_ids_filter: d.workspaceIdsFilter,
|
|
369
|
-
delivery_path_prefix: d.deliveryPathPrefix,
|
|
370
|
-
delivery_start_time: d.deliveryStartTime,
|
|
371
|
-
status: d.status,
|
|
372
|
-
creation_time: d.creationTime,
|
|
373
|
-
update_time: d.updateTime,
|
|
374
|
-
log_delivery_status: d.logDeliveryStatus,
|
|
375
|
-
}));
|
|
376
|
-
|
|
377
|
-
export const marshalCreateLogDeliveryConfigurationRequestSchema: z.ZodType = z
|
|
378
|
-
.object({
|
|
379
|
-
logDeliveryConfiguration: z
|
|
380
|
-
.lazy(() => marshalCreateLogDeliveryConfigurationParamsSchema)
|
|
381
|
-
.optional(),
|
|
382
|
-
})
|
|
383
|
-
.transform(d => ({
|
|
384
|
-
log_delivery_configuration: d.logDeliveryConfiguration,
|
|
385
|
-
}));
|
|
386
|
-
|
|
387
|
-
export const marshalLogDeliveryStatusSchema: z.ZodType = z
|
|
388
|
-
.object({
|
|
389
|
-
status: z.enum(LogDeliveryStatusEnum).optional(),
|
|
390
|
-
lastAttemptTime: z.string().optional(),
|
|
391
|
-
lastSuccessfulAttemptTime: z.string().optional(),
|
|
392
|
-
message: z.string().optional(),
|
|
393
|
-
})
|
|
394
|
-
.transform(d => ({
|
|
395
|
-
status: d.status,
|
|
396
|
-
last_attempt_time: d.lastAttemptTime,
|
|
397
|
-
last_successful_attempt_time: d.lastSuccessfulAttemptTime,
|
|
398
|
-
message: d.message,
|
|
399
|
-
}));
|
|
400
|
-
|
|
401
|
-
export const marshalUpdateLogDeliveryConfigurationRequestSchema: z.ZodType = z
|
|
402
|
-
.object({
|
|
403
|
-
configId: z.string().optional(),
|
|
404
|
-
accountId: z.string().optional(),
|
|
405
|
-
status: z.enum(LogDeliveryConfigStatus).optional(),
|
|
406
|
-
})
|
|
407
|
-
.transform(d => ({
|
|
408
|
-
config_id: d.configId,
|
|
409
|
-
account_id: d.accountId,
|
|
410
|
-
status: d.status,
|
|
411
|
-
}));
|