@scaleway/sdk-dedibox 2.2.0 → 2.3.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.
@@ -1,1454 +1,913 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
- import { SERVER_TRANSIENT_STATUSES, SERVER_INSTALL_TRANSIENT_STATUSES, BMC_ACCESS_TRANSIENT_STATUSES, RPN_SAN_TRANSIENT_STATUSES, RPN_V2_GROUP_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListServersResponse, unmarshalServer, unmarshalBackup, marshalUpdateServerBackupRequest, unmarshalListSubscribableServerOptionsResponse, marshalSubscribeServerOptionRequest, unmarshalService, marshalCreateServerRequest, marshalSubscribeStorageOptionsRequest, unmarshalSubscribeStorageOptionsResponse, marshalUpdateServerRequest, marshalUpdateServerTagsRequest, unmarshalListServerEventsResponse, unmarshalListServerDisksResponse, unmarshalListServicesResponse, marshalInstallServerRequest, unmarshalServerInstall, unmarshalServerDefaultPartitioning, marshalStartBMCAccessRequest, unmarshalBMCAccess, unmarshalListOffersResponse, unmarshalOffer, unmarshalListOSResponse, unmarshalOS, marshalUpdateReverseRequest, unmarshalIP, marshalCreateFailoverIPsRequest, unmarshalCreateFailoverIPsResponse, marshalAttachFailoverIPsRequest, marshalDetachFailoverIPsRequest, marshalAttachFailoverIPToMacAddressRequest, unmarshalListFailoverIPsResponse, unmarshalFailoverIP, unmarshalGetRemainingQuotaResponse, unmarshalRaid, marshalUpdateRaidRequest, marshalStartRescueRequest, unmarshalRescue, unmarshalListInvoicesResponse, unmarshalInvoice, unmarshalListRefundsResponse, unmarshalRefund, unmarshalCanOrderResponse, unmarshalGetIPv6BlockQuotasResponse, marshalIPv6BlockApiCreateIPv6BlockRequest, unmarshalIPv6Block, unmarshalListIPv6BlocksResponse, marshalIPv6BlockApiUpdateIPv6BlockRequest, marshalIPv6BlockApiCreateIPv6BlockSubnetRequest, unmarshalListIPv6BlockSubnetsAvailableResponse, unmarshalListRpnServerCapabilitiesResponse, unmarshalGetRpnStatusResponse, unmarshalListRpnSansResponse, unmarshalRpnSan, marshalRpnSanApiCreateRpnSanRequest, unmarshalListIpsResponse, marshalRpnSanApiAddIpRequest, marshalRpnSanApiRemoveIpRequest, unmarshalListRpnGroupsResponse, unmarshalRpnGroup, marshalRpnV1ApiCreateRpnGroupRequest, marshalRpnV1ApiUpdateRpnGroupNameRequest, unmarshalListRpnGroupMembersResponse, marshalRpnV1ApiRpnGroupInviteRequest, marshalRpnV1ApiLeaveRpnGroupRequest, marshalRpnV1ApiAddRpnGroupMembersRequest, marshalRpnV1ApiDeleteRpnGroupMembersRequest, unmarshalListRpnCapableServersResponse, unmarshalListRpnCapableSanServersResponse, unmarshalListRpnInvitesResponse, unmarshalListRpnV2GroupsResponse, unmarshalListRpnV2MembersResponse, unmarshalRpnV2Group, marshalRpnV2ApiCreateRpnV2GroupRequest, marshalRpnV2ApiUpdateRpnV2GroupNameRequest, marshalRpnV2ApiAddRpnV2MembersRequest, marshalRpnV2ApiDeleteRpnV2MembersRequest, unmarshalListRpnV2CapableResourcesResponse, unmarshalListRpnV2GroupLogsResponse, marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest, marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
1
+ import { BMC_ACCESS_TRANSIENT_STATUSES, RPN_SAN_TRANSIENT_STATUSES, RPN_V2_GROUP_TRANSIENT_STATUSES, SERVER_INSTALL_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalAttachFailoverIPToMacAddressRequest, marshalAttachFailoverIPsRequest, marshalCreateFailoverIPsRequest, marshalCreateServerRequest, marshalDetachFailoverIPsRequest, marshalIPv6BlockApiCreateIPv6BlockRequest, marshalIPv6BlockApiCreateIPv6BlockSubnetRequest, marshalIPv6BlockApiUpdateIPv6BlockRequest, marshalInstallServerRequest, marshalRpnSanApiAddIpRequest, marshalRpnSanApiCreateRpnSanRequest, marshalRpnSanApiRemoveIpRequest, marshalRpnV1ApiAddRpnGroupMembersRequest, marshalRpnV1ApiCreateRpnGroupRequest, marshalRpnV1ApiDeleteRpnGroupMembersRequest, marshalRpnV1ApiLeaveRpnGroupRequest, marshalRpnV1ApiRpnGroupInviteRequest, marshalRpnV1ApiUpdateRpnGroupNameRequest, marshalRpnV2ApiAddRpnV2MembersRequest, marshalRpnV2ApiCreateRpnV2GroupRequest, marshalRpnV2ApiDeleteRpnV2MembersRequest, marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest, marshalRpnV2ApiUpdateRpnV2GroupNameRequest, marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest, marshalStartBMCAccessRequest, marshalStartRescueRequest, marshalSubscribeServerOptionRequest, marshalSubscribeStorageOptionsRequest, marshalUpdateRaidRequest, marshalUpdateReverseRequest, marshalUpdateServerBackupRequest, marshalUpdateServerRequest, marshalUpdateServerTagsRequest, unmarshalBMCAccess, unmarshalBackup, unmarshalCanOrderResponse, unmarshalCreateFailoverIPsResponse, unmarshalFailoverIP, unmarshalGetIPv6BlockQuotasResponse, unmarshalGetRemainingQuotaResponse, unmarshalGetRpnStatusResponse, unmarshalIP, unmarshalIPv6Block, unmarshalInvoice, unmarshalListFailoverIPsResponse, unmarshalListIPv6BlockSubnetsAvailableResponse, unmarshalListIPv6BlocksResponse, unmarshalListInvoicesResponse, unmarshalListIpsResponse, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListRefundsResponse, unmarshalListRpnCapableSanServersResponse, unmarshalListRpnCapableServersResponse, unmarshalListRpnGroupMembersResponse, unmarshalListRpnGroupsResponse, unmarshalListRpnInvitesResponse, unmarshalListRpnSansResponse, unmarshalListRpnServerCapabilitiesResponse, unmarshalListRpnV2CapableResourcesResponse, unmarshalListRpnV2GroupLogsResponse, unmarshalListRpnV2GroupsResponse, unmarshalListRpnV2MembersResponse, unmarshalListServerDisksResponse, unmarshalListServerEventsResponse, unmarshalListServersResponse, unmarshalListServicesResponse, unmarshalListSubscribableServerOptionsResponse, unmarshalOS, unmarshalOffer, unmarshalRaid, unmarshalRefund, unmarshalRescue, unmarshalRpnGroup, unmarshalRpnSan, unmarshalRpnV2Group, unmarshalServer, unmarshalServerDefaultPartitioning, unmarshalServerInstall, unmarshalService, unmarshalSubscribeStorageOptionsResponse } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Dedibox Phoenix API.
7
+ */
8
+ var API$1 = class extends API {
9
+ /**
10
+ * Locality of this API.
11
+ * type ∈ {'zone','region','global','unspecified'}
12
+ */
13
+ static LOCALITY = toApiLocality({ zones: [
14
+ "fr-par-1",
15
+ "fr-par-2",
16
+ "nl-ams-1"
17
+ ] });
18
+ pageOfListServers = (request = {}) => this.client.fetch({
19
+ method: "GET",
20
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
21
+ 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], ["search", request.search])
22
+ }, unmarshalListServersResponse);
23
+ /**
24
+ * List baremetal servers for project.
25
+ *
26
+ * @param request - The request {@link ListServersRequest}
27
+ * @returns A Promise of ListServersResponse
28
+ */
29
+ listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
30
+ /**
31
+ * Get a specific baremetal server. Get the server associated with the given ID.
32
+ *
33
+ * @param request - The request {@link GetServerRequest}
34
+ * @returns A Promise of Server
35
+ */
36
+ getServer = (request) => this.client.fetch({
37
+ method: "GET",
38
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
39
+ }, unmarshalServer);
40
+ /**
41
+ * Waits for {@link Server} to be in a final state.
42
+ *
43
+ * @param request - The request {@link GetServerRequest}
44
+ * @param options - The waiting options
45
+ * @returns A Promise of Server
46
+ */
47
+ waitForServer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
48
+ getServerBackup = (request) => this.client.fetch({
49
+ method: "GET",
50
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/backups`
51
+ }, unmarshalBackup);
52
+ updateServerBackup = (request) => this.client.fetch({
53
+ body: JSON.stringify(marshalUpdateServerBackupRequest(request, this.client.settings)),
54
+ headers: jsonContentHeaders,
55
+ method: "PATCH",
56
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/backups`
57
+ }, unmarshalBackup);
58
+ pageOfListSubscribableServerOptions = (request) => this.client.fetch({
59
+ method: "GET",
60
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/subscribable-server-options`,
61
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
62
+ }, unmarshalListSubscribableServerOptionsResponse);
63
+ /**
64
+ * List subscribable server options. List subscribable options associated to the given server ID.
65
+ *
66
+ * @param request - The request {@link ListSubscribableServerOptionsRequest}
67
+ * @returns A Promise of ListSubscribableServerOptionsResponse
68
+ */
69
+ listSubscribableServerOptions = (request) => enrichForPagination("serverOptions", this.pageOfListSubscribableServerOptions, request);
70
+ /**
71
+ * Subscribe server option. Subscribe option for the given server ID.
72
+ *
73
+ * @param request - The request {@link SubscribeServerOptionRequest}
74
+ * @returns A Promise of Service
75
+ */
76
+ subscribeServerOption = (request) => this.client.fetch({
77
+ body: JSON.stringify(marshalSubscribeServerOptionRequest(request, this.client.settings)),
78
+ headers: jsonContentHeaders,
79
+ method: "PATCH",
80
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/subscribe-server-option`
81
+ }, unmarshalService);
82
+ /**
83
+ * Create a baremetal server. Create a new baremetal server. The order return you a service ID to follow the provisionning status you could call GetService.
84
+ *
85
+ * @param request - The request {@link CreateServerRequest}
86
+ * @returns A Promise of Service
87
+ */
88
+ createServer = (request) => this.client.fetch({
89
+ body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
90
+ headers: jsonContentHeaders,
91
+ method: "POST",
92
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
93
+ }, unmarshalService);
94
+ /**
95
+ * Subscribe storage server option. Subscribe storage option for the given server ID.
96
+ *
97
+ * @param request - The request {@link SubscribeStorageOptionsRequest}
98
+ * @returns A Promise of SubscribeStorageOptionsResponse
99
+ */
100
+ subscribeStorageOptions = (request) => this.client.fetch({
101
+ body: JSON.stringify(marshalSubscribeStorageOptionsRequest(request, this.client.settings)),
102
+ headers: jsonContentHeaders,
103
+ method: "POST",
104
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/subscribe-storage-options`
105
+ }, unmarshalSubscribeStorageOptionsResponse);
106
+ /**
107
+ * Update a baremetal server. Update the server associated with the given ID.
108
+ *
109
+ * @param request - The request {@link UpdateServerRequest}
110
+ * @returns A Promise of Server
111
+ */
112
+ updateServer = (request) => this.client.fetch({
113
+ body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
114
+ headers: jsonContentHeaders,
115
+ method: "PATCH",
116
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
117
+ }, unmarshalServer);
118
+ updateServerTags = (request) => this.client.fetch({
119
+ body: JSON.stringify(marshalUpdateServerTagsRequest(request, this.client.settings)),
120
+ headers: jsonContentHeaders,
121
+ method: "POST",
122
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/tags`
123
+ }, unmarshalServer);
124
+ /**
125
+ * Reboot a baremetal server. Reboot the server associated with the given ID, use boot param to reboot in rescue.
126
+ *
127
+ * @param request - The request {@link RebootServerRequest}
128
+ */
129
+ rebootServer = (request) => this.client.fetch({
130
+ body: "{}",
131
+ headers: jsonContentHeaders,
132
+ method: "POST",
133
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
134
+ });
135
+ /**
136
+ * Start a baremetal server. Start the server associated with the given ID.
137
+ *
138
+ * @param request - The request {@link StartServerRequest}
139
+ */
140
+ startServer = (request) => this.client.fetch({
141
+ body: "{}",
142
+ headers: jsonContentHeaders,
143
+ method: "POST",
144
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/start`
145
+ });
146
+ /**
147
+ * Stop a baremetal server. Stop the server associated with the given ID.
148
+ *
149
+ * @param request - The request {@link StopServerRequest}
150
+ */
151
+ stopServer = (request) => this.client.fetch({
152
+ body: "{}",
153
+ headers: jsonContentHeaders,
154
+ method: "POST",
155
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/stop`
156
+ });
157
+ /**
158
+ * Delete a baremetal server. Delete the server associated with the given ID.
159
+ *
160
+ * @param request - The request {@link DeleteServerRequest}
161
+ */
162
+ deleteServer = (request) => this.client.fetch({
163
+ method: "DELETE",
164
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
165
+ });
166
+ pageOfListServerEvents = (request) => this.client.fetch({
167
+ method: "GET",
168
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/events`,
169
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
170
+ }, unmarshalListServerEventsResponse);
171
+ /**
172
+ * List server events. List events associated to the given server ID.
173
+ *
174
+ * @param request - The request {@link ListServerEventsRequest}
175
+ * @returns A Promise of ListServerEventsResponse
176
+ */
177
+ listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
178
+ pageOfListServerDisks = (request) => this.client.fetch({
179
+ method: "GET",
180
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/disks`,
181
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
182
+ }, unmarshalListServerDisksResponse);
183
+ /**
184
+ * List server disks. List disks associated to the given server ID.
185
+ *
186
+ * @param request - The request {@link ListServerDisksRequest}
187
+ * @returns A Promise of ListServerDisksResponse
188
+ */
189
+ listServerDisks = (request) => enrichForPagination("disks", this.pageOfListServerDisks, request);
190
+ getOrderedService = (request) => this.client.fetch({
191
+ method: "GET",
192
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ordered-services/${validatePathParam("orderedServiceId", request.orderedServiceId)}`
193
+ }, unmarshalService);
194
+ /**
195
+ * Get a specific service. Get the service associated with the given ID.
196
+ *
197
+ * @param request - The request {@link GetServiceRequest}
198
+ * @returns A Promise of Service
199
+ */
200
+ getService = (request) => this.client.fetch({
201
+ body: "{}",
202
+ headers: jsonContentHeaders,
203
+ method: "PATCH",
204
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${validatePathParam("serviceId", request.serviceId)}`
205
+ }, unmarshalService);
206
+ /**
207
+ * Delete a specific service. Delete the service associated with the given ID.
208
+ *
209
+ * @param request - The request {@link DeleteServiceRequest}
210
+ * @returns A Promise of Service
211
+ */
212
+ deleteService = (request) => this.client.fetch({
213
+ method: "DELETE",
214
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${validatePathParam("serviceId", request.serviceId)}`
215
+ }, unmarshalService);
216
+ pageOfListServices = (request = {}) => this.client.fetch({
217
+ method: "GET",
218
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services`,
219
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
220
+ }, unmarshalListServicesResponse);
221
+ /**
222
+ * List services.
223
+ *
224
+ * @param request - The request {@link ListServicesRequest}
225
+ * @returns A Promise of ListServicesResponse
226
+ */
227
+ listServices = (request = {}) => enrichForPagination("services", this.pageOfListServices, request);
228
+ /**
229
+ * Install a baremetal server. Install an OS on the server associated with the given ID.
230
+ *
231
+ * @param request - The request {@link InstallServerRequest}
232
+ * @returns A Promise of ServerInstall
233
+ */
234
+ installServer = (request) => this.client.fetch({
235
+ body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
236
+ headers: jsonContentHeaders,
237
+ method: "POST",
238
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
239
+ }, unmarshalServerInstall);
240
+ /**
241
+ * Get a specific server installation status. Get the server installation status associated with the given server ID.
242
+ *
243
+ * @param request - The request {@link GetServerInstallRequest}
244
+ * @returns A Promise of ServerInstall
245
+ */
246
+ getServerInstall = (request) => this.client.fetch({
247
+ method: "GET",
248
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
249
+ }, unmarshalServerInstall);
250
+ /**
251
+ * Waits for {@link ServerInstall} to be in a final state.
252
+ *
253
+ * @param request - The request {@link GetServerInstallRequest}
254
+ * @param options - The waiting options
255
+ * @returns A Promise of ServerInstall
256
+ */
257
+ waitForServerInstall = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SERVER_INSTALL_TRANSIENT_STATUSES.includes(res.status))), this.getServerInstall, request, options);
258
+ /**
259
+ * Cancels the current (running) server installation. Cancels the current server installation associated with the given server ID.
260
+ *
261
+ * @param request - The request {@link CancelServerInstallRequest}
262
+ */
263
+ cancelServerInstall = (request) => this.client.fetch({
264
+ method: "POST",
265
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/cancel-install`
266
+ });
267
+ /**
268
+ * Get server default partitioning. Get the server default partitioning schema associated with the given server ID and OS ID.
269
+ *
270
+ * @param request - The request {@link GetServerDefaultPartitioningRequest}
271
+ * @returns A Promise of ServerDefaultPartitioning
272
+ */
273
+ getServerDefaultPartitioning = (request) => this.client.fetch({
274
+ method: "GET",
275
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/partitioning/${validatePathParam("osId", request.osId)}`
276
+ }, unmarshalServerDefaultPartitioning);
277
+ /**
278
+ * Start BMC (Baseboard Management Controller) access for a given baremetal server. Start BMC (Baseboard Management Controller) access associated with the given ID.
279
+ The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
280
+ *
281
+ * @param request - The request {@link StartBMCAccessRequest}
282
+ */
283
+ startBMCAccess = (request) => this.client.fetch({
284
+ body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
285
+ headers: jsonContentHeaders,
286
+ method: "POST",
287
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
288
+ });
289
+ /**
290
+ * Get BMC (Baseboard Management Controller) access for a given baremetal server. Get the BMC (Baseboard Management Controller) access associated with the given ID.
291
+ *
292
+ * @param request - The request {@link GetBMCAccessRequest}
293
+ * @returns A Promise of BMCAccess
294
+ */
295
+ getBMCAccess = (request) => this.client.fetch({
296
+ method: "GET",
297
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
298
+ }, unmarshalBMCAccess);
299
+ /**
300
+ * Waits for {@link BMCAccess} to be in a final state.
301
+ *
302
+ * @param request - The request {@link GetBMCAccessRequest}
303
+ * @param options - The waiting options
304
+ * @returns A Promise of BMCAccess
305
+ */
306
+ waitForBMCAccess = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!BMC_ACCESS_TRANSIENT_STATUSES.includes(res.status))), this.getBMCAccess, request, options);
307
+ /**
308
+ * Stop BMC (Baseboard Management Controller) access for a given baremetal server. Stop BMC (Baseboard Management Controller) access associated with the given ID.
309
+ *
310
+ * @param request - The request {@link StopBMCAccessRequest}
311
+ */
312
+ stopBMCAccess = (request) => this.client.fetch({
313
+ method: "DELETE",
314
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
315
+ });
316
+ pageOfListOffers = (request = {}) => this.client.fetch({
317
+ method: "GET",
318
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
319
+ urlParams: urlParams(["available_only", request.availableOnly], ["catalog", request.catalog], ["commercial_range", request.commercialRange], ["is_failover_block", request.isFailoverBlock], ["is_failover_ip", request.isFailoverIp], ["is_rpn_san", request.isRpnSan], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["sold_in", request.soldIn && request.soldIn.length > 0 ? request.soldIn.join(",") : void 0])
320
+ }, unmarshalListOffersResponse);
321
+ /**
322
+ * List offers. List all available server offers.
323
+ *
324
+ * @param request - The request {@link ListOffersRequest}
325
+ * @returns A Promise of ListOffersResponse
326
+ */
327
+ listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
328
+ /**
329
+ * Get offer. Return specific offer for the given ID.
330
+ *
331
+ * @param request - The request {@link GetOfferRequest}
332
+ * @returns A Promise of Offer
333
+ */
334
+ getOffer = (request) => this.client.fetch({
335
+ method: "GET",
336
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`,
337
+ urlParams: urlParams(["project_id", request.projectId])
338
+ }, unmarshalOffer);
339
+ pageOfListOS = (request) => this.client.fetch({
340
+ method: "GET",
341
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
342
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["server_id", request.serverId], ["type", request.type])
343
+ }, unmarshalListOSResponse);
344
+ /**
345
+ * List all available OS that can be install on a baremetal server.
346
+ *
347
+ * @param request - The request {@link ListOSRequest}
348
+ * @returns A Promise of ListOSResponse
349
+ */
350
+ listOS = (request) => enrichForPagination("os", this.pageOfListOS, request);
351
+ /**
352
+ * Get an OS with a given ID. Return specific OS for the given ID.
353
+ *
354
+ * @param request - The request {@link GetOSRequest}
355
+ * @returns A Promise of OS
356
+ */
357
+ getOS = (request) => this.client.fetch({
358
+ method: "GET",
359
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`,
360
+ urlParams: urlParams(["project_id", request.projectId], ["server_id", request.serverId])
361
+ }, unmarshalOS);
362
+ /**
363
+ * Update reverse of ip. Update reverse of ip associated with the given ID.
364
+ *
365
+ * @param request - The request {@link UpdateReverseRequest}
366
+ * @returns A Promise of IP
367
+ */
368
+ updateReverse = (request) => this.client.fetch({
369
+ body: JSON.stringify(marshalUpdateReverseRequest(request, this.client.settings)),
370
+ headers: jsonContentHeaders,
371
+ method: "PATCH",
372
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/reverses/${validatePathParam("ipId", request.ipId)}`
373
+ }, unmarshalIP);
374
+ /**
375
+ * Order failover IPs. Order X failover IPs.
376
+ *
377
+ * @param request - The request {@link CreateFailoverIPsRequest}
378
+ * @returns A Promise of CreateFailoverIPsResponse
379
+ */
380
+ createFailoverIPs = (request) => this.client.fetch({
381
+ body: JSON.stringify(marshalCreateFailoverIPsRequest(request, this.client.settings)),
382
+ headers: jsonContentHeaders,
383
+ method: "POST",
384
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`
385
+ }, unmarshalCreateFailoverIPsResponse);
386
+ /**
387
+ * Attach failovers on baremetal server. Attach failovers on the server associated with the given ID.
388
+ *
389
+ * @param request - The request {@link AttachFailoverIPsRequest}
390
+ */
391
+ attachFailoverIPs = (request) => this.client.fetch({
392
+ body: JSON.stringify(marshalAttachFailoverIPsRequest(request, this.client.settings)),
393
+ headers: jsonContentHeaders,
394
+ method: "POST",
395
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`
396
+ });
397
+ /**
398
+ * Detach failovers on baremetal server. Detach failovers on the server associated with the given ID.
399
+ *
400
+ * @param request - The request {@link DetachFailoverIPsRequest}
401
+ */
402
+ detachFailoverIPs = (request) => this.client.fetch({
403
+ body: JSON.stringify(marshalDetachFailoverIPsRequest(request, this.client.settings)),
404
+ headers: jsonContentHeaders,
405
+ method: "POST",
406
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`
407
+ });
408
+ /**
409
+ * Attach a failover IP to a MAC address.
410
+ *
411
+ * @param request - The request {@link AttachFailoverIPToMacAddressRequest}
412
+ * @returns A Promise of IP
413
+ */
414
+ attachFailoverIPToMacAddress = (request) => this.client.fetch({
415
+ body: JSON.stringify(marshalAttachFailoverIPToMacAddressRequest(request, this.client.settings)),
416
+ headers: jsonContentHeaders,
417
+ method: "POST",
418
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}/attach-to-mac-address`
419
+ }, unmarshalIP);
420
+ /**
421
+ * Detach a failover IP from a MAC address.
422
+ *
423
+ * @param request - The request {@link DetachFailoverIPFromMacAddressRequest}
424
+ * @returns A Promise of IP
425
+ */
426
+ detachFailoverIPFromMacAddress = (request) => this.client.fetch({
427
+ body: "{}",
428
+ headers: jsonContentHeaders,
429
+ method: "POST",
430
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}/detach-from-mac-address`
431
+ }, unmarshalIP);
432
+ /**
433
+ * Delete a failover server. Delete the failover associated with the given ID.
434
+ *
435
+ * @param request - The request {@link DeleteFailoverIPRequest}
436
+ */
437
+ deleteFailoverIP = (request) => this.client.fetch({
438
+ method: "DELETE",
439
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}`
440
+ });
441
+ pageOfListFailoverIPs = (request = {}) => this.client.fetch({
442
+ method: "GET",
443
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`,
444
+ urlParams: urlParams(["only_available", request.onlyAvailable], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId], ["search", request.search])
445
+ }, unmarshalListFailoverIPsResponse);
446
+ /**
447
+ * List failovers for project. List failovers servers for project.
448
+ *
449
+ * @param request - The request {@link ListFailoverIPsRequest}
450
+ * @returns A Promise of ListFailoverIPsResponse
451
+ */
452
+ listFailoverIPs = (request = {}) => enrichForPagination("failoverIps", this.pageOfListFailoverIPs, request);
453
+ /**
454
+ * Get a specific baremetal server. Get the server associated with the given ID.
455
+ *
456
+ * @param request - The request {@link GetFailoverIPRequest}
457
+ * @returns A Promise of FailoverIP
458
+ */
459
+ getFailoverIP = (request) => this.client.fetch({
460
+ method: "GET",
461
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}`
462
+ }, unmarshalFailoverIP);
463
+ /**
464
+ * Get remaining quota.
465
+ *
466
+ * @param request - The request {@link GetRemainingQuotaRequest}
467
+ * @returns A Promise of GetRemainingQuotaResponse
468
+ */
469
+ getRemainingQuota = (request = {}) => this.client.fetch({
470
+ method: "GET",
471
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/remaining-quota`,
472
+ urlParams: urlParams(["project_id", request.projectId])
473
+ }, unmarshalGetRemainingQuotaResponse);
474
+ /**
475
+ * Get raid. Return raid for the given server ID.
476
+ *
477
+ * @param request - The request {@link GetRaidRequest}
478
+ * @returns A Promise of Raid
479
+ */
480
+ getRaid = (request) => this.client.fetch({
481
+ method: "GET",
482
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/raid`
483
+ }, unmarshalRaid);
484
+ /**
485
+ * Update RAID. Update RAID associated with the given server ID.
486
+ *
487
+ * @param request - The request {@link UpdateRaidRequest}
488
+ */
489
+ updateRaid = (request) => this.client.fetch({
490
+ body: JSON.stringify(marshalUpdateRaidRequest(request, this.client.settings)),
491
+ headers: jsonContentHeaders,
492
+ method: "POST",
493
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/update-raid`
494
+ });
495
+ /**
496
+ * Start in rescue baremetal server. Start in rescue the server associated with the given ID.
497
+ *
498
+ * @param request - The request {@link StartRescueRequest}
499
+ * @returns A Promise of Rescue
500
+ */
501
+ startRescue = (request) => this.client.fetch({
502
+ body: JSON.stringify(marshalStartRescueRequest(request, this.client.settings)),
503
+ headers: jsonContentHeaders,
504
+ method: "POST",
505
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/rescue`
506
+ }, unmarshalRescue);
507
+ /**
508
+ * Get rescue information. Return rescue information for the given server ID.
509
+ *
510
+ * @param request - The request {@link GetRescueRequest}
511
+ * @returns A Promise of Rescue
512
+ */
513
+ getRescue = (request) => this.client.fetch({
514
+ method: "GET",
515
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/rescue`
516
+ }, unmarshalRescue);
517
+ /**
518
+ * Stop rescue on baremetal server. Stop rescue on the server associated with the given ID.
519
+ *
520
+ * @param request - The request {@link StopRescueRequest}
521
+ */
522
+ stopRescue = (request) => this.client.fetch({
523
+ method: "DELETE",
524
+ path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/rescue`
525
+ });
6
526
  };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- zones: ["fr-par-1", "fr-par-2", "nl-ams-1"]
14
- });
15
- pageOfListServers = (request = {}) => this.client.fetch(
16
- {
17
- method: "GET",
18
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
19
- urlParams: urlParams(
20
- ["order_by", request.orderBy],
21
- ["page", request.page],
22
- [
23
- "page_size",
24
- request.pageSize ?? this.client.settings.defaultPageSize
25
- ],
26
- [
27
- "project_id",
28
- request.projectId ?? this.client.settings.defaultProjectId
29
- ],
30
- ["search", request.search]
31
- )
32
- },
33
- unmarshalListServersResponse
34
- );
35
- /**
36
- * List baremetal servers for project.
37
- *
38
- * @param request - The request {@link ListServersRequest}
39
- * @returns A Promise of ListServersResponse
40
- */
41
- listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
42
- /**
43
- * Get a specific baremetal server. Get the server associated with the given ID.
44
- *
45
- * @param request - The request {@link GetServerRequest}
46
- * @returns A Promise of Server
47
- */
48
- getServer = (request) => this.client.fetch(
49
- {
50
- method: "GET",
51
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
52
- },
53
- unmarshalServer
54
- );
55
- /**
56
- * Waits for {@link Server} to be in a final state.
57
- *
58
- * @param request - The request {@link GetServerRequest}
59
- * @param options - The waiting options
60
- * @returns A Promise of Server
61
- */
62
- waitForServer = (request, options) => waitForResource(
63
- options?.stop ?? ((res) => Promise.resolve(
64
- !SERVER_TRANSIENT_STATUSES.includes(res.status)
65
- )),
66
- this.getServer,
67
- request,
68
- options
69
- );
70
- getServerBackup = (request) => this.client.fetch(
71
- {
72
- method: "GET",
73
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/backups`
74
- },
75
- unmarshalBackup
76
- );
77
- updateServerBackup = (request) => this.client.fetch(
78
- {
79
- body: JSON.stringify(
80
- marshalUpdateServerBackupRequest(request, this.client.settings)
81
- ),
82
- headers: jsonContentHeaders,
83
- method: "PATCH",
84
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/backups`
85
- },
86
- unmarshalBackup
87
- );
88
- pageOfListSubscribableServerOptions = (request) => this.client.fetch(
89
- {
90
- method: "GET",
91
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/subscribable-server-options`,
92
- urlParams: urlParams(
93
- ["page", request.page],
94
- [
95
- "page_size",
96
- request.pageSize ?? this.client.settings.defaultPageSize
97
- ]
98
- )
99
- },
100
- unmarshalListSubscribableServerOptionsResponse
101
- );
102
- /**
103
- * List subscribable server options. List subscribable options associated to the given server ID.
104
- *
105
- * @param request - The request {@link ListSubscribableServerOptionsRequest}
106
- * @returns A Promise of ListSubscribableServerOptionsResponse
107
- */
108
- listSubscribableServerOptions = (request) => enrichForPagination(
109
- "serverOptions",
110
- this.pageOfListSubscribableServerOptions,
111
- request
112
- );
113
- /**
114
- * Subscribe server option. Subscribe option for the given server ID.
115
- *
116
- * @param request - The request {@link SubscribeServerOptionRequest}
117
- * @returns A Promise of Service
118
- */
119
- subscribeServerOption = (request) => this.client.fetch(
120
- {
121
- body: JSON.stringify(
122
- marshalSubscribeServerOptionRequest(request, this.client.settings)
123
- ),
124
- headers: jsonContentHeaders,
125
- method: "PATCH",
126
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/subscribe-server-option`
127
- },
128
- unmarshalService
129
- );
130
- /**
131
- * Create a baremetal server. Create a new baremetal server. The order return you a service ID to follow the provisionning status you could call GetService.
132
- *
133
- * @param request - The request {@link CreateServerRequest}
134
- * @returns A Promise of Service
135
- */
136
- createServer = (request) => this.client.fetch(
137
- {
138
- body: JSON.stringify(
139
- marshalCreateServerRequest(request, this.client.settings)
140
- ),
141
- headers: jsonContentHeaders,
142
- method: "POST",
143
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
144
- },
145
- unmarshalService
146
- );
147
- /**
148
- * Subscribe storage server option. Subscribe storage option for the given server ID.
149
- *
150
- * @param request - The request {@link SubscribeStorageOptionsRequest}
151
- * @returns A Promise of SubscribeStorageOptionsResponse
152
- */
153
- subscribeStorageOptions = (request) => this.client.fetch(
154
- {
155
- body: JSON.stringify(
156
- marshalSubscribeStorageOptionsRequest(request, this.client.settings)
157
- ),
158
- headers: jsonContentHeaders,
159
- method: "POST",
160
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/subscribe-storage-options`
161
- },
162
- unmarshalSubscribeStorageOptionsResponse
163
- );
164
- /**
165
- * Update a baremetal server. Update the server associated with the given ID.
166
- *
167
- * @param request - The request {@link UpdateServerRequest}
168
- * @returns A Promise of Server
169
- */
170
- updateServer = (request) => this.client.fetch(
171
- {
172
- body: JSON.stringify(
173
- marshalUpdateServerRequest(request, this.client.settings)
174
- ),
175
- headers: jsonContentHeaders,
176
- method: "PATCH",
177
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
178
- },
179
- unmarshalServer
180
- );
181
- updateServerTags = (request) => this.client.fetch(
182
- {
183
- body: JSON.stringify(
184
- marshalUpdateServerTagsRequest(request, this.client.settings)
185
- ),
186
- headers: jsonContentHeaders,
187
- method: "POST",
188
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/tags`
189
- },
190
- unmarshalServer
191
- );
192
- /**
193
- * Reboot a baremetal server. Reboot the server associated with the given ID, use boot param to reboot in rescue.
194
- *
195
- * @param request - The request {@link RebootServerRequest}
196
- */
197
- rebootServer = (request) => this.client.fetch({
198
- body: "{}",
199
- headers: jsonContentHeaders,
200
- method: "POST",
201
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
202
- });
203
- /**
204
- * Start a baremetal server. Start the server associated with the given ID.
205
- *
206
- * @param request - The request {@link StartServerRequest}
207
- */
208
- startServer = (request) => this.client.fetch({
209
- body: "{}",
210
- headers: jsonContentHeaders,
211
- method: "POST",
212
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/start`
213
- });
214
- /**
215
- * Stop a baremetal server. Stop the server associated with the given ID.
216
- *
217
- * @param request - The request {@link StopServerRequest}
218
- */
219
- stopServer = (request) => this.client.fetch({
220
- body: "{}",
221
- headers: jsonContentHeaders,
222
- method: "POST",
223
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/stop`
224
- });
225
- /**
226
- * Delete a baremetal server. Delete the server associated with the given ID.
227
- *
228
- * @param request - The request {@link DeleteServerRequest}
229
- */
230
- deleteServer = (request) => this.client.fetch({
231
- method: "DELETE",
232
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
233
- });
234
- pageOfListServerEvents = (request) => this.client.fetch(
235
- {
236
- method: "GET",
237
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/events`,
238
- urlParams: urlParams(
239
- ["order_by", request.orderBy],
240
- ["page", request.page],
241
- [
242
- "page_size",
243
- request.pageSize ?? this.client.settings.defaultPageSize
244
- ]
245
- )
246
- },
247
- unmarshalListServerEventsResponse
248
- );
249
- /**
250
- * List server events. List events associated to the given server ID.
251
- *
252
- * @param request - The request {@link ListServerEventsRequest}
253
- * @returns A Promise of ListServerEventsResponse
254
- */
255
- listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
256
- pageOfListServerDisks = (request) => this.client.fetch(
257
- {
258
- method: "GET",
259
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/disks`,
260
- urlParams: urlParams(
261
- ["order_by", request.orderBy],
262
- ["page", request.page],
263
- [
264
- "page_size",
265
- request.pageSize ?? this.client.settings.defaultPageSize
266
- ]
267
- )
268
- },
269
- unmarshalListServerDisksResponse
270
- );
271
- /**
272
- * List server disks. List disks associated to the given server ID.
273
- *
274
- * @param request - The request {@link ListServerDisksRequest}
275
- * @returns A Promise of ListServerDisksResponse
276
- */
277
- listServerDisks = (request) => enrichForPagination("disks", this.pageOfListServerDisks, request);
278
- getOrderedService = (request) => this.client.fetch(
279
- {
280
- method: "GET",
281
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ordered-services/${validatePathParam("orderedServiceId", request.orderedServiceId)}`
282
- },
283
- unmarshalService
284
- );
285
- /**
286
- * Get a specific service. Get the service associated with the given ID.
287
- *
288
- * @param request - The request {@link GetServiceRequest}
289
- * @returns A Promise of Service
290
- */
291
- getService = (request) => this.client.fetch(
292
- {
293
- body: "{}",
294
- headers: jsonContentHeaders,
295
- method: "PATCH",
296
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${validatePathParam("serviceId", request.serviceId)}`
297
- },
298
- unmarshalService
299
- );
300
- /**
301
- * Delete a specific service. Delete the service associated with the given ID.
302
- *
303
- * @param request - The request {@link DeleteServiceRequest}
304
- * @returns A Promise of Service
305
- */
306
- deleteService = (request) => this.client.fetch(
307
- {
308
- method: "DELETE",
309
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${validatePathParam("serviceId", request.serviceId)}`
310
- },
311
- unmarshalService
312
- );
313
- pageOfListServices = (request = {}) => this.client.fetch(
314
- {
315
- method: "GET",
316
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services`,
317
- urlParams: urlParams(
318
- ["order_by", request.orderBy],
319
- ["page", request.page],
320
- [
321
- "page_size",
322
- request.pageSize ?? this.client.settings.defaultPageSize
323
- ],
324
- ["project_id", request.projectId]
325
- )
326
- },
327
- unmarshalListServicesResponse
328
- );
329
- /**
330
- * List services.
331
- *
332
- * @param request - The request {@link ListServicesRequest}
333
- * @returns A Promise of ListServicesResponse
334
- */
335
- listServices = (request = {}) => enrichForPagination("services", this.pageOfListServices, request);
336
- /**
337
- * Install a baremetal server. Install an OS on the server associated with the given ID.
338
- *
339
- * @param request - The request {@link InstallServerRequest}
340
- * @returns A Promise of ServerInstall
341
- */
342
- installServer = (request) => this.client.fetch(
343
- {
344
- body: JSON.stringify(
345
- marshalInstallServerRequest(request, this.client.settings)
346
- ),
347
- headers: jsonContentHeaders,
348
- method: "POST",
349
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
350
- },
351
- unmarshalServerInstall
352
- );
353
- /**
354
- * Get a specific server installation status. Get the server installation status associated with the given server ID.
355
- *
356
- * @param request - The request {@link GetServerInstallRequest}
357
- * @returns A Promise of ServerInstall
358
- */
359
- getServerInstall = (request) => this.client.fetch(
360
- {
361
- method: "GET",
362
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
363
- },
364
- unmarshalServerInstall
365
- );
366
- /**
367
- * Waits for {@link ServerInstall} to be in a final state.
368
- *
369
- * @param request - The request {@link GetServerInstallRequest}
370
- * @param options - The waiting options
371
- * @returns A Promise of ServerInstall
372
- */
373
- waitForServerInstall = (request, options) => waitForResource(
374
- options?.stop ?? ((res) => Promise.resolve(
375
- !SERVER_INSTALL_TRANSIENT_STATUSES.includes(res.status)
376
- )),
377
- this.getServerInstall,
378
- request,
379
- options
380
- );
381
- /**
382
- * Cancels the current (running) server installation. Cancels the current server installation associated with the given server ID.
383
- *
384
- * @param request - The request {@link CancelServerInstallRequest}
385
- */
386
- cancelServerInstall = (request) => this.client.fetch({
387
- method: "POST",
388
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/cancel-install`
389
- });
390
- /**
391
- * Get server default partitioning. Get the server default partitioning schema associated with the given server ID and OS ID.
392
- *
393
- * @param request - The request {@link GetServerDefaultPartitioningRequest}
394
- * @returns A Promise of ServerDefaultPartitioning
395
- */
396
- getServerDefaultPartitioning = (request) => this.client.fetch(
397
- {
398
- method: "GET",
399
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/partitioning/${validatePathParam("osId", request.osId)}`
400
- },
401
- unmarshalServerDefaultPartitioning
402
- );
403
- /**
404
- * Start BMC (Baseboard Management Controller) access for a given baremetal server. Start BMC (Baseboard Management Controller) access associated with the given ID.
405
- The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
406
- *
407
- * @param request - The request {@link StartBMCAccessRequest}
408
- */
409
- startBMCAccess = (request) => this.client.fetch({
410
- body: JSON.stringify(
411
- marshalStartBMCAccessRequest(request, this.client.settings)
412
- ),
413
- headers: jsonContentHeaders,
414
- method: "POST",
415
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
416
- });
417
- /**
418
- * Get BMC (Baseboard Management Controller) access for a given baremetal server. Get the BMC (Baseboard Management Controller) access associated with the given ID.
419
- *
420
- * @param request - The request {@link GetBMCAccessRequest}
421
- * @returns A Promise of BMCAccess
422
- */
423
- getBMCAccess = (request) => this.client.fetch(
424
- {
425
- method: "GET",
426
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
427
- },
428
- unmarshalBMCAccess
429
- );
430
- /**
431
- * Waits for {@link BMCAccess} to be in a final state.
432
- *
433
- * @param request - The request {@link GetBMCAccessRequest}
434
- * @param options - The waiting options
435
- * @returns A Promise of BMCAccess
436
- */
437
- waitForBMCAccess = (request, options) => waitForResource(
438
- options?.stop ?? ((res) => Promise.resolve(
439
- !BMC_ACCESS_TRANSIENT_STATUSES.includes(res.status)
440
- )),
441
- this.getBMCAccess,
442
- request,
443
- options
444
- );
445
- /**
446
- * Stop BMC (Baseboard Management Controller) access for a given baremetal server. Stop BMC (Baseboard Management Controller) access associated with the given ID.
447
- *
448
- * @param request - The request {@link StopBMCAccessRequest}
449
- */
450
- stopBMCAccess = (request) => this.client.fetch({
451
- method: "DELETE",
452
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
453
- });
454
- pageOfListOffers = (request = {}) => this.client.fetch(
455
- {
456
- method: "GET",
457
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
458
- urlParams: urlParams(
459
- ["available_only", request.availableOnly],
460
- ["catalog", request.catalog],
461
- ["commercial_range", request.commercialRange],
462
- ["is_failover_block", request.isFailoverBlock],
463
- ["is_failover_ip", request.isFailoverIp],
464
- ["is_rpn_san", request.isRpnSan],
465
- ["order_by", request.orderBy],
466
- ["page", request.page],
467
- [
468
- "page_size",
469
- request.pageSize ?? this.client.settings.defaultPageSize
470
- ],
471
- ["project_id", request.projectId],
472
- [
473
- "sold_in",
474
- request.soldIn && request.soldIn.length > 0 ? request.soldIn.join(",") : void 0
475
- ]
476
- )
477
- },
478
- unmarshalListOffersResponse
479
- );
480
- /**
481
- * List offers. List all available server offers.
482
- *
483
- * @param request - The request {@link ListOffersRequest}
484
- * @returns A Promise of ListOffersResponse
485
- */
486
- listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
487
- /**
488
- * Get offer. Return specific offer for the given ID.
489
- *
490
- * @param request - The request {@link GetOfferRequest}
491
- * @returns A Promise of Offer
492
- */
493
- getOffer = (request) => this.client.fetch(
494
- {
495
- method: "GET",
496
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`,
497
- urlParams: urlParams(["project_id", request.projectId])
498
- },
499
- unmarshalOffer
500
- );
501
- pageOfListOS = (request) => this.client.fetch(
502
- {
503
- method: "GET",
504
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
505
- urlParams: urlParams(
506
- ["order_by", request.orderBy],
507
- ["page", request.page],
508
- [
509
- "page_size",
510
- request.pageSize ?? this.client.settings.defaultPageSize
511
- ],
512
- ["project_id", request.projectId],
513
- ["server_id", request.serverId],
514
- ["type", request.type]
515
- )
516
- },
517
- unmarshalListOSResponse
518
- );
519
- /**
520
- * List all available OS that can be install on a baremetal server.
521
- *
522
- * @param request - The request {@link ListOSRequest}
523
- * @returns A Promise of ListOSResponse
524
- */
525
- listOS = (request) => enrichForPagination("os", this.pageOfListOS, request);
526
- /**
527
- * Get an OS with a given ID. Return specific OS for the given ID.
528
- *
529
- * @param request - The request {@link GetOSRequest}
530
- * @returns A Promise of OS
531
- */
532
- getOS = (request) => this.client.fetch(
533
- {
534
- method: "GET",
535
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`,
536
- urlParams: urlParams(
537
- ["project_id", request.projectId],
538
- ["server_id", request.serverId]
539
- )
540
- },
541
- unmarshalOS
542
- );
543
- /**
544
- * Update reverse of ip. Update reverse of ip associated with the given ID.
545
- *
546
- * @param request - The request {@link UpdateReverseRequest}
547
- * @returns A Promise of IP
548
- */
549
- updateReverse = (request) => this.client.fetch(
550
- {
551
- body: JSON.stringify(
552
- marshalUpdateReverseRequest(request, this.client.settings)
553
- ),
554
- headers: jsonContentHeaders,
555
- method: "PATCH",
556
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/reverses/${validatePathParam("ipId", request.ipId)}`
557
- },
558
- unmarshalIP
559
- );
560
- /**
561
- * Order failover IPs. Order X failover IPs.
562
- *
563
- * @param request - The request {@link CreateFailoverIPsRequest}
564
- * @returns A Promise of CreateFailoverIPsResponse
565
- */
566
- createFailoverIPs = (request) => this.client.fetch(
567
- {
568
- body: JSON.stringify(
569
- marshalCreateFailoverIPsRequest(request, this.client.settings)
570
- ),
571
- headers: jsonContentHeaders,
572
- method: "POST",
573
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`
574
- },
575
- unmarshalCreateFailoverIPsResponse
576
- );
577
- /**
578
- * Attach failovers on baremetal server. Attach failovers on the server associated with the given ID.
579
- *
580
- * @param request - The request {@link AttachFailoverIPsRequest}
581
- */
582
- attachFailoverIPs = (request) => this.client.fetch({
583
- body: JSON.stringify(
584
- marshalAttachFailoverIPsRequest(request, this.client.settings)
585
- ),
586
- headers: jsonContentHeaders,
587
- method: "POST",
588
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`
589
- });
590
- /**
591
- * Detach failovers on baremetal server. Detach failovers on the server associated with the given ID.
592
- *
593
- * @param request - The request {@link DetachFailoverIPsRequest}
594
- */
595
- detachFailoverIPs = (request) => this.client.fetch({
596
- body: JSON.stringify(
597
- marshalDetachFailoverIPsRequest(request, this.client.settings)
598
- ),
599
- headers: jsonContentHeaders,
600
- method: "POST",
601
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`
602
- });
603
- /**
604
- * Attach a failover IP to a MAC address.
605
- *
606
- * @param request - The request {@link AttachFailoverIPToMacAddressRequest}
607
- * @returns A Promise of IP
608
- */
609
- attachFailoverIPToMacAddress = (request) => this.client.fetch(
610
- {
611
- body: JSON.stringify(
612
- marshalAttachFailoverIPToMacAddressRequest(
613
- request,
614
- this.client.settings
615
- )
616
- ),
617
- headers: jsonContentHeaders,
618
- method: "POST",
619
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}/attach-to-mac-address`
620
- },
621
- unmarshalIP
622
- );
623
- /**
624
- * Detach a failover IP from a MAC address.
625
- *
626
- * @param request - The request {@link DetachFailoverIPFromMacAddressRequest}
627
- * @returns A Promise of IP
628
- */
629
- detachFailoverIPFromMacAddress = (request) => this.client.fetch(
630
- {
631
- body: "{}",
632
- headers: jsonContentHeaders,
633
- method: "POST",
634
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}/detach-from-mac-address`
635
- },
636
- unmarshalIP
637
- );
638
- /**
639
- * Delete a failover server. Delete the failover associated with the given ID.
640
- *
641
- * @param request - The request {@link DeleteFailoverIPRequest}
642
- */
643
- deleteFailoverIP = (request) => this.client.fetch({
644
- method: "DELETE",
645
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}`
646
- });
647
- pageOfListFailoverIPs = (request = {}) => this.client.fetch(
648
- {
649
- method: "GET",
650
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`,
651
- urlParams: urlParams(
652
- ["only_available", request.onlyAvailable],
653
- ["order_by", request.orderBy],
654
- ["page", request.page],
655
- [
656
- "page_size",
657
- request.pageSize ?? this.client.settings.defaultPageSize
658
- ],
659
- [
660
- "project_id",
661
- request.projectId ?? this.client.settings.defaultProjectId
662
- ],
663
- ["search", request.search]
664
- )
665
- },
666
- unmarshalListFailoverIPsResponse
667
- );
668
- /**
669
- * List failovers for project. List failovers servers for project.
670
- *
671
- * @param request - The request {@link ListFailoverIPsRequest}
672
- * @returns A Promise of ListFailoverIPsResponse
673
- */
674
- listFailoverIPs = (request = {}) => enrichForPagination("failoverIps", this.pageOfListFailoverIPs, request);
675
- /**
676
- * Get a specific baremetal server. Get the server associated with the given ID.
677
- *
678
- * @param request - The request {@link GetFailoverIPRequest}
679
- * @returns A Promise of FailoverIP
680
- */
681
- getFailoverIP = (request) => this.client.fetch(
682
- {
683
- method: "GET",
684
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam("ipId", request.ipId)}`
685
- },
686
- unmarshalFailoverIP
687
- );
688
- /**
689
- * Get remaining quota.
690
- *
691
- * @param request - The request {@link GetRemainingQuotaRequest}
692
- * @returns A Promise of GetRemainingQuotaResponse
693
- */
694
- getRemainingQuota = (request = {}) => this.client.fetch(
695
- {
696
- method: "GET",
697
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/remaining-quota`,
698
- urlParams: urlParams(["project_id", request.projectId])
699
- },
700
- unmarshalGetRemainingQuotaResponse
701
- );
702
- /**
703
- * Get raid. Return raid for the given server ID.
704
- *
705
- * @param request - The request {@link GetRaidRequest}
706
- * @returns A Promise of Raid
707
- */
708
- getRaid = (request) => this.client.fetch(
709
- {
710
- method: "GET",
711
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/raid`
712
- },
713
- unmarshalRaid
714
- );
715
- /**
716
- * Update RAID. Update RAID associated with the given server ID.
717
- *
718
- * @param request - The request {@link UpdateRaidRequest}
719
- */
720
- updateRaid = (request) => this.client.fetch({
721
- body: JSON.stringify(
722
- marshalUpdateRaidRequest(request, this.client.settings)
723
- ),
724
- headers: jsonContentHeaders,
725
- method: "POST",
726
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/update-raid`
727
- });
728
- /**
729
- * Start in rescue baremetal server. Start in rescue the server associated with the given ID.
730
- *
731
- * @param request - The request {@link StartRescueRequest}
732
- * @returns A Promise of Rescue
733
- */
734
- startRescue = (request) => this.client.fetch(
735
- {
736
- body: JSON.stringify(
737
- marshalStartRescueRequest(request, this.client.settings)
738
- ),
739
- headers: jsonContentHeaders,
740
- method: "POST",
741
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/rescue`
742
- },
743
- unmarshalRescue
744
- );
745
- /**
746
- * Get rescue information. Return rescue information for the given server ID.
747
- *
748
- * @param request - The request {@link GetRescueRequest}
749
- * @returns A Promise of Rescue
750
- */
751
- getRescue = (request) => this.client.fetch(
752
- {
753
- method: "GET",
754
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/rescue`
755
- },
756
- unmarshalRescue
757
- );
758
- /**
759
- * Stop rescue on baremetal server. Stop rescue on the server associated with the given ID.
760
- *
761
- * @param request - The request {@link StopRescueRequest}
762
- */
763
- stopRescue = (request) => this.client.fetch({
764
- method: "DELETE",
765
- path: `/dedibox/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/rescue`
766
- });
767
- }
768
- class BillingAPI extends API$1 {
769
- pageOfListInvoices = (request = {}) => this.client.fetch(
770
- {
771
- method: "GET",
772
- path: `/dedibox/v1/invoices`,
773
- urlParams: urlParams(
774
- ["order_by", request.orderBy],
775
- ["page", request.page],
776
- [
777
- "page_size",
778
- request.pageSize ?? this.client.settings.defaultPageSize
779
- ],
780
- ["project_id", request.projectId]
781
- )
782
- },
783
- unmarshalListInvoicesResponse
784
- );
785
- listInvoices = (request = {}) => enrichForPagination("invoices", this.pageOfListInvoices, request);
786
- getInvoice = (request) => this.client.fetch(
787
- {
788
- method: "GET",
789
- path: `/dedibox/v1/invoices/${validatePathParam("invoiceId", request.invoiceId)}`
790
- },
791
- unmarshalInvoice
792
- );
793
- downloadInvoice = (request) => this.client.fetch({
794
- method: "GET",
795
- path: `/dedibox/v1/invoices/${validatePathParam("invoiceId", request.invoiceId)}/download`,
796
- urlParams: urlParams(["dl", 1]),
797
- responseType: "blob"
798
- });
799
- pageOfListRefunds = (request = {}) => this.client.fetch(
800
- {
801
- method: "GET",
802
- path: `/dedibox/v1/refunds`,
803
- urlParams: urlParams(
804
- ["order_by", request.orderBy],
805
- ["page", request.page],
806
- [
807
- "page_size",
808
- request.pageSize ?? this.client.settings.defaultPageSize
809
- ],
810
- ["project_id", request.projectId]
811
- )
812
- },
813
- unmarshalListRefundsResponse
814
- );
815
- listRefunds = (request = {}) => enrichForPagination("refunds", this.pageOfListRefunds, request);
816
- getRefund = (request) => this.client.fetch(
817
- {
818
- method: "GET",
819
- path: `/dedibox/v1/refunds/${validatePathParam("refundId", request.refundId)}`
820
- },
821
- unmarshalRefund
822
- );
823
- downloadRefund = (request) => this.client.fetch({
824
- method: "GET",
825
- path: `/dedibox/v1/refunds/${validatePathParam("refundId", request.refundId)}/download`,
826
- urlParams: urlParams(["dl", 1]),
827
- responseType: "blob"
828
- });
829
- canOrder = (request = {}) => this.client.fetch(
830
- {
831
- method: "GET",
832
- path: `/dedibox/v1/can-order`,
833
- urlParams: urlParams([
834
- "project_id",
835
- request.projectId ?? this.client.settings.defaultProjectId
836
- ])
837
- },
838
- unmarshalCanOrderResponse
839
- );
840
- }
841
- class IPv6BlockAPI extends API$1 {
842
- /**
843
- * Get IPv6 block quota. Get IPv6 block quota with the given project ID.
844
- /48 one per organization.
845
- /56 link to your number of server.
846
- /64 link to your number of failover IP.
847
- *
848
- * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest}
849
- * @returns A Promise of GetIPv6BlockQuotasResponse
850
- */
851
- getIPv6BlockQuotas = (request = {}) => this.client.fetch(
852
- {
853
- method: "GET",
854
- path: `/dedibox/v1/ipv6-block-quotas`,
855
- urlParams: urlParams(["project_id", request.projectId])
856
- },
857
- unmarshalGetIPv6BlockQuotasResponse
858
- );
859
- /**
860
- * Create IPv6 block for baremetal server. Create IPv6 block associated with the given project ID.
861
- *
862
- * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest}
863
- * @returns A Promise of IPv6Block
864
- */
865
- createIPv6Block = (request = {}) => this.client.fetch(
866
- {
867
- body: JSON.stringify(
868
- marshalIPv6BlockApiCreateIPv6BlockRequest(
869
- request,
870
- this.client.settings
871
- )
872
- ),
873
- headers: jsonContentHeaders,
874
- method: "POST",
875
- path: `/dedibox/v1/ipv6-block`
876
- },
877
- unmarshalIPv6Block
878
- );
879
- /**
880
- * List IPv6 blocks. List IPv6 blocks associated given project ID.
881
- *
882
- * @param request - The request {@link IPv6BlockApiListIPv6BlocksRequest}
883
- * @returns A Promise of ListIPv6BlocksResponse
884
- */
885
- listIPv6Blocks = (request = {}) => this.client.fetch(
886
- {
887
- method: "GET",
888
- path: `/dedibox/v1/ipv6-blocks`,
889
- urlParams: urlParams(["project_id", request.projectId])
890
- },
891
- unmarshalListIPv6BlocksResponse
892
- );
893
- /**
894
- * Get first IPv6 block. Get the first IPv6 block associated with the given project ID.
895
- *
896
- * @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest}
897
- * @returns A Promise of IPv6Block
898
- */
899
- getIPv6Block = (request = {}) => this.client.fetch(
900
- {
901
- method: "GET",
902
- path: `/dedibox/v1/ipv6-block`,
903
- urlParams: urlParams(["project_id", request.projectId])
904
- },
905
- unmarshalIPv6Block
906
- );
907
- /**
908
- * Update IPv6 block. Update DNS associated to IPv6 block.
909
- If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate).
910
- *
911
- * @param request - The request {@link IPv6BlockApiUpdateIPv6BlockRequest}
912
- * @returns A Promise of IPv6Block
913
- */
914
- updateIPv6Block = (request) => this.client.fetch(
915
- {
916
- body: JSON.stringify(
917
- marshalIPv6BlockApiUpdateIPv6BlockRequest(
918
- request,
919
- this.client.settings
920
- )
921
- ),
922
- headers: jsonContentHeaders,
923
- method: "PATCH",
924
- path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}`
925
- },
926
- unmarshalIPv6Block
927
- );
928
- /**
929
- * Delete IPv6 block. Delete IPv6 block subnet with the given ID.
930
- *
931
- * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest}
932
- */
933
- deleteIPv6Block = (request) => this.client.fetch({
934
- method: "DELETE",
935
- path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}`
936
- });
937
- /**
938
- * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID.
939
- /48 could create subnet in /56 (quota link to your number of server).
940
- /56 could create subnet in /64 (quota link to your number of failover IP).
941
- *
942
- * @param request - The request {@link IPv6BlockApiCreateIPv6BlockSubnetRequest}
943
- * @returns A Promise of IPv6Block
944
- */
945
- createIPv6BlockSubnet = (request) => this.client.fetch(
946
- {
947
- body: JSON.stringify(
948
- marshalIPv6BlockApiCreateIPv6BlockSubnetRequest(
949
- request,
950
- this.client.settings
951
- )
952
- ),
953
- headers: jsonContentHeaders,
954
- method: "POST",
955
- path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}/subnets`
956
- },
957
- unmarshalIPv6Block
958
- );
959
- /**
960
- * List available IPv6 block subnets. List all available IPv6 block subnets for given IP ID.
961
- *
962
- * @param request - The request {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest}
963
- * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse
964
- */
965
- listIPv6BlockSubnetsAvailable = (request) => this.client.fetch(
966
- {
967
- method: "GET",
968
- path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}/subnets`
969
- },
970
- unmarshalListIPv6BlockSubnetsAvailableResponse
971
- );
972
- }
973
- class RpnAPI extends API$1 {
974
- pageOfListRpnServerCapabilities = (request = {}) => this.client.fetch(
975
- {
976
- method: "GET",
977
- path: `/dedibox/v1/rpn/server-capabilities`,
978
- urlParams: urlParams(
979
- ["order_by", request.orderBy],
980
- ["page", request.page],
981
- [
982
- "page_size",
983
- request.pageSize ?? this.client.settings.defaultPageSize
984
- ],
985
- ["project_id", request.projectId]
986
- )
987
- },
988
- unmarshalListRpnServerCapabilitiesResponse
989
- );
990
- listRpnServerCapabilities = (request = {}) => enrichForPagination(
991
- "servers",
992
- this.pageOfListRpnServerCapabilities,
993
- request
994
- );
995
- getRpnStatus = (request = {}) => this.client.fetch(
996
- {
997
- method: "GET",
998
- path: `/dedibox/v1/rpn/status`,
999
- urlParams: urlParams(
1000
- ["project_id", request.projectId],
1001
- ["rpnv1_group_id", request.rpnv1GroupId],
1002
- ["rpnv2_group_id", request.rpnv2GroupId]
1003
- )
1004
- },
1005
- unmarshalGetRpnStatusResponse
1006
- );
1007
- }
1008
- class RpnSanAPI extends API$1 {
1009
- pageOfListRpnSans = (request = {}) => this.client.fetch(
1010
- {
1011
- method: "GET",
1012
- path: `/dedibox/v1/rpn-sans`,
1013
- urlParams: urlParams(
1014
- ["order_by", request.orderBy],
1015
- ["page", request.page],
1016
- [
1017
- "page_size",
1018
- request.pageSize ?? this.client.settings.defaultPageSize
1019
- ],
1020
- ["project_id", request.projectId]
1021
- )
1022
- },
1023
- unmarshalListRpnSansResponse
1024
- );
1025
- listRpnSans = (request = {}) => enrichForPagination("rpnSans", this.pageOfListRpnSans, request);
1026
- getRpnSan = (request) => this.client.fetch(
1027
- {
1028
- method: "GET",
1029
- path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}`
1030
- },
1031
- unmarshalRpnSan
1032
- );
1033
- /**
1034
- * Waits for {@link RpnSan} to be in a final state.
1035
- *
1036
- * @param request - The request {@link RpnSanApiGetRpnSanRequest}
1037
- * @param options - The waiting options
1038
- * @returns A Promise of RpnSan
1039
- */
1040
- waitForRpnSan = (request, options) => waitForResource(
1041
- options?.stop ?? ((res) => Promise.resolve(
1042
- !RPN_SAN_TRANSIENT_STATUSES.includes(res.status)
1043
- )),
1044
- this.getRpnSan,
1045
- request,
1046
- options
1047
- );
1048
- deleteRpnSan = (request) => this.client.fetch({
1049
- method: "DELETE",
1050
- path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}`
1051
- });
1052
- createRpnSan = (request) => this.client.fetch(
1053
- {
1054
- body: JSON.stringify(
1055
- marshalRpnSanApiCreateRpnSanRequest(request, this.client.settings)
1056
- ),
1057
- headers: jsonContentHeaders,
1058
- method: "POST",
1059
- path: `/dedibox/v1/rpn-sans`
1060
- },
1061
- unmarshalService
1062
- );
1063
- listIps = (request) => this.client.fetch(
1064
- {
1065
- method: "GET",
1066
- path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/ips`,
1067
- urlParams: urlParams(["type", request.type])
1068
- },
1069
- unmarshalListIpsResponse
1070
- );
1071
- addIp = (request) => this.client.fetch({
1072
- body: JSON.stringify(
1073
- marshalRpnSanApiAddIpRequest(request, this.client.settings)
1074
- ),
1075
- headers: jsonContentHeaders,
1076
- method: "POST",
1077
- path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/ips`
1078
- });
1079
- removeIp = (request) => this.client.fetch({
1080
- body: JSON.stringify(
1081
- marshalRpnSanApiRemoveIpRequest(request, this.client.settings)
1082
- ),
1083
- headers: jsonContentHeaders,
1084
- method: "DELETE",
1085
- path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/ips`
1086
- });
1087
- listAvailableIps = (request) => this.client.fetch(
1088
- {
1089
- method: "GET",
1090
- path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/available-ips`,
1091
- urlParams: urlParams(["type", request.type])
1092
- },
1093
- unmarshalListIpsResponse
1094
- );
1095
- }
1096
- class RpnV1API extends API$1 {
1097
- pageOfListRpnGroups = (request = {}) => this.client.fetch(
1098
- {
1099
- method: "GET",
1100
- path: `/dedibox/v1/rpnv1/groups`,
1101
- urlParams: urlParams(
1102
- ["order_by", request.orderBy],
1103
- ["page", request.page],
1104
- [
1105
- "page_size",
1106
- request.pageSize ?? this.client.settings.defaultPageSize
1107
- ],
1108
- ["project_id", request.projectId]
1109
- )
1110
- },
1111
- unmarshalListRpnGroupsResponse
1112
- );
1113
- listRpnGroups = (request = {}) => enrichForPagination("rpnGroups", this.pageOfListRpnGroups, request);
1114
- getRpnGroup = (request) => this.client.fetch(
1115
- {
1116
- method: "GET",
1117
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}`
1118
- },
1119
- unmarshalRpnGroup
1120
- );
1121
- createRpnGroup = (request) => this.client.fetch(
1122
- {
1123
- body: JSON.stringify(
1124
- marshalRpnV1ApiCreateRpnGroupRequest(request, this.client.settings)
1125
- ),
1126
- headers: jsonContentHeaders,
1127
- method: "POST",
1128
- path: `/dedibox/v1/rpnv1/groups`
1129
- },
1130
- unmarshalRpnGroup
1131
- );
1132
- deleteRpnGroup = (request) => this.client.fetch({
1133
- method: "DELETE",
1134
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}`
1135
- });
1136
- updateRpnGroupName = (request) => this.client.fetch(
1137
- {
1138
- body: JSON.stringify(
1139
- marshalRpnV1ApiUpdateRpnGroupNameRequest(
1140
- request,
1141
- this.client.settings
1142
- )
1143
- ),
1144
- headers: jsonContentHeaders,
1145
- method: "PATCH",
1146
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}`
1147
- },
1148
- unmarshalRpnGroup
1149
- );
1150
- pageOfListRpnGroupMembers = (request) => this.client.fetch(
1151
- {
1152
- method: "GET",
1153
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/members`,
1154
- urlParams: urlParams(
1155
- ["order_by", request.orderBy],
1156
- ["page", request.page],
1157
- [
1158
- "page_size",
1159
- request.pageSize ?? this.client.settings.defaultPageSize
1160
- ],
1161
- ["project_id", request.projectId]
1162
- )
1163
- },
1164
- unmarshalListRpnGroupMembersResponse
1165
- );
1166
- listRpnGroupMembers = (request) => enrichForPagination("members", this.pageOfListRpnGroupMembers, request);
1167
- rpnGroupInvite = (request) => this.client.fetch({
1168
- body: JSON.stringify(
1169
- marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings)
1170
- ),
1171
- headers: jsonContentHeaders,
1172
- method: "POST",
1173
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/invite`
1174
- });
1175
- leaveRpnGroup = (request) => this.client.fetch({
1176
- body: JSON.stringify(
1177
- marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings)
1178
- ),
1179
- headers: jsonContentHeaders,
1180
- method: "POST",
1181
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/leave`
1182
- });
1183
- addRpnGroupMembers = (request) => this.client.fetch(
1184
- {
1185
- body: JSON.stringify(
1186
- marshalRpnV1ApiAddRpnGroupMembersRequest(
1187
- request,
1188
- this.client.settings
1189
- )
1190
- ),
1191
- headers: jsonContentHeaders,
1192
- method: "POST",
1193
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/members`
1194
- },
1195
- unmarshalRpnGroup
1196
- );
1197
- deleteRpnGroupMembers = (request) => this.client.fetch(
1198
- {
1199
- body: JSON.stringify(
1200
- marshalRpnV1ApiDeleteRpnGroupMembersRequest(
1201
- request,
1202
- this.client.settings
1203
- )
1204
- ),
1205
- headers: jsonContentHeaders,
1206
- method: "DELETE",
1207
- path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/members`
1208
- },
1209
- unmarshalRpnGroup
1210
- );
1211
- pageOfListRpnCapableServers = (request = {}) => this.client.fetch(
1212
- {
1213
- method: "GET",
1214
- path: `/dedibox/v1/rpnv1/capable-servers`,
1215
- urlParams: urlParams(
1216
- ["order_by", request.orderBy],
1217
- ["page", request.page],
1218
- [
1219
- "page_size",
1220
- request.pageSize ?? this.client.settings.defaultPageSize
1221
- ],
1222
- ["project_id", request.projectId]
1223
- )
1224
- },
1225
- unmarshalListRpnCapableServersResponse
1226
- );
1227
- listRpnCapableServers = (request = {}) => enrichForPagination("servers", this.pageOfListRpnCapableServers, request);
1228
- pageOfListRpnCapableSanServers = (request = {}) => this.client.fetch(
1229
- {
1230
- method: "GET",
1231
- path: `/dedibox/v1/rpnv1/capable-san-servers`,
1232
- urlParams: urlParams(
1233
- ["order_by", request.orderBy],
1234
- ["page", request.page],
1235
- [
1236
- "page_size",
1237
- request.pageSize ?? this.client.settings.defaultPageSize
1238
- ],
1239
- ["project_id", request.projectId]
1240
- )
1241
- },
1242
- unmarshalListRpnCapableSanServersResponse
1243
- );
1244
- listRpnCapableSanServers = (request = {}) => enrichForPagination(
1245
- "sanServers",
1246
- this.pageOfListRpnCapableSanServers,
1247
- request
1248
- );
1249
- pageOfListRpnInvites = (request = {}) => this.client.fetch(
1250
- {
1251
- method: "GET",
1252
- path: `/dedibox/v1/rpnv1/invites`,
1253
- urlParams: urlParams(
1254
- ["order_by", request.orderBy],
1255
- ["page", request.page],
1256
- [
1257
- "page_size",
1258
- request.pageSize ?? this.client.settings.defaultPageSize
1259
- ],
1260
- [
1261
- "project_id",
1262
- request.projectId ?? this.client.settings.defaultProjectId
1263
- ]
1264
- )
1265
- },
1266
- unmarshalListRpnInvitesResponse
1267
- );
1268
- listRpnInvites = (request = {}) => enrichForPagination("members", this.pageOfListRpnInvites, request);
1269
- acceptRpnInvite = (request) => this.client.fetch({
1270
- method: "POST",
1271
- path: `/dedibox/v1/rpnv1/invites/${validatePathParam("memberId", request.memberId)}/accept`
1272
- });
1273
- refuseRpnInvite = (request) => this.client.fetch({
1274
- method: "POST",
1275
- path: `/dedibox/v1/rpnv1/invites/${validatePathParam("memberId", request.memberId)}/refuse`
1276
- });
1277
- }
1278
- class RpnV2API extends API$1 {
1279
- pageOfListRpnV2Groups = (request = {}) => this.client.fetch(
1280
- {
1281
- method: "GET",
1282
- path: `/dedibox/v1/rpnv2/groups`,
1283
- urlParams: urlParams(
1284
- ["order_by", request.orderBy],
1285
- ["page", request.page],
1286
- [
1287
- "page_size",
1288
- request.pageSize ?? this.client.settings.defaultPageSize
1289
- ],
1290
- ["project_id", request.projectId]
1291
- )
1292
- },
1293
- unmarshalListRpnV2GroupsResponse
1294
- );
1295
- listRpnV2Groups = (request = {}) => enrichForPagination("rpnGroups", this.pageOfListRpnV2Groups, request);
1296
- pageOfListRpnV2Members = (request) => this.client.fetch(
1297
- {
1298
- method: "GET",
1299
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/members`,
1300
- urlParams: urlParams(
1301
- ["order_by", request.orderBy],
1302
- ["page", request.page],
1303
- [
1304
- "page_size",
1305
- request.pageSize ?? this.client.settings.defaultPageSize
1306
- ],
1307
- ["type", request.type]
1308
- )
1309
- },
1310
- unmarshalListRpnV2MembersResponse
1311
- );
1312
- listRpnV2Members = (request) => enrichForPagination("members", this.pageOfListRpnV2Members, request);
1313
- getRpnV2Group = (request) => this.client.fetch(
1314
- {
1315
- method: "GET",
1316
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}`
1317
- },
1318
- unmarshalRpnV2Group
1319
- );
1320
- /**
1321
- * Waits for {@link RpnV2Group} to be in a final state.
1322
- *
1323
- * @param request - The request {@link RpnV2ApiGetRpnV2GroupRequest}
1324
- * @param options - The waiting options
1325
- * @returns A Promise of RpnV2Group
1326
- */
1327
- waitForRpnV2Group = (request, options) => waitForResource(
1328
- options?.stop ?? ((res) => Promise.resolve(
1329
- !RPN_V2_GROUP_TRANSIENT_STATUSES.includes(res.status)
1330
- )),
1331
- this.getRpnV2Group,
1332
- request,
1333
- options
1334
- );
1335
- createRpnV2Group = (request) => this.client.fetch(
1336
- {
1337
- body: JSON.stringify(
1338
- marshalRpnV2ApiCreateRpnV2GroupRequest(request, this.client.settings)
1339
- ),
1340
- headers: jsonContentHeaders,
1341
- method: "POST",
1342
- path: `/dedibox/v1/rpnv2/groups`
1343
- },
1344
- unmarshalRpnV2Group
1345
- );
1346
- deleteRpnV2Group = (request) => this.client.fetch({
1347
- method: "DELETE",
1348
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}`
1349
- });
1350
- updateRpnV2GroupName = (request) => this.client.fetch(
1351
- {
1352
- body: JSON.stringify(
1353
- marshalRpnV2ApiUpdateRpnV2GroupNameRequest(
1354
- request,
1355
- this.client.settings
1356
- )
1357
- ),
1358
- headers: jsonContentHeaders,
1359
- method: "PATCH",
1360
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}`
1361
- },
1362
- unmarshalRpnV2Group
1363
- );
1364
- addRpnV2Members = (request) => this.client.fetch({
1365
- body: JSON.stringify(
1366
- marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings)
1367
- ),
1368
- headers: jsonContentHeaders,
1369
- method: "POST",
1370
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/members`
1371
- });
1372
- deleteRpnV2Members = (request) => this.client.fetch({
1373
- body: JSON.stringify(
1374
- marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings)
1375
- ),
1376
- headers: jsonContentHeaders,
1377
- method: "DELETE",
1378
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/members`
1379
- });
1380
- pageOfListRpnV2CapableResources = (request = {}) => this.client.fetch(
1381
- {
1382
- method: "GET",
1383
- path: `/dedibox/v1/rpnv2/groups/capable`,
1384
- urlParams: urlParams(
1385
- ["order_by", request.orderBy],
1386
- ["page", request.page],
1387
- [
1388
- "page_size",
1389
- request.pageSize ?? this.client.settings.defaultPageSize
1390
- ],
1391
- ["project_id", request.projectId]
1392
- )
1393
- },
1394
- unmarshalListRpnV2CapableResourcesResponse
1395
- );
1396
- listRpnV2CapableResources = (request = {}) => enrichForPagination(
1397
- "servers",
1398
- this.pageOfListRpnV2CapableResources,
1399
- request
1400
- );
1401
- pageOfListRpnV2GroupLogs = (request) => this.client.fetch(
1402
- {
1403
- method: "GET",
1404
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/logs`,
1405
- urlParams: urlParams(
1406
- ["order_by", request.orderBy],
1407
- ["page", request.page],
1408
- [
1409
- "page_size",
1410
- request.pageSize ?? this.client.settings.defaultPageSize
1411
- ]
1412
- )
1413
- },
1414
- unmarshalListRpnV2GroupLogsResponse
1415
- );
1416
- listRpnV2GroupLogs = (request) => enrichForPagination("logs", this.pageOfListRpnV2GroupLogs, request);
1417
- updateRpnV2VlanForMembers = (request) => this.client.fetch({
1418
- body: JSON.stringify(
1419
- marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest(
1420
- request,
1421
- this.client.settings
1422
- )
1423
- ),
1424
- headers: jsonContentHeaders,
1425
- method: "PATCH",
1426
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/vlan`
1427
- });
1428
- enableRpnV2GroupCompatibility = (request) => this.client.fetch({
1429
- body: JSON.stringify(
1430
- marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest(
1431
- request,
1432
- this.client.settings
1433
- )
1434
- ),
1435
- headers: jsonContentHeaders,
1436
- method: "POST",
1437
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/enable-compatibility`
1438
- });
1439
- disableRpnV2GroupCompatibility = (request) => this.client.fetch({
1440
- body: "{}",
1441
- headers: jsonContentHeaders,
1442
- method: "POST",
1443
- path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/disable-compatibility`
1444
- });
1445
- }
1446
- export {
1447
- API,
1448
- BillingAPI,
1449
- IPv6BlockAPI,
1450
- RpnAPI,
1451
- RpnSanAPI,
1452
- RpnV1API,
1453
- RpnV2API
527
+ /**
528
+ * Dedibox Phoenix Billing API.
529
+ */
530
+ var BillingAPI = class extends API {
531
+ pageOfListInvoices = (request = {}) => this.client.fetch({
532
+ method: "GET",
533
+ path: `/dedibox/v1/invoices`,
534
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
535
+ }, unmarshalListInvoicesResponse);
536
+ listInvoices = (request = {}) => enrichForPagination("invoices", this.pageOfListInvoices, request);
537
+ getInvoice = (request) => this.client.fetch({
538
+ method: "GET",
539
+ path: `/dedibox/v1/invoices/${validatePathParam("invoiceId", request.invoiceId)}`
540
+ }, unmarshalInvoice);
541
+ downloadInvoice = (request) => this.client.fetch({
542
+ method: "GET",
543
+ path: `/dedibox/v1/invoices/${validatePathParam("invoiceId", request.invoiceId)}/download`,
544
+ urlParams: urlParams(["dl", 1]),
545
+ responseType: "blob"
546
+ });
547
+ pageOfListRefunds = (request = {}) => this.client.fetch({
548
+ method: "GET",
549
+ path: `/dedibox/v1/refunds`,
550
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
551
+ }, unmarshalListRefundsResponse);
552
+ listRefunds = (request = {}) => enrichForPagination("refunds", this.pageOfListRefunds, request);
553
+ getRefund = (request) => this.client.fetch({
554
+ method: "GET",
555
+ path: `/dedibox/v1/refunds/${validatePathParam("refundId", request.refundId)}`
556
+ }, unmarshalRefund);
557
+ downloadRefund = (request) => this.client.fetch({
558
+ method: "GET",
559
+ path: `/dedibox/v1/refunds/${validatePathParam("refundId", request.refundId)}/download`,
560
+ urlParams: urlParams(["dl", 1]),
561
+ responseType: "blob"
562
+ });
563
+ canOrder = (request = {}) => this.client.fetch({
564
+ method: "GET",
565
+ path: `/dedibox/v1/can-order`,
566
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
567
+ }, unmarshalCanOrderResponse);
1454
568
  };
569
+ /**
570
+ * Dedibox Phoenix IPv6 Block API.
571
+ */
572
+ var IPv6BlockAPI = class extends API {
573
+ /**
574
+ * Get IPv6 block quota. Get IPv6 block quota with the given project ID.
575
+ /48 one per organization.
576
+ /56 link to your number of server.
577
+ /64 link to your number of failover IP.
578
+ *
579
+ * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest}
580
+ * @returns A Promise of GetIPv6BlockQuotasResponse
581
+ */
582
+ getIPv6BlockQuotas = (request = {}) => this.client.fetch({
583
+ method: "GET",
584
+ path: `/dedibox/v1/ipv6-block-quotas`,
585
+ urlParams: urlParams(["project_id", request.projectId])
586
+ }, unmarshalGetIPv6BlockQuotasResponse);
587
+ /**
588
+ * Create IPv6 block for baremetal server. Create IPv6 block associated with the given project ID.
589
+ *
590
+ * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest}
591
+ * @returns A Promise of IPv6Block
592
+ */
593
+ createIPv6Block = (request = {}) => this.client.fetch({
594
+ body: JSON.stringify(marshalIPv6BlockApiCreateIPv6BlockRequest(request, this.client.settings)),
595
+ headers: jsonContentHeaders,
596
+ method: "POST",
597
+ path: `/dedibox/v1/ipv6-block`
598
+ }, unmarshalIPv6Block);
599
+ /**
600
+ * List IPv6 blocks. List IPv6 blocks associated given project ID.
601
+ *
602
+ * @param request - The request {@link IPv6BlockApiListIPv6BlocksRequest}
603
+ * @returns A Promise of ListIPv6BlocksResponse
604
+ */
605
+ listIPv6Blocks = (request = {}) => this.client.fetch({
606
+ method: "GET",
607
+ path: `/dedibox/v1/ipv6-blocks`,
608
+ urlParams: urlParams(["project_id", request.projectId])
609
+ }, unmarshalListIPv6BlocksResponse);
610
+ /**
611
+ * Get first IPv6 block. Get the first IPv6 block associated with the given project ID.
612
+ *
613
+ * @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest}
614
+ * @returns A Promise of IPv6Block
615
+ */
616
+ getIPv6Block = (request = {}) => this.client.fetch({
617
+ method: "GET",
618
+ path: `/dedibox/v1/ipv6-block`,
619
+ urlParams: urlParams(["project_id", request.projectId])
620
+ }, unmarshalIPv6Block);
621
+ /**
622
+ * Update IPv6 block. Update DNS associated to IPv6 block.
623
+ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate).
624
+ *
625
+ * @param request - The request {@link IPv6BlockApiUpdateIPv6BlockRequest}
626
+ * @returns A Promise of IPv6Block
627
+ */
628
+ updateIPv6Block = (request) => this.client.fetch({
629
+ body: JSON.stringify(marshalIPv6BlockApiUpdateIPv6BlockRequest(request, this.client.settings)),
630
+ headers: jsonContentHeaders,
631
+ method: "PATCH",
632
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}`
633
+ }, unmarshalIPv6Block);
634
+ /**
635
+ * Delete IPv6 block. Delete IPv6 block subnet with the given ID.
636
+ *
637
+ * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest}
638
+ */
639
+ deleteIPv6Block = (request) => this.client.fetch({
640
+ method: "DELETE",
641
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}`
642
+ });
643
+ /**
644
+ * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID.
645
+ /48 could create subnet in /56 (quota link to your number of server).
646
+ /56 could create subnet in /64 (quota link to your number of failover IP).
647
+ *
648
+ * @param request - The request {@link IPv6BlockApiCreateIPv6BlockSubnetRequest}
649
+ * @returns A Promise of IPv6Block
650
+ */
651
+ createIPv6BlockSubnet = (request) => this.client.fetch({
652
+ body: JSON.stringify(marshalIPv6BlockApiCreateIPv6BlockSubnetRequest(request, this.client.settings)),
653
+ headers: jsonContentHeaders,
654
+ method: "POST",
655
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}/subnets`
656
+ }, unmarshalIPv6Block);
657
+ /**
658
+ * List available IPv6 block subnets. List all available IPv6 block subnets for given IP ID.
659
+ *
660
+ * @param request - The request {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest}
661
+ * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse
662
+ */
663
+ listIPv6BlockSubnetsAvailable = (request) => this.client.fetch({
664
+ method: "GET",
665
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam("blockId", request.blockId)}/subnets`
666
+ }, unmarshalListIPv6BlockSubnetsAvailableResponse);
667
+ };
668
+ /**
669
+ * Dedibox Phoenix RPN API.
670
+ */
671
+ var RpnAPI = class extends API {
672
+ pageOfListRpnServerCapabilities = (request = {}) => this.client.fetch({
673
+ method: "GET",
674
+ path: `/dedibox/v1/rpn/server-capabilities`,
675
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
676
+ }, unmarshalListRpnServerCapabilitiesResponse);
677
+ listRpnServerCapabilities = (request = {}) => enrichForPagination("servers", this.pageOfListRpnServerCapabilities, request);
678
+ getRpnStatus = (request = {}) => this.client.fetch({
679
+ method: "GET",
680
+ path: `/dedibox/v1/rpn/status`,
681
+ urlParams: urlParams(["project_id", request.projectId], ["rpnv1_group_id", request.rpnv1GroupId], ["rpnv2_group_id", request.rpnv2GroupId])
682
+ }, unmarshalGetRpnStatusResponse);
683
+ };
684
+ /**
685
+ * Dedibox Phoenix RPN SAN API.
686
+ */
687
+ var RpnSanAPI = class extends API {
688
+ pageOfListRpnSans = (request = {}) => this.client.fetch({
689
+ method: "GET",
690
+ path: `/dedibox/v1/rpn-sans`,
691
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
692
+ }, unmarshalListRpnSansResponse);
693
+ listRpnSans = (request = {}) => enrichForPagination("rpnSans", this.pageOfListRpnSans, request);
694
+ getRpnSan = (request) => this.client.fetch({
695
+ method: "GET",
696
+ path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}`
697
+ }, unmarshalRpnSan);
698
+ /**
699
+ * Waits for {@link RpnSan} to be in a final state.
700
+ *
701
+ * @param request - The request {@link RpnSanApiGetRpnSanRequest}
702
+ * @param options - The waiting options
703
+ * @returns A Promise of RpnSan
704
+ */
705
+ waitForRpnSan = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!RPN_SAN_TRANSIENT_STATUSES.includes(res.status))), this.getRpnSan, request, options);
706
+ deleteRpnSan = (request) => this.client.fetch({
707
+ method: "DELETE",
708
+ path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}`
709
+ });
710
+ createRpnSan = (request) => this.client.fetch({
711
+ body: JSON.stringify(marshalRpnSanApiCreateRpnSanRequest(request, this.client.settings)),
712
+ headers: jsonContentHeaders,
713
+ method: "POST",
714
+ path: `/dedibox/v1/rpn-sans`
715
+ }, unmarshalService);
716
+ listIps = (request) => this.client.fetch({
717
+ method: "GET",
718
+ path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/ips`,
719
+ urlParams: urlParams(["type", request.type])
720
+ }, unmarshalListIpsResponse);
721
+ addIp = (request) => this.client.fetch({
722
+ body: JSON.stringify(marshalRpnSanApiAddIpRequest(request, this.client.settings)),
723
+ headers: jsonContentHeaders,
724
+ method: "POST",
725
+ path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/ips`
726
+ });
727
+ removeIp = (request) => this.client.fetch({
728
+ body: JSON.stringify(marshalRpnSanApiRemoveIpRequest(request, this.client.settings)),
729
+ headers: jsonContentHeaders,
730
+ method: "DELETE",
731
+ path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/ips`
732
+ });
733
+ listAvailableIps = (request) => this.client.fetch({
734
+ method: "GET",
735
+ path: `/dedibox/v1/rpn-sans/${validatePathParam("rpnSanId", request.rpnSanId)}/available-ips`,
736
+ urlParams: urlParams(["type", request.type])
737
+ }, unmarshalListIpsResponse);
738
+ };
739
+ /**
740
+ * Dedibox Phoenix RPN v1 API.
741
+ */
742
+ var RpnV1API = class extends API {
743
+ pageOfListRpnGroups = (request = {}) => this.client.fetch({
744
+ method: "GET",
745
+ path: `/dedibox/v1/rpnv1/groups`,
746
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
747
+ }, unmarshalListRpnGroupsResponse);
748
+ listRpnGroups = (request = {}) => enrichForPagination("rpnGroups", this.pageOfListRpnGroups, request);
749
+ getRpnGroup = (request) => this.client.fetch({
750
+ method: "GET",
751
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}`
752
+ }, unmarshalRpnGroup);
753
+ createRpnGroup = (request) => this.client.fetch({
754
+ body: JSON.stringify(marshalRpnV1ApiCreateRpnGroupRequest(request, this.client.settings)),
755
+ headers: jsonContentHeaders,
756
+ method: "POST",
757
+ path: `/dedibox/v1/rpnv1/groups`
758
+ }, unmarshalRpnGroup);
759
+ deleteRpnGroup = (request) => this.client.fetch({
760
+ method: "DELETE",
761
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}`
762
+ });
763
+ updateRpnGroupName = (request) => this.client.fetch({
764
+ body: JSON.stringify(marshalRpnV1ApiUpdateRpnGroupNameRequest(request, this.client.settings)),
765
+ headers: jsonContentHeaders,
766
+ method: "PATCH",
767
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}`
768
+ }, unmarshalRpnGroup);
769
+ pageOfListRpnGroupMembers = (request) => this.client.fetch({
770
+ method: "GET",
771
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/members`,
772
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
773
+ }, unmarshalListRpnGroupMembersResponse);
774
+ listRpnGroupMembers = (request) => enrichForPagination("members", this.pageOfListRpnGroupMembers, request);
775
+ rpnGroupInvite = (request) => this.client.fetch({
776
+ body: JSON.stringify(marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings)),
777
+ headers: jsonContentHeaders,
778
+ method: "POST",
779
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/invite`
780
+ });
781
+ leaveRpnGroup = (request) => this.client.fetch({
782
+ body: JSON.stringify(marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings)),
783
+ headers: jsonContentHeaders,
784
+ method: "POST",
785
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/leave`
786
+ });
787
+ addRpnGroupMembers = (request) => this.client.fetch({
788
+ body: JSON.stringify(marshalRpnV1ApiAddRpnGroupMembersRequest(request, this.client.settings)),
789
+ headers: jsonContentHeaders,
790
+ method: "POST",
791
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/members`
792
+ }, unmarshalRpnGroup);
793
+ deleteRpnGroupMembers = (request) => this.client.fetch({
794
+ body: JSON.stringify(marshalRpnV1ApiDeleteRpnGroupMembersRequest(request, this.client.settings)),
795
+ headers: jsonContentHeaders,
796
+ method: "DELETE",
797
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam("groupId", request.groupId)}/members`
798
+ }, unmarshalRpnGroup);
799
+ pageOfListRpnCapableServers = (request = {}) => this.client.fetch({
800
+ method: "GET",
801
+ path: `/dedibox/v1/rpnv1/capable-servers`,
802
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
803
+ }, unmarshalListRpnCapableServersResponse);
804
+ listRpnCapableServers = (request = {}) => enrichForPagination("servers", this.pageOfListRpnCapableServers, request);
805
+ pageOfListRpnCapableSanServers = (request = {}) => this.client.fetch({
806
+ method: "GET",
807
+ path: `/dedibox/v1/rpnv1/capable-san-servers`,
808
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
809
+ }, unmarshalListRpnCapableSanServersResponse);
810
+ listRpnCapableSanServers = (request = {}) => enrichForPagination("sanServers", this.pageOfListRpnCapableSanServers, request);
811
+ pageOfListRpnInvites = (request = {}) => this.client.fetch({
812
+ method: "GET",
813
+ path: `/dedibox/v1/rpnv1/invites`,
814
+ 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])
815
+ }, unmarshalListRpnInvitesResponse);
816
+ listRpnInvites = (request = {}) => enrichForPagination("members", this.pageOfListRpnInvites, request);
817
+ acceptRpnInvite = (request) => this.client.fetch({
818
+ method: "POST",
819
+ path: `/dedibox/v1/rpnv1/invites/${validatePathParam("memberId", request.memberId)}/accept`
820
+ });
821
+ refuseRpnInvite = (request) => this.client.fetch({
822
+ method: "POST",
823
+ path: `/dedibox/v1/rpnv1/invites/${validatePathParam("memberId", request.memberId)}/refuse`
824
+ });
825
+ };
826
+ /**
827
+ * Dedibox Phoenix RPN v2 API.
828
+ */
829
+ var RpnV2API = class extends API {
830
+ pageOfListRpnV2Groups = (request = {}) => this.client.fetch({
831
+ method: "GET",
832
+ path: `/dedibox/v1/rpnv2/groups`,
833
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
834
+ }, unmarshalListRpnV2GroupsResponse);
835
+ listRpnV2Groups = (request = {}) => enrichForPagination("rpnGroups", this.pageOfListRpnV2Groups, request);
836
+ pageOfListRpnV2Members = (request) => this.client.fetch({
837
+ method: "GET",
838
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/members`,
839
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["type", request.type])
840
+ }, unmarshalListRpnV2MembersResponse);
841
+ listRpnV2Members = (request) => enrichForPagination("members", this.pageOfListRpnV2Members, request);
842
+ getRpnV2Group = (request) => this.client.fetch({
843
+ method: "GET",
844
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}`
845
+ }, unmarshalRpnV2Group);
846
+ /**
847
+ * Waits for {@link RpnV2Group} to be in a final state.
848
+ *
849
+ * @param request - The request {@link RpnV2ApiGetRpnV2GroupRequest}
850
+ * @param options - The waiting options
851
+ * @returns A Promise of RpnV2Group
852
+ */
853
+ waitForRpnV2Group = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!RPN_V2_GROUP_TRANSIENT_STATUSES.includes(res.status))), this.getRpnV2Group, request, options);
854
+ createRpnV2Group = (request) => this.client.fetch({
855
+ body: JSON.stringify(marshalRpnV2ApiCreateRpnV2GroupRequest(request, this.client.settings)),
856
+ headers: jsonContentHeaders,
857
+ method: "POST",
858
+ path: `/dedibox/v1/rpnv2/groups`
859
+ }, unmarshalRpnV2Group);
860
+ deleteRpnV2Group = (request) => this.client.fetch({
861
+ method: "DELETE",
862
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}`
863
+ });
864
+ updateRpnV2GroupName = (request) => this.client.fetch({
865
+ body: JSON.stringify(marshalRpnV2ApiUpdateRpnV2GroupNameRequest(request, this.client.settings)),
866
+ headers: jsonContentHeaders,
867
+ method: "PATCH",
868
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}`
869
+ }, unmarshalRpnV2Group);
870
+ addRpnV2Members = (request) => this.client.fetch({
871
+ body: JSON.stringify(marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings)),
872
+ headers: jsonContentHeaders,
873
+ method: "POST",
874
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/members`
875
+ });
876
+ deleteRpnV2Members = (request) => this.client.fetch({
877
+ body: JSON.stringify(marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings)),
878
+ headers: jsonContentHeaders,
879
+ method: "DELETE",
880
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/members`
881
+ });
882
+ pageOfListRpnV2CapableResources = (request = {}) => this.client.fetch({
883
+ method: "GET",
884
+ path: `/dedibox/v1/rpnv2/groups/capable`,
885
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
886
+ }, unmarshalListRpnV2CapableResourcesResponse);
887
+ listRpnV2CapableResources = (request = {}) => enrichForPagination("servers", this.pageOfListRpnV2CapableResources, request);
888
+ pageOfListRpnV2GroupLogs = (request) => this.client.fetch({
889
+ method: "GET",
890
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/logs`,
891
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
892
+ }, unmarshalListRpnV2GroupLogsResponse);
893
+ listRpnV2GroupLogs = (request) => enrichForPagination("logs", this.pageOfListRpnV2GroupLogs, request);
894
+ updateRpnV2VlanForMembers = (request) => this.client.fetch({
895
+ body: JSON.stringify(marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest(request, this.client.settings)),
896
+ headers: jsonContentHeaders,
897
+ method: "PATCH",
898
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/vlan`
899
+ });
900
+ enableRpnV2GroupCompatibility = (request) => this.client.fetch({
901
+ body: JSON.stringify(marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest(request, this.client.settings)),
902
+ headers: jsonContentHeaders,
903
+ method: "POST",
904
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/enable-compatibility`
905
+ });
906
+ disableRpnV2GroupCompatibility = (request) => this.client.fetch({
907
+ body: "{}",
908
+ headers: jsonContentHeaders,
909
+ method: "POST",
910
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam("groupId", request.groupId)}/disable-compatibility`
911
+ });
912
+ };
913
+ export { API$1 as API, BillingAPI, IPv6BlockAPI, RpnAPI, RpnSanAPI, RpnV1API, RpnV2API };