@sylphx/sdk 0.31.0 → 0.32.1
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 +131 -4
- package/dist/access.d.ts +146 -17
- package/dist/access.js +114 -8
- package/dist/access.js.map +1 -1
- package/dist/agents.d.ts +1564 -0
- package/dist/agents.js +1096 -0
- package/dist/agents.js.map +1 -0
- package/dist/ai.d.ts +1 -2
- package/dist/ai.js +2 -3
- package/dist/ai.js.map +1 -1
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +2 -2
- package/dist/assets.d.ts +447 -0
- package/dist/assets.js +266 -0
- package/dist/assets.js.map +1 -0
- package/dist/auth/client.d.ts +239 -0
- package/dist/auth/client.js +337 -0
- package/dist/auth/client.js.map +1 -0
- package/dist/auth/end-user-keys-mock.d.ts +83 -0
- package/dist/auth/end-user-keys-mock.js +427 -0
- package/dist/auth/end-user-keys-mock.js.map +1 -0
- package/dist/auth/end-user-keys.d.ts +219 -0
- package/dist/auth/end-user-keys.js +240 -0
- package/dist/auth/end-user-keys.js.map +1 -0
- package/dist/auth/verify.d.ts +38 -3
- package/dist/auth/verify.js +58 -8
- package/dist/auth/verify.js.map +1 -1
- package/dist/auth.d.ts +656 -9
- package/dist/auth.js +563 -6
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +99 -21
- package/dist/billing.js +43 -5
- package/dist/billing.js.map +1 -1
- package/dist/broker.d.ts +5 -4
- package/dist/broker.js +3 -3
- package/dist/broker.js.map +1 -1
- package/dist/build.d.ts +362 -29
- package/dist/build.js +302 -10
- package/dist/build.js.map +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/config/flags.d.ts +140 -0
- package/dist/config/flags.js +462 -0
- package/dist/config/flags.js.map +1 -0
- package/dist/config.d.ts +380 -15
- package/dist/config.js +283 -5
- package/dist/config.js.map +1 -1
- package/dist/connections.d.ts +6 -6
- package/dist/connections.js +3 -3
- package/dist/data.d.ts +612 -7
- package/dist/data.js +566 -4
- package/dist/data.js.map +1 -1
- package/dist/entitlement.d.ts +10 -8
- package/dist/entitlement.js +3 -4
- package/dist/entitlement.js.map +1 -1
- package/dist/events/realtime.d.ts +69 -0
- package/dist/events/realtime.js +107 -0
- package/dist/events/realtime.js.map +1 -0
- package/dist/events/webhooks.d.ts +40 -0
- package/dist/events/webhooks.js +110 -0
- package/dist/events/webhooks.js.map +1 -0
- package/dist/events.d.ts +369 -22
- package/dist/events.js +311 -8
- package/dist/events.js.map +1 -1
- package/dist/flags.d.ts +18 -0
- package/dist/flags.js +44 -0
- package/dist/flags.js.map +1 -0
- package/dist/hosting.d.ts +13 -14
- package/dist/hosting.js +3 -4
- package/dist/hosting.js.map +1 -1
- package/dist/ids.d.ts +987 -0
- package/dist/ids.js +317 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +25 -1
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +2 -2
- package/dist/keys.js +3 -3
- package/dist/knowledge.d.ts +1192 -0
- package/dist/knowledge.js +1002 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/localization.d.ts +663 -0
- package/dist/localization.js +491 -0
- package/dist/localization.js.map +1 -0
- package/dist/methods.js +3251 -133
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +3086 -0
- package/dist/money.js +2358 -0
- package/dist/money.js.map +1 -0
- package/dist/network.d.ts +4 -5
- package/dist/network.js +3 -4
- package/dist/network.js.map +1 -1
- package/dist/notify.d.ts +667 -125
- package/dist/notify.js +471 -73
- package/dist/notify.js.map +1 -1
- package/dist/observability.d.ts +322 -7
- package/dist/observability.js +244 -8
- package/dist/observability.js.map +1 -1
- package/dist/realtime.d.ts +404 -0
- package/dist/realtime.js +312 -0
- package/dist/realtime.js.map +1 -0
- package/dist/release.d.ts +14 -15
- package/dist/release.js +3 -4
- package/dist/release.js.map +1 -1
- package/dist/runners.d.ts +2 -3
- package/dist/runners.js +3 -4
- package/dist/runners.js.map +1 -1
- package/dist/runtime.d.ts +5 -1
- package/dist/runtime.js +7 -3
- package/dist/runtime.js.map +1 -1
- package/dist/sandboxes.d.ts +64 -20
- package/dist/sandboxes.js +9 -4
- package/dist/sandboxes.js.map +1 -1
- package/dist/secrets.d.ts +342 -6
- package/dist/secrets.js +271 -4
- package/dist/secrets.js.map +1 -1
- package/dist/workflows.d.ts +969 -15
- package/dist/workflows.js +815 -6
- package/dist/workflows.js.map +1 -1
- package/package.json +2 -2
package/dist/workflows.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import * as runtime from './runtime.js';
|
|
2
2
|
import './common.js';
|
|
3
3
|
import type * as common from './common.js';
|
|
4
|
+
/** The request of AddDistributedRunShards. */
|
|
5
|
+
export interface AddDistributedRunShardsRequest {
|
|
6
|
+
/** The name of the distributed run; its manifest must be open. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The shards to append. */
|
|
9
|
+
shards?: ShardInput[];
|
|
10
|
+
/** Close the manifest: the run ends once its shards are done. */
|
|
11
|
+
close?: boolean;
|
|
12
|
+
}
|
|
4
13
|
/** A child Run's place in its batch. */
|
|
5
14
|
export interface BatchPosition {
|
|
6
15
|
/** The parent batch Run. */
|
|
@@ -17,6 +26,20 @@ export interface CalendarSpec {
|
|
|
17
26
|
/** IANA time zone; default `UTC`. */
|
|
18
27
|
timeZone?: string;
|
|
19
28
|
}
|
|
29
|
+
/** The request of CancelDistributedRun. */
|
|
30
|
+
export interface CancelDistributedRunRequest {
|
|
31
|
+
/** The name of the distributed run. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Why the run is cancelled. */
|
|
34
|
+
reason?: string;
|
|
35
|
+
}
|
|
36
|
+
/** The request of CancelJobRun. */
|
|
37
|
+
export interface CancelJobRunRequest {
|
|
38
|
+
/** The name of the job run. */
|
|
39
|
+
name: string;
|
|
40
|
+
/** Why the run is cancelled. */
|
|
41
|
+
reason?: string;
|
|
42
|
+
}
|
|
20
43
|
/** The request of CancelRun. */
|
|
21
44
|
export interface CancelRunRequest {
|
|
22
45
|
/** The name of the run. */
|
|
@@ -24,6 +47,50 @@ export interface CancelRunRequest {
|
|
|
24
47
|
/** Why the Run is cancelled. */
|
|
25
48
|
reason?: string;
|
|
26
49
|
}
|
|
50
|
+
/** The request of CreateDistributedJob. */
|
|
51
|
+
export interface CreateDistributedJobRequest {
|
|
52
|
+
/** The parent to create in. */
|
|
53
|
+
parent: string;
|
|
54
|
+
/** The distributed job id, the final name segment: `[a-z][a-z0-9-]{0,62}`. */
|
|
55
|
+
distributedJobId?: string;
|
|
56
|
+
/** The distributed job to create; only caller-writable fields are read. */
|
|
57
|
+
distributedJob: DistributedJob;
|
|
58
|
+
/** Validate and return the result without writing anything. */
|
|
59
|
+
validateOnly?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** The request of CreateDistributedRun. */
|
|
62
|
+
export interface CreateDistributedRunRequest {
|
|
63
|
+
/** The distributed job to run. */
|
|
64
|
+
parent: string;
|
|
65
|
+
/** The run id, the final name segment; the server assigns one when empty. */
|
|
66
|
+
distributedRunId?: string;
|
|
67
|
+
/** The run to start: `args`, `env`, `shards` and `open_manifest`. */
|
|
68
|
+
distributedRun: DistributedRun;
|
|
69
|
+
/** Validate and return the result without starting anything. */
|
|
70
|
+
validateOnly?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/** The request of CreateJob. */
|
|
73
|
+
export interface CreateJobRequest {
|
|
74
|
+
/** The parent to create in. */
|
|
75
|
+
parent: string;
|
|
76
|
+
/** The job id, the final name segment: `[a-z0-9-]{1,63}`. */
|
|
77
|
+
jobId?: string;
|
|
78
|
+
/** The job to create; only caller-writable fields are read. */
|
|
79
|
+
job: Job;
|
|
80
|
+
/** Validate and return the result without writing anything. */
|
|
81
|
+
validateOnly?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** The request of CreateJobRun. */
|
|
84
|
+
export interface CreateJobRunRequest {
|
|
85
|
+
/** The job to run. */
|
|
86
|
+
parent: string;
|
|
87
|
+
/** The run id, the final name segment; the server assigns one when empty. */
|
|
88
|
+
jobRunId?: string;
|
|
89
|
+
/** The run to start: `args` and `env` override the Job's for this run. */
|
|
90
|
+
jobRun: JobRun;
|
|
91
|
+
/** Validate and return the result without starting anything. */
|
|
92
|
+
validateOnly?: boolean;
|
|
93
|
+
}
|
|
27
94
|
/** The request of CreateRun. */
|
|
28
95
|
export interface CreateRunRequest {
|
|
29
96
|
/** The parent to create in. */
|
|
@@ -63,6 +130,38 @@ export interface CreateWorkflowRequest {
|
|
|
63
130
|
/** Validate and return the result without writing anything. */
|
|
64
131
|
validateOnly?: boolean;
|
|
65
132
|
}
|
|
133
|
+
/** The request of DeleteDistributedJob. */
|
|
134
|
+
export interface DeleteDistributedJobRequest {
|
|
135
|
+
/** The name of the distributed job to delete. */
|
|
136
|
+
name: string;
|
|
137
|
+
/** Delete only if the current etag matches. */
|
|
138
|
+
etag?: string;
|
|
139
|
+
/** Succeed when the distributed job does not exist. */
|
|
140
|
+
allowMissing?: boolean;
|
|
141
|
+
/** Validate without deleting anything. */
|
|
142
|
+
validateOnly?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Also cancel active runs; without it a job with an active run fails with
|
|
145
|
+
* INVALID_STATE.
|
|
146
|
+
*/
|
|
147
|
+
force?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/** The request of DeleteJob. */
|
|
150
|
+
export interface DeleteJobRequest {
|
|
151
|
+
/** The name of the job to delete. */
|
|
152
|
+
name: string;
|
|
153
|
+
/** Delete only if the current etag matches. */
|
|
154
|
+
etag?: string;
|
|
155
|
+
/** Succeed when the job does not exist. */
|
|
156
|
+
allowMissing?: boolean;
|
|
157
|
+
/** Validate without deleting anything. */
|
|
158
|
+
validateOnly?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Also cancel active runs and delete Schedules targeting the job; without
|
|
161
|
+
* it a job with an active run or a Schedule fails with INVALID_STATE.
|
|
162
|
+
*/
|
|
163
|
+
force?: boolean;
|
|
164
|
+
}
|
|
66
165
|
/** The request of DeleteSchedule. */
|
|
67
166
|
export interface DeleteScheduleRequest {
|
|
68
167
|
/** The name of the schedule to delete. */
|
|
@@ -90,6 +189,132 @@ export interface DeleteWorkflowRequest {
|
|
|
90
189
|
*/
|
|
91
190
|
force?: boolean;
|
|
92
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* A DistributedJob runs one container image on many workers at once
|
|
194
|
+
* (run-distributed-jobs.md §4). A run splits its work into shards that
|
|
195
|
+
* workers lease from a queue; the worker pool grows and shrinks with the
|
|
196
|
+
* capacity Kueue admits, and a preempted shard goes back to the queue.
|
|
197
|
+
*/
|
|
198
|
+
export interface DistributedJob {
|
|
199
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/distributed_jobs/{distributed_job}`. */
|
|
200
|
+
name?: string;
|
|
201
|
+
/** `djob_<cell><ulid>`; never reused. */
|
|
202
|
+
readonly uid?: string;
|
|
203
|
+
/** Resource metadata. */
|
|
204
|
+
meta?: common.ResourceMeta;
|
|
205
|
+
/** Desired state. */
|
|
206
|
+
spec?: DistributedJobSpec;
|
|
207
|
+
/** Observed state. */
|
|
208
|
+
readonly status?: DistributedJobStatus;
|
|
209
|
+
}
|
|
210
|
+
/** DistributedJobSpec is the caller-writable state of a DistributedJob. */
|
|
211
|
+
export interface DistributedJobSpec {
|
|
212
|
+
/**
|
|
213
|
+
* The worker container: its image, command, env and instance type.
|
|
214
|
+
* `timeout` is the longest one worker lives, so the pool turns over;
|
|
215
|
+
* `max_retries` and `concurrency` do not apply.
|
|
216
|
+
*/
|
|
217
|
+
worker?: JobSpec;
|
|
218
|
+
/** Price and preemption class; default scavenger. */
|
|
219
|
+
workerClass?: WorkerClass;
|
|
220
|
+
/** Elastic bounds of the worker pool. */
|
|
221
|
+
scale?: WorkerScale;
|
|
222
|
+
/** Local scratch disk at `/scratch` per worker, GiB; 0 is none. */
|
|
223
|
+
scratchGib?: number;
|
|
224
|
+
/** A run that brings no shards of its own gets this many index-only shards. */
|
|
225
|
+
shardCount?: string;
|
|
226
|
+
/** The longest one lease may live without the shard ending; default 30m. */
|
|
227
|
+
shardTimeout?: string;
|
|
228
|
+
/** Attempts a shard gets after a failure; a preemption is not one. Default 3. */
|
|
229
|
+
shardRetries?: number;
|
|
230
|
+
/** Failed shards the run tolerates before it fails; default 0. */
|
|
231
|
+
maxFailedShards?: string;
|
|
232
|
+
/** The whole run's deadline; default 48h. */
|
|
233
|
+
runTimeout?: string;
|
|
234
|
+
/** `data://<bucket>/<prefix>/`: checkpoints go under `<run>/<shard>/`. */
|
|
235
|
+
checkpointUri?: string;
|
|
236
|
+
/** `data://<bucket>/<prefix>/`: outputs go under `<run>/<shard>/`. */
|
|
237
|
+
outputUri?: string;
|
|
238
|
+
}
|
|
239
|
+
/** DistributedJobStatus is the observed state of a DistributedJob. */
|
|
240
|
+
export interface DistributedJobStatus {
|
|
241
|
+
/** The generation this status was computed from. */
|
|
242
|
+
readonly observedGeneration?: string;
|
|
243
|
+
/** Ready, Reconciling, Stalled. */
|
|
244
|
+
readonly conditions?: common.Condition[];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* A DistributedRun is one start of a DistributedJob: a queue of shards and
|
|
248
|
+
* the workers that drain it.
|
|
249
|
+
*/
|
|
250
|
+
export interface DistributedRun {
|
|
251
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/distributed_jobs/{distributed_job}/distributed_runs/{distributed_run}`. */
|
|
252
|
+
name?: string;
|
|
253
|
+
/** `drun_<cell><ulid>`; never reused. */
|
|
254
|
+
readonly uid?: string;
|
|
255
|
+
/** Resource metadata. */
|
|
256
|
+
meta?: common.ResourceMeta;
|
|
257
|
+
/** The DistributedJob generation the run pinned. */
|
|
258
|
+
readonly jobGeneration?: string;
|
|
259
|
+
/** The run's lifecycle state. */
|
|
260
|
+
readonly state?: DistributedRunState;
|
|
261
|
+
/** Whether more shards may still be added (`:addShards`). */
|
|
262
|
+
readonly manifestOpen?: boolean;
|
|
263
|
+
/** Why the run failed or was refused, when it did. */
|
|
264
|
+
readonly message?: string;
|
|
265
|
+
/** When the run was accepted. */
|
|
266
|
+
readonly createTime?: string;
|
|
267
|
+
/** When the first worker started. */
|
|
268
|
+
readonly startTime?: string;
|
|
269
|
+
/** When the run closed. */
|
|
270
|
+
readonly endTime?: string;
|
|
271
|
+
/** Shards by state. */
|
|
272
|
+
readonly shardCounts?: ShardCounts;
|
|
273
|
+
/** Workers by state. */
|
|
274
|
+
readonly workerCounts?: WorkerCounts;
|
|
275
|
+
/** Metered usage across workers. */
|
|
276
|
+
readonly usage?: DistributedRunUsage;
|
|
277
|
+
/** Arguments of every worker of this run (the job's when empty). */
|
|
278
|
+
args?: string[];
|
|
279
|
+
/** Environment overrides of this run. */
|
|
280
|
+
env?: Record<string, string>;
|
|
281
|
+
/**
|
|
282
|
+
* The run's own shards (the customer's planner output); without them the
|
|
283
|
+
* job's `shard_count` makes index-only shards.
|
|
284
|
+
*/
|
|
285
|
+
shards?: ShardInput[];
|
|
286
|
+
/** Keep the manifest open: `:addShards` appends until it is closed. */
|
|
287
|
+
openManifest?: boolean;
|
|
288
|
+
}
|
|
289
|
+
/** Metered usage of a DistributedRun. */
|
|
290
|
+
export interface DistributedRunUsage {
|
|
291
|
+
/** Summed worker run time from container start to exit. */
|
|
292
|
+
readonly workerDuration?: string;
|
|
293
|
+
/** The price class the workers ran in. */
|
|
294
|
+
readonly workerClass?: WorkerClass;
|
|
295
|
+
/** The instance type the workers ran on. */
|
|
296
|
+
readonly instanceType?: string;
|
|
297
|
+
}
|
|
298
|
+
/** The request of GetDistributedJob. */
|
|
299
|
+
export interface GetDistributedJobRequest {
|
|
300
|
+
/** The name of the distributed job to get. */
|
|
301
|
+
name: string;
|
|
302
|
+
}
|
|
303
|
+
/** The request of GetDistributedRun. */
|
|
304
|
+
export interface GetDistributedRunRequest {
|
|
305
|
+
/** The name of the distributed run to get. */
|
|
306
|
+
name: string;
|
|
307
|
+
}
|
|
308
|
+
/** The request of GetJob. */
|
|
309
|
+
export interface GetJobRequest {
|
|
310
|
+
/** The name of the job to get. */
|
|
311
|
+
name: string;
|
|
312
|
+
}
|
|
313
|
+
/** The request of GetJobRun. */
|
|
314
|
+
export interface GetJobRunRequest {
|
|
315
|
+
/** The name of the job run to get. */
|
|
316
|
+
name: string;
|
|
317
|
+
}
|
|
93
318
|
/** The request of GetRun. */
|
|
94
319
|
export interface GetRunRequest {
|
|
95
320
|
/** The name of the run to get. */
|
|
@@ -112,6 +337,228 @@ export interface IntervalSpec {
|
|
|
112
337
|
/** Phase offset within each period. */
|
|
113
338
|
offset?: string;
|
|
114
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* A Job runs a container to completion: the project's image, a command, an
|
|
342
|
+
* exit status, logs, and metered usage (docs/services/workflows/jobs.md). It
|
|
343
|
+
* takes no HTTP handler and no worker. A Schedule may target it; every start
|
|
344
|
+
* is a JobRun.
|
|
345
|
+
*/
|
|
346
|
+
export interface Job {
|
|
347
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/jobs/{job}`. */
|
|
348
|
+
name?: string;
|
|
349
|
+
/** `job_<cell><ulid>`; never reused. */
|
|
350
|
+
readonly uid?: string;
|
|
351
|
+
/** Resource metadata. */
|
|
352
|
+
meta?: common.ResourceMeta;
|
|
353
|
+
/** Desired state. */
|
|
354
|
+
spec?: JobSpec;
|
|
355
|
+
/** Observed state. */
|
|
356
|
+
readonly status?: JobStatus;
|
|
357
|
+
}
|
|
358
|
+
/** A container that handles a Workflow's invocations. */
|
|
359
|
+
export interface JobHandler {
|
|
360
|
+
/** The image reference. */
|
|
361
|
+
image?: string;
|
|
362
|
+
/** The entrypoint; empty keeps the image's. */
|
|
363
|
+
command?: string[];
|
|
364
|
+
}
|
|
365
|
+
/** One line a JobRun's container wrote. */
|
|
366
|
+
export interface JobLogLine {
|
|
367
|
+
/** When the line was written. */
|
|
368
|
+
readonly writeTime?: string;
|
|
369
|
+
/** The attempt that wrote it, from 1. */
|
|
370
|
+
readonly attempt?: number;
|
|
371
|
+
/** `stdout` or `stderr`. */
|
|
372
|
+
readonly stream?: string;
|
|
373
|
+
/** The line, without its trailing newline. */
|
|
374
|
+
readonly text?: string;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* A JobRun is one start of a Job: queued until the environment's quota admits
|
|
378
|
+
* it, then one attempt per try until an exit of 0, the retries run out, the
|
|
379
|
+
* deadline passes, or it is cancelled.
|
|
380
|
+
*/
|
|
381
|
+
export interface JobRun {
|
|
382
|
+
/** `orgs/{org}/projects/{project}/envs/{env}/jobs/{job}/job_runs/{job_run}`. */
|
|
383
|
+
name?: string;
|
|
384
|
+
/** `jrun_<cell><ulid>`; never reused. */
|
|
385
|
+
readonly uid?: string;
|
|
386
|
+
/** Resource metadata. */
|
|
387
|
+
meta?: common.ResourceMeta;
|
|
388
|
+
/** The Job generation the run pinned. */
|
|
389
|
+
readonly jobGeneration?: string;
|
|
390
|
+
/** The image digest the run executes. */
|
|
391
|
+
readonly resolvedImage?: string;
|
|
392
|
+
/** Arguments of this run (the Job's when empty). */
|
|
393
|
+
args?: string[];
|
|
394
|
+
/** Environment overrides of this run. */
|
|
395
|
+
env?: Record<string, string>;
|
|
396
|
+
/** The run's lifecycle state. */
|
|
397
|
+
readonly state?: JobRunState;
|
|
398
|
+
/** The last attempt's exit code, once it exited. */
|
|
399
|
+
readonly exitCode?: number;
|
|
400
|
+
/** Attempts made so far. */
|
|
401
|
+
readonly attemptCount?: number;
|
|
402
|
+
/**
|
|
403
|
+
* Why the last attempt ended other than by exiting, for example
|
|
404
|
+
* `OOMKilled` or `Evicted`.
|
|
405
|
+
*/
|
|
406
|
+
readonly terminationReason?: string;
|
|
407
|
+
/** Set when a Schedule fire started the run. */
|
|
408
|
+
readonly scheduleFire?: ScheduleFireRef;
|
|
409
|
+
/** When the run was accepted. */
|
|
410
|
+
readonly createTime?: string;
|
|
411
|
+
/** When the first attempt started. */
|
|
412
|
+
readonly startTime?: string;
|
|
413
|
+
/** When the run closed. */
|
|
414
|
+
readonly endTime?: string;
|
|
415
|
+
/** Metered usage across attempts. */
|
|
416
|
+
readonly usage?: JobRunUsage;
|
|
417
|
+
/** Why the run failed or was refused, when it did. */
|
|
418
|
+
readonly message?: string;
|
|
419
|
+
/**
|
|
420
|
+
* Start no earlier than this: set it directly, or through `start_delay`;
|
|
421
|
+
* at most 365 days ahead. A run cancelled before then makes no attempt.
|
|
422
|
+
*/
|
|
423
|
+
scheduleTime?: string;
|
|
424
|
+
/** Start no earlier than this long after the request. */
|
|
425
|
+
startDelay?: string;
|
|
426
|
+
}
|
|
427
|
+
/** Metered usage of a JobRun. */
|
|
428
|
+
export interface JobRunUsage {
|
|
429
|
+
/**
|
|
430
|
+
* Summed wall time of every attempt from start to exit; billed as this
|
|
431
|
+
* duration on `instance_type` (`workflows.job.seconds`).
|
|
432
|
+
*/
|
|
433
|
+
readonly billedDuration?: string;
|
|
434
|
+
/** The instance type the attempts ran on. */
|
|
435
|
+
readonly instanceType?: string;
|
|
436
|
+
}
|
|
437
|
+
/** JobSpec is the caller-writable state of a Job. */
|
|
438
|
+
export interface JobSpec {
|
|
439
|
+
/**
|
|
440
|
+
* The Hosting Service whose env and Secret bindings every run takes, and
|
|
441
|
+
* whose live Release image it runs unless `image` or `build` names another,
|
|
442
|
+
* so a Job never runs code the environment does not serve.
|
|
443
|
+
*/
|
|
444
|
+
service?: string;
|
|
445
|
+
/**
|
|
446
|
+
* A digest-pinned image from this org's Artifacts, in place of the
|
|
447
|
+
* service's image. Exclusive with `build`.
|
|
448
|
+
*/
|
|
449
|
+
image?: string;
|
|
450
|
+
/** The entrypoint; empty keeps the image's. */
|
|
451
|
+
command?: string[];
|
|
452
|
+
/** Arguments; a run may replace them. */
|
|
453
|
+
args?: string[];
|
|
454
|
+
/** Environment overrides on top of the service's env and Secret bindings. */
|
|
455
|
+
env?: Record<string, string>;
|
|
456
|
+
/** A Hosting instance type; default `standard`. */
|
|
457
|
+
instanceType?: string;
|
|
458
|
+
/** One attempt's deadline, 10s to 24h; default 1h. */
|
|
459
|
+
timeout?: string;
|
|
460
|
+
/** Re-runs after a non-zero exit, 0 to 10; backoff 30s doubling. */
|
|
461
|
+
maxRetries?: number;
|
|
462
|
+
/** What a start does while a run is active; default forbid. */
|
|
463
|
+
concurrency?: JobConcurrency;
|
|
464
|
+
/**
|
|
465
|
+
* A build the project declares: its latest built image, in place of the
|
|
466
|
+
* service's; the image needs no running service of its own. Exclusive with
|
|
467
|
+
* `image`.
|
|
468
|
+
*/
|
|
469
|
+
build?: string;
|
|
470
|
+
}
|
|
471
|
+
/** JobStatus is the observed state of a Job. */
|
|
472
|
+
export interface JobStatus {
|
|
473
|
+
/** The generation this status was computed from. */
|
|
474
|
+
readonly observedGeneration?: string;
|
|
475
|
+
/** Ready, Reconciling, Stalled. */
|
|
476
|
+
readonly conditions?: common.Condition[];
|
|
477
|
+
/** The image digest the next run uses. */
|
|
478
|
+
readonly resolvedImage?: string;
|
|
479
|
+
/** The most recent run. */
|
|
480
|
+
readonly lastRun?: string;
|
|
481
|
+
}
|
|
482
|
+
/** The request of ListDistributedJobs. */
|
|
483
|
+
export interface ListDistributedJobsRequest {
|
|
484
|
+
/** The parent to list in. */
|
|
485
|
+
parent: string;
|
|
486
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
487
|
+
pageSize?: number;
|
|
488
|
+
/** `next_page_token` of the previous page. */
|
|
489
|
+
pageToken?: string;
|
|
490
|
+
/** AIP-160 filter over labels and filterable fields. */
|
|
491
|
+
filter?: string;
|
|
492
|
+
/** AIP-132 ordering over filterable fields. */
|
|
493
|
+
orderBy?: string;
|
|
494
|
+
}
|
|
495
|
+
/** The response of ListDistributedJobs. */
|
|
496
|
+
export interface ListDistributedJobsResponse {
|
|
497
|
+
/** The page. */
|
|
498
|
+
distributedJobs?: DistributedJob[];
|
|
499
|
+
/** The token of the next page; empty on the last page. */
|
|
500
|
+
nextPageToken?: string;
|
|
501
|
+
}
|
|
502
|
+
/** The request of ListDistributedRuns. */
|
|
503
|
+
export interface ListDistributedRunsRequest {
|
|
504
|
+
/** The parent to list in. */
|
|
505
|
+
parent: string;
|
|
506
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
507
|
+
pageSize?: number;
|
|
508
|
+
/** `next_page_token` of the previous page. */
|
|
509
|
+
pageToken?: string;
|
|
510
|
+
/** AIP-160 filter over labels and filterable fields. */
|
|
511
|
+
filter?: string;
|
|
512
|
+
/** AIP-132 ordering over filterable fields. */
|
|
513
|
+
orderBy?: string;
|
|
514
|
+
}
|
|
515
|
+
/** The response of ListDistributedRuns. */
|
|
516
|
+
export interface ListDistributedRunsResponse {
|
|
517
|
+
/** The page. */
|
|
518
|
+
distributedRuns?: DistributedRun[];
|
|
519
|
+
/** The token of the next page; empty on the last page. */
|
|
520
|
+
nextPageToken?: string;
|
|
521
|
+
}
|
|
522
|
+
/** The request of ListJobRuns. */
|
|
523
|
+
export interface ListJobRunsRequest {
|
|
524
|
+
/** The parent to list in. */
|
|
525
|
+
parent: string;
|
|
526
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
527
|
+
pageSize?: number;
|
|
528
|
+
/** `next_page_token` of the previous page. */
|
|
529
|
+
pageToken?: string;
|
|
530
|
+
/** AIP-160 filter over labels and filterable fields. */
|
|
531
|
+
filter?: string;
|
|
532
|
+
/** AIP-132 ordering over filterable fields. */
|
|
533
|
+
orderBy?: string;
|
|
534
|
+
}
|
|
535
|
+
/** The response of ListJobRuns. */
|
|
536
|
+
export interface ListJobRunsResponse {
|
|
537
|
+
/** The page. */
|
|
538
|
+
jobRuns?: JobRun[];
|
|
539
|
+
/** The token of the next page; empty on the last page. */
|
|
540
|
+
nextPageToken?: string;
|
|
541
|
+
}
|
|
542
|
+
/** The request of ListJobs. */
|
|
543
|
+
export interface ListJobsRequest {
|
|
544
|
+
/** The parent to list in. */
|
|
545
|
+
parent: string;
|
|
546
|
+
/** At most this many; default 50, clamped to 1000. */
|
|
547
|
+
pageSize?: number;
|
|
548
|
+
/** `next_page_token` of the previous page. */
|
|
549
|
+
pageToken?: string;
|
|
550
|
+
/** AIP-160 filter over labels and filterable fields. */
|
|
551
|
+
filter?: string;
|
|
552
|
+
/** AIP-132 ordering over filterable fields. */
|
|
553
|
+
orderBy?: string;
|
|
554
|
+
}
|
|
555
|
+
/** The response of ListJobs. */
|
|
556
|
+
export interface ListJobsResponse {
|
|
557
|
+
/** The page. */
|
|
558
|
+
jobs?: Job[];
|
|
559
|
+
/** The token of the next page; empty on the last page. */
|
|
560
|
+
nextPageToken?: string;
|
|
561
|
+
}
|
|
115
562
|
/** The request of ListRuns. */
|
|
116
563
|
export interface ListRunsRequest {
|
|
117
564
|
/** The parent to list in. */
|
|
@@ -183,6 +630,65 @@ export interface PauseScheduleRequest {
|
|
|
183
630
|
/** Validate without writing anything. */
|
|
184
631
|
validateOnly?: boolean;
|
|
185
632
|
}
|
|
633
|
+
/** The request of ReadDistributedRunShards. */
|
|
634
|
+
export interface ReadDistributedRunShardsRequest {
|
|
635
|
+
/** The name of the distributed run. */
|
|
636
|
+
name: string;
|
|
637
|
+
/** At most this many; default 100, clamped to 1000. */
|
|
638
|
+
pageSize?: number;
|
|
639
|
+
/** `next_page_token` of the previous page. */
|
|
640
|
+
pageToken?: string;
|
|
641
|
+
/** Only shards in this state; unset reads every shard. */
|
|
642
|
+
stateFilter?: ShardState;
|
|
643
|
+
}
|
|
644
|
+
/** The response of ReadDistributedRunShards. */
|
|
645
|
+
export interface ReadDistributedRunShardsResponse {
|
|
646
|
+
/** The page, in queue order. */
|
|
647
|
+
shards?: Shard[];
|
|
648
|
+
/** The token of the next page; empty on the last page. */
|
|
649
|
+
nextPageToken?: string;
|
|
650
|
+
}
|
|
651
|
+
/** The request of ReadDistributedRunWorkers. */
|
|
652
|
+
export interface ReadDistributedRunWorkersRequest {
|
|
653
|
+
/** The name of the distributed run. */
|
|
654
|
+
name: string;
|
|
655
|
+
/** At most this many; default 100, clamped to 1000. */
|
|
656
|
+
pageSize?: number;
|
|
657
|
+
/** `next_page_token` of the previous page. */
|
|
658
|
+
pageToken?: string;
|
|
659
|
+
}
|
|
660
|
+
/** The response of ReadDistributedRunWorkers. */
|
|
661
|
+
export interface ReadDistributedRunWorkersResponse {
|
|
662
|
+
/** The page, oldest first. */
|
|
663
|
+
workers?: Worker[];
|
|
664
|
+
/** The token of the next page; empty on the last page. */
|
|
665
|
+
nextPageToken?: string;
|
|
666
|
+
}
|
|
667
|
+
/** The request of ReadJobRunLogs. */
|
|
668
|
+
export interface ReadJobRunLogsRequest {
|
|
669
|
+
/** The name of the job run. */
|
|
670
|
+
name: string;
|
|
671
|
+
/** At most this many lines; default 500, clamped to 5000. */
|
|
672
|
+
pageSize?: number;
|
|
673
|
+
/** `next_page_token` of the previous page. */
|
|
674
|
+
pageToken?: string;
|
|
675
|
+
/**
|
|
676
|
+
* On a running run, wait up to this long (at most 30s) for new lines
|
|
677
|
+
* before returning an empty page.
|
|
678
|
+
*/
|
|
679
|
+
wait?: string;
|
|
680
|
+
}
|
|
681
|
+
/** The response of ReadJobRunLogs. */
|
|
682
|
+
export interface ReadJobRunLogsResponse {
|
|
683
|
+
/** The page, oldest first. */
|
|
684
|
+
lines?: JobLogLine[];
|
|
685
|
+
/**
|
|
686
|
+
* The token of the next page. It is set while the run can still write, so
|
|
687
|
+
* a follower keeps polling; empty once the run closed and every line was
|
|
688
|
+
* read.
|
|
689
|
+
*/
|
|
690
|
+
nextPageToken?: string;
|
|
691
|
+
}
|
|
186
692
|
/** The request of ReadRunHistory. */
|
|
187
693
|
export interface ReadRunHistoryRequest {
|
|
188
694
|
/** The name of the run. */
|
|
@@ -220,10 +726,9 @@ export interface RetryPolicy {
|
|
|
220
726
|
maxInterval?: string;
|
|
221
727
|
}
|
|
222
728
|
/**
|
|
223
|
-
* A Run is one execution of a Workflow, read from the engine
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* same key is refused. A Run ends `succeeded` only from its handler's recorded
|
|
729
|
+
* A Run is one execution of a Workflow, read from the engine. Create starts
|
|
730
|
+
* it: the same `Idempotency-Key` and input return the same Run, a changed
|
|
731
|
+
* input under the same key is refused. A Run ends `succeeded` only from its handler's recorded
|
|
227
732
|
* result, and `cancelled` only from an authenticated cancel the handler
|
|
228
733
|
* acknowledged or a Run that never started.
|
|
229
734
|
*/
|
|
@@ -256,6 +761,12 @@ export interface Run {
|
|
|
256
761
|
readonly output?: Record<string, unknown>;
|
|
257
762
|
/** The failure, once `failed` or `timed_out`. */
|
|
258
763
|
readonly error?: RunError;
|
|
764
|
+
/**
|
|
765
|
+
* When the first invocation is due: set it directly, or through
|
|
766
|
+
* `start_delay`; at most 365 days ahead. A Run cancelled before then closes
|
|
767
|
+
* `cancelled` with no invocation.
|
|
768
|
+
*/
|
|
769
|
+
scheduleTime?: string;
|
|
259
770
|
}
|
|
260
771
|
/** Why a Run failed. */
|
|
261
772
|
export interface RunError {
|
|
@@ -287,9 +798,9 @@ export interface RunHistoryEvent {
|
|
|
287
798
|
readonly details?: Record<string, unknown>;
|
|
288
799
|
}
|
|
289
800
|
/**
|
|
290
|
-
* A Schedule starts Runs of a Workflow on a calendar or an interval
|
|
291
|
-
*
|
|
292
|
-
*
|
|
801
|
+
* A Schedule starts Runs of a Workflow on a calendar or an interval. Every
|
|
802
|
+
* fire is an engine timer; `(schedule, intended time)` is the Run identity, so
|
|
803
|
+
* one instant starts at most one Run.
|
|
293
804
|
* A fire is not a Run result.
|
|
294
805
|
*/
|
|
295
806
|
export interface Schedule {
|
|
@@ -359,6 +870,47 @@ export interface ServiceHandler {
|
|
|
359
870
|
/** The request path, for example `/api/sylphx/workflows`. */
|
|
360
871
|
path?: string;
|
|
361
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* One unit of a DistributedRun's work, leased by one worker at a time. A
|
|
875
|
+
* lease that stops heartbeating returns the shard without counting an
|
|
876
|
+
* attempt. Shards are read as a paged view of their run (`:readShards`).
|
|
877
|
+
*/
|
|
878
|
+
export interface Shard {
|
|
879
|
+
/** The shard id, unique in its run. */
|
|
880
|
+
readonly id?: string;
|
|
881
|
+
/** Order in the run's queue, from 0. */
|
|
882
|
+
readonly seq?: string;
|
|
883
|
+
/** The shard's state. */
|
|
884
|
+
readonly state?: ShardState;
|
|
885
|
+
/** Attempts counted so far (failures and timeouts, not preemptions). */
|
|
886
|
+
readonly attempts?: number;
|
|
887
|
+
/** The worker holding or last holding the lease. */
|
|
888
|
+
readonly worker?: string;
|
|
889
|
+
/** What the worker reported at `complete`, any JSON. */
|
|
890
|
+
readonly outputs?: unknown;
|
|
891
|
+
/** The last failure's message. */
|
|
892
|
+
readonly error?: string;
|
|
893
|
+
}
|
|
894
|
+
/** Shards of a DistributedRun by state. */
|
|
895
|
+
export interface ShardCounts {
|
|
896
|
+
/** Waiting to be leased. */
|
|
897
|
+
readonly pending?: string;
|
|
898
|
+
/** Held by a worker. */
|
|
899
|
+
readonly leased?: string;
|
|
900
|
+
/** Completed. */
|
|
901
|
+
readonly succeeded?: string;
|
|
902
|
+
/** Out of attempts. */
|
|
903
|
+
readonly failed?: string;
|
|
904
|
+
/** Every shard of the run. */
|
|
905
|
+
readonly total?: string;
|
|
906
|
+
}
|
|
907
|
+
/** One shard as a run is started with it or appended to. */
|
|
908
|
+
export interface ShardInput {
|
|
909
|
+
/** The shard id, unique in the run; the server assigns one when empty. */
|
|
910
|
+
id?: string;
|
|
911
|
+
/** What the worker gets as its input, any JSON. */
|
|
912
|
+
input?: unknown;
|
|
913
|
+
}
|
|
362
914
|
/** The request of SignalRun. */
|
|
363
915
|
export interface SignalRunRequest {
|
|
364
916
|
/** The name of the run. */
|
|
@@ -382,6 +934,28 @@ export interface StartRunBatchResponse {
|
|
|
382
934
|
/** The parent batch Run. */
|
|
383
935
|
run?: Run;
|
|
384
936
|
}
|
|
937
|
+
/** The request of UpdateDistributedJob. */
|
|
938
|
+
export interface UpdateDistributedJobRequest {
|
|
939
|
+
/** The distributed job to update; `name` identifies it. */
|
|
940
|
+
distributedJob: DistributedJob;
|
|
941
|
+
/** The fields to write; unset writes every populated field. */
|
|
942
|
+
updateMask?: string;
|
|
943
|
+
/** Create the distributed job when it does not exist (declarative upsert). */
|
|
944
|
+
allowMissing?: boolean;
|
|
945
|
+
/** Validate and return the result without writing anything. */
|
|
946
|
+
validateOnly?: boolean;
|
|
947
|
+
}
|
|
948
|
+
/** The request of UpdateJob. */
|
|
949
|
+
export interface UpdateJobRequest {
|
|
950
|
+
/** The job to update; `name` identifies it. */
|
|
951
|
+
job: Job;
|
|
952
|
+
/** The fields to write; unset writes every populated field. */
|
|
953
|
+
updateMask?: string;
|
|
954
|
+
/** Create the job when it does not exist (declarative upsert). */
|
|
955
|
+
allowMissing?: boolean;
|
|
956
|
+
/** Validate and return the result without writing anything. */
|
|
957
|
+
validateOnly?: boolean;
|
|
958
|
+
}
|
|
385
959
|
/** The request of UpdateSchedule. */
|
|
386
960
|
export interface UpdateScheduleRequest {
|
|
387
961
|
/** The schedule to update; `name` identifies it. */
|
|
@@ -411,11 +985,49 @@ export interface WaitRunRequest {
|
|
|
411
985
|
/** How long to wait; default 30s, at most 60s. */
|
|
412
986
|
timeout?: string;
|
|
413
987
|
}
|
|
988
|
+
/**
|
|
989
|
+
* One container of a DistributedRun's worker pool, read as a paged view of
|
|
990
|
+
* its run (`:readWorkers`).
|
|
991
|
+
*/
|
|
992
|
+
export interface Worker {
|
|
993
|
+
/** The worker id in its run, `w<n>`. */
|
|
994
|
+
readonly id?: string;
|
|
995
|
+
/** The worker's state. */
|
|
996
|
+
readonly state?: WorkerState;
|
|
997
|
+
/** The job that runs it. */
|
|
998
|
+
readonly job?: string;
|
|
999
|
+
/** Why it ended, for example `Completed`, `Preempted` or `OOMKilled`. */
|
|
1000
|
+
readonly reason?: string;
|
|
1001
|
+
/** When its container started. */
|
|
1002
|
+
readonly startTime?: string;
|
|
1003
|
+
/** When its container ended. */
|
|
1004
|
+
readonly endTime?: string;
|
|
1005
|
+
/** Billed run time. */
|
|
1006
|
+
readonly duration?: string;
|
|
1007
|
+
}
|
|
1008
|
+
/** Workers of a DistributedRun by state. */
|
|
1009
|
+
export interface WorkerCounts {
|
|
1010
|
+
/** Every worker the run created. */
|
|
1011
|
+
readonly created?: string;
|
|
1012
|
+
/** Waiting for Kueue to admit them. */
|
|
1013
|
+
readonly waiting?: string;
|
|
1014
|
+
/** Running. */
|
|
1015
|
+
readonly running?: string;
|
|
1016
|
+
/** Ended. */
|
|
1017
|
+
readonly ended?: string;
|
|
1018
|
+
}
|
|
1019
|
+
/** Elastic bounds of a DistributedJob's worker pool. */
|
|
1020
|
+
export interface WorkerScale {
|
|
1021
|
+
/** Workers kept while shards remain; default 1. */
|
|
1022
|
+
minWorkers?: number;
|
|
1023
|
+
/** The most workers at once; the Cell and the org quota cap it too. Default 1. */
|
|
1024
|
+
maxWorkers?: number;
|
|
1025
|
+
}
|
|
414
1026
|
/**
|
|
415
1027
|
* A Workflow is durable work a customer declares: the handler each step of a
|
|
416
|
-
* Run invokes, and its retry and timeout policy
|
|
417
|
-
*
|
|
418
|
-
*
|
|
1028
|
+
* Run invokes, and its retry and timeout policy. A Workflow write never
|
|
1029
|
+
* starts, completes, or cancels a Run; a Run pins the Workflow generation it
|
|
1030
|
+
* started from.
|
|
419
1031
|
*/
|
|
420
1032
|
export interface Workflow {
|
|
421
1033
|
/** `orgs/{org}/projects/{project}/envs/{env}/workflows/{workflow}`. */
|
|
@@ -447,6 +1059,24 @@ export interface WorkflowSpec {
|
|
|
447
1059
|
* plan.
|
|
448
1060
|
*/
|
|
449
1061
|
maxConcurrentRuns?: number;
|
|
1062
|
+
/**
|
|
1063
|
+
* A container that runs once per invocation. Not served yet: the server
|
|
1064
|
+
* refuses it until the engine runs container handlers.
|
|
1065
|
+
*/
|
|
1066
|
+
jobHandler?: JobHandler;
|
|
1067
|
+
/**
|
|
1068
|
+
* Who may start, signal, wait on and cancel its Runs (`callable_by` in
|
|
1069
|
+
* `sylphx.toml`); unset is `SERVER`.
|
|
1070
|
+
* Not served yet: the server refuses the field, set to any value, until
|
|
1071
|
+
* end-user sessions are admitted.
|
|
1072
|
+
*/
|
|
1073
|
+
callers?: WorkflowCaller;
|
|
1074
|
+
/**
|
|
1075
|
+
* The app permission an end user's session must hold to call the Run
|
|
1076
|
+
* methods of this Workflow; required when `callers` is `USERS`. Not
|
|
1077
|
+
* served yet, like `callers`.
|
|
1078
|
+
*/
|
|
1079
|
+
permission?: string;
|
|
450
1080
|
}
|
|
451
1081
|
/** WorkflowStatus is the observed state of a Workflow. */
|
|
452
1082
|
export interface WorkflowStatus {
|
|
@@ -466,29 +1096,117 @@ export interface WorkflowTimeouts {
|
|
|
466
1096
|
}
|
|
467
1097
|
/** How one invocation attempt ended (workflows-on-temporal.md §7.3). */
|
|
468
1098
|
export type AttemptOutcome = 'invoked' | 'protocol_error' | 'rejected' | 'retryable' | 'unreached' | 'unknown' | 'unsigned' | (string & {});
|
|
1099
|
+
/** The lifecycle state of a DistributedRun. */
|
|
1100
|
+
export type DistributedRunState = 'queued' | 'running' | 'draining' | 'succeeded' | 'failed' | 'cancelled' | 'timed_out' | (string & {});
|
|
469
1101
|
/** What one Schedule fire did. */
|
|
470
1102
|
export type FireOutcome = 'started' | 'skipped' | 'buffered' | (string & {});
|
|
1103
|
+
/** What a Job start does while one of its runs is active. */
|
|
1104
|
+
export type JobConcurrency = 'forbid' | 'queue' | 'allow' | (string & {});
|
|
1105
|
+
/** The lifecycle state of a JobRun. */
|
|
1106
|
+
export type JobRunState = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'timed_out' | (string & {});
|
|
471
1107
|
/** What a Schedule fire does while a previous Run is still running. */
|
|
472
1108
|
export type OverlapPolicy = 'skip' | 'buffer_one' | 'buffer_all' | 'cancel_other' | 'allow' | (string & {});
|
|
473
1109
|
/** What a Run history event records. */
|
|
474
1110
|
export type RunHistoryEventKind = 'run_started' | 'invocation' | 'step_completed' | 'sleep_started' | 'signal_received' | 'child_started' | 'cancel_requested' | 'run_closed' | (string & {});
|
|
475
1111
|
/** The lifecycle state of a Run. */
|
|
476
1112
|
export type RunState = 'running' | 'succeeded' | 'failed' | 'cancelled' | 'timed_out' | (string & {});
|
|
1113
|
+
/** The state of a Shard. */
|
|
1114
|
+
export type ShardState = 'pending' | 'leased' | 'succeeded' | 'failed' | (string & {});
|
|
1115
|
+
/** Price and preemption class of distributed job workers (run-distributed-jobs.md §6). */
|
|
1116
|
+
export type WorkerClass = 'scavenger' | 'standard' | (string & {});
|
|
1117
|
+
/** The state of a Worker. */
|
|
1118
|
+
export type WorkerState = 'pending' | 'queued' | 'running' | 'ended' | (string & {});
|
|
1119
|
+
/** Who may call the Run methods of a Workflow. */
|
|
1120
|
+
export type WorkflowCaller = 'server' | 'users' | (string & {});
|
|
477
1121
|
/**
|
|
478
1122
|
* WorkflowsService is Sylphx Workflows: durable execution, schedules, timers,
|
|
479
|
-
* and runs
|
|
480
|
-
* Workflows is the one writer of these types.
|
|
1123
|
+
* and runs. Workflows is the one writer of these types.
|
|
481
1124
|
*
|
|
482
1125
|
* Namespace of Sylphx Workflows on `Sylphx`.
|
|
483
1126
|
*/
|
|
484
1127
|
export declare class WorkflowsApi {
|
|
1128
|
+
private readonly client;
|
|
485
1129
|
/** The `workflows` collection. */
|
|
486
1130
|
readonly workflows: WorkflowsCollection;
|
|
487
1131
|
/** The `schedules` collection. */
|
|
488
1132
|
readonly schedules: SchedulesCollection;
|
|
489
1133
|
/** The `runs` collection. */
|
|
490
1134
|
readonly runs: RunsCollection;
|
|
1135
|
+
/** The `jobs` collection. */
|
|
1136
|
+
readonly jobs: JobsCollection;
|
|
1137
|
+
/** The `job_runs` collection. */
|
|
1138
|
+
readonly jobRuns: JobRunsCollection;
|
|
1139
|
+
/** The `distributed_jobs` collection. */
|
|
1140
|
+
readonly distributedJobs: DistributedJobsCollection;
|
|
1141
|
+
/** The `distributed_runs` collection. */
|
|
1142
|
+
readonly distributedRuns: DistributedRunsCollection;
|
|
491
1143
|
constructor(client: runtime.Client);
|
|
1144
|
+
/**
|
|
1145
|
+
* Updates a schedule; with `allow_missing` it creates the schedule when it
|
|
1146
|
+
* does not exist, so its short name `schedule` is an upsert by name.
|
|
1147
|
+
*
|
|
1148
|
+
* `PATCH /v1/{schedule.name=orgs/*\/projects/*\/envs/*\/schedules/*}` · permission `workflows:write` · effect `write`
|
|
1149
|
+
*
|
|
1150
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1151
|
+
*
|
|
1152
|
+
* Short name of `sx.workflows.schedules.update`.
|
|
1153
|
+
*/
|
|
1154
|
+
schedule(request: UpdateScheduleRequest): Promise<runtime.Operation<Schedule>>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Starts a Run of a Workflow, now or after `start_delay` or at
|
|
1157
|
+
* `schedule_time`. `run_id` is the caller's key: the same key and intent
|
|
1158
|
+
* return the same Run, a changed intent is refused.
|
|
1159
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1160
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
1161
|
+
*
|
|
1162
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/workflows/*}/runs` · permission `workflows:run` · effect `write`
|
|
1163
|
+
*
|
|
1164
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1165
|
+
*
|
|
1166
|
+
* Short name of `sx.workflows.runs.create`.
|
|
1167
|
+
*/
|
|
1168
|
+
start(request: CreateRunRequest): Promise<Run>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Sends a named signal to a running Run; a `wait` op for that name resumes
|
|
1171
|
+
* with its payload. A signal to a closed Run fails with INVALID_STATE.
|
|
1172
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1173
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
1174
|
+
*
|
|
1175
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/workflows/*\/runs/*}:signal` · permission `workflows:run` · effect `write`
|
|
1176
|
+
*
|
|
1177
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1178
|
+
*
|
|
1179
|
+
* Short name of `sx.workflows.runs.signal`.
|
|
1180
|
+
*/
|
|
1181
|
+
signal(request: SignalRunRequest): Promise<Run>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Requests cancellation. Timers and waits stop; a running invocation is not
|
|
1184
|
+
* interrupted: the handler receives one final invocation with `cancel:
|
|
1185
|
+
* true`, and the Run ends `cancelled` when it answers.
|
|
1186
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1187
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
1188
|
+
*
|
|
1189
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/workflows/*\/runs/*}:cancel` · permission `workflows:run` · effect `destructive`
|
|
1190
|
+
*
|
|
1191
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1192
|
+
*
|
|
1193
|
+
* Short name of `sx.workflows.runs.cancel`.
|
|
1194
|
+
*/
|
|
1195
|
+
cancel(request: CancelRunRequest): Promise<Run>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Waits up to `timeout` (at most 60s) for the Run to close, then returns it,
|
|
1198
|
+
* closed or not. Its short name is `result`: the closed Run carries the
|
|
1199
|
+
* handler's output or error.
|
|
1200
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1201
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
1202
|
+
*
|
|
1203
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/workflows/*\/runs/*}:wait` · permission `workflows:read` · effect `read`
|
|
1204
|
+
*
|
|
1205
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1206
|
+
*
|
|
1207
|
+
* Short name of `sx.workflows.runs.wait`.
|
|
1208
|
+
*/
|
|
1209
|
+
result(request: WaitRunRequest): Promise<Run>;
|
|
492
1210
|
}
|
|
493
1211
|
/** `workflows` of Sylphx Workflows: Resource type `workflows.sylphx.com/Workflow`. */
|
|
494
1212
|
export declare class WorkflowsCollection {
|
|
@@ -568,11 +1286,14 @@ export declare class SchedulesCollection {
|
|
|
568
1286
|
*/
|
|
569
1287
|
create(request: CreateScheduleRequest): Promise<runtime.Operation<Schedule>>;
|
|
570
1288
|
/**
|
|
571
|
-
* Updates a schedule
|
|
1289
|
+
* Updates a schedule; with `allow_missing` it creates the schedule when it
|
|
1290
|
+
* does not exist, so its short name `schedule` is an upsert by name.
|
|
572
1291
|
*
|
|
573
1292
|
* `PATCH /v1/{schedule.name=orgs/*\/projects/*\/envs/*\/schedules/*}` · permission `workflows:write` · effect `write`
|
|
574
1293
|
*
|
|
575
1294
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1295
|
+
*
|
|
1296
|
+
* Also `sx.workflows.schedule`.
|
|
576
1297
|
*/
|
|
577
1298
|
update(request: UpdateScheduleRequest): Promise<runtime.Operation<Schedule>>;
|
|
578
1299
|
/**
|
|
@@ -623,11 +1344,17 @@ export declare class RunsCollection {
|
|
|
623
1344
|
/** Every item of every page of `list`. */
|
|
624
1345
|
listAll(request: ListRunsRequest): AsyncGenerator<Run>;
|
|
625
1346
|
/**
|
|
626
|
-
* Starts a Run of a Workflow
|
|
1347
|
+
* Starts a Run of a Workflow, now or after `start_delay` or at
|
|
1348
|
+
* `schedule_time`. `run_id` is the caller's key: the same key and intent
|
|
1349
|
+
* return the same Run, a changed intent is refused.
|
|
1350
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1351
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
627
1352
|
*
|
|
628
1353
|
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/workflows/*}/runs` · permission `workflows:run` · effect `write`
|
|
629
1354
|
*
|
|
630
1355
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1356
|
+
*
|
|
1357
|
+
* Also `sx.workflows.start`.
|
|
631
1358
|
*/
|
|
632
1359
|
create(request: CreateRunRequest): Promise<Run>;
|
|
633
1360
|
/**
|
|
@@ -642,29 +1369,42 @@ export declare class RunsCollection {
|
|
|
642
1369
|
/**
|
|
643
1370
|
* Sends a named signal to a running Run; a `wait` op for that name resumes
|
|
644
1371
|
* with its payload. A signal to a closed Run fails with INVALID_STATE.
|
|
1372
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1373
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
645
1374
|
*
|
|
646
1375
|
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/workflows/*\/runs/*}:signal` · permission `workflows:run` · effect `write`
|
|
647
1376
|
*
|
|
648
1377
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1378
|
+
*
|
|
1379
|
+
* Also `sx.workflows.signal`.
|
|
649
1380
|
*/
|
|
650
1381
|
signal(request: SignalRunRequest): Promise<Run>;
|
|
651
1382
|
/**
|
|
652
1383
|
* Requests cancellation. Timers and waits stop; a running invocation is not
|
|
653
1384
|
* interrupted: the handler receives one final invocation with `cancel:
|
|
654
1385
|
* true`, and the Run ends `cancelled` when it answers.
|
|
1386
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1387
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
655
1388
|
*
|
|
656
1389
|
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/workflows/*\/runs/*}:cancel` · permission `workflows:run` · effect `destructive`
|
|
657
1390
|
*
|
|
658
1391
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1392
|
+
*
|
|
1393
|
+
* Also `sx.workflows.cancel`.
|
|
659
1394
|
*/
|
|
660
1395
|
cancel(request: CancelRunRequest): Promise<Run>;
|
|
661
1396
|
/**
|
|
662
1397
|
* Waits up to `timeout` (at most 60s) for the Run to close, then returns it,
|
|
663
|
-
* closed or not.
|
|
1398
|
+
* closed or not. Its short name is `result`: the closed Run carries the
|
|
1399
|
+
* handler's output or error.
|
|
1400
|
+
* An end user's session may call it on a Workflow whose `callers` is
|
|
1401
|
+
* `USERS` when the session holds the Workflow's `permission`.
|
|
664
1402
|
*
|
|
665
1403
|
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/workflows/*\/runs/*}:wait` · permission `workflows:read` · effect `read`
|
|
666
1404
|
*
|
|
667
1405
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1406
|
+
*
|
|
1407
|
+
* Also `sx.workflows.result`.
|
|
668
1408
|
*/
|
|
669
1409
|
wait(request: WaitRunRequest): Promise<Run>;
|
|
670
1410
|
/**
|
|
@@ -676,3 +1416,217 @@ export declare class RunsCollection {
|
|
|
676
1416
|
*/
|
|
677
1417
|
readHistory(request: ReadRunHistoryRequest): Promise<ReadRunHistoryResponse>;
|
|
678
1418
|
}
|
|
1419
|
+
/** `jobs` of Sylphx Workflows: Resource type `workflows.sylphx.com/Job`. */
|
|
1420
|
+
export declare class JobsCollection {
|
|
1421
|
+
private readonly client;
|
|
1422
|
+
constructor(client: runtime.Client);
|
|
1423
|
+
/**
|
|
1424
|
+
* Gets a job.
|
|
1425
|
+
*
|
|
1426
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*}` · permission `workflows:read` · effect `read`
|
|
1427
|
+
*
|
|
1428
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1429
|
+
*/
|
|
1430
|
+
get(request: GetJobRequest): Promise<Job>;
|
|
1431
|
+
/**
|
|
1432
|
+
* Lists jobs.
|
|
1433
|
+
*
|
|
1434
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/jobs` · permission `workflows:read` · effect `read`
|
|
1435
|
+
*
|
|
1436
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1437
|
+
*/
|
|
1438
|
+
list(request: ListJobsRequest): Promise<ListJobsResponse>;
|
|
1439
|
+
/** Every item of every page of `list`. */
|
|
1440
|
+
listAll(request: ListJobsRequest): AsyncGenerator<Job>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Creates a job.
|
|
1443
|
+
*
|
|
1444
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/jobs` · permission `workflows:write` · effect `write`
|
|
1445
|
+
*
|
|
1446
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1447
|
+
*/
|
|
1448
|
+
create(request: CreateJobRequest): Promise<runtime.Operation<Job>>;
|
|
1449
|
+
/**
|
|
1450
|
+
* Updates a job. Runs already started keep the generation they pinned.
|
|
1451
|
+
*
|
|
1452
|
+
* `PATCH /v1/{job.name=orgs/*\/projects/*\/envs/*\/jobs/*}` · permission `workflows:write` · effect `write`
|
|
1453
|
+
*
|
|
1454
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1455
|
+
*/
|
|
1456
|
+
update(request: UpdateJobRequest): Promise<runtime.Operation<Job>>;
|
|
1457
|
+
/**
|
|
1458
|
+
* Deletes a job.
|
|
1459
|
+
*
|
|
1460
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*}` · permission `workflows:write` · effect `destructive`
|
|
1461
|
+
*
|
|
1462
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1463
|
+
*/
|
|
1464
|
+
delete(request: DeleteJobRequest): Promise<runtime.Operation<Record<string, never>>>;
|
|
1465
|
+
}
|
|
1466
|
+
/** `job_runs` of Sylphx Workflows: Resource type `workflows.sylphx.com/JobRun`. */
|
|
1467
|
+
export declare class JobRunsCollection {
|
|
1468
|
+
private readonly client;
|
|
1469
|
+
constructor(client: runtime.Client);
|
|
1470
|
+
/**
|
|
1471
|
+
* Starts a run of a Job now. The same `Idempotency-Key` returns the same
|
|
1472
|
+
* run for 24h; a Schedule fire uses `{job}:{intended time}`. With
|
|
1473
|
+
* concurrency `forbid`, a start while a run is active fails with
|
|
1474
|
+
* INVALID_STATE.
|
|
1475
|
+
*
|
|
1476
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/jobs/*}/job_runs` · permission `workflows:run` · effect `write`
|
|
1477
|
+
*
|
|
1478
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1479
|
+
*/
|
|
1480
|
+
create(request: CreateJobRunRequest): Promise<JobRun>;
|
|
1481
|
+
/**
|
|
1482
|
+
* Gets a job run.
|
|
1483
|
+
*
|
|
1484
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*\/job_runs/*}` · permission `workflows:read` · effect `read`
|
|
1485
|
+
*
|
|
1486
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1487
|
+
*/
|
|
1488
|
+
get(request: GetJobRunRequest): Promise<JobRun>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Lists a job's runs, newest first.
|
|
1491
|
+
*
|
|
1492
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/jobs/*}/job_runs` · permission `workflows:read` · effect `read`
|
|
1493
|
+
*
|
|
1494
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1495
|
+
*/
|
|
1496
|
+
list(request: ListJobRunsRequest): Promise<ListJobRunsResponse>;
|
|
1497
|
+
/** Every item of every page of `list`. */
|
|
1498
|
+
listAll(request: ListJobRunsRequest): AsyncGenerator<JobRun>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Cancels a job run: SIGTERM, then SIGKILL after 30s. A closed run fails
|
|
1501
|
+
* with INVALID_STATE.
|
|
1502
|
+
*
|
|
1503
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*\/job_runs/*}:cancel` · permission `workflows:run` · effect `destructive`
|
|
1504
|
+
*
|
|
1505
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1506
|
+
*/
|
|
1507
|
+
cancel(request: CancelJobRunRequest): Promise<JobRun>;
|
|
1508
|
+
/**
|
|
1509
|
+
* Reads a page of a job run's log lines, oldest first. With `wait`, an
|
|
1510
|
+
* empty page on a running run waits up to that long for new lines, so a
|
|
1511
|
+
* client follows the log by passing each `next_page_token` back.
|
|
1512
|
+
*
|
|
1513
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*\/job_runs/*}:readLogs` · permission `workflows:read` · effect `read`
|
|
1514
|
+
*
|
|
1515
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `PAGE_TOKEN_MISMATCH`.
|
|
1516
|
+
*/
|
|
1517
|
+
readLogs(request: ReadJobRunLogsRequest): Promise<ReadJobRunLogsResponse>;
|
|
1518
|
+
}
|
|
1519
|
+
/** `distributed_jobs` of Sylphx Workflows: Resource type `workflows.sylphx.com/DistributedJob`. */
|
|
1520
|
+
export declare class DistributedJobsCollection {
|
|
1521
|
+
private readonly client;
|
|
1522
|
+
constructor(client: runtime.Client);
|
|
1523
|
+
/**
|
|
1524
|
+
* Gets a distributed job.
|
|
1525
|
+
*
|
|
1526
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}` · permission `workflows:read` · effect `read`
|
|
1527
|
+
*
|
|
1528
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1529
|
+
*/
|
|
1530
|
+
get(request: GetDistributedJobRequest): Promise<DistributedJob>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Lists distributed jobs.
|
|
1533
|
+
*
|
|
1534
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/distributed_jobs` · permission `workflows:read` · effect `read`
|
|
1535
|
+
*
|
|
1536
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1537
|
+
*/
|
|
1538
|
+
list(request: ListDistributedJobsRequest): Promise<ListDistributedJobsResponse>;
|
|
1539
|
+
/** Every item of every page of `list`. */
|
|
1540
|
+
listAll(request: ListDistributedJobsRequest): AsyncGenerator<DistributedJob>;
|
|
1541
|
+
/**
|
|
1542
|
+
* Creates a distributed job.
|
|
1543
|
+
*
|
|
1544
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/distributed_jobs` · permission `workflows:write` · effect `write`
|
|
1545
|
+
*
|
|
1546
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1547
|
+
*/
|
|
1548
|
+
create(request: CreateDistributedJobRequest): Promise<runtime.Operation<DistributedJob>>;
|
|
1549
|
+
/**
|
|
1550
|
+
* Updates a distributed job. Runs already started keep the generation they
|
|
1551
|
+
* pinned.
|
|
1552
|
+
*
|
|
1553
|
+
* `PATCH /v1/{distributed_job.name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}` · permission `workflows:write` · effect `write`
|
|
1554
|
+
*
|
|
1555
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1556
|
+
*/
|
|
1557
|
+
update(request: UpdateDistributedJobRequest): Promise<runtime.Operation<DistributedJob>>;
|
|
1558
|
+
/**
|
|
1559
|
+
* Deletes a distributed job.
|
|
1560
|
+
*
|
|
1561
|
+
* `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}` · permission `workflows:write` · effect `destructive`
|
|
1562
|
+
*
|
|
1563
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1564
|
+
*/
|
|
1565
|
+
delete(request: DeleteDistributedJobRequest): Promise<runtime.Operation<Record<string, never>>>;
|
|
1566
|
+
}
|
|
1567
|
+
/** `distributed_runs` of Sylphx Workflows: Resource type `workflows.sylphx.com/DistributedRun`. */
|
|
1568
|
+
export declare class DistributedRunsCollection {
|
|
1569
|
+
private readonly client;
|
|
1570
|
+
constructor(client: runtime.Client);
|
|
1571
|
+
/**
|
|
1572
|
+
* Starts a run of a distributed job. The same `Idempotency-Key` returns the
|
|
1573
|
+
* same run for 24h.
|
|
1574
|
+
*
|
|
1575
|
+
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}/distributed_runs` · permission `workflows:run` · effect `write`
|
|
1576
|
+
*
|
|
1577
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
|
|
1578
|
+
*/
|
|
1579
|
+
create(request: CreateDistributedRunRequest): Promise<DistributedRun>;
|
|
1580
|
+
/**
|
|
1581
|
+
* Gets a distributed run: its state, shard and worker counts, and usage.
|
|
1582
|
+
*
|
|
1583
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}` · permission `workflows:read` · effect `read`
|
|
1584
|
+
*
|
|
1585
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
|
|
1586
|
+
*/
|
|
1587
|
+
get(request: GetDistributedRunRequest): Promise<DistributedRun>;
|
|
1588
|
+
/**
|
|
1589
|
+
* Lists a distributed job's runs, newest first.
|
|
1590
|
+
*
|
|
1591
|
+
* `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}/distributed_runs` · permission `workflows:read` · effect `read`
|
|
1592
|
+
*
|
|
1593
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
|
|
1594
|
+
*/
|
|
1595
|
+
list(request: ListDistributedRunsRequest): Promise<ListDistributedRunsResponse>;
|
|
1596
|
+
/** Every item of every page of `list`. */
|
|
1597
|
+
listAll(request: ListDistributedRunsRequest): AsyncGenerator<DistributedRun>;
|
|
1598
|
+
/**
|
|
1599
|
+
* Cancels a distributed run: workers get SIGTERM and 30s, then leases are
|
|
1600
|
+
* released; finished shards are kept. A closed run fails with INVALID_STATE.
|
|
1601
|
+
*
|
|
1602
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:cancel` · permission `workflows:run` · effect `destructive`
|
|
1603
|
+
*
|
|
1604
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1605
|
+
*/
|
|
1606
|
+
cancel(request: CancelDistributedRunRequest): Promise<DistributedRun>;
|
|
1607
|
+
/**
|
|
1608
|
+
* Appends shards to a run started with an open manifest; `close` ends the
|
|
1609
|
+
* manifest, and the run ends once those shards are done.
|
|
1610
|
+
*
|
|
1611
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:addShards` · permission `workflows:run` · effect `write`
|
|
1612
|
+
*
|
|
1613
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1614
|
+
*/
|
|
1615
|
+
addShards(request: AddDistributedRunShardsRequest): Promise<DistributedRun>;
|
|
1616
|
+
/**
|
|
1617
|
+
* Reads a page of the run's shards, in queue order.
|
|
1618
|
+
*
|
|
1619
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:readShards` · permission `workflows:read` · effect `read`
|
|
1620
|
+
*
|
|
1621
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`, `RESOURCE_NOT_FOUND`.
|
|
1622
|
+
*/
|
|
1623
|
+
readShards(request: ReadDistributedRunShardsRequest): Promise<ReadDistributedRunShardsResponse>;
|
|
1624
|
+
/**
|
|
1625
|
+
* Reads a page of the run's workers.
|
|
1626
|
+
*
|
|
1627
|
+
* `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:readWorkers` · permission `workflows:read` · effect `read`
|
|
1628
|
+
*
|
|
1629
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`, `RESOURCE_NOT_FOUND`.
|
|
1630
|
+
*/
|
|
1631
|
+
readWorkers(request: ReadDistributedRunWorkersRequest): Promise<ReadDistributedRunWorkersResponse>;
|
|
1632
|
+
}
|