@scaleway/sdk-jobs 2.6.0 → 2.7.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/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +6 -6
- package/dist/metadata.gen.js +6 -2
- package/dist/v1alpha1/api.gen.js +91 -184
- package/dist/v1alpha1/content.gen.js +1 -1
- package/dist/v1alpha1/marshalling.gen.js +22 -22
- package/dist/v1alpha1/metadata.gen.js +1 -1
- package/dist/v1alpha1/validation-rules.gen.js +10 -10
- package/dist/v1alpha2/api.gen.js +118 -240
- package/dist/v1alpha2/content.gen.js +1 -1
- package/dist/v1alpha2/marshalling.gen.js +31 -31
- package/dist/v1alpha2/metadata.gen.js +1 -1
- package/dist/v1alpha2/validation-rules.gen.js +16 -16
- package/package.json +8 -6
- package/LICENSE +0 -191
- package/dist/metadata.gen.json +0 -6
- package/dist/metadata2.gen.js +0 -8
package/dist/metadata.gen.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* This file is automatically generated
|
|
3
3
|
* PLEASE DO NOT EDIT HERE
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
name:
|
|
7
|
-
namespace:
|
|
8
|
-
displayName:
|
|
9
|
-
versions:
|
|
5
|
+
export declare const pkgMetadata: {
|
|
6
|
+
readonly name: "@scaleway/sdk-jobs";
|
|
7
|
+
readonly namespace: "jobs";
|
|
8
|
+
readonly displayName: "Jobs";
|
|
9
|
+
readonly versions: readonly ["v1alpha1", "v1alpha2"];
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type Metadata = typeof pkgMetadata;
|
|
12
12
|
export default pkgMetadata;
|
package/dist/metadata.gen.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import metadata_gen_default from "./metadata2.gen.js";
|
|
2
1
|
//#region src/metadata.gen.ts
|
|
3
2
|
/**
|
|
4
3
|
* This file is automatically generated
|
|
5
4
|
* PLEASE DO NOT EDIT HERE
|
|
6
5
|
*/
|
|
7
|
-
|
|
6
|
+
const pkgMetadata = {
|
|
7
|
+
name: "@scaleway/sdk-jobs",
|
|
8
|
+
namespace: "jobs",
|
|
9
|
+
displayName: "Jobs",
|
|
10
|
+
versions: ["v1alpha1", "v1alpha2"]
|
|
11
|
+
};
|
|
8
12
|
//#endregion
|
|
9
13
|
export { pkgMetadata as default, pkgMetadata };
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,196 +1,103 @@
|
|
|
1
1
|
import { marshalCreateJobDefinitionRequest, marshalCreateJobDefinitionSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateJobDefinitionSecretRequest, unmarshalCreateJobDefinitionSecretsResponse, unmarshalJobDefinition, unmarshalJobRun, unmarshalJobsLimits, unmarshalListJobDefinitionSecretsResponse, unmarshalListJobDefinitionsResponse, unmarshalListJobRunsResponse, unmarshalListJobsResourcesResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse } from "./marshalling.gen.js";
|
|
2
2
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
3
|
//#region src/v1alpha1/api.gen.ts
|
|
4
|
-
|
|
4
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
5
|
/**
|
|
6
6
|
* Serverless Jobs API.
|
|
7
7
|
|
|
8
8
|
This API allows you to manage your Serverless Jobs.
|
|
9
9
|
*/
|
|
10
10
|
var API = class extends API$1 {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
*
|
|
102
|
-
* @param request - The request {@link GetJobDefinitionSecretRequest}
|
|
103
|
-
* @returns A Promise of Secret
|
|
104
|
-
*/
|
|
105
|
-
getJobDefinitionSecret = (request) => this.client.fetch({
|
|
106
|
-
method: "GET",
|
|
107
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
108
|
-
}, unmarshalSecret);
|
|
109
|
-
/**
|
|
110
|
-
* List secrets references within a job definition.
|
|
111
|
-
*
|
|
112
|
-
* @param request - The request {@link ListJobDefinitionSecretsRequest}
|
|
113
|
-
* @returns A Promise of ListJobDefinitionSecretsResponse
|
|
114
|
-
*/
|
|
115
|
-
listJobDefinitionSecrets = (request) => this.client.fetch({
|
|
116
|
-
method: "GET",
|
|
117
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
118
|
-
}, unmarshalListJobDefinitionSecretsResponse);
|
|
119
|
-
/**
|
|
120
|
-
* Update a secret reference within a job definition.
|
|
121
|
-
*
|
|
122
|
-
* @param request - The request {@link UpdateJobDefinitionSecretRequest}
|
|
123
|
-
* @returns A Promise of Secret
|
|
124
|
-
*/
|
|
125
|
-
updateJobDefinitionSecret = (request) => this.client.fetch({
|
|
126
|
-
body: JSON.stringify(marshalUpdateJobDefinitionSecretRequest(request, this.client.settings)),
|
|
127
|
-
headers: jsonContentHeaders,
|
|
128
|
-
method: "PATCH",
|
|
129
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
130
|
-
}, unmarshalSecret);
|
|
131
|
-
/**
|
|
132
|
-
* Delete a secret reference within a job definition.
|
|
133
|
-
*
|
|
134
|
-
* @param request - The request {@link DeleteJobDefinitionSecretRequest}
|
|
135
|
-
*/
|
|
136
|
-
deleteJobDefinitionSecret = (request) => this.client.fetch({
|
|
137
|
-
method: "DELETE",
|
|
138
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
139
|
-
});
|
|
140
|
-
/**
|
|
141
|
-
* Get a job run by its unique identifier.
|
|
142
|
-
*
|
|
143
|
-
* @param request - The request {@link GetJobRunRequest}
|
|
144
|
-
* @returns A Promise of JobRun
|
|
145
|
-
*/
|
|
146
|
-
getJobRun = (request) => this.client.fetch({
|
|
147
|
-
method: "GET",
|
|
148
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam("jobRunId", request.jobRunId)}`
|
|
149
|
-
}, unmarshalJobRun);
|
|
150
|
-
/**
|
|
151
|
-
* Stop a job run by its unique identifier.
|
|
152
|
-
*
|
|
153
|
-
* @param request - The request {@link StopJobRunRequest}
|
|
154
|
-
* @returns A Promise of JobRun
|
|
155
|
-
*/
|
|
156
|
-
stopJobRun = (request) => this.client.fetch({
|
|
157
|
-
body: "{}",
|
|
158
|
-
headers: jsonContentHeaders,
|
|
159
|
-
method: "POST",
|
|
160
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam("jobRunId", request.jobRunId)}/stop`
|
|
161
|
-
}, unmarshalJobRun);
|
|
162
|
-
pageOfListJobRuns = (request = {}) => this.client.fetch({
|
|
163
|
-
method: "GET",
|
|
164
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs`,
|
|
165
|
-
urlParams: urlParams(["job_definition_id", request.jobDefinitionId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["state", request.state], ["states", request.states])
|
|
166
|
-
}, unmarshalListJobRunsResponse);
|
|
167
|
-
/**
|
|
168
|
-
* List all job runs with filters.
|
|
169
|
-
*
|
|
170
|
-
* @param request - The request {@link ListJobRunsRequest}
|
|
171
|
-
* @returns A Promise of ListJobRunsResponse
|
|
172
|
-
*/
|
|
173
|
-
listJobRuns = (request = {}) => enrichForPagination("jobRuns", this.pageOfListJobRuns, request);
|
|
174
|
-
/**
|
|
175
|
-
* List jobs resources for the console.
|
|
176
|
-
*
|
|
177
|
-
* @param request - The request {@link ListJobsResourcesRequest}
|
|
178
|
-
* @returns A Promise of ListJobsResourcesResponse
|
|
179
|
-
*/
|
|
180
|
-
listJobsResources = (request = {}) => this.client.fetch({
|
|
181
|
-
method: "GET",
|
|
182
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-resources`
|
|
183
|
-
}, unmarshalListJobsResourcesResponse);
|
|
184
|
-
/**
|
|
185
|
-
* Get jobs limits for the console.
|
|
186
|
-
*
|
|
187
|
-
* @param request - The request {@link GetJobsLimitsRequest}
|
|
188
|
-
* @returns A Promise of JobsLimits
|
|
189
|
-
*/
|
|
190
|
-
getJobsLimits = (request = {}) => this.client.fetch({
|
|
191
|
-
method: "GET",
|
|
192
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-limits`
|
|
193
|
-
}, unmarshalJobsLimits);
|
|
11
|
+
constructor(..._args) {
|
|
12
|
+
super(..._args);
|
|
13
|
+
this.createJobDefinition = (request) => this.client.fetch({
|
|
14
|
+
body: JSON.stringify(marshalCreateJobDefinitionRequest(request, this.client.settings)),
|
|
15
|
+
headers: jsonContentHeaders,
|
|
16
|
+
method: "POST",
|
|
17
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`
|
|
18
|
+
}, unmarshalJobDefinition);
|
|
19
|
+
this.getJobDefinition = (request) => this.client.fetch({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
22
|
+
}, unmarshalJobDefinition);
|
|
23
|
+
this.pageOfListJobDefinitions = (request = {}) => this.client.fetch({
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`,
|
|
26
|
+
urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
27
|
+
}, unmarshalListJobDefinitionsResponse);
|
|
28
|
+
this.listJobDefinitions = (request = {}) => enrichForPagination("jobDefinitions", this.pageOfListJobDefinitions, request);
|
|
29
|
+
this.updateJobDefinition = (request) => this.client.fetch({
|
|
30
|
+
body: JSON.stringify(marshalUpdateJobDefinitionRequest(request, this.client.settings)),
|
|
31
|
+
headers: jsonContentHeaders,
|
|
32
|
+
method: "PATCH",
|
|
33
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
34
|
+
}, unmarshalJobDefinition);
|
|
35
|
+
this.deleteJobDefinition = (request) => this.client.fetch({
|
|
36
|
+
method: "DELETE",
|
|
37
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
38
|
+
});
|
|
39
|
+
this.startJobDefinition = (request) => this.client.fetch({
|
|
40
|
+
body: JSON.stringify(marshalStartJobDefinitionRequest(request, this.client.settings)),
|
|
41
|
+
headers: jsonContentHeaders,
|
|
42
|
+
method: "POST",
|
|
43
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/start`
|
|
44
|
+
}, unmarshalStartJobDefinitionResponse);
|
|
45
|
+
this.createJobDefinitionSecrets = (request) => this.client.fetch({
|
|
46
|
+
body: JSON.stringify(marshalCreateJobDefinitionSecretsRequest(request, this.client.settings)),
|
|
47
|
+
headers: jsonContentHeaders,
|
|
48
|
+
method: "POST",
|
|
49
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
50
|
+
}, unmarshalCreateJobDefinitionSecretsResponse);
|
|
51
|
+
this.getJobDefinitionSecret = (request) => this.client.fetch({
|
|
52
|
+
method: "GET",
|
|
53
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
54
|
+
}, unmarshalSecret);
|
|
55
|
+
this.listJobDefinitionSecrets = (request) => this.client.fetch({
|
|
56
|
+
method: "GET",
|
|
57
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
58
|
+
}, unmarshalListJobDefinitionSecretsResponse);
|
|
59
|
+
this.updateJobDefinitionSecret = (request) => this.client.fetch({
|
|
60
|
+
body: JSON.stringify(marshalUpdateJobDefinitionSecretRequest(request, this.client.settings)),
|
|
61
|
+
headers: jsonContentHeaders,
|
|
62
|
+
method: "PATCH",
|
|
63
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
64
|
+
}, unmarshalSecret);
|
|
65
|
+
this.deleteJobDefinitionSecret = (request) => this.client.fetch({
|
|
66
|
+
method: "DELETE",
|
|
67
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
68
|
+
});
|
|
69
|
+
this.getJobRun = (request) => this.client.fetch({
|
|
70
|
+
method: "GET",
|
|
71
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam("jobRunId", request.jobRunId)}`
|
|
72
|
+
}, unmarshalJobRun);
|
|
73
|
+
this.stopJobRun = (request) => this.client.fetch({
|
|
74
|
+
body: "{}",
|
|
75
|
+
headers: jsonContentHeaders,
|
|
76
|
+
method: "POST",
|
|
77
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam("jobRunId", request.jobRunId)}/stop`
|
|
78
|
+
}, unmarshalJobRun);
|
|
79
|
+
this.pageOfListJobRuns = (request = {}) => this.client.fetch({
|
|
80
|
+
method: "GET",
|
|
81
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs`,
|
|
82
|
+
urlParams: urlParams(["job_definition_id", request.jobDefinitionId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["state", request.state], ["states", request.states])
|
|
83
|
+
}, unmarshalListJobRunsResponse);
|
|
84
|
+
this.listJobRuns = (request = {}) => enrichForPagination("jobRuns", this.pageOfListJobRuns, request);
|
|
85
|
+
this.listJobsResources = (request = {}) => this.client.fetch({
|
|
86
|
+
method: "GET",
|
|
87
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-resources`
|
|
88
|
+
}, unmarshalListJobsResourcesResponse);
|
|
89
|
+
this.getJobsLimits = (request = {}) => this.client.fetch({
|
|
90
|
+
method: "GET",
|
|
91
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-limits`
|
|
92
|
+
}, unmarshalJobsLimits);
|
|
93
|
+
}
|
|
94
|
+
static {
|
|
95
|
+
this.LOCALITY = toApiLocality({ regions: [
|
|
96
|
+
"fr-par",
|
|
97
|
+
"nl-ams",
|
|
98
|
+
"pl-waw"
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
194
101
|
};
|
|
195
102
|
//#endregion
|
|
196
103
|
export { API };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
2
|
import randomName from "@scaleway/random-name";
|
|
3
3
|
//#region src/v1alpha1/marshalling.gen.ts
|
|
4
|
-
|
|
4
|
+
const unmarshalSecretEnvVar = (data) => {
|
|
5
5
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`);
|
|
6
6
|
return { name: data.name };
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
const unmarshalSecretFile = (data) => {
|
|
9
9
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`);
|
|
10
10
|
return { path: data.path };
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
const unmarshalSecret = (data) => {
|
|
13
13
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
|
|
14
14
|
return {
|
|
15
15
|
envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
|
|
@@ -19,14 +19,14 @@ var unmarshalSecret = (data) => {
|
|
|
19
19
|
secretManagerVersion: data.secret_manager_version
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const unmarshalCronSchedule = (data) => {
|
|
23
23
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.`);
|
|
24
24
|
return {
|
|
25
25
|
schedule: data.schedule,
|
|
26
26
|
timezone: data.timezone
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
const unmarshalJobDefinition = (data) => {
|
|
30
30
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`);
|
|
31
31
|
return {
|
|
32
32
|
command: data.command,
|
|
@@ -46,7 +46,7 @@ var unmarshalJobDefinition = (data) => {
|
|
|
46
46
|
updatedAt: unmarshalDate(data.updated_at)
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
const unmarshalJobRun = (data) => {
|
|
50
50
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`);
|
|
51
51
|
return {
|
|
52
52
|
command: data.command,
|
|
@@ -67,55 +67,55 @@ var unmarshalJobRun = (data) => {
|
|
|
67
67
|
updatedAt: unmarshalDate(data.updated_at)
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
const unmarshalCreateJobDefinitionSecretsResponse = (data) => {
|
|
71
71
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateJobDefinitionSecretsResponse' failed as data isn't a dictionary.`);
|
|
72
72
|
return { secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret) };
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
const unmarshalJobsLimits = (data) => {
|
|
75
75
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobsLimits' failed as data isn't a dictionary.`);
|
|
76
76
|
return { secretsPerJobDefinition: data.secrets_per_job_definition };
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
const unmarshalListJobDefinitionSecretsResponse = (data) => {
|
|
79
79
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionSecretsResponse' failed as data isn't a dictionary.`);
|
|
80
80
|
return {
|
|
81
81
|
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
82
82
|
totalCount: data.total_count
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
const unmarshalListJobDefinitionsResponse = (data) => {
|
|
86
86
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`);
|
|
87
87
|
return {
|
|
88
88
|
jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition),
|
|
89
89
|
totalCount: data.total_count
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
|
-
|
|
92
|
+
const unmarshalListJobRunsResponse = (data) => {
|
|
93
93
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`);
|
|
94
94
|
return {
|
|
95
95
|
jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
|
|
96
96
|
totalCount: data.total_count
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
const unmarshalResource = (data) => {
|
|
100
100
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`);
|
|
101
101
|
return {
|
|
102
102
|
cpuLimit: data.cpu_limit,
|
|
103
103
|
memoryLimit: data.memory_limit
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
const unmarshalListJobsResourcesResponse = (data) => {
|
|
107
107
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobsResourcesResponse' failed as data isn't a dictionary.`);
|
|
108
108
|
return { resources: unmarshalArrayOfObject(data.resources, unmarshalResource) };
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
const unmarshalStartJobDefinitionResponse = (data) => {
|
|
111
111
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`);
|
|
112
112
|
return { jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun) };
|
|
113
113
|
};
|
|
114
|
-
|
|
114
|
+
const marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
115
115
|
schedule: request.schedule,
|
|
116
116
|
timezone: request.timezone
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
119
119
|
command: request.command,
|
|
120
120
|
cpu_limit: request.cpuLimit,
|
|
121
121
|
cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults) : void 0,
|
|
@@ -128,7 +128,7 @@ var marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
128
128
|
name: request.name || randomName("job"),
|
|
129
129
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
130
130
|
});
|
|
131
|
-
|
|
131
|
+
const marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults) => ({
|
|
132
132
|
secret_manager_id: request.secretManagerId,
|
|
133
133
|
secret_manager_version: request.secretManagerVersion,
|
|
134
134
|
...resolveOneOf([{
|
|
@@ -139,17 +139,17 @@ var marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults) =
|
|
|
139
139
|
value: request.envVarName
|
|
140
140
|
}])
|
|
141
141
|
});
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({ secrets: request.secrets.map((elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt, defaults)) });
|
|
143
|
+
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
144
144
|
command: request.command,
|
|
145
145
|
environment_variables: request.environmentVariables,
|
|
146
146
|
replicas: request.replicas
|
|
147
147
|
});
|
|
148
|
-
|
|
148
|
+
const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
149
149
|
schedule: request.schedule,
|
|
150
150
|
timezone: request.timezone
|
|
151
151
|
});
|
|
152
|
-
|
|
152
|
+
const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
153
153
|
command: request.command,
|
|
154
154
|
cpu_limit: request.cpuLimit,
|
|
155
155
|
cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults) : void 0,
|
|
@@ -161,7 +161,7 @@ var marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
161
161
|
memory_limit: request.memoryLimit,
|
|
162
162
|
name: request.name
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
|
|
165
165
|
secret_manager_version: request.secretManagerVersion,
|
|
166
166
|
...resolveOneOf([{
|
|
167
167
|
param: "path",
|
|
@@ -12,7 +12,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
12
12
|
UpdateJobDefinitionRequestCronScheduleConfig: () => UpdateJobDefinitionRequestCronScheduleConfig,
|
|
13
13
|
UpdateJobDefinitionSecretRequest: () => UpdateJobDefinitionSecretRequest
|
|
14
14
|
});
|
|
15
|
-
|
|
15
|
+
const CreateJobDefinitionRequest = {
|
|
16
16
|
cpuLimit: { greaterThan: 0 },
|
|
17
17
|
description: { maxLength: 255 },
|
|
18
18
|
imageUri: { pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ },
|
|
@@ -20,7 +20,7 @@ var CreateJobDefinitionRequest = {
|
|
|
20
20
|
memoryLimit: { greaterThan: 0 },
|
|
21
21
|
name: { pattern: /^[A-Za-z0-9-_]{3,50}$/ }
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
const CreateJobDefinitionRequestCronScheduleConfig = {
|
|
24
24
|
schedule: {
|
|
25
25
|
maxLength: 255,
|
|
26
26
|
minLength: 1
|
|
@@ -30,8 +30,8 @@ var CreateJobDefinitionRequestCronScheduleConfig = {
|
|
|
30
30
|
minLength: 1
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const CreateJobDefinitionSecretsRequestSecretConfig = { secretManagerVersion: { minLength: 1 } };
|
|
34
|
+
const CronSchedule = {
|
|
35
35
|
schedule: {
|
|
36
36
|
maxLength: 255,
|
|
37
37
|
minLength: 1
|
|
@@ -41,22 +41,22 @@ var CronSchedule = {
|
|
|
41
41
|
minLength: 1
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
const ListJobDefinitionsRequest = {
|
|
45
45
|
page: { greaterThanOrEqual: 1 },
|
|
46
46
|
pageSize: {
|
|
47
47
|
greaterThanOrEqual: 1,
|
|
48
48
|
lessThanOrEqual: 1e3
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
const ListJobRunsRequest = {
|
|
52
52
|
page: { greaterThanOrEqual: 1 },
|
|
53
53
|
pageSize: {
|
|
54
54
|
greaterThanOrEqual: 1,
|
|
55
55
|
lessThanOrEqual: 1e3
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const StartJobDefinitionRequest = { replicas: { greaterThan: 0 } };
|
|
59
|
+
const UpdateJobDefinitionRequest = {
|
|
60
60
|
cpuLimit: { greaterThan: 0 },
|
|
61
61
|
description: { maxLength: 255 },
|
|
62
62
|
imageUri: { pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ },
|
|
@@ -64,7 +64,7 @@ var UpdateJobDefinitionRequest = {
|
|
|
64
64
|
memoryLimit: { greaterThan: 0 },
|
|
65
65
|
name: { pattern: /^[A-Za-z0-9-_]{3,50}$/ }
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
const UpdateJobDefinitionRequestCronScheduleConfig = {
|
|
68
68
|
schedule: {
|
|
69
69
|
maxLength: 255,
|
|
70
70
|
minLength: 1
|
|
@@ -74,6 +74,6 @@ var UpdateJobDefinitionRequestCronScheduleConfig = {
|
|
|
74
74
|
minLength: 1
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
const UpdateJobDefinitionSecretRequest = { secretManagerVersion: { minLength: 1 } };
|
|
78
78
|
//#endregion
|
|
79
79
|
export { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateJobDefinitionSecretsRequestSecretConfig, CronSchedule, ListJobDefinitionsRequest, ListJobRunsRequest, StartJobDefinitionRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateJobDefinitionSecretRequest, validation_rules_gen_exports };
|