@scaleway/sdk-jobs 1.2.0 → 2.1.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 +96 -0
- package/dist/v1alpha1/api.gen.d.ts +2 -2
- package/dist/v1alpha1/api.gen.js +23 -31
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/marshalling.gen.js +20 -17
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1alpha1/api.gen.cjs +0 -274
- package/dist/v1alpha1/content.gen.cjs +0 -8
- package/dist/v1alpha1/index.gen.cjs +0 -24
- package/dist/v1alpha1/marshalling.gen.cjs +0 -262
- package/dist/v1alpha1/validation-rules.gen.cjs +0 -115
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-jobs
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-jobs)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-jobs)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Jobs API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-jobs @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-jobs @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-jobs @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Jobs } from '@scaleway/sdk-jobs'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Jobs.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Jobs } from '@scaleway/sdk-jobs'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Jobs.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Jobs API Documentation](https://www.scaleway.com/en/developers/api/jobs/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality } from '@scaleway/sdk-client';
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
3
|
import type { CreateJobDefinitionRequest, CreateJobDefinitionSecretsRequest, CreateJobDefinitionSecretsResponse, DeleteJobDefinitionRequest, DeleteJobDefinitionSecretRequest, GetJobDefinitionRequest, GetJobDefinitionSecretRequest, GetJobRunRequest, GetJobsLimitsRequest, JobDefinition, JobRun, JobsLimits, ListJobDefinitionSecretsRequest, ListJobDefinitionSecretsResponse, ListJobDefinitionsRequest, ListJobDefinitionsResponse, ListJobRunsRequest, ListJobRunsResponse, ListJobsResourcesRequest, ListJobsResourcesResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionSecretRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Serverless Jobs API.
|
|
@@ -45,7 +45,7 @@ export declare class API extends ParentAPI {
|
|
|
45
45
|
*/
|
|
46
46
|
updateJobDefinition: (request: Readonly<UpdateJobDefinitionRequest>) => Promise<JobDefinition>;
|
|
47
47
|
/**
|
|
48
|
-
* Delete an
|
|
48
|
+
* Delete an existing job definition by its unique identifier.
|
|
49
49
|
*
|
|
50
50
|
* @param request - The request {@link DeleteJobDefinitionRequest}
|
|
51
51
|
*/
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -9,7 +9,11 @@ class API extends API$1 {
|
|
|
9
9
|
* type ∈ {'zone','region','global','unspecified'}
|
|
10
10
|
*/
|
|
11
11
|
static LOCALITY = toApiLocality({
|
|
12
|
-
regions: [
|
|
12
|
+
regions: [
|
|
13
|
+
"fr-par",
|
|
14
|
+
"nl-ams",
|
|
15
|
+
"pl-waw"
|
|
16
|
+
]
|
|
13
17
|
});
|
|
14
18
|
/**
|
|
15
19
|
* Create a new job definition in a specified Project.
|
|
@@ -49,10 +53,7 @@ class API extends API$1 {
|
|
|
49
53
|
["order_by", request.orderBy],
|
|
50
54
|
["organization_id", request.organizationId],
|
|
51
55
|
["page", request.page],
|
|
52
|
-
[
|
|
53
|
-
"page_size",
|
|
54
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
55
|
-
],
|
|
56
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
56
57
|
["project_id", request.projectId]
|
|
57
58
|
)
|
|
58
59
|
},
|
|
@@ -64,11 +65,7 @@ class API extends API$1 {
|
|
|
64
65
|
* @param request - The request {@link ListJobDefinitionsRequest}
|
|
65
66
|
* @returns A Promise of ListJobDefinitionsResponse
|
|
66
67
|
*/
|
|
67
|
-
listJobDefinitions = (request = {}) => enrichForPagination(
|
|
68
|
-
"jobDefinitions",
|
|
69
|
-
this.pageOfListJobDefinitions,
|
|
70
|
-
request
|
|
71
|
-
);
|
|
68
|
+
listJobDefinitions = (request = {}) => enrichForPagination("jobDefinitions", this.pageOfListJobDefinitions, request);
|
|
72
69
|
/**
|
|
73
70
|
* Update an existing job definition associated with the specified unique identifier.
|
|
74
71
|
*
|
|
@@ -87,14 +84,16 @@ class API extends API$1 {
|
|
|
87
84
|
unmarshalJobDefinition
|
|
88
85
|
);
|
|
89
86
|
/**
|
|
90
|
-
* Delete an
|
|
87
|
+
* Delete an existing job definition by its unique identifier.
|
|
91
88
|
*
|
|
92
89
|
* @param request - The request {@link DeleteJobDefinitionRequest}
|
|
93
90
|
*/
|
|
94
|
-
deleteJobDefinition = (request) => this.client.fetch(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
deleteJobDefinition = (request) => this.client.fetch(
|
|
92
|
+
{
|
|
93
|
+
method: "DELETE",
|
|
94
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
95
|
+
}
|
|
96
|
+
);
|
|
98
97
|
/**
|
|
99
98
|
* Run an existing job definition by its unique identifier. This will create a new job run.
|
|
100
99
|
*
|
|
@@ -121,10 +120,7 @@ class API extends API$1 {
|
|
|
121
120
|
createJobDefinitionSecrets = (request) => this.client.fetch(
|
|
122
121
|
{
|
|
123
122
|
body: JSON.stringify(
|
|
124
|
-
marshalCreateJobDefinitionSecretsRequest(
|
|
125
|
-
request,
|
|
126
|
-
this.client.settings
|
|
127
|
-
)
|
|
123
|
+
marshalCreateJobDefinitionSecretsRequest(request, this.client.settings)
|
|
128
124
|
),
|
|
129
125
|
headers: jsonContentHeaders,
|
|
130
126
|
method: "POST",
|
|
@@ -167,10 +163,7 @@ class API extends API$1 {
|
|
|
167
163
|
updateJobDefinitionSecret = (request) => this.client.fetch(
|
|
168
164
|
{
|
|
169
165
|
body: JSON.stringify(
|
|
170
|
-
marshalUpdateJobDefinitionSecretRequest(
|
|
171
|
-
request,
|
|
172
|
-
this.client.settings
|
|
173
|
-
)
|
|
166
|
+
marshalUpdateJobDefinitionSecretRequest(request, this.client.settings)
|
|
174
167
|
),
|
|
175
168
|
headers: jsonContentHeaders,
|
|
176
169
|
method: "PATCH",
|
|
@@ -183,10 +176,12 @@ class API extends API$1 {
|
|
|
183
176
|
*
|
|
184
177
|
* @param request - The request {@link DeleteJobDefinitionSecretRequest}
|
|
185
178
|
*/
|
|
186
|
-
deleteJobDefinitionSecret = (request) => this.client.fetch(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
179
|
+
deleteJobDefinitionSecret = (request) => this.client.fetch(
|
|
180
|
+
{
|
|
181
|
+
method: "DELETE",
|
|
182
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
183
|
+
}
|
|
184
|
+
);
|
|
190
185
|
/**
|
|
191
186
|
* Get a job run by its unique identifier.
|
|
192
187
|
*
|
|
@@ -224,10 +219,7 @@ class API extends API$1 {
|
|
|
224
219
|
["order_by", request.orderBy],
|
|
225
220
|
["organization_id", request.organizationId],
|
|
226
221
|
["page", request.page],
|
|
227
|
-
[
|
|
228
|
-
"page_size",
|
|
229
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
230
|
-
],
|
|
222
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
231
223
|
["project_id", request.projectId],
|
|
232
224
|
["state", request.state],
|
|
233
225
|
["states", request.states]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
4
|
export type { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateJobDefinitionSecretsRequest, CreateJobDefinitionSecretsRequestSecretConfig, CreateJobDefinitionSecretsResponse, CronSchedule, DeleteJobDefinitionRequest, DeleteJobDefinitionSecretRequest, GetJobDefinitionRequest, GetJobDefinitionSecretRequest, GetJobRunRequest, GetJobsLimitsRequest, JobDefinition, JobRun, JobRunState, JobsLimits, ListJobDefinitionSecretsRequest, ListJobDefinitionSecretsResponse, ListJobDefinitionsRequest, ListJobDefinitionsRequestOrderBy, ListJobDefinitionsResponse, ListJobRunsRequest, ListJobRunsRequestOrderBy, ListJobRunsResponse, ListJobsResourcesRequest, ListJobsResourcesResponse, Resource, Secret, SecretEnvVar, SecretFile, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateJobDefinitionSecretRequest, } from './types.gen.js';
|
|
@@ -132,10 +132,7 @@ const unmarshalListJobDefinitionsResponse = (data) => {
|
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
return {
|
|
135
|
-
jobDefinitions: unmarshalArrayOfObject(
|
|
136
|
-
data.job_definitions,
|
|
137
|
-
unmarshalJobDefinition
|
|
138
|
-
),
|
|
135
|
+
jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition),
|
|
139
136
|
totalCount: data.total_count
|
|
140
137
|
};
|
|
141
138
|
};
|
|
@@ -188,9 +185,7 @@ const marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults)
|
|
|
188
185
|
const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
189
186
|
command: request.command,
|
|
190
187
|
cpu_limit: request.cpuLimit,
|
|
191
|
-
cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(
|
|
192
|
-
request.cronSchedule
|
|
193
|
-
) : void 0,
|
|
188
|
+
cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(request.cronSchedule) : void 0,
|
|
194
189
|
description: request.description,
|
|
195
190
|
environment_variables: request.environmentVariables !== void 0 ? request.environmentVariables : void 0,
|
|
196
191
|
image_uri: request.imageUri,
|
|
@@ -204,14 +199,18 @@ const marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults)
|
|
|
204
199
|
secret_manager_id: request.secretManagerId,
|
|
205
200
|
secret_manager_version: request.secretManagerVersion,
|
|
206
201
|
...resolveOneOf([
|
|
207
|
-
{
|
|
208
|
-
|
|
202
|
+
{
|
|
203
|
+
param: "path",
|
|
204
|
+
value: request.path
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
param: "env_var_name",
|
|
208
|
+
value: request.envVarName
|
|
209
|
+
}
|
|
209
210
|
])
|
|
210
211
|
});
|
|
211
212
|
const marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({
|
|
212
|
-
secrets: request.secrets.map(
|
|
213
|
-
(elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt)
|
|
214
|
-
)
|
|
213
|
+
secrets: request.secrets.map((elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt))
|
|
215
214
|
});
|
|
216
215
|
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
217
216
|
command: request.command,
|
|
@@ -225,9 +224,7 @@ const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults)
|
|
|
225
224
|
const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
226
225
|
command: request.command,
|
|
227
226
|
cpu_limit: request.cpuLimit,
|
|
228
|
-
cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(
|
|
229
|
-
request.cronSchedule
|
|
230
|
-
) : void 0,
|
|
227
|
+
cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(request.cronSchedule) : void 0,
|
|
231
228
|
description: request.description,
|
|
232
229
|
environment_variables: request.environmentVariables,
|
|
233
230
|
image_uri: request.imageUri,
|
|
@@ -239,8 +236,14 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
239
236
|
const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
|
|
240
237
|
secret_manager_version: request.secretManagerVersion,
|
|
241
238
|
...resolveOneOf([
|
|
242
|
-
{
|
|
243
|
-
|
|
239
|
+
{
|
|
240
|
+
param: "path",
|
|
241
|
+
value: request.path
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
param: "env_var_name",
|
|
245
|
+
value: request.envVarName
|
|
246
|
+
}
|
|
244
247
|
])
|
|
245
248
|
});
|
|
246
249
|
export {
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-jobs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK jobs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/jobs"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
4
|
-
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
5
|
-
const jsonContentHeaders = {
|
|
6
|
-
"Content-Type": "application/json; charset=utf-8"
|
|
7
|
-
};
|
|
8
|
-
class API extends sdkClient.API {
|
|
9
|
-
/**
|
|
10
|
-
* Locality of this API.
|
|
11
|
-
* type ∈ {'zone','region','global','unspecified'}
|
|
12
|
-
*/
|
|
13
|
-
static LOCALITY = sdkClient.toApiLocality({
|
|
14
|
-
regions: ["fr-par", "nl-ams", "pl-waw"]
|
|
15
|
-
});
|
|
16
|
-
/**
|
|
17
|
-
* Create a new job definition in a specified Project.
|
|
18
|
-
*
|
|
19
|
-
* @param request - The request {@link CreateJobDefinitionRequest}
|
|
20
|
-
* @returns A Promise of JobDefinition
|
|
21
|
-
*/
|
|
22
|
-
createJobDefinition = (request) => this.client.fetch(
|
|
23
|
-
{
|
|
24
|
-
body: JSON.stringify(
|
|
25
|
-
marshalling_gen.marshalCreateJobDefinitionRequest(request, this.client.settings)
|
|
26
|
-
),
|
|
27
|
-
headers: jsonContentHeaders,
|
|
28
|
-
method: "POST",
|
|
29
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`
|
|
30
|
-
},
|
|
31
|
-
marshalling_gen.unmarshalJobDefinition
|
|
32
|
-
);
|
|
33
|
-
/**
|
|
34
|
-
* Get a job definition by its unique identifier.
|
|
35
|
-
*
|
|
36
|
-
* @param request - The request {@link GetJobDefinitionRequest}
|
|
37
|
-
* @returns A Promise of JobDefinition
|
|
38
|
-
*/
|
|
39
|
-
getJobDefinition = (request) => this.client.fetch(
|
|
40
|
-
{
|
|
41
|
-
method: "GET",
|
|
42
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
43
|
-
},
|
|
44
|
-
marshalling_gen.unmarshalJobDefinition
|
|
45
|
-
);
|
|
46
|
-
pageOfListJobDefinitions = (request = {}) => this.client.fetch(
|
|
47
|
-
{
|
|
48
|
-
method: "GET",
|
|
49
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`,
|
|
50
|
-
urlParams: sdkClient.urlParams(
|
|
51
|
-
["order_by", request.orderBy],
|
|
52
|
-
["organization_id", request.organizationId],
|
|
53
|
-
["page", request.page],
|
|
54
|
-
[
|
|
55
|
-
"page_size",
|
|
56
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
57
|
-
],
|
|
58
|
-
["project_id", request.projectId]
|
|
59
|
-
)
|
|
60
|
-
},
|
|
61
|
-
marshalling_gen.unmarshalListJobDefinitionsResponse
|
|
62
|
-
);
|
|
63
|
-
/**
|
|
64
|
-
* List all your job definitions with filters.
|
|
65
|
-
*
|
|
66
|
-
* @param request - The request {@link ListJobDefinitionsRequest}
|
|
67
|
-
* @returns A Promise of ListJobDefinitionsResponse
|
|
68
|
-
*/
|
|
69
|
-
listJobDefinitions = (request = {}) => sdkClient.enrichForPagination(
|
|
70
|
-
"jobDefinitions",
|
|
71
|
-
this.pageOfListJobDefinitions,
|
|
72
|
-
request
|
|
73
|
-
);
|
|
74
|
-
/**
|
|
75
|
-
* Update an existing job definition associated with the specified unique identifier.
|
|
76
|
-
*
|
|
77
|
-
* @param request - The request {@link UpdateJobDefinitionRequest}
|
|
78
|
-
* @returns A Promise of JobDefinition
|
|
79
|
-
*/
|
|
80
|
-
updateJobDefinition = (request) => this.client.fetch(
|
|
81
|
-
{
|
|
82
|
-
body: JSON.stringify(
|
|
83
|
-
marshalling_gen.marshalUpdateJobDefinitionRequest(request, this.client.settings)
|
|
84
|
-
),
|
|
85
|
-
headers: jsonContentHeaders,
|
|
86
|
-
method: "PATCH",
|
|
87
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
88
|
-
},
|
|
89
|
-
marshalling_gen.unmarshalJobDefinition
|
|
90
|
-
);
|
|
91
|
-
/**
|
|
92
|
-
* Delete an exsisting job definition by its unique identifier.
|
|
93
|
-
*
|
|
94
|
-
* @param request - The request {@link DeleteJobDefinitionRequest}
|
|
95
|
-
*/
|
|
96
|
-
deleteJobDefinition = (request) => this.client.fetch({
|
|
97
|
-
method: "DELETE",
|
|
98
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}`
|
|
99
|
-
});
|
|
100
|
-
/**
|
|
101
|
-
* Run an existing job definition by its unique identifier. This will create a new job run.
|
|
102
|
-
*
|
|
103
|
-
* @param request - The request {@link StartJobDefinitionRequest}
|
|
104
|
-
* @returns A Promise of StartJobDefinitionResponse
|
|
105
|
-
*/
|
|
106
|
-
startJobDefinition = (request) => this.client.fetch(
|
|
107
|
-
{
|
|
108
|
-
body: JSON.stringify(
|
|
109
|
-
marshalling_gen.marshalStartJobDefinitionRequest(request, this.client.settings)
|
|
110
|
-
),
|
|
111
|
-
headers: jsonContentHeaders,
|
|
112
|
-
method: "POST",
|
|
113
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/start`
|
|
114
|
-
},
|
|
115
|
-
marshalling_gen.unmarshalStartJobDefinitionResponse
|
|
116
|
-
);
|
|
117
|
-
/**
|
|
118
|
-
* Create a secret reference within a job definition.
|
|
119
|
-
*
|
|
120
|
-
* @param request - The request {@link CreateJobDefinitionSecretsRequest}
|
|
121
|
-
* @returns A Promise of CreateJobDefinitionSecretsResponse
|
|
122
|
-
*/
|
|
123
|
-
createJobDefinitionSecrets = (request) => this.client.fetch(
|
|
124
|
-
{
|
|
125
|
-
body: JSON.stringify(
|
|
126
|
-
marshalling_gen.marshalCreateJobDefinitionSecretsRequest(
|
|
127
|
-
request,
|
|
128
|
-
this.client.settings
|
|
129
|
-
)
|
|
130
|
-
),
|
|
131
|
-
headers: jsonContentHeaders,
|
|
132
|
-
method: "POST",
|
|
133
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
134
|
-
},
|
|
135
|
-
marshalling_gen.unmarshalCreateJobDefinitionSecretsResponse
|
|
136
|
-
);
|
|
137
|
-
/**
|
|
138
|
-
* Get a secret references within a job definition.
|
|
139
|
-
*
|
|
140
|
-
* @param request - The request {@link GetJobDefinitionSecretRequest}
|
|
141
|
-
* @returns A Promise of Secret
|
|
142
|
-
*/
|
|
143
|
-
getJobDefinitionSecret = (request) => this.client.fetch(
|
|
144
|
-
{
|
|
145
|
-
method: "GET",
|
|
146
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${sdkClient.validatePathParam("secretId", request.secretId)}`
|
|
147
|
-
},
|
|
148
|
-
marshalling_gen.unmarshalSecret
|
|
149
|
-
);
|
|
150
|
-
/**
|
|
151
|
-
* List secrets references within a job definition.
|
|
152
|
-
*
|
|
153
|
-
* @param request - The request {@link ListJobDefinitionSecretsRequest}
|
|
154
|
-
* @returns A Promise of ListJobDefinitionSecretsResponse
|
|
155
|
-
*/
|
|
156
|
-
listJobDefinitionSecrets = (request) => this.client.fetch(
|
|
157
|
-
{
|
|
158
|
-
method: "GET",
|
|
159
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
160
|
-
},
|
|
161
|
-
marshalling_gen.unmarshalListJobDefinitionSecretsResponse
|
|
162
|
-
);
|
|
163
|
-
/**
|
|
164
|
-
* Update a secret reference within a job definition.
|
|
165
|
-
*
|
|
166
|
-
* @param request - The request {@link UpdateJobDefinitionSecretRequest}
|
|
167
|
-
* @returns A Promise of Secret
|
|
168
|
-
*/
|
|
169
|
-
updateJobDefinitionSecret = (request) => this.client.fetch(
|
|
170
|
-
{
|
|
171
|
-
body: JSON.stringify(
|
|
172
|
-
marshalling_gen.marshalUpdateJobDefinitionSecretRequest(
|
|
173
|
-
request,
|
|
174
|
-
this.client.settings
|
|
175
|
-
)
|
|
176
|
-
),
|
|
177
|
-
headers: jsonContentHeaders,
|
|
178
|
-
method: "PATCH",
|
|
179
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${sdkClient.validatePathParam("secretId", request.secretId)}`
|
|
180
|
-
},
|
|
181
|
-
marshalling_gen.unmarshalSecret
|
|
182
|
-
);
|
|
183
|
-
/**
|
|
184
|
-
* Delete a secret reference within a job definition.
|
|
185
|
-
*
|
|
186
|
-
* @param request - The request {@link DeleteJobDefinitionSecretRequest}
|
|
187
|
-
*/
|
|
188
|
-
deleteJobDefinitionSecret = (request) => this.client.fetch({
|
|
189
|
-
method: "DELETE",
|
|
190
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${sdkClient.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${sdkClient.validatePathParam("secretId", request.secretId)}`
|
|
191
|
-
});
|
|
192
|
-
/**
|
|
193
|
-
* Get a job run by its unique identifier.
|
|
194
|
-
*
|
|
195
|
-
* @param request - The request {@link GetJobRunRequest}
|
|
196
|
-
* @returns A Promise of JobRun
|
|
197
|
-
*/
|
|
198
|
-
getJobRun = (request) => this.client.fetch(
|
|
199
|
-
{
|
|
200
|
-
method: "GET",
|
|
201
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${sdkClient.validatePathParam("jobRunId", request.jobRunId)}`
|
|
202
|
-
},
|
|
203
|
-
marshalling_gen.unmarshalJobRun
|
|
204
|
-
);
|
|
205
|
-
/**
|
|
206
|
-
* Stop a job run by its unique identifier.
|
|
207
|
-
*
|
|
208
|
-
* @param request - The request {@link StopJobRunRequest}
|
|
209
|
-
* @returns A Promise of JobRun
|
|
210
|
-
*/
|
|
211
|
-
stopJobRun = (request) => this.client.fetch(
|
|
212
|
-
{
|
|
213
|
-
body: "{}",
|
|
214
|
-
headers: jsonContentHeaders,
|
|
215
|
-
method: "POST",
|
|
216
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${sdkClient.validatePathParam("jobRunId", request.jobRunId)}/stop`
|
|
217
|
-
},
|
|
218
|
-
marshalling_gen.unmarshalJobRun
|
|
219
|
-
);
|
|
220
|
-
pageOfListJobRuns = (request = {}) => this.client.fetch(
|
|
221
|
-
{
|
|
222
|
-
method: "GET",
|
|
223
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs`,
|
|
224
|
-
urlParams: sdkClient.urlParams(
|
|
225
|
-
["job_definition_id", request.jobDefinitionId],
|
|
226
|
-
["order_by", request.orderBy],
|
|
227
|
-
["organization_id", request.organizationId],
|
|
228
|
-
["page", request.page],
|
|
229
|
-
[
|
|
230
|
-
"page_size",
|
|
231
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
232
|
-
],
|
|
233
|
-
["project_id", request.projectId],
|
|
234
|
-
["state", request.state],
|
|
235
|
-
["states", request.states]
|
|
236
|
-
)
|
|
237
|
-
},
|
|
238
|
-
marshalling_gen.unmarshalListJobRunsResponse
|
|
239
|
-
);
|
|
240
|
-
/**
|
|
241
|
-
* List all job runs with filters.
|
|
242
|
-
*
|
|
243
|
-
* @param request - The request {@link ListJobRunsRequest}
|
|
244
|
-
* @returns A Promise of ListJobRunsResponse
|
|
245
|
-
*/
|
|
246
|
-
listJobRuns = (request = {}) => sdkClient.enrichForPagination("jobRuns", this.pageOfListJobRuns, request);
|
|
247
|
-
/**
|
|
248
|
-
* List jobs resources for the console.
|
|
249
|
-
*
|
|
250
|
-
* @param request - The request {@link ListJobsResourcesRequest}
|
|
251
|
-
* @returns A Promise of ListJobsResourcesResponse
|
|
252
|
-
*/
|
|
253
|
-
listJobsResources = (request = {}) => this.client.fetch(
|
|
254
|
-
{
|
|
255
|
-
method: "GET",
|
|
256
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-resources`
|
|
257
|
-
},
|
|
258
|
-
marshalling_gen.unmarshalListJobsResourcesResponse
|
|
259
|
-
);
|
|
260
|
-
/**
|
|
261
|
-
* Get jobs limits for the console.
|
|
262
|
-
*
|
|
263
|
-
* @param request - The request {@link GetJobsLimitsRequest}
|
|
264
|
-
* @returns A Promise of JobsLimits
|
|
265
|
-
*/
|
|
266
|
-
getJobsLimits = (request = {}) => this.client.fetch(
|
|
267
|
-
{
|
|
268
|
-
method: "GET",
|
|
269
|
-
path: `/serverless-jobs/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-limits`
|
|
270
|
-
},
|
|
271
|
-
marshalling_gen.unmarshalJobsLimits
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
exports.API = API;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const api_gen = require("./api.gen.cjs");
|
|
4
|
-
const content_gen = require("./content.gen.cjs");
|
|
5
|
-
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
|
-
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
7
|
-
exports.API = api_gen.API;
|
|
8
|
-
exports.JOB_RUN_TRANSIENT_STATUSES = content_gen.JOB_RUN_TRANSIENT_STATUSES;
|
|
9
|
-
exports.marshalCreateJobDefinitionRequest = marshalling_gen.marshalCreateJobDefinitionRequest;
|
|
10
|
-
exports.marshalCreateJobDefinitionSecretsRequest = marshalling_gen.marshalCreateJobDefinitionSecretsRequest;
|
|
11
|
-
exports.marshalStartJobDefinitionRequest = marshalling_gen.marshalStartJobDefinitionRequest;
|
|
12
|
-
exports.marshalUpdateJobDefinitionRequest = marshalling_gen.marshalUpdateJobDefinitionRequest;
|
|
13
|
-
exports.marshalUpdateJobDefinitionSecretRequest = marshalling_gen.marshalUpdateJobDefinitionSecretRequest;
|
|
14
|
-
exports.unmarshalCreateJobDefinitionSecretsResponse = marshalling_gen.unmarshalCreateJobDefinitionSecretsResponse;
|
|
15
|
-
exports.unmarshalJobDefinition = marshalling_gen.unmarshalJobDefinition;
|
|
16
|
-
exports.unmarshalJobRun = marshalling_gen.unmarshalJobRun;
|
|
17
|
-
exports.unmarshalJobsLimits = marshalling_gen.unmarshalJobsLimits;
|
|
18
|
-
exports.unmarshalListJobDefinitionSecretsResponse = marshalling_gen.unmarshalListJobDefinitionSecretsResponse;
|
|
19
|
-
exports.unmarshalListJobDefinitionsResponse = marshalling_gen.unmarshalListJobDefinitionsResponse;
|
|
20
|
-
exports.unmarshalListJobRunsResponse = marshalling_gen.unmarshalListJobRunsResponse;
|
|
21
|
-
exports.unmarshalListJobsResourcesResponse = marshalling_gen.unmarshalListJobsResourcesResponse;
|
|
22
|
-
exports.unmarshalSecret = marshalling_gen.unmarshalSecret;
|
|
23
|
-
exports.unmarshalStartJobDefinitionResponse = marshalling_gen.unmarshalStartJobDefinitionResponse;
|
|
24
|
-
exports.ValidationRules = validationRules_gen;
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const randomName = require("@scaleway/random-name");
|
|
4
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
5
|
-
const unmarshalSecretEnvVar = (data) => {
|
|
6
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
7
|
-
throw new TypeError(
|
|
8
|
-
`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
name: data.name
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const unmarshalSecretFile = (data) => {
|
|
16
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
17
|
-
throw new TypeError(
|
|
18
|
-
`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
path: data.path
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
const unmarshalSecret = (data) => {
|
|
26
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
27
|
-
throw new TypeError(
|
|
28
|
-
`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
|
|
33
|
-
file: data.file ? unmarshalSecretFile(data.file) : void 0,
|
|
34
|
-
secretId: data.secret_id,
|
|
35
|
-
secretManagerId: data.secret_manager_id,
|
|
36
|
-
secretManagerVersion: data.secret_manager_version
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const unmarshalCronSchedule = (data) => {
|
|
40
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
41
|
-
throw new TypeError(
|
|
42
|
-
`Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.`
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
schedule: data.schedule,
|
|
47
|
-
timezone: data.timezone
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
const unmarshalJobDefinition = (data) => {
|
|
51
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
52
|
-
throw new TypeError(
|
|
53
|
-
`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
command: data.command,
|
|
58
|
-
cpuLimit: data.cpu_limit,
|
|
59
|
-
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
60
|
-
cronSchedule: data.cron_schedule ? unmarshalCronSchedule(data.cron_schedule) : void 0,
|
|
61
|
-
description: data.description,
|
|
62
|
-
environmentVariables: data.environment_variables,
|
|
63
|
-
id: data.id,
|
|
64
|
-
imageUri: data.image_uri,
|
|
65
|
-
jobTimeout: data.job_timeout,
|
|
66
|
-
localStorageCapacity: data.local_storage_capacity,
|
|
67
|
-
memoryLimit: data.memory_limit,
|
|
68
|
-
name: data.name,
|
|
69
|
-
projectId: data.project_id,
|
|
70
|
-
region: data.region,
|
|
71
|
-
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
const unmarshalJobRun = (data) => {
|
|
75
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
76
|
-
throw new TypeError(
|
|
77
|
-
`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
command: data.command,
|
|
82
|
-
cpuLimit: data.cpu_limit,
|
|
83
|
-
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
84
|
-
environmentVariables: data.environment_variables,
|
|
85
|
-
errorMessage: data.error_message,
|
|
86
|
-
exitCode: data.exit_code,
|
|
87
|
-
id: data.id,
|
|
88
|
-
jobDefinitionId: data.job_definition_id,
|
|
89
|
-
localStorageCapacity: data.local_storage_capacity,
|
|
90
|
-
memoryLimit: data.memory_limit,
|
|
91
|
-
region: data.region,
|
|
92
|
-
runDuration: data.run_duration,
|
|
93
|
-
startedAt: sdkClient.unmarshalDate(data.started_at),
|
|
94
|
-
state: data.state,
|
|
95
|
-
terminatedAt: sdkClient.unmarshalDate(data.terminated_at),
|
|
96
|
-
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const unmarshalCreateJobDefinitionSecretsResponse = (data) => {
|
|
100
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
101
|
-
throw new TypeError(
|
|
102
|
-
`Unmarshalling the type 'CreateJobDefinitionSecretsResponse' failed as data isn't a dictionary.`
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
secrets: sdkClient.unmarshalArrayOfObject(data.secrets, unmarshalSecret)
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
const unmarshalJobsLimits = (data) => {
|
|
110
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
111
|
-
throw new TypeError(
|
|
112
|
-
`Unmarshalling the type 'JobsLimits' failed as data isn't a dictionary.`
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
secretsPerJobDefinition: data.secrets_per_job_definition
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
const unmarshalListJobDefinitionSecretsResponse = (data) => {
|
|
120
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
121
|
-
throw new TypeError(
|
|
122
|
-
`Unmarshalling the type 'ListJobDefinitionSecretsResponse' failed as data isn't a dictionary.`
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
secrets: sdkClient.unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
127
|
-
totalCount: data.total_count
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
const unmarshalListJobDefinitionsResponse = (data) => {
|
|
131
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
132
|
-
throw new TypeError(
|
|
133
|
-
`Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
jobDefinitions: sdkClient.unmarshalArrayOfObject(
|
|
138
|
-
data.job_definitions,
|
|
139
|
-
unmarshalJobDefinition
|
|
140
|
-
),
|
|
141
|
-
totalCount: data.total_count
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
const unmarshalListJobRunsResponse = (data) => {
|
|
145
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
146
|
-
throw new TypeError(
|
|
147
|
-
`Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
return {
|
|
151
|
-
jobRuns: sdkClient.unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
|
|
152
|
-
totalCount: data.total_count
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
const unmarshalResource = (data) => {
|
|
156
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
157
|
-
throw new TypeError(
|
|
158
|
-
`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
return {
|
|
162
|
-
cpuLimit: data.cpu_limit,
|
|
163
|
-
memoryLimit: data.memory_limit
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
const unmarshalListJobsResourcesResponse = (data) => {
|
|
167
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
168
|
-
throw new TypeError(
|
|
169
|
-
`Unmarshalling the type 'ListJobsResourcesResponse' failed as data isn't a dictionary.`
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
resources: sdkClient.unmarshalArrayOfObject(data.resources, unmarshalResource)
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
const unmarshalStartJobDefinitionResponse = (data) => {
|
|
177
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
178
|
-
throw new TypeError(
|
|
179
|
-
`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
return {
|
|
183
|
-
jobRuns: sdkClient.unmarshalArrayOfObject(data.job_runs, unmarshalJobRun)
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
const marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
187
|
-
schedule: request.schedule,
|
|
188
|
-
timezone: request.timezone
|
|
189
|
-
});
|
|
190
|
-
const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
191
|
-
command: request.command,
|
|
192
|
-
cpu_limit: request.cpuLimit,
|
|
193
|
-
cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(
|
|
194
|
-
request.cronSchedule
|
|
195
|
-
) : void 0,
|
|
196
|
-
description: request.description,
|
|
197
|
-
environment_variables: request.environmentVariables !== void 0 ? request.environmentVariables : void 0,
|
|
198
|
-
image_uri: request.imageUri,
|
|
199
|
-
job_timeout: request.jobTimeout,
|
|
200
|
-
local_storage_capacity: request.localStorageCapacity,
|
|
201
|
-
memory_limit: request.memoryLimit,
|
|
202
|
-
name: request.name || randomName("job"),
|
|
203
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
204
|
-
});
|
|
205
|
-
const marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults) => ({
|
|
206
|
-
secret_manager_id: request.secretManagerId,
|
|
207
|
-
secret_manager_version: request.secretManagerVersion,
|
|
208
|
-
...sdkClient.resolveOneOf([
|
|
209
|
-
{ param: "path", value: request.path },
|
|
210
|
-
{ param: "env_var_name", value: request.envVarName }
|
|
211
|
-
])
|
|
212
|
-
});
|
|
213
|
-
const marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({
|
|
214
|
-
secrets: request.secrets.map(
|
|
215
|
-
(elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt)
|
|
216
|
-
)
|
|
217
|
-
});
|
|
218
|
-
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
219
|
-
command: request.command,
|
|
220
|
-
environment_variables: request.environmentVariables,
|
|
221
|
-
replicas: request.replicas
|
|
222
|
-
});
|
|
223
|
-
const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
224
|
-
schedule: request.schedule,
|
|
225
|
-
timezone: request.timezone
|
|
226
|
-
});
|
|
227
|
-
const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
228
|
-
command: request.command,
|
|
229
|
-
cpu_limit: request.cpuLimit,
|
|
230
|
-
cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(
|
|
231
|
-
request.cronSchedule
|
|
232
|
-
) : void 0,
|
|
233
|
-
description: request.description,
|
|
234
|
-
environment_variables: request.environmentVariables,
|
|
235
|
-
image_uri: request.imageUri,
|
|
236
|
-
job_timeout: request.jobTimeout,
|
|
237
|
-
local_storage_capacity: request.localStorageCapacity,
|
|
238
|
-
memory_limit: request.memoryLimit,
|
|
239
|
-
name: request.name
|
|
240
|
-
});
|
|
241
|
-
const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
|
|
242
|
-
secret_manager_version: request.secretManagerVersion,
|
|
243
|
-
...sdkClient.resolveOneOf([
|
|
244
|
-
{ param: "path", value: request.path },
|
|
245
|
-
{ param: "env_var_name", value: request.envVarName }
|
|
246
|
-
])
|
|
247
|
-
});
|
|
248
|
-
exports.marshalCreateJobDefinitionRequest = marshalCreateJobDefinitionRequest;
|
|
249
|
-
exports.marshalCreateJobDefinitionSecretsRequest = marshalCreateJobDefinitionSecretsRequest;
|
|
250
|
-
exports.marshalStartJobDefinitionRequest = marshalStartJobDefinitionRequest;
|
|
251
|
-
exports.marshalUpdateJobDefinitionRequest = marshalUpdateJobDefinitionRequest;
|
|
252
|
-
exports.marshalUpdateJobDefinitionSecretRequest = marshalUpdateJobDefinitionSecretRequest;
|
|
253
|
-
exports.unmarshalCreateJobDefinitionSecretsResponse = unmarshalCreateJobDefinitionSecretsResponse;
|
|
254
|
-
exports.unmarshalJobDefinition = unmarshalJobDefinition;
|
|
255
|
-
exports.unmarshalJobRun = unmarshalJobRun;
|
|
256
|
-
exports.unmarshalJobsLimits = unmarshalJobsLimits;
|
|
257
|
-
exports.unmarshalListJobDefinitionSecretsResponse = unmarshalListJobDefinitionSecretsResponse;
|
|
258
|
-
exports.unmarshalListJobDefinitionsResponse = unmarshalListJobDefinitionsResponse;
|
|
259
|
-
exports.unmarshalListJobRunsResponse = unmarshalListJobRunsResponse;
|
|
260
|
-
exports.unmarshalListJobsResourcesResponse = unmarshalListJobsResourcesResponse;
|
|
261
|
-
exports.unmarshalSecret = unmarshalSecret;
|
|
262
|
-
exports.unmarshalStartJobDefinitionResponse = unmarshalStartJobDefinitionResponse;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const CreateJobDefinitionRequest = {
|
|
4
|
-
cpuLimit: {
|
|
5
|
-
greaterThan: 0
|
|
6
|
-
},
|
|
7
|
-
description: {
|
|
8
|
-
maxLength: 255
|
|
9
|
-
},
|
|
10
|
-
imageUri: {
|
|
11
|
-
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,}))?$/
|
|
12
|
-
},
|
|
13
|
-
localStorageCapacity: {
|
|
14
|
-
greaterThan: 0
|
|
15
|
-
},
|
|
16
|
-
memoryLimit: {
|
|
17
|
-
greaterThan: 0
|
|
18
|
-
},
|
|
19
|
-
name: {
|
|
20
|
-
pattern: /^[A-Za-z0-9-_]{3,50}$/
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const CreateJobDefinitionRequestCronScheduleConfig = {
|
|
24
|
-
schedule: {
|
|
25
|
-
maxLength: 255,
|
|
26
|
-
minLength: 1
|
|
27
|
-
},
|
|
28
|
-
timezone: {
|
|
29
|
-
maxLength: 255,
|
|
30
|
-
minLength: 1
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const CreateJobDefinitionSecretsRequestSecretConfig = {
|
|
34
|
-
secretManagerVersion: {
|
|
35
|
-
minLength: 1
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const CronSchedule = {
|
|
39
|
-
schedule: {
|
|
40
|
-
maxLength: 255,
|
|
41
|
-
minLength: 1
|
|
42
|
-
},
|
|
43
|
-
timezone: {
|
|
44
|
-
maxLength: 255,
|
|
45
|
-
minLength: 1
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const ListJobDefinitionsRequest = {
|
|
49
|
-
page: {
|
|
50
|
-
greaterThanOrEqual: 1
|
|
51
|
-
},
|
|
52
|
-
pageSize: {
|
|
53
|
-
greaterThanOrEqual: 1,
|
|
54
|
-
lessThanOrEqual: 1e3
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const ListJobRunsRequest = {
|
|
58
|
-
page: {
|
|
59
|
-
greaterThanOrEqual: 1
|
|
60
|
-
},
|
|
61
|
-
pageSize: {
|
|
62
|
-
greaterThanOrEqual: 1,
|
|
63
|
-
lessThanOrEqual: 1e3
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const StartJobDefinitionRequest = {
|
|
67
|
-
replicas: {
|
|
68
|
-
greaterThan: 0
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const UpdateJobDefinitionRequest = {
|
|
72
|
-
cpuLimit: {
|
|
73
|
-
greaterThan: 0
|
|
74
|
-
},
|
|
75
|
-
description: {
|
|
76
|
-
maxLength: 255
|
|
77
|
-
},
|
|
78
|
-
imageUri: {
|
|
79
|
-
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,}))?$/
|
|
80
|
-
},
|
|
81
|
-
localStorageCapacity: {
|
|
82
|
-
greaterThan: 0
|
|
83
|
-
},
|
|
84
|
-
memoryLimit: {
|
|
85
|
-
greaterThan: 0
|
|
86
|
-
},
|
|
87
|
-
name: {
|
|
88
|
-
pattern: /^[A-Za-z0-9-_]{3,50}$/
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const UpdateJobDefinitionRequestCronScheduleConfig = {
|
|
92
|
-
schedule: {
|
|
93
|
-
maxLength: 255,
|
|
94
|
-
minLength: 1
|
|
95
|
-
},
|
|
96
|
-
timezone: {
|
|
97
|
-
maxLength: 255,
|
|
98
|
-
minLength: 1
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
const UpdateJobDefinitionSecretRequest = {
|
|
102
|
-
secretManagerVersion: {
|
|
103
|
-
minLength: 1
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
exports.CreateJobDefinitionRequest = CreateJobDefinitionRequest;
|
|
107
|
-
exports.CreateJobDefinitionRequestCronScheduleConfig = CreateJobDefinitionRequestCronScheduleConfig;
|
|
108
|
-
exports.CreateJobDefinitionSecretsRequestSecretConfig = CreateJobDefinitionSecretsRequestSecretConfig;
|
|
109
|
-
exports.CronSchedule = CronSchedule;
|
|
110
|
-
exports.ListJobDefinitionsRequest = ListJobDefinitionsRequest;
|
|
111
|
-
exports.ListJobRunsRequest = ListJobRunsRequest;
|
|
112
|
-
exports.StartJobDefinitionRequest = StartJobDefinitionRequest;
|
|
113
|
-
exports.UpdateJobDefinitionRequest = UpdateJobDefinitionRequest;
|
|
114
|
-
exports.UpdateJobDefinitionRequestCronScheduleConfig = UpdateJobDefinitionRequestCronScheduleConfig;
|
|
115
|
-
exports.UpdateJobDefinitionSecretRequest = UpdateJobDefinitionSecretRequest;
|