@databricks/sdk-jobs 0.1.0-dev.1 → 0.1.0-dev.3
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/v2/client.d.ts +25 -24
- package/dist/v2/client.d.ts.map +1 -1
- package/dist/v2/client.js +52 -79
- package/dist/v2/client.js.map +1 -1
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/model.d.ts +56 -56
- package/dist/v2/model.d.ts.map +1 -1
- package/dist/v2/model.js +21 -40
- package/dist/v2/model.js.map +1 -1
- package/dist/v2/utils.d.ts +14 -2
- package/dist/v2/utils.d.ts.map +1 -1
- package/dist/v2/utils.js +19 -1
- package/dist/v2/utils.js.map +1 -1
- package/package.json +6 -5
- package/src/v2/client.ts +164 -202
- package/src/v2/index.ts +21 -21
- package/src/v2/model.ts +283 -324
- package/src/v2/utils.ts +27 -3
package/dist/v2/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CallOptions } from '@databricks/sdk-options/call';
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
-
import type {
|
|
3
|
+
import type { LroOptions } from '@databricks/sdk-options/lro';
|
|
4
|
+
import type { BaseJob, BaseRun, CancelAllRunsRequest, CancelAllRunsResponse, CancelRunRequest, CreateJobRequest, CreateJobResponse, DeleteJobRequest, DeleteJobResponse, DeleteRunRequest, DeleteRunResponse, EnforcePolicyComplianceForJob, EnforcePolicyComplianceResponse, ExportRunRequest, ExportRunResponse, GetJobRequest, GetJobResponse, GetPolicyComplianceForJob, GetPolicyComplianceForJobResponse, GetRunOutputRequest, GetRunOutputResponse, GetRunRequest, GetRunResponse, ListJobComplianceForPolicy, ListJobComplianceForPolicy_JobCompliance, ListJobComplianceResponse, ListJobsRequest, ListJobsResponse, ListRunsRequest, ListRunsResponse, RepairRunRequest, ResetJobRequest, ResetJobResponse, RunNowRequest, SubmitRunRequest, UpdateJobRequest, UpdateJobResponse } from './model';
|
|
4
5
|
export declare class JobsClient {
|
|
5
6
|
private readonly host;
|
|
6
7
|
private readonly workspaceId;
|
|
@@ -14,41 +15,41 @@ export declare class JobsClient {
|
|
|
14
15
|
* current versions of their respective cluster policies.
|
|
15
16
|
* All-purpose clusters used in the job will not be updated.
|
|
16
17
|
*/
|
|
17
|
-
enforcePolicyComplianceForJob(req: EnforcePolicyComplianceForJob, options?: CallOptions): Promise<
|
|
18
|
+
enforcePolicyComplianceForJob(req: EnforcePolicyComplianceForJob, options?: CallOptions): Promise<EnforcePolicyComplianceResponse>;
|
|
18
19
|
/**
|
|
19
20
|
* Returns the policy compliance status of a job. Jobs could be out of
|
|
20
21
|
* compliance if a cluster policy they use was updated after the job was
|
|
21
22
|
* last edited and some of its job clusters no longer comply with
|
|
22
23
|
* their updated policies.
|
|
23
24
|
*/
|
|
24
|
-
getPolicyComplianceForJob(req: GetPolicyComplianceForJob, options?: CallOptions): Promise<
|
|
25
|
+
getPolicyComplianceForJob(req: GetPolicyComplianceForJob, options?: CallOptions): Promise<GetPolicyComplianceForJobResponse>;
|
|
25
26
|
/**
|
|
26
27
|
* Returns the policy compliance status of all jobs that use a
|
|
27
28
|
* given policy. Jobs could be out of compliance if a cluster policy they
|
|
28
29
|
* use was updated after the job was last edited and its job
|
|
29
30
|
* clusters no longer comply with the updated policy.
|
|
30
31
|
*/
|
|
31
|
-
listJobComplianceForPolicy(req: ListJobComplianceForPolicy, options?: CallOptions): Promise<
|
|
32
|
+
listJobComplianceForPolicy(req: ListJobComplianceForPolicy, options?: CallOptions): Promise<ListJobComplianceResponse>;
|
|
32
33
|
listJobComplianceForPolicyIter(req: ListJobComplianceForPolicy, options?: CallOptions): AsyncGenerator<ListJobComplianceForPolicy_JobCompliance>;
|
|
33
34
|
/**
|
|
34
35
|
* Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't
|
|
35
36
|
* prevent new runs from being started.
|
|
36
37
|
*/
|
|
37
|
-
cancelAllRuns(req: CancelAllRunsRequest, options?: CallOptions): Promise<
|
|
38
|
+
cancelAllRuns(req: CancelAllRunsRequest, options?: CallOptions): Promise<CancelAllRunsResponse>;
|
|
38
39
|
/**
|
|
39
40
|
* Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when
|
|
40
41
|
* this request completes.
|
|
41
42
|
*/
|
|
42
|
-
cancelRun
|
|
43
|
+
private cancelRun;
|
|
43
44
|
cancelRunWaiter(req: CancelRunRequest, options?: CallOptions): Promise<CancelRunWaiter>;
|
|
44
45
|
/** Create a new job. */
|
|
45
|
-
createJob(req: CreateJobRequest, options?: CallOptions): Promise<
|
|
46
|
+
createJob(req: CreateJobRequest, options?: CallOptions): Promise<CreateJobResponse>;
|
|
46
47
|
/** Deletes a job. */
|
|
47
|
-
deleteJob(req: DeleteJobRequest, options?: CallOptions): Promise<
|
|
48
|
+
deleteJob(req: DeleteJobRequest, options?: CallOptions): Promise<DeleteJobResponse>;
|
|
48
49
|
/** Deletes a non-active run. Returns an error if the run is active. */
|
|
49
|
-
deleteRun(req: DeleteRunRequest, options?: CallOptions): Promise<
|
|
50
|
+
deleteRun(req: DeleteRunRequest, options?: CallOptions): Promise<DeleteRunResponse>;
|
|
50
51
|
/** Export and retrieve the job run task. */
|
|
51
|
-
exportRun(req: ExportRunRequest, options?: CallOptions): Promise<
|
|
52
|
+
exportRun(req: ExportRunRequest, options?: CallOptions): Promise<ExportRunResponse>;
|
|
52
53
|
/**
|
|
53
54
|
* Retrieves the details for a single job.
|
|
54
55
|
*
|
|
@@ -57,7 +58,7 @@ export declare class JobsClient {
|
|
|
57
58
|
* Use the `next_page_token` field to check for more results and pass its value as the `page_token` in subsequent requests.
|
|
58
59
|
* If any array properties have more than 100 elements, additional results will be returned on subsequent requests. Arrays without additional results will be empty on later pages.
|
|
59
60
|
*/
|
|
60
|
-
getJob(req: GetJobRequest, options?: CallOptions): Promise<
|
|
61
|
+
getJob(req: GetJobRequest, options?: CallOptions): Promise<GetJobResponse>;
|
|
61
62
|
/**
|
|
62
63
|
* Retrieves the metadata of a run.
|
|
63
64
|
*
|
|
@@ -66,7 +67,7 @@ export declare class JobsClient {
|
|
|
66
67
|
* Use the next_page_token field to check for more results and pass its value as the page_token in subsequent requests.
|
|
67
68
|
* If any array properties have more than 100 elements, additional results will be returned on subsequent requests. Arrays without additional results will be empty on later pages.
|
|
68
69
|
*/
|
|
69
|
-
getRun(req: GetRunRequest, options?: CallOptions): Promise<
|
|
70
|
+
getRun(req: GetRunRequest, options?: CallOptions): Promise<GetRunResponse>;
|
|
70
71
|
/**
|
|
71
72
|
* Retrieve the output and metadata of a single task run. When a notebook task returns
|
|
72
73
|
* a value through the `dbutils.notebook.exit()` call, you can use this endpoint to retrieve
|
|
@@ -78,24 +79,24 @@ export declare class JobsClient {
|
|
|
78
79
|
* 60 days. If you to want to reference them beyond 60 days, you must save old run results
|
|
79
80
|
* before they expire.
|
|
80
81
|
*/
|
|
81
|
-
getRunOutput(req: GetRunOutputRequest, options?: CallOptions): Promise<
|
|
82
|
+
getRunOutput(req: GetRunOutputRequest, options?: CallOptions): Promise<GetRunOutputResponse>;
|
|
82
83
|
/** Retrieves a list of jobs. */
|
|
83
|
-
listJobs(req: ListJobsRequest, options?: CallOptions): Promise<
|
|
84
|
+
listJobs(req: ListJobsRequest, options?: CallOptions): Promise<ListJobsResponse>;
|
|
84
85
|
listJobsIter(req: ListJobsRequest, options?: CallOptions): AsyncGenerator<BaseJob>;
|
|
85
86
|
/** List runs in descending order by start time. */
|
|
86
|
-
listRuns(req: ListRunsRequest, options?: CallOptions): Promise<
|
|
87
|
+
listRuns(req: ListRunsRequest, options?: CallOptions): Promise<ListRunsResponse>;
|
|
87
88
|
listRunsIter(req: ListRunsRequest, options?: CallOptions): AsyncGenerator<BaseRun>;
|
|
88
89
|
/**
|
|
89
90
|
* Re-run one or more tasks. Tasks are re-run as part of the original job run.
|
|
90
91
|
* They use the current job and task settings, and can be viewed in the history for the
|
|
91
92
|
* original job run.
|
|
92
93
|
*/
|
|
93
|
-
repair
|
|
94
|
+
private repair;
|
|
94
95
|
repairWaiter(req: RepairRunRequest, options?: CallOptions): Promise<RepairWaiter>;
|
|
95
96
|
/** Overwrite all settings for the given job. Use the [_Update_ endpoint](:method:jobs/update) to update job settings partially. */
|
|
96
|
-
resetJob(req: ResetJobRequest, options?: CallOptions): Promise<
|
|
97
|
+
resetJob(req: ResetJobRequest, options?: CallOptions): Promise<ResetJobResponse>;
|
|
97
98
|
/** Run a job and return the `run_id` of the triggered run. */
|
|
98
|
-
runNow
|
|
99
|
+
private runNow;
|
|
99
100
|
runNowWaiter(req: RunNowRequest, options?: CallOptions): Promise<RunNowWaiter>;
|
|
100
101
|
/**
|
|
101
102
|
* Submit a one-time run. This endpoint allows you to submit a workload directly
|
|
@@ -110,10 +111,10 @@ export declare class JobsClient {
|
|
|
110
111
|
* the compute needs for the job. Alternatively, use the `POST /jobs/create` and
|
|
111
112
|
* `POST /jobs/run-now` endpoints to create and run a saved job.
|
|
112
113
|
*/
|
|
113
|
-
submitRun
|
|
114
|
+
private submitRun;
|
|
114
115
|
submitRunWaiter(req: SubmitRunRequest, options?: CallOptions): Promise<SubmitRunWaiter>;
|
|
115
116
|
/** Add, update, or remove specific settings of an existing job. Use the [_Reset_ endpoint](:method:jobs/reset) to overwrite all job settings. */
|
|
116
|
-
updateJob(req: UpdateJobRequest, options?: CallOptions): Promise<
|
|
117
|
+
updateJob(req: UpdateJobRequest, options?: CallOptions): Promise<UpdateJobResponse>;
|
|
117
118
|
}
|
|
118
119
|
export declare class CancelRunWaiter {
|
|
119
120
|
private readonly client;
|
|
@@ -124,7 +125,7 @@ export declare class CancelRunWaiter {
|
|
|
124
125
|
*
|
|
125
126
|
* Throws if a failure state is reached.
|
|
126
127
|
*/
|
|
127
|
-
wait(options?:
|
|
128
|
+
wait(options?: LroOptions): Promise<GetRunResponse>;
|
|
128
129
|
/** Checks whether the operation has reached a terminal state. */
|
|
129
130
|
done(options?: CallOptions): Promise<boolean>;
|
|
130
131
|
}
|
|
@@ -137,7 +138,7 @@ export declare class RepairWaiter {
|
|
|
137
138
|
*
|
|
138
139
|
* Throws if a failure state is reached.
|
|
139
140
|
*/
|
|
140
|
-
wait(options?:
|
|
141
|
+
wait(options?: LroOptions): Promise<GetRunResponse>;
|
|
141
142
|
/** Checks whether the operation has reached a terminal state. */
|
|
142
143
|
done(options?: CallOptions): Promise<boolean>;
|
|
143
144
|
}
|
|
@@ -150,7 +151,7 @@ export declare class RunNowWaiter {
|
|
|
150
151
|
*
|
|
151
152
|
* Throws if a failure state is reached.
|
|
152
153
|
*/
|
|
153
|
-
wait(options?:
|
|
154
|
+
wait(options?: LroOptions): Promise<GetRunResponse>;
|
|
154
155
|
/** Checks whether the operation has reached a terminal state. */
|
|
155
156
|
done(options?: CallOptions): Promise<boolean>;
|
|
156
157
|
}
|
|
@@ -163,7 +164,7 @@ export declare class SubmitRunWaiter {
|
|
|
163
164
|
*
|
|
164
165
|
* Throws if a failure state is reached.
|
|
165
166
|
*/
|
|
166
|
-
wait(options?:
|
|
167
|
+
wait(options?: LroOptions): Promise<GetRunResponse>;
|
|
167
168
|
/** Checks whether the operation has reached a terminal state. */
|
|
168
169
|
done(options?: CallOptions): Promise<boolean>;
|
|
169
170
|
}
|
package/dist/v2/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v2/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v2/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAa5D,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,qB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ED,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM;gBADL,MAAM,EAAE,UAAU,EAC1B,KAAK,EAAE,MAAM;IAGxB;;;;OAIG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAqCzD,iEAAiE;IAC3D,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAsBpD;AAED,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM;gBADL,MAAM,EAAE,UAAU,EAC1B,KAAK,EAAE,MAAM;IAGxB;;;;OAIG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAqCzD,iEAAiE;IAC3D,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAsBpD;AAED,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM;gBADL,MAAM,EAAE,UAAU,EAC1B,KAAK,EAAE,MAAM;IAGxB;;;;OAIG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAqCzD,iEAAiE;IAC3D,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAsBpD"}
|
package/dist/v2/client.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
|
-
import { retryOn } from '@databricks/sdk-core/api';
|
|
4
3
|
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
5
4
|
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
6
5
|
import { newHttpClient } from './transport';
|
|
7
|
-
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
6
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, executeWait, StillRunningError, } from './utils';
|
|
8
7
|
import pkgJson from '../../package.json' with { type: 'json' };
|
|
9
|
-
import { RunLifeCycleState_RunLifeCycleState, marshalCancelAllRunsRequestSchema, marshalCancelRunRequestSchema, marshalCreateJobRequestSchema, marshalDeleteJobRequestSchema, marshalDeleteRunRequestSchema, marshalEnforcePolicyComplianceForJobSchema, marshalRepairRunRequestSchema, marshalResetJobRequestSchema, marshalRunNowRequestSchema, marshalSubmitRunRequestSchema, marshalUpdateJobRequestSchema,
|
|
8
|
+
import { RunLifeCycleState_RunLifeCycleState, marshalCancelAllRunsRequestSchema, marshalCancelRunRequestSchema, marshalCreateJobRequestSchema, marshalDeleteJobRequestSchema, marshalDeleteRunRequestSchema, marshalEnforcePolicyComplianceForJobSchema, marshalRepairRunRequestSchema, marshalResetJobRequestSchema, marshalRunNowRequestSchema, marshalSubmitRunRequestSchema, marshalUpdateJobRequestSchema, unmarshalCancelAllRunsResponseSchema, unmarshalCancelRunResponseSchema, unmarshalCreateJobResponseSchema, unmarshalDeleteJobResponseSchema, unmarshalDeleteRunResponseSchema, unmarshalEnforcePolicyComplianceResponseSchema, unmarshalExportRunResponseSchema, unmarshalGetJobResponseSchema, unmarshalGetPolicyComplianceForJobResponseSchema, unmarshalGetRunOutputResponseSchema, unmarshalGetRunResponseSchema, unmarshalListJobComplianceResponseSchema, unmarshalListJobsResponseSchema, unmarshalListRunsResponseSchema, unmarshalRepairRunResponseSchema, unmarshalResetJobResponseSchema, unmarshalRunNowResponseSchema, unmarshalSubmitRunResponseSchema, unmarshalUpdateJobResponseSchema, } from './model';
|
|
10
9
|
// Package identity segment for this client to be used in the User-Agent header.
|
|
11
10
|
const PACKAGE_SEGMENT = {
|
|
12
11
|
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
13
12
|
value: pkgJson.version,
|
|
14
13
|
};
|
|
15
|
-
class StillRunningError extends Error {
|
|
16
|
-
}
|
|
17
14
|
export class JobsClient {
|
|
18
15
|
host;
|
|
19
16
|
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
@@ -62,11 +59,11 @@ export class JobsClient {
|
|
|
62
59
|
httpClient: this.httpClient,
|
|
63
60
|
logger: this.logger,
|
|
64
61
|
});
|
|
65
|
-
resp = parseResponse(respBody,
|
|
62
|
+
resp = parseResponse(respBody, unmarshalEnforcePolicyComplianceResponseSchema);
|
|
66
63
|
};
|
|
67
64
|
await executeCall(call, options);
|
|
68
65
|
if (resp === undefined) {
|
|
69
|
-
throw new Error('
|
|
66
|
+
throw new Error('operation completed without a result.');
|
|
70
67
|
}
|
|
71
68
|
return resp;
|
|
72
69
|
}
|
|
@@ -97,11 +94,11 @@ export class JobsClient {
|
|
|
97
94
|
httpClient: this.httpClient,
|
|
98
95
|
logger: this.logger,
|
|
99
96
|
});
|
|
100
|
-
resp = parseResponse(respBody,
|
|
97
|
+
resp = parseResponse(respBody, unmarshalGetPolicyComplianceForJobResponseSchema);
|
|
101
98
|
};
|
|
102
99
|
await executeCall(call, options);
|
|
103
100
|
if (resp === undefined) {
|
|
104
|
-
throw new Error('
|
|
101
|
+
throw new Error('operation completed without a result.');
|
|
105
102
|
}
|
|
106
103
|
return resp;
|
|
107
104
|
}
|
|
@@ -138,11 +135,11 @@ export class JobsClient {
|
|
|
138
135
|
httpClient: this.httpClient,
|
|
139
136
|
logger: this.logger,
|
|
140
137
|
});
|
|
141
|
-
resp = parseResponse(respBody,
|
|
138
|
+
resp = parseResponse(respBody, unmarshalListJobComplianceResponseSchema);
|
|
142
139
|
};
|
|
143
140
|
await executeCall(call, options);
|
|
144
141
|
if (resp === undefined) {
|
|
145
|
-
throw new Error('
|
|
142
|
+
throw new Error('operation completed without a result.');
|
|
146
143
|
}
|
|
147
144
|
return resp;
|
|
148
145
|
}
|
|
@@ -179,11 +176,11 @@ export class JobsClient {
|
|
|
179
176
|
httpClient: this.httpClient,
|
|
180
177
|
logger: this.logger,
|
|
181
178
|
});
|
|
182
|
-
resp = parseResponse(respBody,
|
|
179
|
+
resp = parseResponse(respBody, unmarshalCancelAllRunsResponseSchema);
|
|
183
180
|
};
|
|
184
181
|
await executeCall(call, options);
|
|
185
182
|
if (resp === undefined) {
|
|
186
|
-
throw new Error('
|
|
183
|
+
throw new Error('operation completed without a result.');
|
|
187
184
|
}
|
|
188
185
|
return resp;
|
|
189
186
|
}
|
|
@@ -207,11 +204,11 @@ export class JobsClient {
|
|
|
207
204
|
httpClient: this.httpClient,
|
|
208
205
|
logger: this.logger,
|
|
209
206
|
});
|
|
210
|
-
resp = parseResponse(respBody,
|
|
207
|
+
resp = parseResponse(respBody, unmarshalCancelRunResponseSchema);
|
|
211
208
|
};
|
|
212
209
|
await executeCall(call, options);
|
|
213
210
|
if (resp === undefined) {
|
|
214
|
-
throw new Error('
|
|
211
|
+
throw new Error('operation completed without a result.');
|
|
215
212
|
}
|
|
216
213
|
return resp;
|
|
217
214
|
}
|
|
@@ -239,11 +236,11 @@ export class JobsClient {
|
|
|
239
236
|
httpClient: this.httpClient,
|
|
240
237
|
logger: this.logger,
|
|
241
238
|
});
|
|
242
|
-
resp = parseResponse(respBody,
|
|
239
|
+
resp = parseResponse(respBody, unmarshalCreateJobResponseSchema);
|
|
243
240
|
};
|
|
244
241
|
await executeCall(call, options);
|
|
245
242
|
if (resp === undefined) {
|
|
246
|
-
throw new Error('
|
|
243
|
+
throw new Error('operation completed without a result.');
|
|
247
244
|
}
|
|
248
245
|
return resp;
|
|
249
246
|
}
|
|
@@ -264,11 +261,11 @@ export class JobsClient {
|
|
|
264
261
|
httpClient: this.httpClient,
|
|
265
262
|
logger: this.logger,
|
|
266
263
|
});
|
|
267
|
-
resp = parseResponse(respBody,
|
|
264
|
+
resp = parseResponse(respBody, unmarshalDeleteJobResponseSchema);
|
|
268
265
|
};
|
|
269
266
|
await executeCall(call, options);
|
|
270
267
|
if (resp === undefined) {
|
|
271
|
-
throw new Error('
|
|
268
|
+
throw new Error('operation completed without a result.');
|
|
272
269
|
}
|
|
273
270
|
return resp;
|
|
274
271
|
}
|
|
@@ -289,11 +286,11 @@ export class JobsClient {
|
|
|
289
286
|
httpClient: this.httpClient,
|
|
290
287
|
logger: this.logger,
|
|
291
288
|
});
|
|
292
|
-
resp = parseResponse(respBody,
|
|
289
|
+
resp = parseResponse(respBody, unmarshalDeleteRunResponseSchema);
|
|
293
290
|
};
|
|
294
291
|
await executeCall(call, options);
|
|
295
292
|
if (resp === undefined) {
|
|
296
|
-
throw new Error('
|
|
293
|
+
throw new Error('operation completed without a result.');
|
|
297
294
|
}
|
|
298
295
|
return resp;
|
|
299
296
|
}
|
|
@@ -322,11 +319,11 @@ export class JobsClient {
|
|
|
322
319
|
httpClient: this.httpClient,
|
|
323
320
|
logger: this.logger,
|
|
324
321
|
});
|
|
325
|
-
resp = parseResponse(respBody,
|
|
322
|
+
resp = parseResponse(respBody, unmarshalExportRunResponseSchema);
|
|
326
323
|
};
|
|
327
324
|
await executeCall(call, options);
|
|
328
325
|
if (resp === undefined) {
|
|
329
|
-
throw new Error('
|
|
326
|
+
throw new Error('operation completed without a result.');
|
|
330
327
|
}
|
|
331
328
|
return resp;
|
|
332
329
|
}
|
|
@@ -365,11 +362,11 @@ export class JobsClient {
|
|
|
365
362
|
httpClient: this.httpClient,
|
|
366
363
|
logger: this.logger,
|
|
367
364
|
});
|
|
368
|
-
resp = parseResponse(respBody,
|
|
365
|
+
resp = parseResponse(respBody, unmarshalGetJobResponseSchema);
|
|
369
366
|
};
|
|
370
367
|
await executeCall(call, options);
|
|
371
368
|
if (resp === undefined) {
|
|
372
|
-
throw new Error('
|
|
369
|
+
throw new Error('operation completed without a result.');
|
|
373
370
|
}
|
|
374
371
|
return resp;
|
|
375
372
|
}
|
|
@@ -411,11 +408,11 @@ export class JobsClient {
|
|
|
411
408
|
httpClient: this.httpClient,
|
|
412
409
|
logger: this.logger,
|
|
413
410
|
});
|
|
414
|
-
resp = parseResponse(respBody,
|
|
411
|
+
resp = parseResponse(respBody, unmarshalGetRunResponseSchema);
|
|
415
412
|
};
|
|
416
413
|
await executeCall(call, options);
|
|
417
414
|
if (resp === undefined) {
|
|
418
|
-
throw new Error('
|
|
415
|
+
throw new Error('operation completed without a result.');
|
|
419
416
|
}
|
|
420
417
|
return resp;
|
|
421
418
|
}
|
|
@@ -451,11 +448,11 @@ export class JobsClient {
|
|
|
451
448
|
httpClient: this.httpClient,
|
|
452
449
|
logger: this.logger,
|
|
453
450
|
});
|
|
454
|
-
resp = parseResponse(respBody,
|
|
451
|
+
resp = parseResponse(respBody, unmarshalGetRunOutputResponseSchema);
|
|
455
452
|
};
|
|
456
453
|
await executeCall(call, options);
|
|
457
454
|
if (resp === undefined) {
|
|
458
|
-
throw new Error('
|
|
455
|
+
throw new Error('operation completed without a result.');
|
|
459
456
|
}
|
|
460
457
|
return resp;
|
|
461
458
|
}
|
|
@@ -493,11 +490,11 @@ export class JobsClient {
|
|
|
493
490
|
httpClient: this.httpClient,
|
|
494
491
|
logger: this.logger,
|
|
495
492
|
});
|
|
496
|
-
resp = parseResponse(respBody,
|
|
493
|
+
resp = parseResponse(respBody, unmarshalListJobsResponseSchema);
|
|
497
494
|
};
|
|
498
495
|
await executeCall(call, options);
|
|
499
496
|
if (resp === undefined) {
|
|
500
|
-
throw new Error('
|
|
497
|
+
throw new Error('operation completed without a result.');
|
|
501
498
|
}
|
|
502
499
|
return resp;
|
|
503
500
|
}
|
|
@@ -563,11 +560,11 @@ export class JobsClient {
|
|
|
563
560
|
httpClient: this.httpClient,
|
|
564
561
|
logger: this.logger,
|
|
565
562
|
});
|
|
566
|
-
resp = parseResponse(respBody,
|
|
563
|
+
resp = parseResponse(respBody, unmarshalListRunsResponseSchema);
|
|
567
564
|
};
|
|
568
565
|
await executeCall(call, options);
|
|
569
566
|
if (resp === undefined) {
|
|
570
|
-
throw new Error('
|
|
567
|
+
throw new Error('operation completed without a result.');
|
|
571
568
|
}
|
|
572
569
|
return resp;
|
|
573
570
|
}
|
|
@@ -605,11 +602,11 @@ export class JobsClient {
|
|
|
605
602
|
httpClient: this.httpClient,
|
|
606
603
|
logger: this.logger,
|
|
607
604
|
});
|
|
608
|
-
resp = parseResponse(respBody,
|
|
605
|
+
resp = parseResponse(respBody, unmarshalRepairRunResponseSchema);
|
|
609
606
|
};
|
|
610
607
|
await executeCall(call, options);
|
|
611
608
|
if (resp === undefined) {
|
|
612
|
-
throw new Error('
|
|
609
|
+
throw new Error('operation completed without a result.');
|
|
613
610
|
}
|
|
614
611
|
return resp;
|
|
615
612
|
}
|
|
@@ -637,11 +634,11 @@ export class JobsClient {
|
|
|
637
634
|
httpClient: this.httpClient,
|
|
638
635
|
logger: this.logger,
|
|
639
636
|
});
|
|
640
|
-
resp = parseResponse(respBody,
|
|
637
|
+
resp = parseResponse(respBody, unmarshalResetJobResponseSchema);
|
|
641
638
|
};
|
|
642
639
|
await executeCall(call, options);
|
|
643
640
|
if (resp === undefined) {
|
|
644
|
-
throw new Error('
|
|
641
|
+
throw new Error('operation completed without a result.');
|
|
645
642
|
}
|
|
646
643
|
return resp;
|
|
647
644
|
}
|
|
@@ -662,11 +659,11 @@ export class JobsClient {
|
|
|
662
659
|
httpClient: this.httpClient,
|
|
663
660
|
logger: this.logger,
|
|
664
661
|
});
|
|
665
|
-
resp = parseResponse(respBody,
|
|
662
|
+
resp = parseResponse(respBody, unmarshalRunNowResponseSchema);
|
|
666
663
|
};
|
|
667
664
|
await executeCall(call, options);
|
|
668
665
|
if (resp === undefined) {
|
|
669
|
-
throw new Error('
|
|
666
|
+
throw new Error('operation completed without a result.');
|
|
670
667
|
}
|
|
671
668
|
return resp;
|
|
672
669
|
}
|
|
@@ -706,11 +703,11 @@ export class JobsClient {
|
|
|
706
703
|
httpClient: this.httpClient,
|
|
707
704
|
logger: this.logger,
|
|
708
705
|
});
|
|
709
|
-
resp = parseResponse(respBody,
|
|
706
|
+
resp = parseResponse(respBody, unmarshalSubmitRunResponseSchema);
|
|
710
707
|
};
|
|
711
708
|
await executeCall(call, options);
|
|
712
709
|
if (resp === undefined) {
|
|
713
|
-
throw new Error('
|
|
710
|
+
throw new Error('operation completed without a result.');
|
|
714
711
|
}
|
|
715
712
|
return resp;
|
|
716
713
|
}
|
|
@@ -738,11 +735,11 @@ export class JobsClient {
|
|
|
738
735
|
httpClient: this.httpClient,
|
|
739
736
|
logger: this.logger,
|
|
740
737
|
});
|
|
741
|
-
resp = parseResponse(respBody,
|
|
738
|
+
resp = parseResponse(respBody, unmarshalUpdateJobResponseSchema);
|
|
742
739
|
};
|
|
743
740
|
await executeCall(call, options);
|
|
744
741
|
if (resp === undefined) {
|
|
745
|
-
throw new Error('
|
|
742
|
+
throw new Error('operation completed without a result.');
|
|
746
743
|
}
|
|
747
744
|
return resp;
|
|
748
745
|
}
|
|
@@ -764,7 +761,7 @@ export class CancelRunWaiter {
|
|
|
764
761
|
const call = async (callSignal) => {
|
|
765
762
|
const pollResp = await this.client.getRun({
|
|
766
763
|
runId: this.runId,
|
|
767
|
-
},
|
|
764
|
+
}, callSignal !== undefined ? { signal: callSignal } : undefined);
|
|
768
765
|
const status = pollResp.state?.lifeCycleState;
|
|
769
766
|
if (status === undefined) {
|
|
770
767
|
throw new Error('response missing required status field');
|
|
@@ -782,15 +779,9 @@ export class CancelRunWaiter {
|
|
|
782
779
|
throw new StillRunningError();
|
|
783
780
|
}
|
|
784
781
|
};
|
|
785
|
-
|
|
786
|
-
...(options?.signal !== undefined && { signal: options.signal }),
|
|
787
|
-
retrier: () => retryOn({}, (err) => {
|
|
788
|
-
return err instanceof StillRunningError;
|
|
789
|
-
}),
|
|
790
|
-
};
|
|
791
|
-
await executeCall(call, retryOptions);
|
|
782
|
+
await executeWait(call, options);
|
|
792
783
|
if (result === undefined) {
|
|
793
|
-
throw new Error('
|
|
784
|
+
throw new Error('operation completed without a result.');
|
|
794
785
|
}
|
|
795
786
|
return result;
|
|
796
787
|
}
|
|
@@ -830,7 +821,7 @@ export class RepairWaiter {
|
|
|
830
821
|
const call = async (callSignal) => {
|
|
831
822
|
const pollResp = await this.client.getRun({
|
|
832
823
|
runId: this.runId,
|
|
833
|
-
},
|
|
824
|
+
}, callSignal !== undefined ? { signal: callSignal } : undefined);
|
|
834
825
|
const status = pollResp.state?.lifeCycleState;
|
|
835
826
|
if (status === undefined) {
|
|
836
827
|
throw new Error('response missing required status field');
|
|
@@ -848,15 +839,9 @@ export class RepairWaiter {
|
|
|
848
839
|
throw new StillRunningError();
|
|
849
840
|
}
|
|
850
841
|
};
|
|
851
|
-
|
|
852
|
-
...(options?.signal !== undefined && { signal: options.signal }),
|
|
853
|
-
retrier: () => retryOn({}, (err) => {
|
|
854
|
-
return err instanceof StillRunningError;
|
|
855
|
-
}),
|
|
856
|
-
};
|
|
857
|
-
await executeCall(call, retryOptions);
|
|
842
|
+
await executeWait(call, options);
|
|
858
843
|
if (result === undefined) {
|
|
859
|
-
throw new Error('
|
|
844
|
+
throw new Error('operation completed without a result.');
|
|
860
845
|
}
|
|
861
846
|
return result;
|
|
862
847
|
}
|
|
@@ -896,7 +881,7 @@ export class RunNowWaiter {
|
|
|
896
881
|
const call = async (callSignal) => {
|
|
897
882
|
const pollResp = await this.client.getRun({
|
|
898
883
|
runId: this.runId,
|
|
899
|
-
},
|
|
884
|
+
}, callSignal !== undefined ? { signal: callSignal } : undefined);
|
|
900
885
|
const status = pollResp.state?.lifeCycleState;
|
|
901
886
|
if (status === undefined) {
|
|
902
887
|
throw new Error('response missing required status field');
|
|
@@ -914,15 +899,9 @@ export class RunNowWaiter {
|
|
|
914
899
|
throw new StillRunningError();
|
|
915
900
|
}
|
|
916
901
|
};
|
|
917
|
-
|
|
918
|
-
...(options?.signal !== undefined && { signal: options.signal }),
|
|
919
|
-
retrier: () => retryOn({}, (err) => {
|
|
920
|
-
return err instanceof StillRunningError;
|
|
921
|
-
}),
|
|
922
|
-
};
|
|
923
|
-
await executeCall(call, retryOptions);
|
|
902
|
+
await executeWait(call, options);
|
|
924
903
|
if (result === undefined) {
|
|
925
|
-
throw new Error('
|
|
904
|
+
throw new Error('operation completed without a result.');
|
|
926
905
|
}
|
|
927
906
|
return result;
|
|
928
907
|
}
|
|
@@ -962,7 +941,7 @@ export class SubmitRunWaiter {
|
|
|
962
941
|
const call = async (callSignal) => {
|
|
963
942
|
const pollResp = await this.client.getRun({
|
|
964
943
|
runId: this.runId,
|
|
965
|
-
},
|
|
944
|
+
}, callSignal !== undefined ? { signal: callSignal } : undefined);
|
|
966
945
|
const status = pollResp.state?.lifeCycleState;
|
|
967
946
|
if (status === undefined) {
|
|
968
947
|
throw new Error('response missing required status field');
|
|
@@ -980,15 +959,9 @@ export class SubmitRunWaiter {
|
|
|
980
959
|
throw new StillRunningError();
|
|
981
960
|
}
|
|
982
961
|
};
|
|
983
|
-
|
|
984
|
-
...(options?.signal !== undefined && { signal: options.signal }),
|
|
985
|
-
retrier: () => retryOn({}, (err) => {
|
|
986
|
-
return err instanceof StillRunningError;
|
|
987
|
-
}),
|
|
988
|
-
};
|
|
989
|
-
await executeCall(call, retryOptions);
|
|
962
|
+
await executeWait(call, options);
|
|
990
963
|
if (result === undefined) {
|
|
991
|
-
throw new Error('
|
|
964
|
+
throw new Error('operation completed without a result.');
|
|
992
965
|
}
|
|
993
966
|
return result;
|
|
994
967
|
}
|