@scaleway/sdk-applesilicon 1.0.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.
@@ -0,0 +1,153 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { Zone as ScwZone, 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';
4
+ /**
5
+ * Apple silicon API.
6
+
7
+ This API allows you to manage your Apple silicon machines.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /** Lists the available zones of the API. */
11
+ static readonly LOCALITIES: ScwZone[];
12
+ /**
13
+ * 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
+ *
15
+ * @param request - The request {@link ListServerTypesRequest}
16
+ * @returns A Promise of ListServerTypesResponse
17
+ */
18
+ listServerTypes: (request?: Readonly<ListServerTypesRequest>) => Promise<ListServerTypesResponse>;
19
+ /**
20
+ * Get a server type. Get technical details (CPU, disk size etc.) of a server type.
21
+ *
22
+ * @param request - The request {@link GetServerTypeRequest}
23
+ * @returns A Promise of ServerType
24
+ */
25
+ getServerType: (request: Readonly<GetServerTypeRequest>) => Promise<ServerType>;
26
+ /**
27
+ * Create a server. Create a new server in the targeted zone, specifying its configuration including name and type.
28
+ *
29
+ * @param request - The request {@link CreateServerRequest}
30
+ * @returns A Promise of Server
31
+ */
32
+ createServer: (request: Readonly<CreateServerRequest>) => Promise<Server>;
33
+ protected pageOfListServers: (request?: Readonly<ListServersRequest>) => Promise<ListServersResponse>;
34
+ /**
35
+ * 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.
36
+ *
37
+ * @param request - The request {@link ListServersRequest}
38
+ * @returns A Promise of ListServersResponse
39
+ */
40
+ listServers: (request?: Readonly<ListServersRequest>) => Promise<ListServersResponse> & {
41
+ all: () => Promise<Server[]>;
42
+ [Symbol.asyncIterator]: () => AsyncGenerator<Server[], void, void>;
43
+ };
44
+ protected pageOfListOS: (request?: Readonly<ListOSRequest>) => Promise<ListOSResponse>;
45
+ /**
46
+ * List all Operating Systems (OS). List all Operating Systems (OS). The response will include the total number of OS as well as their associated IDs, names and labels.
47
+ *
48
+ * @param request - The request {@link ListOSRequest}
49
+ * @returns A Promise of ListOSResponse
50
+ */
51
+ listOS: (request?: Readonly<ListOSRequest>) => Promise<ListOSResponse> & {
52
+ all: () => Promise<OS[]>;
53
+ [Symbol.asyncIterator]: () => AsyncGenerator<OS[], void, void>;
54
+ };
55
+ /**
56
+ * Get an Operating System (OS). Get an Operating System (OS). The response will include the OS's unique ID as well as its name and label.
57
+ *
58
+ * @param request - The request {@link GetOSRequest}
59
+ * @returns A Promise of OS
60
+ */
61
+ getOS: (request: Readonly<GetOSRequest>) => Promise<OS>;
62
+ /**
63
+ * Get a server. Retrieve information about an existing Apple silicon server, specified by its server ID. Its full details, including name, status and IP address, are returned in the response object.
64
+ *
65
+ * @param request - The request {@link GetServerRequest}
66
+ * @returns A Promise of Server
67
+ */
68
+ getServer: (request: Readonly<GetServerRequest>) => Promise<Server>;
69
+ /**
70
+ * Waits for {@link Server} to be in a final state.
71
+ *
72
+ * @param request - The request {@link GetServerRequest}
73
+ * @param options - The waiting options
74
+ * @returns A Promise of Server
75
+ */
76
+ waitForServer: (request: Readonly<GetServerRequest>, options?: Readonly<WaitForOptions<Server>>) => Promise<Server>;
77
+ /**
78
+ * Update a server. Update the parameters of an existing Apple silicon server, specified by its server ID.
79
+ *
80
+ * @param request - The request {@link UpdateServerRequest}
81
+ * @returns A Promise of Server
82
+ */
83
+ updateServer: (request: Readonly<UpdateServerRequest>) => Promise<Server>;
84
+ /**
85
+ * Delete a server. Delete an existing Apple silicon server, specified by its server ID. Deleting a server is permanent, and cannot be undone. Note that the minimum allocation period for Apple silicon-as-a-service is 24 hours, meaning you cannot delete your server prior to that.
86
+ *
87
+ * @param request - The request {@link DeleteServerRequest}
88
+ */
89
+ deleteServer: (request: Readonly<DeleteServerRequest>) => Promise<void>;
90
+ /**
91
+ * Reboot a server. Reboot an existing Apple silicon server, specified by its server ID.
92
+ *
93
+ * @param request - The request {@link RebootServerRequest}
94
+ * @returns A Promise of Server
95
+ */
96
+ rebootServer: (request: Readonly<RebootServerRequest>) => Promise<Server>;
97
+ /**
98
+ * Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the defailt configuration values of the image (OS).
99
+ *
100
+ * @param request - The request {@link ReinstallServerRequest}
101
+ * @returns A Promise of Server
102
+ */
103
+ reinstallServer: (request: Readonly<ReinstallServerRequest>) => Promise<Server>;
104
+ startConnectivityDiagnostic: (request: Readonly<StartConnectivityDiagnosticRequest>) => Promise<StartConnectivityDiagnosticResponse>;
105
+ getConnectivityDiagnostic: (request: Readonly<GetConnectivityDiagnosticRequest>) => Promise<ConnectivityDiagnostic>;
106
+ }
107
+ /**
108
+ * Apple silicon - Private Networks API.
109
+ */
110
+ export declare class PrivateNetworkAPI extends ParentAPI {
111
+ /** Lists the available zones of the API. */
112
+ static readonly LOCALITIES: ScwZone[];
113
+ getServerPrivateNetwork: (request: Readonly<PrivateNetworkApiGetServerPrivateNetworkRequest>) => Promise<ServerPrivateNetwork>;
114
+ /**
115
+ * Waits for {@link ServerPrivateNetwork} to be in a final state.
116
+ *
117
+ * @param request - The request {@link PrivateNetworkApiGetServerPrivateNetworkRequest}
118
+ * @param options - The waiting options
119
+ * @returns A Promise of ServerPrivateNetwork
120
+ */
121
+ waitForServerPrivateNetwork: (request: Readonly<PrivateNetworkApiGetServerPrivateNetworkRequest>, options?: Readonly<WaitForOptions<ServerPrivateNetwork>>) => Promise<ServerPrivateNetwork>;
122
+ /**
123
+ * Add a server to a Private Network. Add an Apple silicon server to a Private Network.
124
+ *
125
+ * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
126
+ * @returns A Promise of ServerPrivateNetwork
127
+ */
128
+ addServerPrivateNetwork: (request: Readonly<PrivateNetworkApiAddServerPrivateNetworkRequest>) => Promise<ServerPrivateNetwork>;
129
+ /**
130
+ * Set multiple Private Networks on a server. Configure multiple Private Networks on an Apple silicon server.
131
+ *
132
+ * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
133
+ * @returns A Promise of SetServerPrivateNetworksResponse
134
+ */
135
+ setServerPrivateNetworks: (request: Readonly<PrivateNetworkApiSetServerPrivateNetworksRequest>) => Promise<SetServerPrivateNetworksResponse>;
136
+ protected pageOfListServerPrivateNetworks: (request?: Readonly<PrivateNetworkApiListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse>;
137
+ /**
138
+ * List the Private Networks of a server. List the Private Networks of an Apple silicon server.
139
+ *
140
+ * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
141
+ * @returns A Promise of ListServerPrivateNetworksResponse
142
+ */
143
+ listServerPrivateNetworks: (request?: Readonly<PrivateNetworkApiListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse> & {
144
+ all: () => Promise<ServerPrivateNetwork[]>;
145
+ [Symbol.asyncIterator]: () => AsyncGenerator<ServerPrivateNetwork[], void, void>;
146
+ };
147
+ /**
148
+ * Delete a Private Network.
149
+ *
150
+ * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
151
+ */
152
+ deleteServerPrivateNetwork: (request: Readonly<PrivateNetworkApiDeleteServerPrivateNetworkRequest>) => Promise<void>;
153
+ }
@@ -0,0 +1,332 @@
1
+ import { API as API$1, validatePathParam, urlParams, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
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";
4
+ const jsonContentHeaders = {
5
+ "Content-Type": "application/json; charset=utf-8"
6
+ };
7
+ class API extends API$1 {
8
+ /** Lists the available zones of the API. */
9
+ static LOCALITIES = ["fr-par-3"];
10
+ /**
11
+ * 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
+ *
13
+ * @param request - The request {@link ListServerTypesRequest}
14
+ * @returns A Promise of ListServerTypesResponse
15
+ */
16
+ listServerTypes = (request = {}) => this.client.fetch(
17
+ {
18
+ method: "GET",
19
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-types`
20
+ },
21
+ unmarshalListServerTypesResponse
22
+ );
23
+ /**
24
+ * Get a server type. Get technical details (CPU, disk size etc.) of a server type.
25
+ *
26
+ * @param request - The request {@link GetServerTypeRequest}
27
+ * @returns A Promise of ServerType
28
+ */
29
+ getServerType = (request) => this.client.fetch(
30
+ {
31
+ method: "GET",
32
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam("serverType", request.serverType)}`
33
+ },
34
+ unmarshalServerType
35
+ );
36
+ /**
37
+ * Create a server. Create a new server in the targeted zone, specifying its configuration including name and type.
38
+ *
39
+ * @param request - The request {@link CreateServerRequest}
40
+ * @returns A Promise of Server
41
+ */
42
+ createServer = (request) => this.client.fetch(
43
+ {
44
+ body: JSON.stringify(
45
+ marshalCreateServerRequest(request, this.client.settings)
46
+ ),
47
+ headers: jsonContentHeaders,
48
+ method: "POST",
49
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
50
+ },
51
+ unmarshalServer
52
+ );
53
+ pageOfListServers = (request = {}) => this.client.fetch(
54
+ {
55
+ method: "GET",
56
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
57
+ urlParams: urlParams(
58
+ ["order_by", request.orderBy],
59
+ ["organization_id", request.organizationId],
60
+ ["page", request.page],
61
+ [
62
+ "page_size",
63
+ request.pageSize ?? this.client.settings.defaultPageSize
64
+ ],
65
+ ["project_id", request.projectId]
66
+ )
67
+ },
68
+ unmarshalListServersResponse
69
+ );
70
+ /**
71
+ * 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.
72
+ *
73
+ * @param request - The request {@link ListServersRequest}
74
+ * @returns A Promise of ListServersResponse
75
+ */
76
+ listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
77
+ pageOfListOS = (request = {}) => this.client.fetch(
78
+ {
79
+ method: "GET",
80
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
81
+ urlParams: urlParams(
82
+ ["name", request.name],
83
+ ["page", request.page],
84
+ [
85
+ "page_size",
86
+ request.pageSize ?? this.client.settings.defaultPageSize
87
+ ],
88
+ ["server_type", request.serverType]
89
+ )
90
+ },
91
+ unmarshalListOSResponse
92
+ );
93
+ /**
94
+ * List all Operating Systems (OS). List all Operating Systems (OS). The response will include the total number of OS as well as their associated IDs, names and labels.
95
+ *
96
+ * @param request - The request {@link ListOSRequest}
97
+ * @returns A Promise of ListOSResponse
98
+ */
99
+ listOS = (request = {}) => enrichForPagination("os", this.pageOfListOS, request);
100
+ /**
101
+ * Get an Operating System (OS). Get an Operating System (OS). The response will include the OS's unique ID as well as its name and label.
102
+ *
103
+ * @param request - The request {@link GetOSRequest}
104
+ * @returns A Promise of OS
105
+ */
106
+ getOS = (request) => this.client.fetch(
107
+ {
108
+ method: "GET",
109
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`
110
+ },
111
+ unmarshalOS
112
+ );
113
+ /**
114
+ * Get a server. Retrieve information about an existing Apple silicon server, specified by its server ID. Its full details, including name, status and IP address, are returned in the response object.
115
+ *
116
+ * @param request - The request {@link GetServerRequest}
117
+ * @returns A Promise of Server
118
+ */
119
+ getServer = (request) => this.client.fetch(
120
+ {
121
+ method: "GET",
122
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
123
+ },
124
+ unmarshalServer
125
+ );
126
+ /**
127
+ * Waits for {@link Server} to be in a final state.
128
+ *
129
+ * @param request - The request {@link GetServerRequest}
130
+ * @param options - The waiting options
131
+ * @returns A Promise of Server
132
+ */
133
+ waitForServer = (request, options) => waitForResource(
134
+ options?.stop ?? ((res) => Promise.resolve(
135
+ !SERVER_TRANSIENT_STATUSES.includes(res.status)
136
+ )),
137
+ this.getServer,
138
+ request,
139
+ options
140
+ );
141
+ /**
142
+ * Update a server. Update the parameters of an existing Apple silicon server, specified by its server ID.
143
+ *
144
+ * @param request - The request {@link UpdateServerRequest}
145
+ * @returns A Promise of Server
146
+ */
147
+ updateServer = (request) => this.client.fetch(
148
+ {
149
+ body: JSON.stringify(
150
+ marshalUpdateServerRequest(request, this.client.settings)
151
+ ),
152
+ headers: jsonContentHeaders,
153
+ method: "PATCH",
154
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
155
+ },
156
+ unmarshalServer
157
+ );
158
+ /**
159
+ * Delete a server. Delete an existing Apple silicon server, specified by its server ID. Deleting a server is permanent, and cannot be undone. Note that the minimum allocation period for Apple silicon-as-a-service is 24 hours, meaning you cannot delete your server prior to that.
160
+ *
161
+ * @param request - The request {@link DeleteServerRequest}
162
+ */
163
+ deleteServer = (request) => this.client.fetch({
164
+ method: "DELETE",
165
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
166
+ });
167
+ /**
168
+ * Reboot a server. Reboot an existing Apple silicon server, specified by its server ID.
169
+ *
170
+ * @param request - The request {@link RebootServerRequest}
171
+ * @returns A Promise of Server
172
+ */
173
+ rebootServer = (request) => this.client.fetch(
174
+ {
175
+ body: "{}",
176
+ headers: jsonContentHeaders,
177
+ method: "POST",
178
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
179
+ },
180
+ unmarshalServer
181
+ );
182
+ /**
183
+ * Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the defailt configuration values of the image (OS).
184
+ *
185
+ * @param request - The request {@link ReinstallServerRequest}
186
+ * @returns A Promise of Server
187
+ */
188
+ reinstallServer = (request) => this.client.fetch(
189
+ {
190
+ body: JSON.stringify(
191
+ marshalReinstallServerRequest(request, this.client.settings)
192
+ ),
193
+ headers: jsonContentHeaders,
194
+ method: "POST",
195
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reinstall`
196
+ },
197
+ unmarshalServer
198
+ );
199
+ startConnectivityDiagnostic = (request) => this.client.fetch(
200
+ {
201
+ body: JSON.stringify(
202
+ marshalStartConnectivityDiagnosticRequest(
203
+ request,
204
+ this.client.settings
205
+ )
206
+ ),
207
+ headers: jsonContentHeaders,
208
+ method: "POST",
209
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics`
210
+ },
211
+ unmarshalStartConnectivityDiagnosticResponse
212
+ );
213
+ getConnectivityDiagnostic = (request) => this.client.fetch(
214
+ {
215
+ method: "GET",
216
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics/${validatePathParam("diagnosticId", request.diagnosticId)}`
217
+ },
218
+ unmarshalConnectivityDiagnostic
219
+ );
220
+ }
221
+ class PrivateNetworkAPI extends API$1 {
222
+ /** Lists the available zones of the API. */
223
+ static LOCALITIES = ["fr-par-1", "fr-par-3"];
224
+ getServerPrivateNetwork = (request) => this.client.fetch(
225
+ {
226
+ method: "GET",
227
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
228
+ },
229
+ unmarshalServerPrivateNetwork
230
+ );
231
+ /**
232
+ * Waits for {@link ServerPrivateNetwork} to be in a final state.
233
+ *
234
+ * @param request - The request {@link PrivateNetworkApiGetServerPrivateNetworkRequest}
235
+ * @param options - The waiting options
236
+ * @returns A Promise of ServerPrivateNetwork
237
+ */
238
+ waitForServerPrivateNetwork = (request, options) => waitForResource(
239
+ options?.stop ?? ((res) => Promise.resolve(
240
+ !SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES.includes(
241
+ res.status
242
+ )
243
+ )),
244
+ this.getServerPrivateNetwork,
245
+ request,
246
+ options
247
+ );
248
+ /**
249
+ * Add a server to a Private Network. Add an Apple silicon server to a Private Network.
250
+ *
251
+ * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
252
+ * @returns A Promise of ServerPrivateNetwork
253
+ */
254
+ addServerPrivateNetwork = (request) => this.client.fetch(
255
+ {
256
+ body: JSON.stringify(
257
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
258
+ request,
259
+ this.client.settings
260
+ )
261
+ ),
262
+ headers: jsonContentHeaders,
263
+ method: "POST",
264
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
265
+ },
266
+ unmarshalServerPrivateNetwork
267
+ );
268
+ /**
269
+ * Set multiple Private Networks on a server. Configure multiple Private Networks on an Apple silicon server.
270
+ *
271
+ * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
272
+ * @returns A Promise of SetServerPrivateNetworksResponse
273
+ */
274
+ setServerPrivateNetworks = (request) => this.client.fetch(
275
+ {
276
+ body: JSON.stringify(
277
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
278
+ request,
279
+ this.client.settings
280
+ )
281
+ ),
282
+ headers: jsonContentHeaders,
283
+ method: "PUT",
284
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
285
+ },
286
+ unmarshalSetServerPrivateNetworksResponse
287
+ );
288
+ pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
289
+ {
290
+ method: "GET",
291
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
292
+ urlParams: urlParams(
293
+ ["ipam_ip_ids", request.ipamIpIds],
294
+ ["order_by", request.orderBy],
295
+ ["organization_id", request.organizationId],
296
+ ["page", request.page],
297
+ [
298
+ "page_size",
299
+ request.pageSize ?? this.client.settings.defaultPageSize
300
+ ],
301
+ ["private_network_id", request.privateNetworkId],
302
+ ["project_id", request.projectId],
303
+ ["server_id", request.serverId]
304
+ )
305
+ },
306
+ unmarshalListServerPrivateNetworksResponse
307
+ );
308
+ /**
309
+ * List the Private Networks of a server. List the Private Networks of an Apple silicon server.
310
+ *
311
+ * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
312
+ * @returns A Promise of ListServerPrivateNetworksResponse
313
+ */
314
+ listServerPrivateNetworks = (request = {}) => enrichForPagination(
315
+ "serverPrivateNetworks",
316
+ this.pageOfListServerPrivateNetworks,
317
+ request
318
+ );
319
+ /**
320
+ * Delete a Private Network.
321
+ *
322
+ * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
323
+ */
324
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
325
+ method: "DELETE",
326
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
327
+ });
328
+ }
329
+ export {
330
+ API,
331
+ PrivateNetworkAPI
332
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES = ["attaching", "detaching"];
4
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["vpc_updating"];
5
+ const SERVER_TRANSIENT_STATUSES = [
6
+ "starting",
7
+ "rebooting",
8
+ "updating",
9
+ "locking",
10
+ "unlocking",
11
+ "reinstalling",
12
+ "busy"
13
+ ];
14
+ exports.SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES;
15
+ exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;
16
+ exports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES;
@@ -0,0 +1,7 @@
1
+ import type { ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus } from './types.gen';
2
+ /** Lists transient statutes of the enum {@link ServerPrivateNetworkServerStatus}. */
3
+ export declare const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[];
4
+ /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
5
+ export declare const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[];
6
+ /** Lists transient statutes of the enum {@link ServerStatus}. */
7
+ export declare const SERVER_TRANSIENT_STATUSES: ServerStatus[];
@@ -0,0 +1,16 @@
1
+ const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES = ["attaching", "detaching"];
2
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["vpc_updating"];
3
+ const SERVER_TRANSIENT_STATUSES = [
4
+ "starting",
5
+ "rebooting",
6
+ "updating",
7
+ "locking",
8
+ "unlocking",
9
+ "reinstalling",
10
+ "busy"
11
+ ];
12
+ export {
13
+ SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES,
14
+ SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
15
+ SERVER_TRANSIENT_STATUSES
16
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ exports.API = api_gen.API;
7
+ exports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI;
8
+ exports.SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES;
9
+ exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;
10
+ exports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES;
11
+ exports.marshalCreateServerRequest = marshalling_gen.marshalCreateServerRequest;
12
+ exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
13
+ exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
14
+ exports.marshalReinstallServerRequest = marshalling_gen.marshalReinstallServerRequest;
15
+ exports.marshalStartConnectivityDiagnosticRequest = marshalling_gen.marshalStartConnectivityDiagnosticRequest;
16
+ exports.marshalUpdateServerRequest = marshalling_gen.marshalUpdateServerRequest;
17
+ exports.unmarshalConnectivityDiagnostic = marshalling_gen.unmarshalConnectivityDiagnostic;
18
+ exports.unmarshalListOSResponse = marshalling_gen.unmarshalListOSResponse;
19
+ exports.unmarshalListServerPrivateNetworksResponse = marshalling_gen.unmarshalListServerPrivateNetworksResponse;
20
+ exports.unmarshalListServerTypesResponse = marshalling_gen.unmarshalListServerTypesResponse;
21
+ exports.unmarshalListServersResponse = marshalling_gen.unmarshalListServersResponse;
22
+ exports.unmarshalOS = marshalling_gen.unmarshalOS;
23
+ exports.unmarshalServer = marshalling_gen.unmarshalServer;
24
+ exports.unmarshalServerPrivateNetwork = marshalling_gen.unmarshalServerPrivateNetwork;
25
+ exports.unmarshalServerType = marshalling_gen.unmarshalServerType;
26
+ exports.unmarshalSetServerPrivateNetworksResponse = marshalling_gen.unmarshalSetServerPrivateNetworksResponse;
27
+ exports.unmarshalStartConnectivityDiagnosticResponse = marshalling_gen.unmarshalStartConnectivityDiagnosticResponse;
@@ -0,0 +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';
@@ -0,0 +1,27 @@
1
+ import { API, PrivateNetworkAPI } from "./api.gen.js";
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";
4
+ export {
5
+ API,
6
+ PrivateNetworkAPI,
7
+ SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES,
8
+ SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
9
+ SERVER_TRANSIENT_STATUSES,
10
+ marshalCreateServerRequest,
11
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
12
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
13
+ marshalReinstallServerRequest,
14
+ marshalStartConnectivityDiagnosticRequest,
15
+ marshalUpdateServerRequest,
16
+ unmarshalConnectivityDiagnostic,
17
+ unmarshalListOSResponse,
18
+ unmarshalListServerPrivateNetworksResponse,
19
+ unmarshalListServerTypesResponse,
20
+ unmarshalListServersResponse,
21
+ unmarshalOS,
22
+ unmarshalServer,
23
+ unmarshalServerPrivateNetwork,
24
+ unmarshalServerType,
25
+ unmarshalSetServerPrivateNetworksResponse,
26
+ unmarshalStartConnectivityDiagnosticResponse
27
+ };