@scaleway/sdk-applesilicon 1.0.3 → 1.1.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.
@@ -7,8 +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 zones of the API. */
11
- static LOCALITIES = ["fr-par-3"];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = sdkClient.toApiLocality({
15
+ zones: ["fr-par-3"]
16
+ });
12
17
  /**
13
18
  * List server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`.
14
19
  *
@@ -221,8 +226,13 @@ class API extends sdkClient.API {
221
226
  );
222
227
  }
223
228
  class PrivateNetworkAPI extends sdkClient.API {
224
- /** Lists the available zones of the API. */
225
- static LOCALITIES = ["fr-par-1", "fr-par-3"];
229
+ /**
230
+ * Locality of this API.
231
+ * type ∈ {'zone','region','global','unspecified'}
232
+ */
233
+ static LOCALITY = sdkClient.toApiLocality({
234
+ zones: ["fr-par-1", "fr-par-3"]
235
+ });
226
236
  getServerPrivateNetwork = (request) => this.client.fetch(
227
237
  {
228
238
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client';
2
+ import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
3
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';
4
4
  /**
5
5
  * Apple silicon API.
@@ -7,8 +7,11 @@ import type { ConnectivityDiagnostic, CreateServerRequest, DeleteServerRequest,
7
7
  This API allows you to manage your Apple silicon machines.
8
8
  */
9
9
  export declare class API extends ParentAPI {
10
- /** Lists the available zones of the API. */
11
- static readonly LOCALITIES: ScwZone[];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
12
15
  /**
13
16
  * List server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`.
14
17
  *
@@ -108,8 +111,11 @@ export declare class API extends ParentAPI {
108
111
  * Apple silicon - Private Networks API.
109
112
  */
110
113
  export declare class PrivateNetworkAPI extends ParentAPI {
111
- /** Lists the available zones of the API. */
112
- static readonly LOCALITIES: ScwZone[];
114
+ /**
115
+ * Locality of this API.
116
+ * type ∈ {'zone','region','global','unspecified'}
117
+ */
118
+ static readonly LOCALITY: ApiLocality;
113
119
  getServerPrivateNetwork: (request: Readonly<PrivateNetworkApiGetServerPrivateNetworkRequest>) => Promise<ServerPrivateNetwork>;
114
120
  /**
115
121
  * Waits for {@link ServerPrivateNetwork} to be in a final state.
@@ -1,12 +1,17 @@
1
- import { API as API$1, validatePathParam, urlParams, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
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
3
  import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, 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
  };
7
7
  class API extends API$1 {
8
- /** Lists the available zones of the API. */
9
- static LOCALITIES = ["fr-par-3"];
8
+ /**
9
+ * Locality of this API.
10
+ * type ∈ {'zone','region','global','unspecified'}
11
+ */
12
+ static LOCALITY = toApiLocality({
13
+ zones: ["fr-par-3"]
14
+ });
10
15
  /**
11
16
  * List server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`.
12
17
  *
@@ -219,8 +224,13 @@ class API extends API$1 {
219
224
  );
220
225
  }
221
226
  class PrivateNetworkAPI extends API$1 {
222
- /** Lists the available zones of the API. */
223
- static LOCALITIES = ["fr-par-1", "fr-par-3"];
227
+ /**
228
+ * Locality of this API.
229
+ * type ∈ {'zone','region','global','unspecified'}
230
+ */
231
+ static LOCALITY = toApiLocality({
232
+ zones: ["fr-par-1", "fr-par-3"]
233
+ });
224
234
  getServerPrivateNetwork = (request) => this.client.fetch(
225
235
  {
226
236
  method: "GET",
@@ -89,7 +89,8 @@ const unmarshalServerTypeNetwork = (data) => {
89
89
  );
90
90
  }
91
91
  return {
92
- publicBandwidthBps: data.public_bandwidth_bps
92
+ publicBandwidthBps: data.public_bandwidth_bps,
93
+ supportedBandwidth: data.supported_bandwidth
93
94
  };
94
95
  };
95
96
  const unmarshalServerType = (data) => {
@@ -139,6 +140,7 @@ const unmarshalServer = (data) => {
139
140
  organizationId: data.organization_id,
140
141
  os: data.os ? unmarshalOS(data.os) : void 0,
141
142
  projectId: data.project_id,
143
+ publicBandwidthBps: data.public_bandwidth_bps,
142
144
  sshUsername: data.ssh_username,
143
145
  status: data.status,
144
146
  sudoPassword: data.sudo_password,
@@ -255,6 +257,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
255
257
  name: request.name || randomName("as"),
256
258
  os_id: request.osId,
257
259
  project_id: request.projectId ?? defaults.defaultProjectId,
260
+ public_bandwidth_bps: request.publicBandwidthBps,
258
261
  type: request.type
259
262
  });
260
263
  const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
@@ -277,6 +280,7 @@ const marshalUpdateServerRequest = (request, defaults) => ({
277
280
  commitment_type: request.commitmentType !== void 0 ? marshalCommitmentTypeValue(request.commitmentType) : void 0,
278
281
  enable_vpc: request.enableVpc,
279
282
  name: request.name,
283
+ public_bandwidth_bps: request.publicBandwidthBps,
280
284
  schedule_deletion: request.scheduleDeletion
281
285
  });
282
286
  exports.marshalCreateServerRequest = marshalCreateServerRequest;
@@ -1,5 +1,5 @@
1
1
  import randomName from "@scaleway/random-name";
2
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
3
  const unmarshalOS = (data) => {
4
4
  if (!isJSONObject(data)) {
5
5
  throw new TypeError(
@@ -87,7 +87,8 @@ const unmarshalServerTypeNetwork = (data) => {
87
87
  );
88
88
  }
89
89
  return {
90
- publicBandwidthBps: data.public_bandwidth_bps
90
+ publicBandwidthBps: data.public_bandwidth_bps,
91
+ supportedBandwidth: data.supported_bandwidth
91
92
  };
92
93
  };
93
94
  const unmarshalServerType = (data) => {
@@ -137,6 +138,7 @@ const unmarshalServer = (data) => {
137
138
  organizationId: data.organization_id,
138
139
  os: data.os ? unmarshalOS(data.os) : void 0,
139
140
  projectId: data.project_id,
141
+ publicBandwidthBps: data.public_bandwidth_bps,
140
142
  sshUsername: data.ssh_username,
141
143
  status: data.status,
142
144
  sudoPassword: data.sudo_password,
@@ -253,6 +255,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
253
255
  name: request.name || randomName("as"),
254
256
  os_id: request.osId,
255
257
  project_id: request.projectId ?? defaults.defaultProjectId,
258
+ public_bandwidth_bps: request.publicBandwidthBps,
256
259
  type: request.type
257
260
  });
258
261
  const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
@@ -275,6 +278,7 @@ const marshalUpdateServerRequest = (request, defaults) => ({
275
278
  commitment_type: request.commitmentType !== void 0 ? marshalCommitmentTypeValue(request.commitmentType) : void 0,
276
279
  enable_vpc: request.enableVpc,
277
280
  name: request.name,
281
+ public_bandwidth_bps: request.publicBandwidthBps,
278
282
  schedule_deletion: request.scheduleDeletion
279
283
  });
280
284
  export {
@@ -64,6 +64,7 @@ export interface ServerTypeMemory {
64
64
  }
65
65
  export interface ServerTypeNetwork {
66
66
  publicBandwidthBps: number;
67
+ supportedBandwidth: number[];
67
68
  }
68
69
  export interface Commitment {
69
70
  type: CommitmentType;
@@ -234,6 +235,10 @@ export interface Server {
234
235
  * Commitment scheme applied to this server.
235
236
  */
236
237
  commitment?: Commitment;
238
+ /**
239
+ * Public bandwidth configured for this server. Expressed in bits per second.
240
+ */
241
+ publicBandwidthBps: number;
237
242
  }
238
243
  export interface CommitmentTypeValue {
239
244
  commitmentType: CommitmentType;
@@ -275,6 +280,10 @@ export type CreateServerRequest = {
275
280
  * Activate commitment for this server. 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.
276
281
  */
277
282
  commitmentType?: CommitmentType;
283
+ /**
284
+ * 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
+ */
286
+ publicBandwidthBps: number;
278
287
  };
279
288
  export type DeleteServerRequest = {
280
289
  /**
@@ -561,4 +570,8 @@ export type UpdateServerRequest = {
561
570
  * Change commitment. Use 'none' to automatically cancel a renewing commitment.
562
571
  */
563
572
  commitmentType?: CommitmentTypeValue;
573
+ /**
574
+ * Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint.
575
+ */
576
+ publicBandwidthBps?: number;
564
577
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-applesilicon",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Scaleway SDK applesilicon",
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",