@scaleway/sdk-applesilicon 1.2.0 → 1.4.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.
@@ -2,4 +2,4 @@
2
2
  * This file is automatically generated
3
3
  * PLEASE DO NOT EDIT HERE
4
4
  */
5
- export * as Applesiliconv1alpha1 from './v1alpha1/index.gen';
5
+ export * as Applesiliconv1alpha1 from './v1alpha1/index.gen.js';
@@ -57,6 +57,23 @@ class API extends sdkClient.API {
57
57
  },
58
58
  marshalling_gen.unmarshalServer
59
59
  );
60
+ /**
61
+ * Create multiple servers atomically. Create multiple servers in the targeted zone specifying their configurations. If the request cannot entirely be fulfilled, no servers are created.
62
+ *
63
+ * @param request - The request {@link BatchCreateServersRequest}
64
+ * @returns A Promise of BatchCreateServersResponse
65
+ */
66
+ batchCreateServers = (request) => this.client.fetch(
67
+ {
68
+ body: JSON.stringify(
69
+ marshalling_gen.marshalBatchCreateServersRequest(request, this.client.settings)
70
+ ),
71
+ headers: jsonContentHeaders,
72
+ method: "POST",
73
+ path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/batch-create-servers`
74
+ },
75
+ marshalling_gen.unmarshalBatchCreateServersResponse
76
+ );
60
77
  pageOfListServers = (request = {}) => this.client.fetch(
61
78
  {
62
79
  method: "GET",
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
2
  import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
3
- import type { ConnectivityDiagnostic, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest } from './types.gen';
3
+ import type { BatchCreateServersRequest, BatchCreateServersResponse, ConnectivityDiagnostic, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest } from './types.gen.js';
4
4
  /**
5
5
  * Apple silicon API.
6
6
 
@@ -33,6 +33,13 @@ export declare class API extends ParentAPI {
33
33
  * @returns A Promise of Server
34
34
  */
35
35
  createServer: (request: Readonly<CreateServerRequest>) => Promise<Server>;
36
+ /**
37
+ * Create multiple servers atomically. Create multiple servers in the targeted zone specifying their configurations. If the request cannot entirely be fulfilled, no servers are created.
38
+ *
39
+ * @param request - The request {@link BatchCreateServersRequest}
40
+ * @returns A Promise of BatchCreateServersResponse
41
+ */
42
+ batchCreateServers: (request: Readonly<BatchCreateServersRequest>) => Promise<BatchCreateServersResponse>;
36
43
  protected pageOfListServers: (request?: Readonly<ListServersRequest>) => Promise<ListServersResponse>;
37
44
  /**
38
45
  * List all servers. List all servers in the specified zone. By default, returned servers in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
@@ -1,6 +1,6 @@
1
1
  import { API as API$1, toApiLocality, validatePathParam, urlParams, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
2
  import { SERVER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, unmarshalStartConnectivityDiagnosticResponse, unmarshalConnectivityDiagnostic, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
3
+ import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, marshalBatchCreateServersRequest, unmarshalBatchCreateServersResponse, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, unmarshalStartConnectivityDiagnosticResponse, unmarshalConnectivityDiagnostic, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
4
4
  const jsonContentHeaders = {
5
5
  "Content-Type": "application/json; charset=utf-8"
6
6
  };
@@ -55,6 +55,23 @@ class API extends API$1 {
55
55
  },
56
56
  unmarshalServer
57
57
  );
58
+ /**
59
+ * Create multiple servers atomically. Create multiple servers in the targeted zone specifying their configurations. If the request cannot entirely be fulfilled, no servers are created.
60
+ *
61
+ * @param request - The request {@link BatchCreateServersRequest}
62
+ * @returns A Promise of BatchCreateServersResponse
63
+ */
64
+ batchCreateServers = (request) => this.client.fetch(
65
+ {
66
+ body: JSON.stringify(
67
+ marshalBatchCreateServersRequest(request, this.client.settings)
68
+ ),
69
+ headers: jsonContentHeaders,
70
+ method: "POST",
71
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/batch-create-servers`
72
+ },
73
+ unmarshalBatchCreateServersResponse
74
+ );
58
75
  pageOfListServers = (request = {}) => this.client.fetch(
59
76
  {
60
77
  method: "GET",
@@ -1,4 +1,4 @@
1
- import type { ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus } from './types.gen';
1
+ import type { ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus } from './types.gen.js';
2
2
  /** Lists transient statutes of the enum {@link ServerPrivateNetworkServerStatus}. */
3
3
  export declare const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[];
4
4
  /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
@@ -8,12 +8,14 @@ exports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI;
8
8
  exports.SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES;
9
9
  exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;
10
10
  exports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES;
11
+ exports.marshalBatchCreateServersRequest = marshalling_gen.marshalBatchCreateServersRequest;
11
12
  exports.marshalCreateServerRequest = marshalling_gen.marshalCreateServerRequest;
12
13
  exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
13
14
  exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
14
15
  exports.marshalReinstallServerRequest = marshalling_gen.marshalReinstallServerRequest;
15
16
  exports.marshalStartConnectivityDiagnosticRequest = marshalling_gen.marshalStartConnectivityDiagnosticRequest;
16
17
  exports.marshalUpdateServerRequest = marshalling_gen.marshalUpdateServerRequest;
18
+ exports.unmarshalBatchCreateServersResponse = marshalling_gen.unmarshalBatchCreateServersResponse;
17
19
  exports.unmarshalConnectivityDiagnostic = marshalling_gen.unmarshalConnectivityDiagnostic;
18
20
  exports.unmarshalListOSResponse = marshalling_gen.unmarshalListOSResponse;
19
21
  exports.unmarshalListServerPrivateNetworksResponse = marshalling_gen.unmarshalListServerPrivateNetworksResponse;
@@ -1,4 +1,4 @@
1
- export { API, PrivateNetworkAPI, } from './api.gen';
2
- export * from './content.gen';
3
- export * from './marshalling.gen';
4
- export type { Commitment, CommitmentType, CommitmentTypeValue, ConnectivityDiagnostic, ConnectivityDiagnosticActionType, ConnectivityDiagnosticDiagnosticStatus, ConnectivityDiagnosticServerHealth, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Server, ServerPrivateNetwork, ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus, ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, ServerTypeStock, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, } from './types.gen';
1
+ export { API, PrivateNetworkAPI, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { BatchCreateServersRequest, BatchCreateServersRequestBatchInnerCreateServerRequest, BatchCreateServersResponse, Commitment, CommitmentType, CommitmentTypeValue, ConnectivityDiagnostic, ConnectivityDiagnosticActionType, ConnectivityDiagnosticDiagnosticStatus, ConnectivityDiagnosticServerHealth, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, OS, OSSupportedServerType, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, RunnerConfiguration, RunnerConfigurationProvider, Server, ServerPrivateNetwork, ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus, ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNPU, ServerTypeNetwork, ServerTypeStock, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, } from './types.gen.js';
@@ -1,18 +1,20 @@
1
1
  import { API, PrivateNetworkAPI } from "./api.gen.js";
2
2
  import { SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalCreateServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, marshalUpdateServerRequest, unmarshalConnectivityDiagnostic, unmarshalListOSResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalServerType, unmarshalSetServerPrivateNetworksResponse, unmarshalStartConnectivityDiagnosticResponse } from "./marshalling.gen.js";
3
+ import { marshalBatchCreateServersRequest, marshalCreateServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, marshalUpdateServerRequest, unmarshalBatchCreateServersResponse, unmarshalConnectivityDiagnostic, unmarshalListOSResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalServerType, unmarshalSetServerPrivateNetworksResponse, unmarshalStartConnectivityDiagnosticResponse } from "./marshalling.gen.js";
4
4
  export {
5
5
  API,
6
6
  PrivateNetworkAPI,
7
7
  SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES,
8
8
  SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
9
9
  SERVER_TRANSIENT_STATUSES,
10
+ marshalBatchCreateServersRequest,
10
11
  marshalCreateServerRequest,
11
12
  marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
12
13
  marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
13
14
  marshalReinstallServerRequest,
14
15
  marshalStartConnectivityDiagnosticRequest,
15
16
  marshalUpdateServerRequest,
17
+ unmarshalBatchCreateServersResponse,
16
18
  unmarshalConnectivityDiagnostic,
17
19
  unmarshalListOSResponse,
18
20
  unmarshalListServerPrivateNetworksResponse,
@@ -2,6 +2,17 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const randomName = require("@scaleway/random-name");
4
4
  const sdkClient = require("@scaleway/sdk-client");
5
+ const unmarshalOSSupportedServerType = (data) => {
6
+ if (!sdkClient.isJSONObject(data)) {
7
+ throw new TypeError(
8
+ `Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`
9
+ );
10
+ }
11
+ return {
12
+ fastDeliveryAvailable: data.fast_delivery_available,
13
+ serverType: data.server_type
14
+ };
15
+ };
5
16
  const unmarshalOS = (data) => {
6
17
  if (!sdkClient.isJSONObject(data)) {
7
18
  throw new TypeError(
@@ -9,13 +20,20 @@ const unmarshalOS = (data) => {
9
20
  );
10
21
  }
11
22
  return {
12
- compatibleServerTypes: data.compatible_server_types,
23
+ compatibleServerTypes: data.compatible_server_types ? data.compatible_server_types : void 0,
24
+ description: data.description,
13
25
  family: data.family,
14
26
  id: data.id,
15
27
  imageUrl: data.image_url,
16
28
  isBeta: data.is_beta,
17
29
  label: data.label,
18
30
  name: data.name,
31
+ releaseNotesUrl: data.release_notes_url,
32
+ supportedServerTypes: sdkClient.unmarshalArrayOfObject(
33
+ data.supported_server_types,
34
+ unmarshalOSSupportedServerType
35
+ ),
36
+ tags: data.tags,
19
37
  version: data.version,
20
38
  xcodeVersion: data.xcode_version
21
39
  };
@@ -31,6 +49,19 @@ const unmarshalCommitment = (data) => {
31
49
  type: data.type
32
50
  };
33
51
  };
52
+ const unmarshalRunnerConfiguration = (data) => {
53
+ if (!sdkClient.isJSONObject(data)) {
54
+ throw new TypeError(
55
+ `Unmarshalling the type 'RunnerConfiguration' failed as data isn't a dictionary.`
56
+ );
57
+ }
58
+ return {
59
+ name: data.name,
60
+ provider: data.provider,
61
+ token: data.token,
62
+ url: data.url
63
+ };
64
+ };
34
65
  const unmarshalServer = (data) => {
35
66
  if (!sdkClient.isJSONObject(data)) {
36
67
  throw new TypeError(
@@ -50,9 +81,11 @@ const unmarshalServer = (data) => {
50
81
  os: data.os ? unmarshalOS(data.os) : void 0,
51
82
  projectId: data.project_id,
52
83
  publicBandwidthBps: data.public_bandwidth_bps,
84
+ runnerConfiguration: data.runner_configuration ? unmarshalRunnerConfiguration(data.runner_configuration) : void 0,
53
85
  sshUsername: data.ssh_username,
54
86
  status: data.status,
55
87
  sudoPassword: data.sudo_password,
88
+ tags: data.tags,
56
89
  type: data.type,
57
90
  updatedAt: sdkClient.unmarshalDate(data.updated_at),
58
91
  vncPort: data.vnc_port,
@@ -88,7 +121,9 @@ const unmarshalServerTypeCPU = (data) => {
88
121
  return {
89
122
  coreCount: data.core_count,
90
123
  frequency: data.frequency,
91
- name: data.name
124
+ name: data.name,
125
+ sockets: data.sockets,
126
+ threadsPerCore: data.threads_per_core
92
127
  };
93
128
  };
94
129
  const unmarshalServerTypeDisk = (data) => {
@@ -123,6 +158,16 @@ const unmarshalServerTypeMemory = (data) => {
123
158
  type: data.type
124
159
  };
125
160
  };
161
+ const unmarshalServerTypeNPU = (data) => {
162
+ if (!sdkClient.isJSONObject(data)) {
163
+ throw new TypeError(
164
+ `Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary.`
165
+ );
166
+ }
167
+ return {
168
+ count: data.count
169
+ };
170
+ };
126
171
  const unmarshalServerTypeNetwork = (data) => {
127
172
  if (!sdkClient.isJSONObject(data)) {
128
173
  throw new TypeError(
@@ -130,6 +175,7 @@ const unmarshalServerTypeNetwork = (data) => {
130
175
  );
131
176
  }
132
177
  return {
178
+ defaultPublicBandwidth: data.default_public_bandwidth,
133
179
  publicBandwidthBps: data.public_bandwidth_bps,
134
180
  supportedBandwidth: data.supported_bandwidth
135
181
  };
@@ -149,9 +195,20 @@ const unmarshalServerType = (data) => {
149
195
  minimumLeaseDuration: data.minimum_lease_duration,
150
196
  name: data.name,
151
197
  network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,
198
+ npu: data.npu ? unmarshalServerTypeNPU(data.npu) : void 0,
152
199
  stock: data.stock
153
200
  };
154
201
  };
202
+ const unmarshalBatchCreateServersResponse = (data) => {
203
+ if (!sdkClient.isJSONObject(data)) {
204
+ throw new TypeError(
205
+ `Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`
206
+ );
207
+ }
208
+ return {
209
+ servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer)
210
+ };
211
+ };
155
212
  const unmarshalConnectivityDiagnosticServerHealth = (data) => {
156
213
  if (!sdkClient.isJSONObject(data)) {
157
214
  throw new TypeError(
@@ -251,6 +308,28 @@ const unmarshalStartConnectivityDiagnosticResponse = (data) => {
251
308
  diagnosticId: data.diagnostic_id
252
309
  };
253
310
  };
311
+ const marshalBatchCreateServersRequestBatchInnerCreateServerRequest = (request, defaults) => ({
312
+ name: request.name
313
+ });
314
+ const marshalBatchCreateServersRequest = (request, defaults) => ({
315
+ commitment_type: request.commitmentType,
316
+ enable_vpc: request.enableVpc,
317
+ os_id: request.osId,
318
+ project_id: request.projectId ?? defaults.defaultProjectId,
319
+ public_bandwidth_bps: request.publicBandwidthBps,
320
+ requests: request.requests !== void 0 ? request.requests.map(
321
+ (elt) => marshalBatchCreateServersRequestBatchInnerCreateServerRequest(
322
+ elt
323
+ )
324
+ ) : void 0,
325
+ type: request.type
326
+ });
327
+ const marshalRunnerConfiguration = (request, defaults) => ({
328
+ name: request.name,
329
+ provider: request.provider,
330
+ token: request.token,
331
+ url: request.url
332
+ });
254
333
  const marshalCreateServerRequest = (request, defaults) => ({
255
334
  commitment_type: request.commitmentType,
256
335
  enable_vpc: request.enableVpc,
@@ -258,6 +337,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
258
337
  os_id: request.osId,
259
338
  project_id: request.projectId ?? defaults.defaultProjectId,
260
339
  public_bandwidth_bps: request.publicBandwidthBps,
340
+ runner_configuration: request.runnerConfiguration !== void 0 ? marshalRunnerConfiguration(request.runnerConfiguration) : void 0,
261
341
  type: request.type
262
342
  });
263
343
  const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
@@ -283,12 +363,14 @@ const marshalUpdateServerRequest = (request, defaults) => ({
283
363
  public_bandwidth_bps: request.publicBandwidthBps,
284
364
  schedule_deletion: request.scheduleDeletion
285
365
  });
366
+ exports.marshalBatchCreateServersRequest = marshalBatchCreateServersRequest;
286
367
  exports.marshalCreateServerRequest = marshalCreateServerRequest;
287
368
  exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
288
369
  exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
289
370
  exports.marshalReinstallServerRequest = marshalReinstallServerRequest;
290
371
  exports.marshalStartConnectivityDiagnosticRequest = marshalStartConnectivityDiagnosticRequest;
291
372
  exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
373
+ exports.unmarshalBatchCreateServersResponse = unmarshalBatchCreateServersResponse;
292
374
  exports.unmarshalConnectivityDiagnostic = unmarshalConnectivityDiagnostic;
293
375
  exports.unmarshalListOSResponse = unmarshalListOSResponse;
294
376
  exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;
@@ -1,9 +1,10 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { ConnectivityDiagnostic, CreateServerRequest, ListOSResponse, ListServerPrivateNetworksResponse, ListServerTypesResponse, ListServersResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ReinstallServerRequest, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest } from './types.gen';
2
+ import type { BatchCreateServersRequest, BatchCreateServersResponse, ConnectivityDiagnostic, CreateServerRequest, ListOSResponse, ListServerPrivateNetworksResponse, ListServerTypesResponse, ListServersResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ReinstallServerRequest, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest } from './types.gen.js';
3
3
  export declare const unmarshalOS: (data: unknown) => OS;
4
4
  export declare const unmarshalServer: (data: unknown) => Server;
5
5
  export declare const unmarshalServerPrivateNetwork: (data: unknown) => ServerPrivateNetwork;
6
6
  export declare const unmarshalServerType: (data: unknown) => ServerType;
7
+ export declare const unmarshalBatchCreateServersResponse: (data: unknown) => BatchCreateServersResponse;
7
8
  export declare const unmarshalConnectivityDiagnostic: (data: unknown) => ConnectivityDiagnostic;
8
9
  export declare const unmarshalListOSResponse: (data: unknown) => ListOSResponse;
9
10
  export declare const unmarshalListServerPrivateNetworksResponse: (data: unknown) => ListServerPrivateNetworksResponse;
@@ -11,6 +12,7 @@ export declare const unmarshalListServerTypesResponse: (data: unknown) => ListSe
11
12
  export declare const unmarshalListServersResponse: (data: unknown) => ListServersResponse;
12
13
  export declare const unmarshalSetServerPrivateNetworksResponse: (data: unknown) => SetServerPrivateNetworksResponse;
13
14
  export declare const unmarshalStartConnectivityDiagnosticResponse: (data: unknown) => StartConnectivityDiagnosticResponse;
15
+ export declare const marshalBatchCreateServersRequest: (request: BatchCreateServersRequest, defaults: DefaultValues) => Record<string, unknown>;
14
16
  export declare const marshalCreateServerRequest: (request: CreateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
15
17
  export declare const marshalPrivateNetworkApiAddServerPrivateNetworkRequest: (request: PrivateNetworkApiAddServerPrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
16
18
  export declare const marshalPrivateNetworkApiSetServerPrivateNetworksRequest: (request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,5 +1,16 @@
1
1
  import randomName from "@scaleway/random-name";
2
2
  import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
+ const unmarshalOSSupportedServerType = (data) => {
4
+ if (!isJSONObject(data)) {
5
+ throw new TypeError(
6
+ `Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`
7
+ );
8
+ }
9
+ return {
10
+ fastDeliveryAvailable: data.fast_delivery_available,
11
+ serverType: data.server_type
12
+ };
13
+ };
3
14
  const unmarshalOS = (data) => {
4
15
  if (!isJSONObject(data)) {
5
16
  throw new TypeError(
@@ -7,13 +18,20 @@ const unmarshalOS = (data) => {
7
18
  );
8
19
  }
9
20
  return {
10
- compatibleServerTypes: data.compatible_server_types,
21
+ compatibleServerTypes: data.compatible_server_types ? data.compatible_server_types : void 0,
22
+ description: data.description,
11
23
  family: data.family,
12
24
  id: data.id,
13
25
  imageUrl: data.image_url,
14
26
  isBeta: data.is_beta,
15
27
  label: data.label,
16
28
  name: data.name,
29
+ releaseNotesUrl: data.release_notes_url,
30
+ supportedServerTypes: unmarshalArrayOfObject(
31
+ data.supported_server_types,
32
+ unmarshalOSSupportedServerType
33
+ ),
34
+ tags: data.tags,
17
35
  version: data.version,
18
36
  xcodeVersion: data.xcode_version
19
37
  };
@@ -29,6 +47,19 @@ const unmarshalCommitment = (data) => {
29
47
  type: data.type
30
48
  };
31
49
  };
50
+ const unmarshalRunnerConfiguration = (data) => {
51
+ if (!isJSONObject(data)) {
52
+ throw new TypeError(
53
+ `Unmarshalling the type 'RunnerConfiguration' failed as data isn't a dictionary.`
54
+ );
55
+ }
56
+ return {
57
+ name: data.name,
58
+ provider: data.provider,
59
+ token: data.token,
60
+ url: data.url
61
+ };
62
+ };
32
63
  const unmarshalServer = (data) => {
33
64
  if (!isJSONObject(data)) {
34
65
  throw new TypeError(
@@ -48,9 +79,11 @@ const unmarshalServer = (data) => {
48
79
  os: data.os ? unmarshalOS(data.os) : void 0,
49
80
  projectId: data.project_id,
50
81
  publicBandwidthBps: data.public_bandwidth_bps,
82
+ runnerConfiguration: data.runner_configuration ? unmarshalRunnerConfiguration(data.runner_configuration) : void 0,
51
83
  sshUsername: data.ssh_username,
52
84
  status: data.status,
53
85
  sudoPassword: data.sudo_password,
86
+ tags: data.tags,
54
87
  type: data.type,
55
88
  updatedAt: unmarshalDate(data.updated_at),
56
89
  vncPort: data.vnc_port,
@@ -86,7 +119,9 @@ const unmarshalServerTypeCPU = (data) => {
86
119
  return {
87
120
  coreCount: data.core_count,
88
121
  frequency: data.frequency,
89
- name: data.name
122
+ name: data.name,
123
+ sockets: data.sockets,
124
+ threadsPerCore: data.threads_per_core
90
125
  };
91
126
  };
92
127
  const unmarshalServerTypeDisk = (data) => {
@@ -121,6 +156,16 @@ const unmarshalServerTypeMemory = (data) => {
121
156
  type: data.type
122
157
  };
123
158
  };
159
+ const unmarshalServerTypeNPU = (data) => {
160
+ if (!isJSONObject(data)) {
161
+ throw new TypeError(
162
+ `Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary.`
163
+ );
164
+ }
165
+ return {
166
+ count: data.count
167
+ };
168
+ };
124
169
  const unmarshalServerTypeNetwork = (data) => {
125
170
  if (!isJSONObject(data)) {
126
171
  throw new TypeError(
@@ -128,6 +173,7 @@ const unmarshalServerTypeNetwork = (data) => {
128
173
  );
129
174
  }
130
175
  return {
176
+ defaultPublicBandwidth: data.default_public_bandwidth,
131
177
  publicBandwidthBps: data.public_bandwidth_bps,
132
178
  supportedBandwidth: data.supported_bandwidth
133
179
  };
@@ -147,9 +193,20 @@ const unmarshalServerType = (data) => {
147
193
  minimumLeaseDuration: data.minimum_lease_duration,
148
194
  name: data.name,
149
195
  network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,
196
+ npu: data.npu ? unmarshalServerTypeNPU(data.npu) : void 0,
150
197
  stock: data.stock
151
198
  };
152
199
  };
200
+ const unmarshalBatchCreateServersResponse = (data) => {
201
+ if (!isJSONObject(data)) {
202
+ throw new TypeError(
203
+ `Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`
204
+ );
205
+ }
206
+ return {
207
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServer)
208
+ };
209
+ };
153
210
  const unmarshalConnectivityDiagnosticServerHealth = (data) => {
154
211
  if (!isJSONObject(data)) {
155
212
  throw new TypeError(
@@ -249,6 +306,28 @@ const unmarshalStartConnectivityDiagnosticResponse = (data) => {
249
306
  diagnosticId: data.diagnostic_id
250
307
  };
251
308
  };
309
+ const marshalBatchCreateServersRequestBatchInnerCreateServerRequest = (request, defaults) => ({
310
+ name: request.name
311
+ });
312
+ const marshalBatchCreateServersRequest = (request, defaults) => ({
313
+ commitment_type: request.commitmentType,
314
+ enable_vpc: request.enableVpc,
315
+ os_id: request.osId,
316
+ project_id: request.projectId ?? defaults.defaultProjectId,
317
+ public_bandwidth_bps: request.publicBandwidthBps,
318
+ requests: request.requests !== void 0 ? request.requests.map(
319
+ (elt) => marshalBatchCreateServersRequestBatchInnerCreateServerRequest(
320
+ elt
321
+ )
322
+ ) : void 0,
323
+ type: request.type
324
+ });
325
+ const marshalRunnerConfiguration = (request, defaults) => ({
326
+ name: request.name,
327
+ provider: request.provider,
328
+ token: request.token,
329
+ url: request.url
330
+ });
252
331
  const marshalCreateServerRequest = (request, defaults) => ({
253
332
  commitment_type: request.commitmentType,
254
333
  enable_vpc: request.enableVpc,
@@ -256,6 +335,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
256
335
  os_id: request.osId,
257
336
  project_id: request.projectId ?? defaults.defaultProjectId,
258
337
  public_bandwidth_bps: request.publicBandwidthBps,
338
+ runner_configuration: request.runnerConfiguration !== void 0 ? marshalRunnerConfiguration(request.runnerConfiguration) : void 0,
259
339
  type: request.type
260
340
  });
261
341
  const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
@@ -282,12 +362,14 @@ const marshalUpdateServerRequest = (request, defaults) => ({
282
362
  schedule_deletion: request.scheduleDeletion
283
363
  });
284
364
  export {
365
+ marshalBatchCreateServersRequest,
285
366
  marshalCreateServerRequest,
286
367
  marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
287
368
  marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
288
369
  marshalReinstallServerRequest,
289
370
  marshalStartConnectivityDiagnosticRequest,
290
371
  marshalUpdateServerRequest,
372
+ unmarshalBatchCreateServersResponse,
291
373
  unmarshalConnectivityDiagnostic,
292
374
  unmarshalListOSResponse,
293
375
  unmarshalListServerPrivateNetworksResponse,
@@ -4,10 +4,15 @@ export type ConnectivityDiagnosticActionType = 'reboot_server' | 'reinstall_serv
4
4
  export type ConnectivityDiagnosticDiagnosticStatus = 'unknown_status' | 'processing' | 'error' | 'completed';
5
5
  export type ListServerPrivateNetworksRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
6
6
  export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc';
7
+ export type RunnerConfigurationProvider = 'unknown_provider' | 'github' | 'gitlab';
7
8
  export type ServerPrivateNetworkServerStatus = 'unknown_status' | 'attaching' | 'attached' | 'error' | 'detaching' | 'locked';
8
9
  export type ServerPrivateNetworkStatus = 'vpc_unknown_status' | 'vpc_enabled' | 'vpc_updating' | 'vpc_disabled';
9
10
  export type ServerStatus = 'unknown_status' | 'starting' | 'ready' | 'error' | 'rebooting' | 'updating' | 'locking' | 'locked' | 'unlocking' | 'reinstalling' | 'busy';
10
11
  export type ServerTypeStock = 'unknown_stock' | 'no_stock' | 'low_stock' | 'high_stock';
12
+ export interface OSSupportedServerType {
13
+ serverType: string;
14
+ fastDeliveryAvailable: boolean;
15
+ }
11
16
  export interface Commitment {
12
17
  type: CommitmentType;
13
18
  cancelled: boolean;
@@ -46,14 +51,38 @@ export interface OS {
46
51
  */
47
52
  xcodeVersion: string;
48
53
  /**
49
- * List of compatible server types.
54
+ * @deprecated List of compatible server types. Deprecated.
55
+ */
56
+ compatibleServerTypes?: string[];
57
+ /**
58
+ * Url of the release notes for the OS image or softwares pre-installed.
59
+ */
60
+ releaseNotesUrl: string;
61
+ /**
62
+ * A summary of the OS image content and configuration.
50
63
  */
51
- compatibleServerTypes: string[];
64
+ description: string;
65
+ /**
66
+ * List of tags for the OS configuration.
67
+ */
68
+ tags: string[];
69
+ /**
70
+ * List of server types which supports the OS configuration. Also gives information about immediate stock availability.
71
+ */
72
+ supportedServerTypes: OSSupportedServerType[];
73
+ }
74
+ export interface RunnerConfiguration {
75
+ name: string;
76
+ url: string;
77
+ token: string;
78
+ provider: RunnerConfigurationProvider;
52
79
  }
53
80
  export interface ServerTypeCPU {
54
81
  name: string;
55
82
  coreCount: number;
56
83
  frequency: number;
84
+ sockets: number;
85
+ threadsPerCore: number;
57
86
  }
58
87
  export interface ServerTypeDisk {
59
88
  capacity: number;
@@ -66,9 +95,16 @@ export interface ServerTypeMemory {
66
95
  capacity: number;
67
96
  type: string;
68
97
  }
98
+ export interface ServerTypeNPU {
99
+ count: number;
100
+ }
69
101
  export interface ServerTypeNetwork {
70
102
  publicBandwidthBps: number;
71
103
  supportedBandwidth: number[];
104
+ defaultPublicBandwidth: number;
105
+ }
106
+ export interface BatchCreateServersRequestBatchInnerCreateServerRequest {
107
+ name: string;
72
108
  }
73
109
  export interface Server {
74
110
  /**
@@ -155,6 +191,14 @@ export interface Server {
155
191
  * Public bandwidth configured for this server. Expressed in bits per second.
156
192
  */
157
193
  publicBandwidthBps: number;
194
+ /**
195
+ * Current runner configuration, empty if none is installed.
196
+ */
197
+ runnerConfiguration?: RunnerConfiguration;
198
+ /**
199
+ * A list of tags attached to the server.
200
+ */
201
+ tags: string[];
158
202
  }
159
203
  export interface ConnectivityDiagnosticServerHealth {
160
204
  lastCheckinDate?: Date;
@@ -239,10 +283,54 @@ export interface ServerType {
239
283
  * The default OS for this server type.
240
284
  */
241
285
  defaultOs?: OS;
286
+ /**
287
+ * NPU description.
288
+ */
289
+ npu?: ServerTypeNPU;
242
290
  }
243
291
  export interface CommitmentTypeValue {
244
292
  commitmentType: CommitmentType;
245
293
  }
294
+ export type BatchCreateServersRequest = {
295
+ /**
296
+ * Zone to target. If none is passed will use default zone from the config.
297
+ */
298
+ zone?: ScwZone;
299
+ /**
300
+ * Create servers in the given project ID.
301
+ */
302
+ projectId?: string;
303
+ /**
304
+ * Create servers of the given type.
305
+ */
306
+ type: string;
307
+ /**
308
+ * Create servers & install the given os_id, when no os_id provided the default OS for this server type is chosen. Requesting a non-default OS will induce an extended delivery time.
309
+ */
310
+ osId?: string;
311
+ /**
312
+ * Activate the Private Network feature for these servers. This feature is configured through the Apple Silicon - Private Networks API.
313
+ */
314
+ enableVpc: boolean;
315
+ /**
316
+ * Activate commitment for these servers. If not specified, there is a 24h commitment due to Apple licensing (commitment_type `duration_24h`). It can be updated with the Update Server request. Available commitment depends on server type.
317
+ */
318
+ commitmentType?: CommitmentType;
319
+ /**
320
+ * Public bandwidth to configure for these servers. This defaults to the minimum bandwidth for the corresponding server type. For compatible server types, the bandwidth can be increased which incurs additional costs.
321
+ */
322
+ publicBandwidthBps: number;
323
+ /**
324
+ * List of servers to create.
325
+ */
326
+ requests?: BatchCreateServersRequestBatchInnerCreateServerRequest[];
327
+ };
328
+ export interface BatchCreateServersResponse {
329
+ /**
330
+ * List of created servers.
331
+ */
332
+ servers: Server[];
333
+ }
246
334
  export interface ConnectivityDiagnostic {
247
335
  id: string;
248
336
  status: ConnectivityDiagnosticDiagnosticStatus;
@@ -284,6 +372,10 @@ export type CreateServerRequest = {
284
372
  * Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs.
285
373
  */
286
374
  publicBandwidthBps: number;
375
+ /**
376
+ * Specify the configuration to install an optional CICD runner on the server during installation.
377
+ */
378
+ runnerConfiguration?: RunnerConfiguration;
287
379
  };
288
380
  export type DeleteServerRequest = {
289
381
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-applesilicon",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Scaleway SDK applesilicon",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -26,17 +26,17 @@
26
26
  "directory": "packages_generated/applesilicon"
27
27
  },
28
28
  "engines": {
29
- "node": ">=20.19.1"
29
+ "node": ">=20.19.4"
30
30
  },
31
31
  "dependencies": {
32
- "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.5"
32
+ "@scaleway/random-name": "5.1.2",
33
+ "@scaleway/sdk-std": "1.1.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.0"
36
+ "@scaleway/sdk-client": "^1.3.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.0"
39
+ "@scaleway/sdk-client": "^1.3.2"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",