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