@scaleway/sdk-jobs 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +3 -6
- package/dist/v1alpha1/api.gen.js +193 -273
- package/dist/v1alpha1/content.gen.js +5 -6
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/index.gen.js +24 -22
- package/dist/v1alpha1/marshalling.gen.js +137 -226
- package/dist/v1alpha1/validation-rules.gen.js +63 -101
- package/dist/v1alpha2/api.gen.js +194 -269
- package/dist/v1alpha2/content.gen.js +8 -8
- package/dist/v1alpha2/index.gen.d.ts +2 -2
- package/dist/v1alpha2/index.gen.js +24 -22
- package/dist/v1alpha2/marshalling.gen.js +159 -237
- package/dist/v1alpha2/types.gen.d.ts +21 -2
- package/dist/v1alpha2/validation-rules.gen.d.ts +5 -0
- package/dist/v1alpha2/validation-rules.gen.js +65 -101
- package/package.json +4 -4
|
@@ -1,275 +1,197 @@
|
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
1
2
|
import randomName from "@scaleway/random-name";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
throw new TypeError(
|
|
6
|
-
`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
name: data.name
|
|
11
|
-
};
|
|
3
|
+
var unmarshalSecretEnvVar = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`);
|
|
5
|
+
return { name: data.name };
|
|
12
6
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
path: data.path
|
|
21
|
-
};
|
|
7
|
+
var unmarshalSecretFile = (data) => {
|
|
8
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`);
|
|
9
|
+
return { path: data.path };
|
|
22
10
|
};
|
|
23
11
|
const unmarshalSecret = (data) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
secretId: data.secret_id,
|
|
34
|
-
secretManagerId: data.secret_manager_id,
|
|
35
|
-
secretManagerVersion: data.secret_manager_version
|
|
36
|
-
};
|
|
12
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
|
|
13
|
+
return {
|
|
14
|
+
envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
|
|
15
|
+
file: data.file ? unmarshalSecretFile(data.file) : void 0,
|
|
16
|
+
jobDefinitionId: data.job_definition_id,
|
|
17
|
+
secretId: data.secret_id,
|
|
18
|
+
secretManagerId: data.secret_manager_id,
|
|
19
|
+
secretManagerVersion: data.secret_manager_version
|
|
20
|
+
};
|
|
37
21
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
var unmarshalCronSchedule = (data) => {
|
|
23
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.`);
|
|
24
|
+
return {
|
|
25
|
+
schedule: data.schedule,
|
|
26
|
+
timezone: data.timezone
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
var unmarshalRetryPolicy = (data) => {
|
|
30
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RetryPolicy' failed as data isn't a dictionary.`);
|
|
31
|
+
return { maxRetries: data.max_retries };
|
|
48
32
|
};
|
|
49
33
|
const unmarshalJobDefinition = (data) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
startupCommand: data.startup_command,
|
|
72
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
73
|
-
};
|
|
34
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`);
|
|
35
|
+
return {
|
|
36
|
+
args: data.args,
|
|
37
|
+
command: data.command,
|
|
38
|
+
cpuLimit: data.cpu_limit,
|
|
39
|
+
createdAt: unmarshalDate(data.created_at),
|
|
40
|
+
cronSchedule: data.cron_schedule ? unmarshalCronSchedule(data.cron_schedule) : void 0,
|
|
41
|
+
description: data.description,
|
|
42
|
+
environmentVariables: data.environment_variables,
|
|
43
|
+
id: data.id,
|
|
44
|
+
imageUri: data.image_uri,
|
|
45
|
+
jobTimeout: data.job_timeout,
|
|
46
|
+
localStorageCapacity: data.local_storage_capacity,
|
|
47
|
+
memoryLimit: data.memory_limit,
|
|
48
|
+
name: data.name,
|
|
49
|
+
projectId: data.project_id,
|
|
50
|
+
region: data.region,
|
|
51
|
+
retryPolicy: data.retry_policy ? unmarshalRetryPolicy(data.retry_policy) : void 0,
|
|
52
|
+
startupCommand: data.startup_command,
|
|
53
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
54
|
+
};
|
|
74
55
|
};
|
|
75
56
|
const unmarshalJobRun = (data) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
terminatedAt: unmarshalDate(data.terminated_at),
|
|
100
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
101
|
-
};
|
|
57
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`);
|
|
58
|
+
return {
|
|
59
|
+
args: data.args,
|
|
60
|
+
attempts: data.attempts,
|
|
61
|
+
command: data.command,
|
|
62
|
+
cpuLimit: data.cpu_limit,
|
|
63
|
+
createdAt: unmarshalDate(data.created_at),
|
|
64
|
+
environmentVariables: data.environment_variables,
|
|
65
|
+
errorMessage: data.error_message,
|
|
66
|
+
exitCode: data.exit_code,
|
|
67
|
+
id: data.id,
|
|
68
|
+
jobDefinitionId: data.job_definition_id,
|
|
69
|
+
localStorageCapacity: data.local_storage_capacity,
|
|
70
|
+
memoryLimit: data.memory_limit,
|
|
71
|
+
reason: data.reason ? data.reason : void 0,
|
|
72
|
+
region: data.region,
|
|
73
|
+
runDuration: data.run_duration,
|
|
74
|
+
startedAt: unmarshalDate(data.started_at),
|
|
75
|
+
startupCommand: data.startup_command,
|
|
76
|
+
state: data.state,
|
|
77
|
+
terminatedAt: unmarshalDate(data.terminated_at),
|
|
78
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
79
|
+
};
|
|
102
80
|
};
|
|
103
81
|
const unmarshalCreateSecretsResponse = (data) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
`Unmarshalling the type 'CreateSecretsResponse' failed as data isn't a dictionary.`
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret)
|
|
111
|
-
};
|
|
82
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateSecretsResponse' failed as data isn't a dictionary.`);
|
|
83
|
+
return { secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret) };
|
|
112
84
|
};
|
|
113
85
|
const unmarshalJobLimits = (data) => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
`Unmarshalling the type 'JobLimits' failed as data isn't a dictionary.`
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
secretsPerJobDefinition: data.secrets_per_job_definition
|
|
121
|
-
};
|
|
86
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobLimits' failed as data isn't a dictionary.`);
|
|
87
|
+
return { secretsPerJobDefinition: data.secrets_per_job_definition };
|
|
122
88
|
};
|
|
123
89
|
const unmarshalListJobDefinitionsResponse = (data) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
jobDefinitions: unmarshalArrayOfObject(
|
|
131
|
-
data.job_definitions,
|
|
132
|
-
unmarshalJobDefinition
|
|
133
|
-
),
|
|
134
|
-
totalCount: data.total_count
|
|
135
|
-
};
|
|
90
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`);
|
|
91
|
+
return {
|
|
92
|
+
jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition),
|
|
93
|
+
totalCount: data.total_count
|
|
94
|
+
};
|
|
136
95
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
computeLimitMvcpu: data.compute_limit_mvcpu,
|
|
145
|
-
memoryLimitBytes: data.memory_limit_bytes
|
|
146
|
-
};
|
|
96
|
+
var unmarshalResource = (data) => {
|
|
97
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`);
|
|
98
|
+
return {
|
|
99
|
+
computeLimitMvcpu: data.compute_limit_mvcpu,
|
|
100
|
+
memoryLimitBytes: data.memory_limit_bytes
|
|
101
|
+
};
|
|
147
102
|
};
|
|
148
103
|
const unmarshalListJobResourcesResponse = (data) => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
`Unmarshalling the type 'ListJobResourcesResponse' failed as data isn't a dictionary.`
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
return {
|
|
155
|
-
resources: unmarshalArrayOfObject(data.resources, unmarshalResource)
|
|
156
|
-
};
|
|
104
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobResourcesResponse' failed as data isn't a dictionary.`);
|
|
105
|
+
return { resources: unmarshalArrayOfObject(data.resources, unmarshalResource) };
|
|
157
106
|
};
|
|
158
107
|
const unmarshalListJobRunsResponse = (data) => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return {
|
|
165
|
-
jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
|
|
166
|
-
totalCount: data.total_count
|
|
167
|
-
};
|
|
108
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`);
|
|
109
|
+
return {
|
|
110
|
+
jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
|
|
111
|
+
totalCount: data.total_count
|
|
112
|
+
};
|
|
168
113
|
};
|
|
169
114
|
const unmarshalListSecretsResponse = (data) => {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return {
|
|
176
|
-
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
177
|
-
totalCount: data.total_count
|
|
178
|
-
};
|
|
115
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
|
|
116
|
+
return {
|
|
117
|
+
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
118
|
+
totalCount: data.total_count
|
|
119
|
+
};
|
|
179
120
|
};
|
|
180
121
|
const unmarshalStartJobDefinitionResponse = (data) => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
return {
|
|
187
|
-
jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun)
|
|
188
|
-
};
|
|
122
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`);
|
|
123
|
+
return { jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun) };
|
|
189
124
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
125
|
+
var marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
126
|
+
schedule: request.schedule,
|
|
127
|
+
timezone: request.timezone
|
|
193
128
|
});
|
|
129
|
+
var marshalRetryPolicy = (request, defaults) => ({ max_retries: request.maxRetries });
|
|
194
130
|
const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
startup_command: request.startupCommand
|
|
131
|
+
args: request.args,
|
|
132
|
+
command: request.command,
|
|
133
|
+
cpu_limit: request.cpuLimit,
|
|
134
|
+
cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults) : void 0,
|
|
135
|
+
description: request.description,
|
|
136
|
+
environment_variables: request.environmentVariables !== void 0 ? request.environmentVariables : void 0,
|
|
137
|
+
image_uri: request.imageUri,
|
|
138
|
+
job_timeout: request.jobTimeout,
|
|
139
|
+
local_storage_capacity: request.localStorageCapacity,
|
|
140
|
+
memory_limit: request.memoryLimit,
|
|
141
|
+
name: request.name || randomName("job"),
|
|
142
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
143
|
+
retry_policy: request.retryPolicy !== void 0 ? marshalRetryPolicy(request.retryPolicy, defaults) : void 0,
|
|
144
|
+
startup_command: request.startupCommand
|
|
210
145
|
});
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
146
|
+
var marshalCreateSecretsRequestSecretConfig = (request, defaults) => ({
|
|
147
|
+
secret_manager_id: request.secretManagerId,
|
|
148
|
+
secret_manager_version: request.secretManagerVersion,
|
|
149
|
+
...resolveOneOf([{
|
|
150
|
+
param: "path",
|
|
151
|
+
value: request.path
|
|
152
|
+
}, {
|
|
153
|
+
param: "env_var_name",
|
|
154
|
+
value: request.envVarName
|
|
155
|
+
}])
|
|
218
156
|
});
|
|
219
157
|
const marshalCreateSecretsRequest = (request, defaults) => ({
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
(elt) => marshalCreateSecretsRequestSecretConfig(elt)
|
|
223
|
-
)
|
|
158
|
+
job_definition_id: request.jobDefinitionId,
|
|
159
|
+
secrets: request.secrets.map((elt) => marshalCreateSecretsRequestSecretConfig(elt, defaults))
|
|
224
160
|
});
|
|
225
161
|
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
162
|
+
args: request.args,
|
|
163
|
+
command: request.command,
|
|
164
|
+
environment_variables: request.environmentVariables,
|
|
165
|
+
replicas: request.replicas,
|
|
166
|
+
startup_command: request.startupCommand
|
|
231
167
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
168
|
+
var marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
169
|
+
schedule: request.schedule,
|
|
170
|
+
timezone: request.timezone
|
|
235
171
|
});
|
|
236
172
|
const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
startup_command: request.startupCommand
|
|
173
|
+
args: request.args,
|
|
174
|
+
command: request.command,
|
|
175
|
+
cpu_limit: request.cpuLimit,
|
|
176
|
+
cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults) : void 0,
|
|
177
|
+
description: request.description,
|
|
178
|
+
environment_variables: request.environmentVariables,
|
|
179
|
+
image_uri: request.imageUri,
|
|
180
|
+
job_timeout: request.jobTimeout,
|
|
181
|
+
local_storage_capacity: request.localStorageCapacity,
|
|
182
|
+
memory_limit: request.memoryLimit,
|
|
183
|
+
name: request.name,
|
|
184
|
+
retry_policy: request.retryPolicy !== void 0 ? marshalRetryPolicy(request.retryPolicy, defaults) : void 0,
|
|
185
|
+
startup_command: request.startupCommand
|
|
251
186
|
});
|
|
252
187
|
const marshalUpdateSecretRequest = (request, defaults) => ({
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
188
|
+
secret_manager_version: request.secretManagerVersion,
|
|
189
|
+
...resolveOneOf([{
|
|
190
|
+
param: "path",
|
|
191
|
+
value: request.path
|
|
192
|
+
}, {
|
|
193
|
+
param: "env_var_name",
|
|
194
|
+
value: request.envVarName
|
|
195
|
+
}])
|
|
258
196
|
});
|
|
259
|
-
export {
|
|
260
|
-
marshalCreateJobDefinitionRequest,
|
|
261
|
-
marshalCreateSecretsRequest,
|
|
262
|
-
marshalStartJobDefinitionRequest,
|
|
263
|
-
marshalUpdateJobDefinitionRequest,
|
|
264
|
-
marshalUpdateSecretRequest,
|
|
265
|
-
unmarshalCreateSecretsResponse,
|
|
266
|
-
unmarshalJobDefinition,
|
|
267
|
-
unmarshalJobLimits,
|
|
268
|
-
unmarshalJobRun,
|
|
269
|
-
unmarshalListJobDefinitionsResponse,
|
|
270
|
-
unmarshalListJobResourcesResponse,
|
|
271
|
-
unmarshalListJobRunsResponse,
|
|
272
|
-
unmarshalListSecretsResponse,
|
|
273
|
-
unmarshalSecret,
|
|
274
|
-
unmarshalStartJobDefinitionResponse
|
|
275
|
-
};
|
|
197
|
+
export { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Region as ScwRegion } from '@scaleway/sdk-client';
|
|
2
|
-
export type JobRunReason = 'unknown_reason' | 'invalid_request' | 'timeout' | 'cancellation' | 'technical_error' | 'image_not_found' | 'invalid_image' | 'memory_usage_exceeded' | 'storage_usage_exceeded' | 'exited_with_error' | 'secret_disabled' | 'secret_not_found';
|
|
3
|
-
export type JobRunState = 'unknown_state' | 'initialized' | 'validated' | 'queued' | 'running' | 'succeeded' | 'failed' | 'interrupting' | 'interrupted';
|
|
2
|
+
export type JobRunReason = 'unknown_reason' | 'invalid_request' | 'timeout' | 'cancellation' | 'technical_error' | 'image_not_found' | 'invalid_image' | 'memory_usage_exceeded' | 'storage_usage_exceeded' | 'exited_with_error' | 'secret_disabled' | 'secret_not_found' | 'quota_exceeded';
|
|
3
|
+
export type JobRunState = 'unknown_state' | 'initialized' | 'validated' | 'queued' | 'running' | 'succeeded' | 'failed' | 'interrupting' | 'interrupted' | 'retrying';
|
|
4
4
|
export type ListJobDefinitionsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
5
5
|
export type ListJobRunsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
6
6
|
export interface SecretEnvVar {
|
|
@@ -19,6 +19,12 @@ export interface CronSchedule {
|
|
|
19
19
|
*/
|
|
20
20
|
timezone: string;
|
|
21
21
|
}
|
|
22
|
+
export interface RetryPolicy {
|
|
23
|
+
/**
|
|
24
|
+
* Maximum number of retries upon a job failure.
|
|
25
|
+
*/
|
|
26
|
+
maxRetries: number;
|
|
27
|
+
}
|
|
22
28
|
export interface CreateJobDefinitionRequestCronScheduleConfig {
|
|
23
29
|
schedule: string;
|
|
24
30
|
timezone: string;
|
|
@@ -87,6 +93,7 @@ export interface JobDefinition {
|
|
|
87
93
|
cronSchedule?: CronSchedule;
|
|
88
94
|
startupCommand: string[];
|
|
89
95
|
args: string[];
|
|
96
|
+
retryPolicy?: RetryPolicy;
|
|
90
97
|
/**
|
|
91
98
|
* Region to target. If none is passed will use default region from the config.
|
|
92
99
|
*/
|
|
@@ -118,6 +125,7 @@ export interface JobRun {
|
|
|
118
125
|
environmentVariables: Record<string, string>;
|
|
119
126
|
startupCommand: string[];
|
|
120
127
|
args: string[];
|
|
128
|
+
attempts?: number;
|
|
121
129
|
/**
|
|
122
130
|
* Region to target. If none is passed will use default region from the config.
|
|
123
131
|
*/
|
|
@@ -186,6 +194,10 @@ export type CreateJobDefinitionRequest = {
|
|
|
186
194
|
* Configure a cron for the job.
|
|
187
195
|
*/
|
|
188
196
|
cronSchedule?: CreateJobDefinitionRequestCronScheduleConfig;
|
|
197
|
+
/**
|
|
198
|
+
* Retry behaviour in case of job failure.
|
|
199
|
+
*/
|
|
200
|
+
retryPolicy?: RetryPolicy;
|
|
189
201
|
};
|
|
190
202
|
export type CreateSecretsRequest = {
|
|
191
203
|
/**
|
|
@@ -435,7 +447,14 @@ export type UpdateJobDefinitionRequest = {
|
|
|
435
447
|
* Timeout of the job in seconds.
|
|
436
448
|
*/
|
|
437
449
|
jobTimeout?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Configure a cron for the job.
|
|
452
|
+
*/
|
|
438
453
|
cronSchedule?: UpdateJobDefinitionRequestCronScheduleConfig;
|
|
454
|
+
/**
|
|
455
|
+
* Retry behaviour in case of job failure.
|
|
456
|
+
*/
|
|
457
|
+
retryPolicy?: RetryPolicy;
|
|
439
458
|
};
|
|
440
459
|
export type UpdateSecretRequest = {
|
|
441
460
|
/**
|
|
@@ -61,6 +61,11 @@ export declare const ListJobRunsRequest: {
|
|
|
61
61
|
lessThanOrEqual: number;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
+
export declare const RetryPolicy: {
|
|
65
|
+
maxRetries: {
|
|
66
|
+
lessThanOrEqual: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
64
69
|
export declare const StartJobDefinitionRequest: {
|
|
65
70
|
replicas: {
|
|
66
71
|
greaterThan: number;
|