@scaleway/sdk-container 1.4.0 → 1.5.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.
@@ -7,12 +7,13 @@ const jsonContentHeaders = {
7
7
  "Content-Type": "application/json; charset=utf-8"
8
8
  };
9
9
  class API extends sdkClient.API {
10
- /** Lists the available regions of the API. */
11
- static LOCALITIES = [
12
- "fr-par",
13
- "nl-ams",
14
- "pl-waw"
15
- ];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = sdkClient.toApiLocality({
15
+ regions: ["fr-par", "nl-ams", "pl-waw"]
16
+ });
16
17
  pageOfListNamespaces = (request = {}) => this.client.fetch(
17
18
  {
18
19
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Region as ScwRegion, WaitForOptions } from '@scaleway/sdk-client';
2
+ import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
3
3
  import type { Container, CreateContainerRequest, CreateCronRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, Cron, DeleteContainerRequest, DeleteCronRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTokenRequest, DeleteTriggerRequest, DeployContainerRequest, Domain, GetContainerRequest, GetCronRequest, GetDomainRequest, GetNamespaceRequest, GetTokenRequest, GetTriggerRequest, ListContainersRequest, ListContainersResponse, ListCronsRequest, ListCronsResponse, ListDomainsRequest, ListDomainsResponse, ListNamespacesRequest, ListNamespacesResponse, ListTokensRequest, ListTokensResponse, ListTriggersRequest, ListTriggersResponse, Namespace, Token, Trigger, UpdateContainerRequest, UpdateCronRequest, UpdateNamespaceRequest, UpdateTriggerRequest } from './types.gen';
4
4
  /**
5
5
  * Serverless Containers API.
@@ -7,8 +7,11 @@ import type { Container, CreateContainerRequest, CreateCronRequest, CreateDomain
7
7
  This API allows you to manage your Serverless Containers.
8
8
  */
9
9
  export declare class API extends ParentAPI {
10
- /** Lists the available regions of the API. */
11
- static readonly LOCALITIES: ScwRegion[];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
12
15
  protected pageOfListNamespaces: (request?: Readonly<ListNamespacesRequest>) => Promise<ListNamespacesResponse>;
13
16
  /**
14
17
  * List all your namespaces. List all namespaces in a specified region.
@@ -1,16 +1,17 @@
1
- import { API as API$1, urlParams, validatePathParam, enrichForPagination, waitForResource, resolveOneOf } from "@scaleway/sdk-client";
1
+ import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource, resolveOneOf } from "@scaleway/sdk-client";
2
2
  import { NAMESPACE_TRANSIENT_STATUSES, CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListContainersResponse, unmarshalContainer, marshalCreateContainerRequest, marshalUpdateContainerRequest, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateTriggerRequest, unmarshalTrigger, unmarshalListTriggersResponse, marshalUpdateTriggerRequest } from "./marshalling.gen.js";
4
4
  const jsonContentHeaders = {
5
5
  "Content-Type": "application/json; charset=utf-8"
6
6
  };
7
7
  class API extends API$1 {
8
- /** Lists the available regions of the API. */
9
- static LOCALITIES = [
10
- "fr-par",
11
- "nl-ams",
12
- "pl-waw"
13
- ];
8
+ /**
9
+ * Locality of this API.
10
+ * type ∈ {'zone','region','global','unspecified'}
11
+ */
12
+ static LOCALITY = toApiLocality({
13
+ regions: ["fr-par", "nl-ams", "pl-waw"]
14
+ });
14
15
  pageOfListNamespaces = (request = {}) => this.client.fetch(
15
16
  {
16
17
  method: "GET",
@@ -63,6 +63,8 @@ const unmarshalContainer = (data) => {
63
63
  );
64
64
  }
65
65
  return {
66
+ args: data.args,
67
+ command: data.command,
66
68
  cpuLimit: data.cpu_limit,
67
69
  createdAt: sdkClient.unmarshalDate(data.created_at),
68
70
  description: data.description,
@@ -331,6 +333,8 @@ const marshalSecret = (request, defaults) => ({
331
333
  value: request.value
332
334
  });
333
335
  const marshalCreateContainerRequest = (request, defaults) => ({
336
+ args: request.args,
337
+ command: request.command,
334
338
  cpu_limit: request.cpuLimit,
335
339
  description: request.description,
336
340
  environment_variables: request.environmentVariables,
@@ -428,6 +432,8 @@ const marshalCreateTriggerRequest = (request, defaults) => ({
428
432
  ])
429
433
  });
430
434
  const marshalUpdateContainerRequest = (request, defaults) => ({
435
+ args: request.args,
436
+ command: request.command,
431
437
  cpu_limit: request.cpuLimit,
432
438
  description: request.description,
433
439
  environment_variables: request.environmentVariables,
@@ -1,5 +1,5 @@
1
1
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
+ import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
3
  const unmarshalContainerHealthCheckSpecHTTPProbe = (data) => {
4
4
  if (!isJSONObject(data)) {
5
5
  throw new TypeError(
@@ -61,6 +61,8 @@ const unmarshalContainer = (data) => {
61
61
  );
62
62
  }
63
63
  return {
64
+ args: data.args,
65
+ command: data.command,
64
66
  cpuLimit: data.cpu_limit,
65
67
  createdAt: unmarshalDate(data.created_at),
66
68
  description: data.description,
@@ -329,6 +331,8 @@ const marshalSecret = (request, defaults) => ({
329
331
  value: request.value
330
332
  });
331
333
  const marshalCreateContainerRequest = (request, defaults) => ({
334
+ args: request.args,
335
+ command: request.command,
332
336
  cpu_limit: request.cpuLimit,
333
337
  description: request.description,
334
338
  environment_variables: request.environmentVariables,
@@ -426,6 +430,8 @@ const marshalCreateTriggerRequest = (request, defaults) => ({
426
430
  ])
427
431
  });
428
432
  const marshalUpdateContainerRequest = (request, defaults) => ({
433
+ args: request.args,
434
+ command: request.command,
429
435
  cpu_limit: request.cpuLimit,
430
436
  description: request.description,
431
437
  environment_variables: request.environmentVariables,
@@ -278,7 +278,18 @@ export interface Container {
278
278
  * List of tags applied to the Serverless Container.
279
279
  */
280
280
  tags: string[];
281
+ /**
282
+ * When connected to a Private Network, the container can access other Scaleway resources in this Private Network.
283
+ */
281
284
  privateNetworkId?: string;
285
+ /**
286
+ * Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
287
+ */
288
+ command: string[];
289
+ /**
290
+ * Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
291
+ */
292
+ args: string[];
282
293
  }
283
294
  export interface Cron {
284
295
  /**
@@ -394,7 +405,8 @@ export interface Namespace {
394
405
  */
395
406
  updatedAt?: Date;
396
407
  /**
397
- * @deprecated
408
+ * @deprecated When activated, containers in the namespace can be connected to a Private Network.
409
+ Note that activating the VPC integration can only be done when creating a new namespace.
398
410
  */
399
411
  vpcIntegrationActivated?: boolean;
400
412
  }
@@ -582,7 +594,20 @@ export type CreateContainerRequest = {
582
594
  * Tags of the Serverless Container.
583
595
  */
584
596
  tags?: string[];
597
+ /**
598
+ * When connected to a Private Network, the container can access other Scaleway resources in this Private Network.
599
+
600
+ Note: this feature is currently in beta and requires a namespace with VPC integration activated, using the `activate_vpc_integration` flag.
601
+ */
585
602
  privateNetworkId?: string;
603
+ /**
604
+ * Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
605
+ */
606
+ command?: string[];
607
+ /**
608
+ * Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
609
+ */
610
+ args?: string[];
586
611
  };
587
612
  export type CreateCronRequest = {
588
613
  /**
@@ -649,6 +674,9 @@ export type CreateNamespaceRequest = {
649
674
  * Tags of the Serverless Container Namespace.
650
675
  */
651
676
  tags?: string[];
677
+ /**
678
+ * When activated, containers in the namespace can be connected to a Private Network.
679
+ */
652
680
  activateVpcIntegration: boolean;
653
681
  };
654
682
  export type CreateTokenRequest = {
@@ -1120,8 +1148,17 @@ export type UpdateContainerRequest = {
1120
1148
  * @deprecated Number of maximum concurrent executions of the container.
1121
1149
  */
1122
1150
  maxConcurrency?: number;
1151
+ /**
1152
+ * Protocol the container uses.
1153
+ */
1123
1154
  protocol?: ContainerProtocol;
1155
+ /**
1156
+ * Port the container listens on.
1157
+ */
1124
1158
  port?: number;
1159
+ /**
1160
+ * Secret environment variables of the container.
1161
+ */
1125
1162
  secretEnvironmentVariables?: Secret[];
1126
1163
  /**
1127
1164
  * Possible values:
@@ -1152,7 +1189,20 @@ export type UpdateContainerRequest = {
1152
1189
  * Tags of the Serverless Container.
1153
1190
  */
1154
1191
  tags?: string[];
1192
+ /**
1193
+ * When connected to a Private Network, the container can access other Scaleway resources in this Private Network.
1194
+
1195
+ Note: this feature is currently in beta and requires a namespace with VPC integration activated, using the `activate_vpc_integration` flag.
1196
+ */
1155
1197
  privateNetworkId?: string;
1198
+ /**
1199
+ * Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
1200
+ */
1201
+ command?: string[];
1202
+ /**
1203
+ * Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
1204
+ */
1205
+ args?: string[];
1156
1206
  };
1157
1207
  export type UpdateCronRequest = {
1158
1208
  /**
@@ -43,6 +43,11 @@ const CreateTriggerRequestMnqSqsClientConfig = {
43
43
  minLength: 1
44
44
  }
45
45
  };
46
+ const UpdateContainerRequest = {
47
+ privateNetworkId: {
48
+ ignoreEmpty: true
49
+ }
50
+ };
46
51
  const UpdateTriggerRequest = {
47
52
  description: {
48
53
  maxLength: 255
@@ -58,4 +63,5 @@ exports.ContainerScalingOption = ContainerScalingOption;
58
63
  exports.CreateTriggerRequest = CreateTriggerRequest;
59
64
  exports.CreateTriggerRequestMnqNatsClientConfig = CreateTriggerRequestMnqNatsClientConfig;
60
65
  exports.CreateTriggerRequestMnqSqsClientConfig = CreateTriggerRequestMnqSqsClientConfig;
66
+ exports.UpdateContainerRequest = UpdateContainerRequest;
61
67
  exports.UpdateTriggerRequest = UpdateTriggerRequest;
@@ -41,6 +41,11 @@ export declare const CreateTriggerRequestMnqSqsClientConfig: {
41
41
  minLength: number;
42
42
  };
43
43
  };
44
+ export declare const UpdateContainerRequest: {
45
+ privateNetworkId: {
46
+ ignoreEmpty: boolean;
47
+ };
48
+ };
44
49
  export declare const UpdateTriggerRequest: {
45
50
  description: {
46
51
  maxLength: number;
@@ -41,6 +41,11 @@ const CreateTriggerRequestMnqSqsClientConfig = {
41
41
  minLength: 1
42
42
  }
43
43
  };
44
+ const UpdateContainerRequest = {
45
+ privateNetworkId: {
46
+ ignoreEmpty: true
47
+ }
48
+ };
44
49
  const UpdateTriggerRequest = {
45
50
  description: {
46
51
  maxLength: 255
@@ -57,5 +62,6 @@ export {
57
62
  CreateTriggerRequest,
58
63
  CreateTriggerRequestMnqNatsClientConfig,
59
64
  CreateTriggerRequestMnqSqsClientConfig,
65
+ UpdateContainerRequest,
60
66
  UpdateTriggerRequest
61
67
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-container",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "Scaleway SDK container",
5
- "types": "dist/index.d.ts",
5
+ "license": "Apache-2.0",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.3"
33
+ "@scaleway/sdk-std": "1.0.5"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.2"
36
+ "@scaleway/sdk-client": "^1.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.2"
39
+ "@scaleway/sdk-client": "^1.3.0"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",