@scaleway/sdk-baremetal 2.5.0 → 2.6.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.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +6 -6
- package/dist/metadata.gen.js +6 -2
- package/dist/v1/api.gen.d.ts +1 -1
- package/dist/v1/api.gen.js +196 -399
- package/dist/v1/content.gen.js +3 -3
- package/dist/v1/marshalling.gen.js +64 -64
- package/dist/v1/metadata.gen.js +1 -1
- package/dist/v1/validation-rules.gen.js +11 -11
- package/dist/v3/api.gen.js +36 -58
- package/dist/v3/content.gen.js +1 -1
- package/dist/v3/marshalling.gen.js +5 -5
- package/dist/v3/metadata.gen.js +1 -1
- package/package.json +15 -14
- package/LICENSE +0 -191
- package/dist/metadata.gen.json +0 -6
- package/dist/metadata2.gen.js +0 -8
package/dist/v1/api.gen.js
CHANGED
|
@@ -2,416 +2,213 @@ import { SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
|
2
2
|
import { marshalAddOptionServerRequest, marshalBatchCreateServersRequest, marshalCreateServerRequest, marshalInstallServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalRebootServerRequest, marshalStartBMCAccessRequest, marshalStartServerRequest, marshalUpdateIPRequest, marshalUpdateServerRequest, marshalUpdateSettingRequest, marshalValidatePartitioningSchemaRequest, unmarshalBMCAccess, unmarshalBatchCreateServersResponse, unmarshalGetServerMetricsResponse, unmarshalIP, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListOptionsResponse, unmarshalListServerEventsResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalListSettingsResponse, unmarshalOS, unmarshalOffer, unmarshalOption, unmarshalSchema, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse, unmarshalSetting } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v1/api.gen.ts
|
|
5
|
-
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
6
|
/**
|
|
7
7
|
* Elastic Metal API.
|
|
8
8
|
|
|
9
9
|
This API allows you to manage your Elastic Metal servers.
|
|
10
10
|
*/
|
|
11
11
|
var API = class extends API$1 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
urlParams: urlParams(["offer_id", request.offerId], ["os_id", request.osId])
|
|
180
|
-
}, unmarshalSchema);
|
|
181
|
-
/**
|
|
182
|
-
* Validate client partitioning schema. Validate the incoming partitioning schema from a user before installing the server. Return default ErrorCode if invalid.
|
|
183
|
-
*
|
|
184
|
-
* @param request - The request {@link ValidatePartitioningSchemaRequest}
|
|
185
|
-
*/
|
|
186
|
-
validatePartitioningSchema = (request) => this.client.fetch({
|
|
187
|
-
body: JSON.stringify(marshalValidatePartitioningSchemaRequest(request, this.client.settings)),
|
|
188
|
-
headers: jsonContentHeaders,
|
|
189
|
-
method: "POST",
|
|
190
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
|
|
191
|
-
});
|
|
192
|
-
/**
|
|
193
|
-
* Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
|
|
194
|
-
The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
|
|
195
|
-
You need first to create an option Remote Access. You will find the ID and the price with a call to listOffers (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92). Then add the option https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
|
|
196
|
-
After adding the BMC option, you need to Get Remote Access to get the login/password https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do not forget to delete the Option after use.
|
|
197
|
-
*
|
|
198
|
-
* @param request - The request {@link StartBMCAccessRequest}
|
|
199
|
-
* @returns A Promise of BMCAccess
|
|
200
|
-
*/
|
|
201
|
-
startBMCAccess = (request) => this.client.fetch({
|
|
202
|
-
body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
|
|
203
|
-
headers: jsonContentHeaders,
|
|
204
|
-
method: "POST",
|
|
205
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
206
|
-
}, unmarshalBMCAccess);
|
|
207
|
-
/**
|
|
208
|
-
* Get BMC access. Get the BMC (Baseboard Management Controller) access associated with the ID, including the URL and login information needed to connect.
|
|
209
|
-
*
|
|
210
|
-
* @param request - The request {@link GetBMCAccessRequest}
|
|
211
|
-
* @returns A Promise of BMCAccess
|
|
212
|
-
*/
|
|
213
|
-
getBMCAccess = (request) => this.client.fetch({
|
|
214
|
-
method: "GET",
|
|
215
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
216
|
-
}, unmarshalBMCAccess);
|
|
217
|
-
/**
|
|
218
|
-
* Stop BMC access. Stop BMC (Baseboard Management Controller) access associated with the ID.
|
|
219
|
-
*
|
|
220
|
-
* @param request - The request {@link StopBMCAccessRequest}
|
|
221
|
-
*/
|
|
222
|
-
stopBMCAccess = (request) => this.client.fetch({
|
|
223
|
-
method: "DELETE",
|
|
224
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
225
|
-
});
|
|
226
|
-
/**
|
|
227
|
-
* Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.
|
|
228
|
-
*
|
|
229
|
-
* @param request - The request {@link UpdateIPRequest}
|
|
230
|
-
* @returns A Promise of IP
|
|
231
|
-
*/
|
|
232
|
-
updateIP = (request) => this.client.fetch({
|
|
233
|
-
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
234
|
-
headers: jsonContentHeaders,
|
|
235
|
-
method: "PATCH",
|
|
236
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
237
|
-
}, unmarshalIP);
|
|
238
|
-
/**
|
|
239
|
-
* Add server option. Add an option, such as Private Networks, to a specific server.
|
|
240
|
-
*
|
|
241
|
-
* @param request - The request {@link AddOptionServerRequest}
|
|
242
|
-
* @returns A Promise of Server
|
|
243
|
-
*/
|
|
244
|
-
addOptionServer = (request) => this.client.fetch({
|
|
245
|
-
body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
|
|
246
|
-
headers: jsonContentHeaders,
|
|
247
|
-
method: "POST",
|
|
248
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
|
|
249
|
-
}, unmarshalServer);
|
|
250
|
-
/**
|
|
251
|
-
* Delete server option. Delete an option from a specific server.
|
|
252
|
-
*
|
|
253
|
-
* @param request - The request {@link DeleteOptionServerRequest}
|
|
254
|
-
* @returns A Promise of Server
|
|
255
|
-
*/
|
|
256
|
-
deleteOptionServer = (request) => this.client.fetch({
|
|
257
|
-
method: "DELETE",
|
|
258
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
|
|
259
|
-
}, unmarshalServer);
|
|
260
|
-
/**
|
|
261
|
-
* Migrate server offer. Migrate server with hourly offer to monthly offer.
|
|
262
|
-
*
|
|
263
|
-
* @param request - The request {@link MigrateServerToMonthlyOfferRequest}
|
|
264
|
-
* @returns A Promise of Server
|
|
265
|
-
*/
|
|
266
|
-
migrateServerToMonthlyOffer = (request) => this.client.fetch({
|
|
267
|
-
method: "POST",
|
|
268
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/migrate-offer-monthly`
|
|
269
|
-
}, unmarshalServer);
|
|
270
|
-
pageOfListOffers = (request = {}) => this.client.fetch({
|
|
271
|
-
method: "GET",
|
|
272
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
|
|
273
|
-
urlParams: urlParams(["name", request.name], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["subscription_period", request.subscriptionPeriod])
|
|
274
|
-
}, unmarshalListOffersResponse);
|
|
275
|
-
/**
|
|
276
|
-
* List offers. List all available Elastic Metal server configurations.
|
|
277
|
-
*
|
|
278
|
-
* @param request - The request {@link ListOffersRequest}
|
|
279
|
-
* @returns A Promise of ListOffersResponse
|
|
280
|
-
*/
|
|
281
|
-
listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
|
|
282
|
-
/**
|
|
283
|
-
* Get offer. Get details of an offer identified by its offer ID.
|
|
284
|
-
*
|
|
285
|
-
* @param request - The request {@link GetOfferRequest}
|
|
286
|
-
* @returns A Promise of Offer
|
|
287
|
-
*/
|
|
288
|
-
getOffer = (request) => this.client.fetch({
|
|
289
|
-
method: "GET",
|
|
290
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`
|
|
291
|
-
}, unmarshalOffer);
|
|
292
|
-
/**
|
|
293
|
-
* Get option. Return specific option for the ID.
|
|
294
|
-
*
|
|
295
|
-
* @param request - The request {@link GetOptionRequest}
|
|
296
|
-
* @returns A Promise of Option
|
|
297
|
-
*/
|
|
298
|
-
getOption = (request) => this.client.fetch({
|
|
299
|
-
method: "GET",
|
|
300
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam("optionId", request.optionId)}`
|
|
301
|
-
}, unmarshalOption);
|
|
302
|
-
pageOfListOptions = (request = {}) => this.client.fetch({
|
|
303
|
-
method: "GET",
|
|
304
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`,
|
|
305
|
-
urlParams: urlParams(["name", request.name], ["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
306
|
-
}, unmarshalListOptionsResponse);
|
|
307
|
-
/**
|
|
308
|
-
* List options. List all options matching with filters.
|
|
309
|
-
*
|
|
310
|
-
* @param request - The request {@link ListOptionsRequest}
|
|
311
|
-
* @returns A Promise of ListOptionsResponse
|
|
312
|
-
*/
|
|
313
|
-
listOptions = (request = {}) => enrichForPagination("options", this.pageOfListOptions, request);
|
|
314
|
-
pageOfListSettings = (request = {}) => this.client.fetch({
|
|
315
|
-
method: "GET",
|
|
316
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`,
|
|
317
|
-
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
|
|
318
|
-
}, unmarshalListSettingsResponse);
|
|
319
|
-
/**
|
|
320
|
-
* List all settings. Return all settings for a Project ID.
|
|
321
|
-
*
|
|
322
|
-
* @param request - The request {@link ListSettingsRequest}
|
|
323
|
-
* @returns A Promise of ListSettingsResponse
|
|
324
|
-
*/
|
|
325
|
-
listSettings = (request = {}) => enrichForPagination("settings", this.pageOfListSettings, request);
|
|
326
|
-
/**
|
|
327
|
-
* Update setting. Update a setting for a Project ID (enable or disable).
|
|
328
|
-
*
|
|
329
|
-
* @param request - The request {@link UpdateSettingRequest}
|
|
330
|
-
* @returns A Promise of Setting
|
|
331
|
-
*/
|
|
332
|
-
updateSetting = (request) => this.client.fetch({
|
|
333
|
-
body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
|
|
334
|
-
headers: jsonContentHeaders,
|
|
335
|
-
method: "PATCH",
|
|
336
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam("settingId", request.settingId)}`
|
|
337
|
-
}, unmarshalSetting);
|
|
338
|
-
pageOfListOS = (request = {}) => this.client.fetch({
|
|
339
|
-
method: "GET",
|
|
340
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
|
|
341
|
-
urlParams: urlParams(["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
342
|
-
}, unmarshalListOSResponse);
|
|
343
|
-
/**
|
|
344
|
-
* List available OSes. List all OSes that are available for installation on Elastic Metal servers.
|
|
345
|
-
*
|
|
346
|
-
* @param request - The request {@link ListOSRequest}
|
|
347
|
-
* @returns A Promise of ListOSResponse
|
|
348
|
-
*/
|
|
349
|
-
listOS = (request = {}) => enrichForPagination("os", this.pageOfListOS, request);
|
|
350
|
-
/**
|
|
351
|
-
* Get OS with an ID. Return the specific OS for the ID.
|
|
352
|
-
*
|
|
353
|
-
* @param request - The request {@link GetOSRequest}
|
|
354
|
-
* @returns A Promise of OS
|
|
355
|
-
*/
|
|
356
|
-
getOS = (request) => this.client.fetch({
|
|
357
|
-
method: "GET",
|
|
358
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`
|
|
359
|
-
}, unmarshalOS);
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.pageOfListServers = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
|
|
17
|
+
urlParams: urlParams(["name", request.name], ["option_id", request.optionId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["status", request.status], ["tags", request.tags])
|
|
18
|
+
}, unmarshalListServersResponse);
|
|
19
|
+
this.listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
|
|
20
|
+
this.getServer = (request) => this.client.fetch({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
|
|
23
|
+
}, unmarshalServer);
|
|
24
|
+
this.waitForServer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
|
|
25
|
+
this.createServer = (request) => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
|
|
30
|
+
}, unmarshalServer);
|
|
31
|
+
this.batchCreateServers = (request = {}) => this.client.fetch({
|
|
32
|
+
body: JSON.stringify(marshalBatchCreateServersRequest(request, this.client.settings)),
|
|
33
|
+
headers: jsonContentHeaders,
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/batch-create-servers`
|
|
36
|
+
}, unmarshalBatchCreateServersResponse);
|
|
37
|
+
this.updateServer = (request) => this.client.fetch({
|
|
38
|
+
body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
|
|
39
|
+
headers: jsonContentHeaders,
|
|
40
|
+
method: "PATCH",
|
|
41
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
|
|
42
|
+
}, unmarshalServer);
|
|
43
|
+
this.installServer = async (request) => this.client.fetch({
|
|
44
|
+
body: JSON.stringify(await marshalInstallServerRequest(request, this.client.settings)),
|
|
45
|
+
headers: jsonContentHeaders,
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
|
|
48
|
+
}, unmarshalServer);
|
|
49
|
+
this.getServerMetrics = (request) => this.client.fetch({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/metrics`
|
|
52
|
+
}, unmarshalGetServerMetricsResponse);
|
|
53
|
+
this.deleteServer = (request) => this.client.fetch({
|
|
54
|
+
method: "DELETE",
|
|
55
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
|
|
56
|
+
}, unmarshalServer);
|
|
57
|
+
this.rebootServer = (request) => this.client.fetch({
|
|
58
|
+
body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
|
|
59
|
+
headers: jsonContentHeaders,
|
|
60
|
+
method: "POST",
|
|
61
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
|
|
62
|
+
}, unmarshalServer);
|
|
63
|
+
this.startServer = (request) => this.client.fetch({
|
|
64
|
+
body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
|
|
65
|
+
headers: jsonContentHeaders,
|
|
66
|
+
method: "POST",
|
|
67
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/start`
|
|
68
|
+
}, unmarshalServer);
|
|
69
|
+
this.stopServer = (request) => this.client.fetch({
|
|
70
|
+
body: "{}",
|
|
71
|
+
headers: jsonContentHeaders,
|
|
72
|
+
method: "POST",
|
|
73
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/stop`
|
|
74
|
+
}, unmarshalServer);
|
|
75
|
+
this.pageOfListServerEvents = (request) => this.client.fetch({
|
|
76
|
+
method: "GET",
|
|
77
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/events`,
|
|
78
|
+
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
79
|
+
}, unmarshalListServerEventsResponse);
|
|
80
|
+
this.listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
|
|
81
|
+
this.getDefaultPartitioningSchema = (request) => this.client.fetch({
|
|
82
|
+
method: "GET",
|
|
83
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
|
|
84
|
+
urlParams: urlParams(["offer_id", request.offerId], ["os_id", request.osId])
|
|
85
|
+
}, unmarshalSchema);
|
|
86
|
+
this.validatePartitioningSchema = (request) => this.client.fetch({
|
|
87
|
+
body: JSON.stringify(marshalValidatePartitioningSchemaRequest(request, this.client.settings)),
|
|
88
|
+
headers: jsonContentHeaders,
|
|
89
|
+
method: "POST",
|
|
90
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
|
|
91
|
+
});
|
|
92
|
+
this.startBMCAccess = (request) => this.client.fetch({
|
|
93
|
+
body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
|
|
94
|
+
headers: jsonContentHeaders,
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
97
|
+
}, unmarshalBMCAccess);
|
|
98
|
+
this.getBMCAccess = (request) => this.client.fetch({
|
|
99
|
+
method: "GET",
|
|
100
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
101
|
+
}, unmarshalBMCAccess);
|
|
102
|
+
this.stopBMCAccess = (request) => this.client.fetch({
|
|
103
|
+
method: "DELETE",
|
|
104
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
105
|
+
});
|
|
106
|
+
this.updateIP = (request) => this.client.fetch({
|
|
107
|
+
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
108
|
+
headers: jsonContentHeaders,
|
|
109
|
+
method: "PATCH",
|
|
110
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
111
|
+
}, unmarshalIP);
|
|
112
|
+
this.addOptionServer = (request) => this.client.fetch({
|
|
113
|
+
body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
|
|
114
|
+
headers: jsonContentHeaders,
|
|
115
|
+
method: "POST",
|
|
116
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
|
|
117
|
+
}, unmarshalServer);
|
|
118
|
+
this.deleteOptionServer = (request) => this.client.fetch({
|
|
119
|
+
method: "DELETE",
|
|
120
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
|
|
121
|
+
}, unmarshalServer);
|
|
122
|
+
this.migrateServerToMonthlyOffer = (request) => this.client.fetch({
|
|
123
|
+
method: "POST",
|
|
124
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/migrate-offer-monthly`
|
|
125
|
+
}, unmarshalServer);
|
|
126
|
+
this.pageOfListOffers = (request = {}) => this.client.fetch({
|
|
127
|
+
method: "GET",
|
|
128
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
|
|
129
|
+
urlParams: urlParams(["name", request.name], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["subscription_period", request.subscriptionPeriod])
|
|
130
|
+
}, unmarshalListOffersResponse);
|
|
131
|
+
this.listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
|
|
132
|
+
this.getOffer = (request) => this.client.fetch({
|
|
133
|
+
method: "GET",
|
|
134
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`
|
|
135
|
+
}, unmarshalOffer);
|
|
136
|
+
this.getOption = (request) => this.client.fetch({
|
|
137
|
+
method: "GET",
|
|
138
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam("optionId", request.optionId)}`
|
|
139
|
+
}, unmarshalOption);
|
|
140
|
+
this.pageOfListOptions = (request = {}) => this.client.fetch({
|
|
141
|
+
method: "GET",
|
|
142
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`,
|
|
143
|
+
urlParams: urlParams(["name", request.name], ["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
144
|
+
}, unmarshalListOptionsResponse);
|
|
145
|
+
this.listOptions = (request = {}) => enrichForPagination("options", this.pageOfListOptions, request);
|
|
146
|
+
this.pageOfListSettings = (request = {}) => this.client.fetch({
|
|
147
|
+
method: "GET",
|
|
148
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`,
|
|
149
|
+
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
|
|
150
|
+
}, unmarshalListSettingsResponse);
|
|
151
|
+
this.listSettings = (request = {}) => enrichForPagination("settings", this.pageOfListSettings, request);
|
|
152
|
+
this.updateSetting = (request) => this.client.fetch({
|
|
153
|
+
body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
|
|
154
|
+
headers: jsonContentHeaders,
|
|
155
|
+
method: "PATCH",
|
|
156
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam("settingId", request.settingId)}`
|
|
157
|
+
}, unmarshalSetting);
|
|
158
|
+
this.pageOfListOS = (request = {}) => this.client.fetch({
|
|
159
|
+
method: "GET",
|
|
160
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
|
|
161
|
+
urlParams: urlParams(["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
162
|
+
}, unmarshalListOSResponse);
|
|
163
|
+
this.listOS = (request = {}) => enrichForPagination("os", this.pageOfListOS, request);
|
|
164
|
+
this.getOS = (request) => this.client.fetch({
|
|
165
|
+
method: "GET",
|
|
166
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`
|
|
167
|
+
}, unmarshalOS);
|
|
168
|
+
}
|
|
169
|
+
static {
|
|
170
|
+
this.LOCALITY = toApiLocality({ zones: [
|
|
171
|
+
"fr-par-1",
|
|
172
|
+
"fr-par-2",
|
|
173
|
+
"nl-ams-1",
|
|
174
|
+
"nl-ams-2",
|
|
175
|
+
"pl-waw-2",
|
|
176
|
+
"pl-waw-3"
|
|
177
|
+
] });
|
|
178
|
+
}
|
|
360
179
|
};
|
|
361
180
|
/**
|
|
362
181
|
* Elastic Metal - Private Network API.
|
|
363
182
|
*/
|
|
364
183
|
var PrivateNetworkAPI = class extends API$1 {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}, unmarshalSetServerPrivateNetworksResponse);
|
|
394
|
-
pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
|
|
395
|
-
method: "GET",
|
|
396
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
|
|
397
|
-
urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["project_id", request.projectId], ["server_id", request.serverId])
|
|
398
|
-
}, unmarshalListServerPrivateNetworksResponse);
|
|
399
|
-
/**
|
|
400
|
-
* List the Private Networks of a server.
|
|
401
|
-
*
|
|
402
|
-
* @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
|
|
403
|
-
* @returns A Promise of ListServerPrivateNetworksResponse
|
|
404
|
-
*/
|
|
405
|
-
listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
|
|
406
|
-
/**
|
|
407
|
-
* Delete a Private Network.
|
|
408
|
-
*
|
|
409
|
-
* @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
|
|
410
|
-
*/
|
|
411
|
-
deleteServerPrivateNetwork = (request) => this.client.fetch({
|
|
412
|
-
method: "DELETE",
|
|
413
|
-
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
414
|
-
});
|
|
184
|
+
constructor(..._args2) {
|
|
185
|
+
super(..._args2);
|
|
186
|
+
this.addServerPrivateNetwork = (request) => this.client.fetch({
|
|
187
|
+
body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
|
|
188
|
+
headers: jsonContentHeaders,
|
|
189
|
+
method: "POST",
|
|
190
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
|
|
191
|
+
}, unmarshalServerPrivateNetwork);
|
|
192
|
+
this.setServerPrivateNetworks = (request) => this.client.fetch({
|
|
193
|
+
body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
|
|
194
|
+
headers: jsonContentHeaders,
|
|
195
|
+
method: "PUT",
|
|
196
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
|
|
197
|
+
}, unmarshalSetServerPrivateNetworksResponse);
|
|
198
|
+
this.pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
|
|
199
|
+
method: "GET",
|
|
200
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
|
|
201
|
+
urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["project_id", request.projectId], ["server_id", request.serverId])
|
|
202
|
+
}, unmarshalListServerPrivateNetworksResponse);
|
|
203
|
+
this.listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
|
|
204
|
+
this.deleteServerPrivateNetwork = (request) => this.client.fetch({
|
|
205
|
+
method: "DELETE",
|
|
206
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
static {
|
|
210
|
+
this.LOCALITY = toApiLocality({ zones: ["fr-par-2"] });
|
|
211
|
+
}
|
|
415
212
|
};
|
|
416
213
|
//#endregion
|
|
417
214
|
export { API, PrivateNetworkAPI };
|