@scaleway/sdk 2.52.1 → 2.53.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/api/applesilicon/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +2 -0
- package/dist/api/container/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/container/v1beta1/marshalling.gen.cjs +66 -6
- package/dist/api/container/v1beta1/marshalling.gen.js +67 -7
- package/dist/api/container/v1beta1/types.gen.d.ts +59 -2
- package/dist/api/container/v1beta1/validation-rules.gen.cjs +14 -0
- package/dist/api/container/v1beta1/validation-rules.gen.d.ts +12 -0
- package/dist/api/container/v1beta1/validation-rules.gen.js +14 -0
- package/dist/api/function/v1beta1/marshalling.gen.cjs +10 -4
- package/dist/api/function/v1beta1/marshalling.gen.js +11 -5
- package/dist/api/function/v1beta1/types.gen.d.ts +12 -0
- package/dist/api/iam/v1alpha1/api.gen.cjs +37 -0
- package/dist/api/iam/v1alpha1/api.gen.d.ts +22 -1
- package/dist/api/iam/v1alpha1/api.gen.js +37 -0
- package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/types.gen.d.ts +12 -0
- package/dist/api/inference/v1beta1/types.gen.d.ts +3 -3
- package/dist/api/instance/v1/api.gen.cjs +2 -2
- package/dist/api/instance/v1/api.gen.d.ts +2 -2
- package/dist/api/instance/v1/api.gen.js +2 -2
- package/dist/api/instance/v1/types.gen.d.ts +2 -2
- package/dist/api/iot/v1/api.gen.cjs +4 -3
- package/dist/api/iot/v1/api.gen.d.ts +4 -3
- package/dist/api/iot/v1/api.gen.js +4 -3
- package/dist/api/iot/v1/types.gen.d.ts +6 -6
- package/dist/api/k8s/v1/api.gen.cjs +64 -0
- package/dist/api/k8s/v1/api.gen.d.ts +32 -1
- package/dist/api/k8s/v1/api.gen.js +65 -1
- package/dist/api/k8s/v1/index.gen.d.ts +1 -1
- package/dist/api/k8s/v1/marshalling.gen.cjs +62 -0
- package/dist/api/k8s/v1/marshalling.gen.d.ts +6 -1
- package/dist/api/k8s/v1/marshalling.gen.js +62 -0
- package/dist/api/k8s/v1/types.gen.d.ts +92 -0
- package/dist/api/k8s/v1/validation-rules.gen.cjs +6 -0
- package/dist/api/k8s/v1/validation-rules.gen.d.ts +5 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +6 -0
- package/dist/api/lb/v1/types.gen.d.ts +15 -10
- package/dist/api/mongodb/v1alpha1/api.gen.cjs +19 -0
- package/dist/api/mongodb/v1alpha1/api.gen.d.ts +10 -1
- package/dist/api/mongodb/v1alpha1/api.gen.js +20 -1
- package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +5 -0
- package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +2 -1
- package/dist/api/mongodb/v1alpha1/marshalling.gen.js +5 -0
- package/dist/api/mongodb/v1alpha1/types.gen.d.ts +13 -0
- package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +12 -0
- package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +11 -0
- package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +12 -0
- package/dist/api/rdb/v1/marshalling.gen.cjs +2 -1
- package/dist/api/rdb/v1/marshalling.gen.js +2 -1
- package/dist/api/rdb/v1/types.gen.d.ts +22 -13
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -80,6 +80,8 @@ export interface Server {
|
|
|
80
80
|
sshUsername: string;
|
|
81
81
|
/** Admin password required to execute commands. */
|
|
82
82
|
sudoPassword: string;
|
|
83
|
+
/** VNC port to use for remote desktop connection. */
|
|
84
|
+
vncPort: number;
|
|
83
85
|
/**
|
|
84
86
|
* Initially installed OS, this does not necessarily reflect the current OS
|
|
85
87
|
* version.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { Container, ContainerHttpOption, ContainerPrivacy, ContainerProtocol, ContainerSandbox, ContainerScalingOption, ContainerStatus, CreateContainerRequest, CreateCronRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, CreateTriggerRequestSqsClientConfig, Cron, CronStatus, DeleteContainerRequest, DeleteCronRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTokenRequest, DeleteTriggerRequest, DeployContainerRequest, Domain, DomainStatus, GetContainerRequest, GetCronRequest, GetDomainRequest, GetNamespaceRequest, GetTokenRequest, GetTriggerRequest, ListContainersRequest, ListContainersRequestOrderBy, ListContainersResponse, ListCronsRequest, ListCronsRequestOrderBy, ListCronsResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTokensRequest, ListTokensRequestOrderBy, ListTokensResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Namespace, NamespaceStatus, Secret, SecretHashedValue, Token, TokenStatus, Trigger, TriggerInputType, TriggerMnqNatsClientConfig, TriggerMnqSqsClientConfig, TriggerSqsClientConfig, TriggerStatus, UpdateContainerRequest, UpdateCronRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UpdateTriggerRequestSqsClientConfig, } from './types.gen';
|
|
3
|
+
export type { Container, ContainerHealthCheckSpec, ContainerHealthCheckSpecHTTPProbe, ContainerHealthCheckSpecTCPProbe, ContainerHttpOption, ContainerPrivacy, ContainerProtocol, ContainerSandbox, ContainerScalingOption, ContainerStatus, CreateContainerRequest, CreateCronRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, CreateTriggerRequestSqsClientConfig, Cron, CronStatus, DeleteContainerRequest, DeleteCronRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTokenRequest, DeleteTriggerRequest, DeployContainerRequest, Domain, DomainStatus, GetContainerRequest, GetCronRequest, GetDomainRequest, GetNamespaceRequest, GetTokenRequest, GetTriggerRequest, ListContainersRequest, ListContainersRequestOrderBy, ListContainersResponse, ListCronsRequest, ListCronsRequestOrderBy, ListCronsResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTokensRequest, ListTokensRequestOrderBy, ListTokensResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Namespace, NamespaceStatus, Secret, SecretHashedValue, Token, TokenStatus, Trigger, TriggerInputType, TriggerMnqNatsClientConfig, TriggerMnqSqsClientConfig, TriggerSqsClientConfig, TriggerStatus, UpdateContainerRequest, UpdateCronRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UpdateTriggerRequestSqsClientConfig, } from './types.gen';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -4,6 +4,37 @@ const randomName = require("@scaleway/random-name");
|
|
|
4
4
|
const json = require("../../../helpers/json.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
6
|
require("../../../vendor/base64/index.cjs");
|
|
7
|
+
const unmarshalContainerHealthCheckSpecHTTPProbe = (data) => {
|
|
8
|
+
if (!json.isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(
|
|
10
|
+
`Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
path: data.path
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const unmarshalContainerHealthCheckSpecTCPProbe = (data) => {
|
|
18
|
+
if (!json.isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(
|
|
20
|
+
`Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return {};
|
|
24
|
+
};
|
|
25
|
+
const unmarshalContainerHealthCheckSpec = (data) => {
|
|
26
|
+
if (!json.isJSONObject(data)) {
|
|
27
|
+
throw new TypeError(
|
|
28
|
+
`Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
failureThreshold: data.failure_threshold,
|
|
33
|
+
http: data.http ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) : void 0,
|
|
34
|
+
interval: data.interval,
|
|
35
|
+
tcp: data.tcp ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) : void 0
|
|
36
|
+
};
|
|
37
|
+
};
|
|
7
38
|
const unmarshalContainerScalingOption = (data) => {
|
|
8
39
|
if (!json.isJSONObject(data)) {
|
|
9
40
|
throw new TypeError(
|
|
@@ -11,7 +42,8 @@ const unmarshalContainerScalingOption = (data) => {
|
|
|
11
42
|
);
|
|
12
43
|
}
|
|
13
44
|
return {
|
|
14
|
-
concurrentRequestsThreshold: data.concurrent_requests_threshold
|
|
45
|
+
concurrentRequestsThreshold: data.concurrent_requests_threshold,
|
|
46
|
+
cpuUsageThreshold: data.cpu_usage_threshold
|
|
15
47
|
};
|
|
16
48
|
};
|
|
17
49
|
const unmarshalSecretHashedValue = (data) => {
|
|
@@ -33,10 +65,12 @@ const unmarshalContainer = (data) => {
|
|
|
33
65
|
}
|
|
34
66
|
return {
|
|
35
67
|
cpuLimit: data.cpu_limit,
|
|
68
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
36
69
|
description: data.description,
|
|
37
70
|
domainName: data.domain_name,
|
|
38
71
|
environmentVariables: data.environment_variables,
|
|
39
72
|
errorMessage: data.error_message,
|
|
73
|
+
healthCheck: data.health_check ? unmarshalContainerHealthCheckSpec(data.health_check) : void 0,
|
|
40
74
|
httpOption: data.http_option,
|
|
41
75
|
id: data.id,
|
|
42
76
|
localStorageLimit: data.local_storage_limit,
|
|
@@ -49,6 +83,7 @@ const unmarshalContainer = (data) => {
|
|
|
49
83
|
port: data.port,
|
|
50
84
|
privacy: data.privacy,
|
|
51
85
|
protocol: data.protocol,
|
|
86
|
+
readyAt: marshalling.unmarshalDate(data.ready_at),
|
|
52
87
|
region: data.region,
|
|
53
88
|
registryImage: data.registry_image,
|
|
54
89
|
sandbox: data.sandbox,
|
|
@@ -58,7 +93,8 @@ const unmarshalContainer = (data) => {
|
|
|
58
93
|
unmarshalSecretHashedValue
|
|
59
94
|
),
|
|
60
95
|
status: data.status,
|
|
61
|
-
timeout: data.timeout
|
|
96
|
+
timeout: data.timeout,
|
|
97
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
62
98
|
};
|
|
63
99
|
};
|
|
64
100
|
const unmarshalCron = (data) => {
|
|
@@ -112,7 +148,8 @@ const unmarshalNamespace = (data) => {
|
|
|
112
148
|
data.secret_environment_variables,
|
|
113
149
|
unmarshalSecretHashedValue
|
|
114
150
|
),
|
|
115
|
-
status: data.status
|
|
151
|
+
status: data.status,
|
|
152
|
+
tags: data.tags
|
|
116
153
|
};
|
|
117
154
|
};
|
|
118
155
|
const unmarshalToken = (data) => {
|
|
@@ -257,12 +294,31 @@ const unmarshalListTriggersResponse = (data) => {
|
|
|
257
294
|
triggers: marshalling.unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
258
295
|
};
|
|
259
296
|
};
|
|
297
|
+
const marshalContainerHealthCheckSpecHTTPProbe = (request, defaults) => ({
|
|
298
|
+
path: request.path
|
|
299
|
+
});
|
|
300
|
+
const marshalContainerHealthCheckSpecTCPProbe = (request, defaults) => ({});
|
|
301
|
+
const marshalContainerHealthCheckSpec = (request, defaults) => ({
|
|
302
|
+
failure_threshold: request.failureThreshold,
|
|
303
|
+
interval: request.interval,
|
|
304
|
+
...marshalling.resolveOneOf([
|
|
305
|
+
{
|
|
306
|
+
param: "http",
|
|
307
|
+
value: request.http !== void 0 ? marshalContainerHealthCheckSpecHTTPProbe(request.http) : void 0
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
param: "tcp",
|
|
311
|
+
value: request.tcp !== void 0 ? marshalContainerHealthCheckSpecTCPProbe(request.tcp) : void 0
|
|
312
|
+
}
|
|
313
|
+
])
|
|
314
|
+
});
|
|
260
315
|
const marshalContainerScalingOption = (request, defaults) => ({
|
|
261
316
|
...marshalling.resolveOneOf([
|
|
262
317
|
{
|
|
263
318
|
param: "concurrent_requests_threshold",
|
|
264
319
|
value: request.concurrentRequestsThreshold
|
|
265
|
-
}
|
|
320
|
+
},
|
|
321
|
+
{ param: "cpu_usage_threshold", value: request.cpuUsageThreshold }
|
|
266
322
|
])
|
|
267
323
|
});
|
|
268
324
|
const marshalSecret = (request, defaults) => ({
|
|
@@ -273,6 +329,7 @@ const marshalCreateContainerRequest = (request, defaults) => ({
|
|
|
273
329
|
cpu_limit: request.cpuLimit,
|
|
274
330
|
description: request.description,
|
|
275
331
|
environment_variables: request.environmentVariables,
|
|
332
|
+
health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
|
|
276
333
|
http_option: request.httpOption,
|
|
277
334
|
local_storage_limit: request.localStorageLimit,
|
|
278
335
|
max_concurrency: request.maxConcurrency,
|
|
@@ -309,7 +366,8 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
|
309
366
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
310
367
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
311
368
|
(elt) => marshalSecret(elt)
|
|
312
|
-
) : void 0
|
|
369
|
+
) : void 0,
|
|
370
|
+
tags: request.tags
|
|
313
371
|
});
|
|
314
372
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
315
373
|
description: request.description,
|
|
@@ -365,6 +423,7 @@ const marshalUpdateContainerRequest = (request, defaults) => ({
|
|
|
365
423
|
cpu_limit: request.cpuLimit,
|
|
366
424
|
description: request.description,
|
|
367
425
|
environment_variables: request.environmentVariables,
|
|
426
|
+
health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
|
|
368
427
|
http_option: request.httpOption,
|
|
369
428
|
local_storage_limit: request.localStorageLimit,
|
|
370
429
|
max_concurrency: request.maxConcurrency,
|
|
@@ -394,7 +453,8 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
|
394
453
|
environment_variables: request.environmentVariables,
|
|
395
454
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
396
455
|
(elt) => marshalSecret(elt)
|
|
397
|
-
) : void 0
|
|
456
|
+
) : void 0,
|
|
457
|
+
tags: request.tags
|
|
398
458
|
});
|
|
399
459
|
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
400
460
|
access_key: request.accessKey,
|
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
|
-
import {
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
|
+
const unmarshalContainerHealthCheckSpecHTTPProbe = (data) => {
|
|
6
|
+
if (!isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
path: data.path
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalContainerHealthCheckSpecTCPProbe = (data) => {
|
|
16
|
+
if (!isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
`Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
};
|
|
23
|
+
const unmarshalContainerHealthCheckSpec = (data) => {
|
|
24
|
+
if (!isJSONObject(data)) {
|
|
25
|
+
throw new TypeError(
|
|
26
|
+
`Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
failureThreshold: data.failure_threshold,
|
|
31
|
+
http: data.http ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) : void 0,
|
|
32
|
+
interval: data.interval,
|
|
33
|
+
tcp: data.tcp ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) : void 0
|
|
34
|
+
};
|
|
35
|
+
};
|
|
5
36
|
const unmarshalContainerScalingOption = (data) => {
|
|
6
37
|
if (!isJSONObject(data)) {
|
|
7
38
|
throw new TypeError(
|
|
@@ -9,7 +40,8 @@ const unmarshalContainerScalingOption = (data) => {
|
|
|
9
40
|
);
|
|
10
41
|
}
|
|
11
42
|
return {
|
|
12
|
-
concurrentRequestsThreshold: data.concurrent_requests_threshold
|
|
43
|
+
concurrentRequestsThreshold: data.concurrent_requests_threshold,
|
|
44
|
+
cpuUsageThreshold: data.cpu_usage_threshold
|
|
13
45
|
};
|
|
14
46
|
};
|
|
15
47
|
const unmarshalSecretHashedValue = (data) => {
|
|
@@ -31,10 +63,12 @@ const unmarshalContainer = (data) => {
|
|
|
31
63
|
}
|
|
32
64
|
return {
|
|
33
65
|
cpuLimit: data.cpu_limit,
|
|
66
|
+
createdAt: unmarshalDate(data.created_at),
|
|
34
67
|
description: data.description,
|
|
35
68
|
domainName: data.domain_name,
|
|
36
69
|
environmentVariables: data.environment_variables,
|
|
37
70
|
errorMessage: data.error_message,
|
|
71
|
+
healthCheck: data.health_check ? unmarshalContainerHealthCheckSpec(data.health_check) : void 0,
|
|
38
72
|
httpOption: data.http_option,
|
|
39
73
|
id: data.id,
|
|
40
74
|
localStorageLimit: data.local_storage_limit,
|
|
@@ -47,6 +81,7 @@ const unmarshalContainer = (data) => {
|
|
|
47
81
|
port: data.port,
|
|
48
82
|
privacy: data.privacy,
|
|
49
83
|
protocol: data.protocol,
|
|
84
|
+
readyAt: unmarshalDate(data.ready_at),
|
|
50
85
|
region: data.region,
|
|
51
86
|
registryImage: data.registry_image,
|
|
52
87
|
sandbox: data.sandbox,
|
|
@@ -56,7 +91,8 @@ const unmarshalContainer = (data) => {
|
|
|
56
91
|
unmarshalSecretHashedValue
|
|
57
92
|
),
|
|
58
93
|
status: data.status,
|
|
59
|
-
timeout: data.timeout
|
|
94
|
+
timeout: data.timeout,
|
|
95
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
60
96
|
};
|
|
61
97
|
};
|
|
62
98
|
const unmarshalCron = (data) => {
|
|
@@ -110,7 +146,8 @@ const unmarshalNamespace = (data) => {
|
|
|
110
146
|
data.secret_environment_variables,
|
|
111
147
|
unmarshalSecretHashedValue
|
|
112
148
|
),
|
|
113
|
-
status: data.status
|
|
149
|
+
status: data.status,
|
|
150
|
+
tags: data.tags
|
|
114
151
|
};
|
|
115
152
|
};
|
|
116
153
|
const unmarshalToken = (data) => {
|
|
@@ -255,12 +292,31 @@ const unmarshalListTriggersResponse = (data) => {
|
|
|
255
292
|
triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
256
293
|
};
|
|
257
294
|
};
|
|
295
|
+
const marshalContainerHealthCheckSpecHTTPProbe = (request, defaults) => ({
|
|
296
|
+
path: request.path
|
|
297
|
+
});
|
|
298
|
+
const marshalContainerHealthCheckSpecTCPProbe = (request, defaults) => ({});
|
|
299
|
+
const marshalContainerHealthCheckSpec = (request, defaults) => ({
|
|
300
|
+
failure_threshold: request.failureThreshold,
|
|
301
|
+
interval: request.interval,
|
|
302
|
+
...resolveOneOf([
|
|
303
|
+
{
|
|
304
|
+
param: "http",
|
|
305
|
+
value: request.http !== void 0 ? marshalContainerHealthCheckSpecHTTPProbe(request.http) : void 0
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
param: "tcp",
|
|
309
|
+
value: request.tcp !== void 0 ? marshalContainerHealthCheckSpecTCPProbe(request.tcp) : void 0
|
|
310
|
+
}
|
|
311
|
+
])
|
|
312
|
+
});
|
|
258
313
|
const marshalContainerScalingOption = (request, defaults) => ({
|
|
259
314
|
...resolveOneOf([
|
|
260
315
|
{
|
|
261
316
|
param: "concurrent_requests_threshold",
|
|
262
317
|
value: request.concurrentRequestsThreshold
|
|
263
|
-
}
|
|
318
|
+
},
|
|
319
|
+
{ param: "cpu_usage_threshold", value: request.cpuUsageThreshold }
|
|
264
320
|
])
|
|
265
321
|
});
|
|
266
322
|
const marshalSecret = (request, defaults) => ({
|
|
@@ -271,6 +327,7 @@ const marshalCreateContainerRequest = (request, defaults) => ({
|
|
|
271
327
|
cpu_limit: request.cpuLimit,
|
|
272
328
|
description: request.description,
|
|
273
329
|
environment_variables: request.environmentVariables,
|
|
330
|
+
health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
|
|
274
331
|
http_option: request.httpOption,
|
|
275
332
|
local_storage_limit: request.localStorageLimit,
|
|
276
333
|
max_concurrency: request.maxConcurrency,
|
|
@@ -307,7 +364,8 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
|
307
364
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
308
365
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
309
366
|
(elt) => marshalSecret(elt)
|
|
310
|
-
) : void 0
|
|
367
|
+
) : void 0,
|
|
368
|
+
tags: request.tags
|
|
311
369
|
});
|
|
312
370
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
313
371
|
description: request.description,
|
|
@@ -363,6 +421,7 @@ const marshalUpdateContainerRequest = (request, defaults) => ({
|
|
|
363
421
|
cpu_limit: request.cpuLimit,
|
|
364
422
|
description: request.description,
|
|
365
423
|
environment_variables: request.environmentVariables,
|
|
424
|
+
health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
|
|
366
425
|
http_option: request.httpOption,
|
|
367
426
|
local_storage_limit: request.localStorageLimit,
|
|
368
427
|
max_concurrency: request.maxConcurrency,
|
|
@@ -392,7 +451,8 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
|
392
451
|
environment_variables: request.environmentVariables,
|
|
393
452
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
394
453
|
(elt) => marshalSecret(elt)
|
|
395
|
-
) : void 0
|
|
454
|
+
) : void 0,
|
|
455
|
+
tags: request.tags
|
|
396
456
|
});
|
|
397
457
|
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
398
458
|
access_key: request.accessKey,
|
|
@@ -16,12 +16,45 @@ export type NamespaceStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'lock
|
|
|
16
16
|
export type TokenStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'creating';
|
|
17
17
|
export type TriggerInputType = 'unknown_input_type' | 'sqs' | 'scw_sqs' | 'nats' | 'scw_nats';
|
|
18
18
|
export type TriggerStatus = 'unknown_status' | 'ready' | 'deleting' | 'error' | 'creating' | 'pending';
|
|
19
|
+
export interface ContainerHealthCheckSpecHTTPProbe {
|
|
20
|
+
/** Path to use for the HTTP health check. */
|
|
21
|
+
path: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ContainerHealthCheckSpecTCPProbe {
|
|
24
|
+
}
|
|
25
|
+
export interface ContainerHealthCheckSpec {
|
|
26
|
+
/**
|
|
27
|
+
* HTTP health check configuration.
|
|
28
|
+
*
|
|
29
|
+
* One-of ('probe'): at most one of 'http', 'tcp' could be set.
|
|
30
|
+
*/
|
|
31
|
+
http?: ContainerHealthCheckSpecHTTPProbe;
|
|
32
|
+
/**
|
|
33
|
+
* TCP health check configuration.
|
|
34
|
+
*
|
|
35
|
+
* One-of ('probe'): at most one of 'http', 'tcp' could be set.
|
|
36
|
+
*/
|
|
37
|
+
tcp?: ContainerHealthCheckSpecTCPProbe;
|
|
38
|
+
/**
|
|
39
|
+
* During a deployment, if a newly created container fails to pass the health
|
|
40
|
+
* check, the deployment is aborted. As a result, lowering this value can help
|
|
41
|
+
* to reduce the time it takes to detect a failed deployment.
|
|
42
|
+
*/
|
|
43
|
+
failureThreshold: number;
|
|
44
|
+
/** Period between health checks. */
|
|
45
|
+
interval?: string;
|
|
46
|
+
}
|
|
19
47
|
export interface ContainerScalingOption {
|
|
20
48
|
/**
|
|
21
|
-
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold'
|
|
22
|
-
* be set.
|
|
49
|
+
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold',
|
|
50
|
+
* 'cpuUsageThreshold' could be set.
|
|
23
51
|
*/
|
|
24
52
|
concurrentRequestsThreshold?: number;
|
|
53
|
+
/**
|
|
54
|
+
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold',
|
|
55
|
+
* 'cpuUsageThreshold' could be set.
|
|
56
|
+
*/
|
|
57
|
+
cpuUsageThreshold?: number;
|
|
25
58
|
}
|
|
26
59
|
export interface SecretHashedValue {
|
|
27
60
|
key: string;
|
|
@@ -148,8 +181,18 @@ export interface Container {
|
|
|
148
181
|
*
|
|
149
182
|
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
|
|
150
183
|
* requests being processed per container instance.
|
|
184
|
+
* - Cpu_usage_threshold: Scale depending on the CPU usage of a container
|
|
185
|
+
* instance.
|
|
151
186
|
*/
|
|
152
187
|
scalingOption?: ContainerScalingOption;
|
|
188
|
+
/** Health check configuration of the container. */
|
|
189
|
+
healthCheck?: ContainerHealthCheckSpec;
|
|
190
|
+
/** Creation date of the container. */
|
|
191
|
+
createdAt?: Date;
|
|
192
|
+
/** Last update date of the container. */
|
|
193
|
+
updatedAt?: Date;
|
|
194
|
+
/** Last date when the container was successfully deployed and set to ready. */
|
|
195
|
+
readyAt?: Date;
|
|
153
196
|
/** Region in which the container will be deployed. */
|
|
154
197
|
region: Region;
|
|
155
198
|
}
|
|
@@ -206,6 +249,8 @@ export interface Namespace {
|
|
|
206
249
|
secretEnvironmentVariables: SecretHashedValue[];
|
|
207
250
|
/** Region in which the namespace will be created. */
|
|
208
251
|
region: Region;
|
|
252
|
+
/** [ALPHA] List of tags applied to the Serverless Container Namespace. */
|
|
253
|
+
tags: string[];
|
|
209
254
|
}
|
|
210
255
|
export interface Token {
|
|
211
256
|
/** UUID of the token. */
|
|
@@ -330,8 +375,12 @@ export type CreateContainerRequest = {
|
|
|
330
375
|
*
|
|
331
376
|
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
|
|
332
377
|
* requests being processed per container instance.
|
|
378
|
+
* - Cpu_usage_threshold: Scale depending on the CPU usage of a container
|
|
379
|
+
* instance.
|
|
333
380
|
*/
|
|
334
381
|
scalingOption?: ContainerScalingOption;
|
|
382
|
+
/** Health check configuration of the container. */
|
|
383
|
+
healthCheck?: ContainerHealthCheckSpec;
|
|
335
384
|
};
|
|
336
385
|
export type CreateCronRequest = {
|
|
337
386
|
/**
|
|
@@ -375,6 +424,8 @@ export type CreateNamespaceRequest = {
|
|
|
375
424
|
description?: string;
|
|
376
425
|
/** Secret environment variables of the namespace to create. */
|
|
377
426
|
secretEnvironmentVariables?: Secret[];
|
|
427
|
+
/** [ALPHA] Tags of the Serverless Container Namespace. */
|
|
428
|
+
tags?: string[];
|
|
378
429
|
};
|
|
379
430
|
export type CreateTokenRequest = {
|
|
380
431
|
/**
|
|
@@ -758,8 +809,12 @@ export type UpdateContainerRequest = {
|
|
|
758
809
|
*
|
|
759
810
|
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
|
|
760
811
|
* requests being processed per container instance.
|
|
812
|
+
* - Cpu_usage_threshold: Scale depending on the CPU usage of a container
|
|
813
|
+
* instance.
|
|
761
814
|
*/
|
|
762
815
|
scalingOption?: ContainerScalingOption;
|
|
816
|
+
/** Health check configuration of the container. */
|
|
817
|
+
healthCheck?: ContainerHealthCheckSpec;
|
|
763
818
|
};
|
|
764
819
|
export type UpdateCronRequest = {
|
|
765
820
|
/**
|
|
@@ -792,6 +847,8 @@ export type UpdateNamespaceRequest = {
|
|
|
792
847
|
description?: string;
|
|
793
848
|
/** Secret environment variables of the namespace to update. */
|
|
794
849
|
secretEnvironmentVariables?: Secret[];
|
|
850
|
+
/** [ALPHA] Tags of the Serverless Container Namespace. */
|
|
851
|
+
tags?: string[];
|
|
795
852
|
};
|
|
796
853
|
export type UpdateTriggerRequest = {
|
|
797
854
|
/**
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ContainerHealthCheckSpec = {
|
|
4
|
+
failureThreshold: {
|
|
5
|
+
greaterThanOrEqual: 3,
|
|
6
|
+
lessThanOrEqual: 50
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const ContainerHealthCheckSpecHTTPProbe = {
|
|
10
|
+
path: {
|
|
11
|
+
maxLength: 100,
|
|
12
|
+
minLength: 1
|
|
13
|
+
}
|
|
14
|
+
};
|
|
3
15
|
const ContainerScalingOption = {};
|
|
4
16
|
const CreateTriggerRequest = {
|
|
5
17
|
description: {
|
|
@@ -40,6 +52,8 @@ const UpdateTriggerRequest = {
|
|
|
40
52
|
minLength: 1
|
|
41
53
|
}
|
|
42
54
|
};
|
|
55
|
+
exports.ContainerHealthCheckSpec = ContainerHealthCheckSpec;
|
|
56
|
+
exports.ContainerHealthCheckSpecHTTPProbe = ContainerHealthCheckSpecHTTPProbe;
|
|
43
57
|
exports.ContainerScalingOption = ContainerScalingOption;
|
|
44
58
|
exports.CreateTriggerRequest = CreateTriggerRequest;
|
|
45
59
|
exports.CreateTriggerRequestMnqNatsClientConfig = CreateTriggerRequestMnqNatsClientConfig;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
export declare const ContainerHealthCheckSpec: {
|
|
2
|
+
failureThreshold: {
|
|
3
|
+
greaterThanOrEqual: number;
|
|
4
|
+
lessThanOrEqual: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const ContainerHealthCheckSpecHTTPProbe: {
|
|
8
|
+
path: {
|
|
9
|
+
maxLength: number;
|
|
10
|
+
minLength: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
1
13
|
export declare const ContainerScalingOption: {};
|
|
2
14
|
export declare const CreateTriggerRequest: {
|
|
3
15
|
description: {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
const ContainerHealthCheckSpec = {
|
|
2
|
+
failureThreshold: {
|
|
3
|
+
greaterThanOrEqual: 3,
|
|
4
|
+
lessThanOrEqual: 50
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
const ContainerHealthCheckSpecHTTPProbe = {
|
|
8
|
+
path: {
|
|
9
|
+
maxLength: 100,
|
|
10
|
+
minLength: 1
|
|
11
|
+
}
|
|
12
|
+
};
|
|
1
13
|
const ContainerScalingOption = {};
|
|
2
14
|
const CreateTriggerRequest = {
|
|
3
15
|
description: {
|
|
@@ -39,6 +51,8 @@ const UpdateTriggerRequest = {
|
|
|
39
51
|
}
|
|
40
52
|
};
|
|
41
53
|
export {
|
|
54
|
+
ContainerHealthCheckSpec,
|
|
55
|
+
ContainerHealthCheckSpecHTTPProbe,
|
|
42
56
|
ContainerScalingOption,
|
|
43
57
|
CreateTriggerRequest,
|
|
44
58
|
CreateTriggerRequestMnqNatsClientConfig,
|
|
@@ -54,6 +54,7 @@ const unmarshalFunction = (data) => {
|
|
|
54
54
|
return {
|
|
55
55
|
buildMessage: data.build_message,
|
|
56
56
|
cpuLimit: data.cpu_limit,
|
|
57
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
57
58
|
description: data.description,
|
|
58
59
|
domainName: data.domain_name,
|
|
59
60
|
environmentVariables: data.environment_variables,
|
|
@@ -67,6 +68,7 @@ const unmarshalFunction = (data) => {
|
|
|
67
68
|
name: data.name,
|
|
68
69
|
namespaceId: data.namespace_id,
|
|
69
70
|
privacy: data.privacy,
|
|
71
|
+
readyAt: marshalling.unmarshalDate(data.ready_at),
|
|
70
72
|
region: data.region,
|
|
71
73
|
runtime: data.runtime,
|
|
72
74
|
runtimeMessage: data.runtime_message,
|
|
@@ -76,7 +78,8 @@ const unmarshalFunction = (data) => {
|
|
|
76
78
|
unmarshalSecretHashedValue
|
|
77
79
|
),
|
|
78
80
|
status: data.status,
|
|
79
|
-
timeout: data.timeout
|
|
81
|
+
timeout: data.timeout,
|
|
82
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
80
83
|
};
|
|
81
84
|
};
|
|
82
85
|
const unmarshalNamespace = (data) => {
|
|
@@ -100,7 +103,8 @@ const unmarshalNamespace = (data) => {
|
|
|
100
103
|
data.secret_environment_variables,
|
|
101
104
|
unmarshalSecretHashedValue
|
|
102
105
|
),
|
|
103
|
-
status: data.status
|
|
106
|
+
status: data.status,
|
|
107
|
+
tags: data.tags
|
|
104
108
|
};
|
|
105
109
|
};
|
|
106
110
|
const unmarshalToken = (data) => {
|
|
@@ -336,7 +340,8 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
|
336
340
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
337
341
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
338
342
|
(elt) => marshalSecret(elt)
|
|
339
|
-
) : void 0
|
|
343
|
+
) : void 0,
|
|
344
|
+
tags: request.tags
|
|
340
345
|
});
|
|
341
346
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
342
347
|
description: request.description,
|
|
@@ -416,7 +421,8 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
|
416
421
|
environment_variables: request.environmentVariables,
|
|
417
422
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
418
423
|
(elt) => marshalSecret(elt)
|
|
419
|
-
) : void 0
|
|
424
|
+
) : void 0,
|
|
425
|
+
tags: request.tags
|
|
420
426
|
});
|
|
421
427
|
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
422
428
|
access_key: request.accessKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
|
-
import {
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
5
|
const unmarshalCron = (data) => {
|
|
6
6
|
if (!isJSONObject(data)) {
|
|
@@ -52,6 +52,7 @@ const unmarshalFunction = (data) => {
|
|
|
52
52
|
return {
|
|
53
53
|
buildMessage: data.build_message,
|
|
54
54
|
cpuLimit: data.cpu_limit,
|
|
55
|
+
createdAt: unmarshalDate(data.created_at),
|
|
55
56
|
description: data.description,
|
|
56
57
|
domainName: data.domain_name,
|
|
57
58
|
environmentVariables: data.environment_variables,
|
|
@@ -65,6 +66,7 @@ const unmarshalFunction = (data) => {
|
|
|
65
66
|
name: data.name,
|
|
66
67
|
namespaceId: data.namespace_id,
|
|
67
68
|
privacy: data.privacy,
|
|
69
|
+
readyAt: unmarshalDate(data.ready_at),
|
|
68
70
|
region: data.region,
|
|
69
71
|
runtime: data.runtime,
|
|
70
72
|
runtimeMessage: data.runtime_message,
|
|
@@ -74,7 +76,8 @@ const unmarshalFunction = (data) => {
|
|
|
74
76
|
unmarshalSecretHashedValue
|
|
75
77
|
),
|
|
76
78
|
status: data.status,
|
|
77
|
-
timeout: data.timeout
|
|
79
|
+
timeout: data.timeout,
|
|
80
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
78
81
|
};
|
|
79
82
|
};
|
|
80
83
|
const unmarshalNamespace = (data) => {
|
|
@@ -98,7 +101,8 @@ const unmarshalNamespace = (data) => {
|
|
|
98
101
|
data.secret_environment_variables,
|
|
99
102
|
unmarshalSecretHashedValue
|
|
100
103
|
),
|
|
101
|
-
status: data.status
|
|
104
|
+
status: data.status,
|
|
105
|
+
tags: data.tags
|
|
102
106
|
};
|
|
103
107
|
};
|
|
104
108
|
const unmarshalToken = (data) => {
|
|
@@ -334,7 +338,8 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
|
334
338
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
335
339
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
336
340
|
(elt) => marshalSecret(elt)
|
|
337
|
-
) : void 0
|
|
341
|
+
) : void 0,
|
|
342
|
+
tags: request.tags
|
|
338
343
|
});
|
|
339
344
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
340
345
|
description: request.description,
|
|
@@ -414,7 +419,8 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
|
414
419
|
environment_variables: request.environmentVariables,
|
|
415
420
|
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
416
421
|
(elt) => marshalSecret(elt)
|
|
417
|
-
) : void 0
|
|
422
|
+
) : void 0,
|
|
423
|
+
tags: request.tags
|
|
418
424
|
});
|
|
419
425
|
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
420
426
|
access_key: request.accessKey,
|