@scaleway/sdk-applesilicon 1.4.0 → 2.1.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.
@@ -1,359 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- zones: ["fr-par-3"]
16
- });
17
- /**
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`.
19
- *
20
- * @param request - The request {@link ListServerTypesRequest}
21
- * @returns A Promise of ListServerTypesResponse
22
- */
23
- listServerTypes = (request = {}) => this.client.fetch(
24
- {
25
- method: "GET",
26
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-types`
27
- },
28
- marshalling_gen.unmarshalListServerTypesResponse
29
- );
30
- /**
31
- * Get a server type. Get technical details (CPU, disk size etc.) of a server type.
32
- *
33
- * @param request - The request {@link GetServerTypeRequest}
34
- * @returns A Promise of ServerType
35
- */
36
- getServerType = (request) => this.client.fetch(
37
- {
38
- method: "GET",
39
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-type/${sdkClient.validatePathParam("serverType", request.serverType)}`
40
- },
41
- marshalling_gen.unmarshalServerType
42
- );
43
- /**
44
- * Create a server. Create a new server in the targeted zone, specifying its configuration including name and type.
45
- *
46
- * @param request - The request {@link CreateServerRequest}
47
- * @returns A Promise of Server
48
- */
49
- createServer = (request) => this.client.fetch(
50
- {
51
- body: JSON.stringify(
52
- marshalling_gen.marshalCreateServerRequest(request, this.client.settings)
53
- ),
54
- headers: jsonContentHeaders,
55
- method: "POST",
56
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
57
- },
58
- marshalling_gen.unmarshalServer
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
- );
77
- pageOfListServers = (request = {}) => this.client.fetch(
78
- {
79
- method: "GET",
80
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
81
- urlParams: sdkClient.urlParams(
82
- ["order_by", request.orderBy],
83
- ["organization_id", request.organizationId],
84
- ["page", request.page],
85
- [
86
- "page_size",
87
- request.pageSize ?? this.client.settings.defaultPageSize
88
- ],
89
- ["project_id", request.projectId]
90
- )
91
- },
92
- marshalling_gen.unmarshalListServersResponse
93
- );
94
- /**
95
- * 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.
96
- *
97
- * @param request - The request {@link ListServersRequest}
98
- * @returns A Promise of ListServersResponse
99
- */
100
- listServers = (request = {}) => sdkClient.enrichForPagination("servers", this.pageOfListServers, request);
101
- pageOfListOS = (request = {}) => this.client.fetch(
102
- {
103
- method: "GET",
104
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
105
- urlParams: sdkClient.urlParams(
106
- ["name", request.name],
107
- ["page", request.page],
108
- [
109
- "page_size",
110
- request.pageSize ?? this.client.settings.defaultPageSize
111
- ],
112
- ["server_type", request.serverType]
113
- )
114
- },
115
- marshalling_gen.unmarshalListOSResponse
116
- );
117
- /**
118
- * 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.
119
- *
120
- * @param request - The request {@link ListOSRequest}
121
- * @returns A Promise of ListOSResponse
122
- */
123
- listOS = (request = {}) => sdkClient.enrichForPagination("os", this.pageOfListOS, request);
124
- /**
125
- * 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.
126
- *
127
- * @param request - The request {@link GetOSRequest}
128
- * @returns A Promise of OS
129
- */
130
- getOS = (request) => this.client.fetch(
131
- {
132
- method: "GET",
133
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${sdkClient.validatePathParam("osId", request.osId)}`
134
- },
135
- marshalling_gen.unmarshalOS
136
- );
137
- /**
138
- * 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.
139
- *
140
- * @param request - The request {@link GetServerRequest}
141
- * @returns A Promise of Server
142
- */
143
- getServer = (request) => this.client.fetch(
144
- {
145
- method: "GET",
146
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
147
- },
148
- marshalling_gen.unmarshalServer
149
- );
150
- /**
151
- * Waits for {@link Server} to be in a final state.
152
- *
153
- * @param request - The request {@link GetServerRequest}
154
- * @param options - The waiting options
155
- * @returns A Promise of Server
156
- */
157
- waitForServer = (request, options) => sdkClient.waitForResource(
158
- options?.stop ?? ((res) => Promise.resolve(
159
- !content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status)
160
- )),
161
- this.getServer,
162
- request,
163
- options
164
- );
165
- /**
166
- * Update a server. Update the parameters of an existing Apple silicon server, specified by its server ID.
167
- *
168
- * @param request - The request {@link UpdateServerRequest}
169
- * @returns A Promise of Server
170
- */
171
- updateServer = (request) => this.client.fetch(
172
- {
173
- body: JSON.stringify(
174
- marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)
175
- ),
176
- headers: jsonContentHeaders,
177
- method: "PATCH",
178
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
179
- },
180
- marshalling_gen.unmarshalServer
181
- );
182
- /**
183
- * 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.
184
- *
185
- * @param request - The request {@link DeleteServerRequest}
186
- */
187
- deleteServer = (request) => this.client.fetch({
188
- method: "DELETE",
189
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
190
- });
191
- /**
192
- * Reboot a server. Reboot an existing Apple silicon server, specified by its server ID.
193
- *
194
- * @param request - The request {@link RebootServerRequest}
195
- * @returns A Promise of Server
196
- */
197
- rebootServer = (request) => this.client.fetch(
198
- {
199
- body: "{}",
200
- headers: jsonContentHeaders,
201
- method: "POST",
202
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/reboot`
203
- },
204
- marshalling_gen.unmarshalServer
205
- );
206
- /**
207
- * 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).
208
- *
209
- * @param request - The request {@link ReinstallServerRequest}
210
- * @returns A Promise of Server
211
- */
212
- reinstallServer = (request) => this.client.fetch(
213
- {
214
- body: JSON.stringify(
215
- marshalling_gen.marshalReinstallServerRequest(request, this.client.settings)
216
- ),
217
- headers: jsonContentHeaders,
218
- method: "POST",
219
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/reinstall`
220
- },
221
- marshalling_gen.unmarshalServer
222
- );
223
- startConnectivityDiagnostic = (request) => this.client.fetch(
224
- {
225
- body: JSON.stringify(
226
- marshalling_gen.marshalStartConnectivityDiagnosticRequest(
227
- request,
228
- this.client.settings
229
- )
230
- ),
231
- headers: jsonContentHeaders,
232
- method: "POST",
233
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics`
234
- },
235
- marshalling_gen.unmarshalStartConnectivityDiagnosticResponse
236
- );
237
- getConnectivityDiagnostic = (request) => this.client.fetch(
238
- {
239
- method: "GET",
240
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics/${sdkClient.validatePathParam("diagnosticId", request.diagnosticId)}`
241
- },
242
- marshalling_gen.unmarshalConnectivityDiagnostic
243
- );
244
- }
245
- class PrivateNetworkAPI extends sdkClient.API {
246
- /**
247
- * Locality of this API.
248
- * type ∈ {'zone','region','global','unspecified'}
249
- */
250
- static LOCALITY = sdkClient.toApiLocality({
251
- zones: ["fr-par-1", "fr-par-3"]
252
- });
253
- getServerPrivateNetwork = (request) => this.client.fetch(
254
- {
255
- method: "GET",
256
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks/${sdkClient.validatePathParam("privateNetworkId", request.privateNetworkId)}`
257
- },
258
- marshalling_gen.unmarshalServerPrivateNetwork
259
- );
260
- /**
261
- * Waits for {@link ServerPrivateNetwork} to be in a final state.
262
- *
263
- * @param request - The request {@link PrivateNetworkApiGetServerPrivateNetworkRequest}
264
- * @param options - The waiting options
265
- * @returns A Promise of ServerPrivateNetwork
266
- */
267
- waitForServerPrivateNetwork = (request, options) => sdkClient.waitForResource(
268
- options?.stop ?? ((res) => Promise.resolve(
269
- !content_gen.SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES.includes(
270
- res.status
271
- )
272
- )),
273
- this.getServerPrivateNetwork,
274
- request,
275
- options
276
- );
277
- /**
278
- * Add a server to a Private Network. Add an Apple silicon server to a Private Network.
279
- *
280
- * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
281
- * @returns A Promise of ServerPrivateNetwork
282
- */
283
- addServerPrivateNetwork = (request) => this.client.fetch(
284
- {
285
- body: JSON.stringify(
286
- marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
287
- request,
288
- this.client.settings
289
- )
290
- ),
291
- headers: jsonContentHeaders,
292
- method: "POST",
293
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks`
294
- },
295
- marshalling_gen.unmarshalServerPrivateNetwork
296
- );
297
- /**
298
- * Set multiple Private Networks on a server. Configure multiple Private Networks on an Apple silicon server.
299
- *
300
- * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
301
- * @returns A Promise of SetServerPrivateNetworksResponse
302
- */
303
- setServerPrivateNetworks = (request) => this.client.fetch(
304
- {
305
- body: JSON.stringify(
306
- marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
307
- request,
308
- this.client.settings
309
- )
310
- ),
311
- headers: jsonContentHeaders,
312
- method: "PUT",
313
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks`
314
- },
315
- marshalling_gen.unmarshalSetServerPrivateNetworksResponse
316
- );
317
- pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
318
- {
319
- method: "GET",
320
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
321
- urlParams: sdkClient.urlParams(
322
- ["ipam_ip_ids", request.ipamIpIds],
323
- ["order_by", request.orderBy],
324
- ["organization_id", request.organizationId],
325
- ["page", request.page],
326
- [
327
- "page_size",
328
- request.pageSize ?? this.client.settings.defaultPageSize
329
- ],
330
- ["private_network_id", request.privateNetworkId],
331
- ["project_id", request.projectId],
332
- ["server_id", request.serverId]
333
- )
334
- },
335
- marshalling_gen.unmarshalListServerPrivateNetworksResponse
336
- );
337
- /**
338
- * List the Private Networks of a server. List the Private Networks of an Apple silicon server.
339
- *
340
- * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
341
- * @returns A Promise of ListServerPrivateNetworksResponse
342
- */
343
- listServerPrivateNetworks = (request = {}) => sdkClient.enrichForPagination(
344
- "serverPrivateNetworks",
345
- this.pageOfListServerPrivateNetworks,
346
- request
347
- );
348
- /**
349
- * Delete a Private Network.
350
- *
351
- * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
352
- */
353
- deleteServerPrivateNetwork = (request) => this.client.fetch({
354
- method: "DELETE",
355
- path: `/apple-silicon/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks/${sdkClient.validatePathParam("privateNetworkId", request.privateNetworkId)}`
356
- });
357
- }
358
- exports.API = API;
359
- exports.PrivateNetworkAPI = PrivateNetworkAPI;
@@ -1,16 +0,0 @@
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;
@@ -1,29 +0,0 @@
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.marshalBatchCreateServersRequest = marshalling_gen.marshalBatchCreateServersRequest;
12
- exports.marshalCreateServerRequest = marshalling_gen.marshalCreateServerRequest;
13
- exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
14
- exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
15
- exports.marshalReinstallServerRequest = marshalling_gen.marshalReinstallServerRequest;
16
- exports.marshalStartConnectivityDiagnosticRequest = marshalling_gen.marshalStartConnectivityDiagnosticRequest;
17
- exports.marshalUpdateServerRequest = marshalling_gen.marshalUpdateServerRequest;
18
- exports.unmarshalBatchCreateServersResponse = marshalling_gen.unmarshalBatchCreateServersResponse;
19
- exports.unmarshalConnectivityDiagnostic = marshalling_gen.unmarshalConnectivityDiagnostic;
20
- exports.unmarshalListOSResponse = marshalling_gen.unmarshalListOSResponse;
21
- exports.unmarshalListServerPrivateNetworksResponse = marshalling_gen.unmarshalListServerPrivateNetworksResponse;
22
- exports.unmarshalListServerTypesResponse = marshalling_gen.unmarshalListServerTypesResponse;
23
- exports.unmarshalListServersResponse = marshalling_gen.unmarshalListServersResponse;
24
- exports.unmarshalOS = marshalling_gen.unmarshalOS;
25
- exports.unmarshalServer = marshalling_gen.unmarshalServer;
26
- exports.unmarshalServerPrivateNetwork = marshalling_gen.unmarshalServerPrivateNetwork;
27
- exports.unmarshalServerType = marshalling_gen.unmarshalServerType;
28
- exports.unmarshalSetServerPrivateNetworksResponse = marshalling_gen.unmarshalSetServerPrivateNetworksResponse;
29
- exports.unmarshalStartConnectivityDiagnosticResponse = marshalling_gen.unmarshalStartConnectivityDiagnosticResponse;