@scaleway/sdk-lb 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1874 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class ZonedAPI extends sdkClient.API {
10
+ /** Lists the available zones of the API. */
11
+ static LOCALITIES = [
12
+ "fr-par-1",
13
+ "fr-par-2",
14
+ "nl-ams-1",
15
+ "nl-ams-2",
16
+ "nl-ams-3",
17
+ "pl-waw-1",
18
+ "pl-waw-2",
19
+ "pl-waw-3"
20
+ ];
21
+ pageOfListLbs = (request = {}) => this.client.fetch(
22
+ {
23
+ method: "GET",
24
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs`,
25
+ urlParams: sdkClient.urlParams(
26
+ ["name", request.name],
27
+ ["order_by", request.orderBy],
28
+ ["organization_id", request.organizationId],
29
+ ["page", request.page],
30
+ [
31
+ "page_size",
32
+ request.pageSize ?? this.client.settings.defaultPageSize
33
+ ],
34
+ ["project_id", request.projectId],
35
+ ["tags", request.tags]
36
+ )
37
+ },
38
+ marshalling_gen.unmarshalListLbsResponse
39
+ );
40
+ /**
41
+ * List Load Balancers. List all Load Balancers in the specified zone, for a Scaleway Organization or Scaleway Project. By default, the Load Balancers returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
42
+ *
43
+ * @param request - The request {@link ZonedApiListLbsRequest}
44
+ * @returns A Promise of ListLbsResponse
45
+ */
46
+ listLbs = (request = {}) => sdkClient.enrichForPagination("lbs", this.pageOfListLbs, request);
47
+ /**
48
+ * Create a Load Balancer. Create a new Load Balancer. Note that the Load Balancer will be created without frontends or backends; these must be created separately via the dedicated endpoints.
49
+ *
50
+ * @param request - The request {@link ZonedApiCreateLbRequest}
51
+ * @returns A Promise of Lb
52
+ */
53
+ createLb = (request) => this.client.fetch(
54
+ {
55
+ body: JSON.stringify(
56
+ marshalling_gen.marshalZonedApiCreateLbRequest(request, this.client.settings)
57
+ ),
58
+ headers: jsonContentHeaders,
59
+ method: "POST",
60
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs`
61
+ },
62
+ marshalling_gen.unmarshalLb
63
+ );
64
+ /**
65
+ * Get a Load Balancer. Retrieve information about an existing Load Balancer, specified by its Load Balancer ID. Its full details, including name, status and IP address, are returned in the response object.
66
+ *
67
+ * @param request - The request {@link ZonedApiGetLbRequest}
68
+ * @returns A Promise of Lb
69
+ */
70
+ getLb = (request) => this.client.fetch(
71
+ {
72
+ method: "GET",
73
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}`
74
+ },
75
+ marshalling_gen.unmarshalLb
76
+ );
77
+ /**
78
+ * Waits for {@link Lb} to be in a final state.
79
+ *
80
+ * @param request - The request {@link ZonedApiGetLbRequest}
81
+ * @param options - The waiting options
82
+ * @returns A Promise of Lb
83
+ */
84
+ waitForLb = (request, options) => sdkClient.waitForResource(
85
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.LB_TRANSIENT_STATUSES.includes(res.status))),
86
+ this.getLb,
87
+ request,
88
+ options
89
+ );
90
+ /**
91
+ * Update a Load Balancer. Update the parameters of an existing Load Balancer, specified by its Load Balancer ID. Note that the request type is PUT and not PATCH. You must set all parameters.
92
+ *
93
+ * @param request - The request {@link ZonedApiUpdateLbRequest}
94
+ * @returns A Promise of Lb
95
+ */
96
+ updateLb = (request) => this.client.fetch(
97
+ {
98
+ body: JSON.stringify(
99
+ marshalling_gen.marshalZonedApiUpdateLbRequest(request, this.client.settings)
100
+ ),
101
+ headers: jsonContentHeaders,
102
+ method: "PUT",
103
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}`
104
+ },
105
+ marshalling_gen.unmarshalLb
106
+ );
107
+ /**
108
+ * Delete a Load Balancer. Delete an existing Load Balancer, specified by its Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be undone. The Load Balancer's flexible IP address can either be deleted with the Load Balancer, or kept in your account for future use.
109
+ *
110
+ * @param request - The request {@link ZonedApiDeleteLbRequest}
111
+ */
112
+ deleteLb = (request) => this.client.fetch({
113
+ method: "DELETE",
114
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}`,
115
+ urlParams: sdkClient.urlParams(["release_ip", request.releaseIp])
116
+ });
117
+ /**
118
+ * Migrate a Load Balancer. Migrate an existing Load Balancer from one commercial type to another. Allows you to scale your Load Balancer up or down in terms of bandwidth or multi-cloud provision.
119
+ *
120
+ * @param request - The request {@link ZonedApiMigrateLbRequest}
121
+ * @returns A Promise of Lb
122
+ */
123
+ migrateLb = (request) => this.client.fetch(
124
+ {
125
+ body: JSON.stringify(
126
+ marshalling_gen.marshalZonedApiMigrateLbRequest(request, this.client.settings)
127
+ ),
128
+ headers: jsonContentHeaders,
129
+ method: "POST",
130
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/migrate`
131
+ },
132
+ marshalling_gen.unmarshalLb
133
+ );
134
+ pageOfListIPs = (request = {}) => this.client.fetch(
135
+ {
136
+ method: "GET",
137
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
138
+ urlParams: sdkClient.urlParams(
139
+ ["ip_address", request.ipAddress],
140
+ ["ip_type", request.ipType],
141
+ ["organization_id", request.organizationId],
142
+ ["page", request.page],
143
+ [
144
+ "page_size",
145
+ request.pageSize ?? this.client.settings.defaultPageSize
146
+ ],
147
+ ["project_id", request.projectId],
148
+ ["tags", request.tags]
149
+ )
150
+ },
151
+ marshalling_gen.unmarshalListIpsResponse
152
+ );
153
+ /**
154
+ * List IP addresses. List the Load Balancer flexible IP addresses held in the account (filtered by Organization ID or Project ID). It is also possible to search for a specific IP address.
155
+ *
156
+ * @param request - The request {@link ZonedApiListIPsRequest}
157
+ * @returns A Promise of ListIpsResponse
158
+ */
159
+ listIPs = (request = {}) => sdkClient.enrichForPagination("ips", this.pageOfListIPs, request);
160
+ /**
161
+ * Create an IP address. Create a new Load Balancer flexible IP address, in the specified Scaleway Project. This can be attached to new Load Balancers created in the future.
162
+ *
163
+ * @param request - The request {@link ZonedApiCreateIpRequest}
164
+ * @returns A Promise of Ip
165
+ */
166
+ createIp = (request) => this.client.fetch(
167
+ {
168
+ body: JSON.stringify(
169
+ marshalling_gen.marshalZonedApiCreateIpRequest(request, this.client.settings)
170
+ ),
171
+ headers: jsonContentHeaders,
172
+ method: "POST",
173
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
174
+ },
175
+ marshalling_gen.unmarshalIp
176
+ );
177
+ /**
178
+ * Get an IP address. Retrieve the full details of a Load Balancer flexible IP address.
179
+ *
180
+ * @param request - The request {@link ZonedApiGetIpRequest}
181
+ * @returns A Promise of Ip
182
+ */
183
+ getIp = (request) => this.client.fetch(
184
+ {
185
+ method: "GET",
186
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
187
+ },
188
+ marshalling_gen.unmarshalIp
189
+ );
190
+ /**
191
+ * Delete an IP address. Delete a Load Balancer flexible IP address. This action is irreversible, and cannot be undone.
192
+ *
193
+ * @param request - The request {@link ZonedApiReleaseIpRequest}
194
+ */
195
+ releaseIp = (request) => this.client.fetch({
196
+ method: "DELETE",
197
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
198
+ });
199
+ /**
200
+ * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP address.
201
+ *
202
+ * @param request - The request {@link ZonedApiUpdateIpRequest}
203
+ * @returns A Promise of Ip
204
+ */
205
+ updateIp = (request) => this.client.fetch(
206
+ {
207
+ body: JSON.stringify(
208
+ marshalling_gen.marshalZonedApiUpdateIpRequest(request, this.client.settings)
209
+ ),
210
+ headers: jsonContentHeaders,
211
+ method: "PATCH",
212
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
213
+ },
214
+ marshalling_gen.unmarshalIp
215
+ );
216
+ pageOfListBackends = (request) => this.client.fetch(
217
+ {
218
+ method: "GET",
219
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/backends`,
220
+ urlParams: sdkClient.urlParams(
221
+ ["name", request.name],
222
+ ["order_by", request.orderBy],
223
+ ["page", request.page],
224
+ [
225
+ "page_size",
226
+ request.pageSize ?? this.client.settings.defaultPageSize
227
+ ]
228
+ )
229
+ },
230
+ marshalling_gen.unmarshalListBackendsResponse
231
+ );
232
+ /**
233
+ * List the backends of a given Load Balancer. List all the backends of a Load Balancer, specified by its Load Balancer ID. By default, results are returned in ascending order by the creation date of each backend. The response is an array of backend objects, containing full details of each one including their configuration parameters such as protocol, port and forwarding algorithm.
234
+ *
235
+ * @param request - The request {@link ZonedApiListBackendsRequest}
236
+ * @returns A Promise of ListBackendsResponse
237
+ */
238
+ listBackends = (request) => sdkClient.enrichForPagination("backends", this.pageOfListBackends, request);
239
+ /**
240
+ * Create a backend for a given Load Balancer. Create a new backend for a given Load Balancer, specifying its full configuration including protocol, port and forwarding algorithm.
241
+ *
242
+ * @param request - The request {@link ZonedApiCreateBackendRequest}
243
+ * @returns A Promise of Backend
244
+ */
245
+ createBackend = (request) => this.client.fetch(
246
+ {
247
+ body: JSON.stringify(
248
+ marshalling_gen.marshalZonedApiCreateBackendRequest(request, this.client.settings)
249
+ ),
250
+ headers: jsonContentHeaders,
251
+ method: "POST",
252
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/backends`
253
+ },
254
+ marshalling_gen.unmarshalBackend
255
+ );
256
+ /**
257
+ * Get a backend of a given Load Balancer. Get the full details of a given backend, specified by its backend ID. The response contains the backend's full configuration parameters including protocol, port and forwarding algorithm.
258
+ *
259
+ * @param request - The request {@link ZonedApiGetBackendRequest}
260
+ * @returns A Promise of Backend
261
+ */
262
+ getBackend = (request) => this.client.fetch(
263
+ {
264
+ method: "GET",
265
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}`
266
+ },
267
+ marshalling_gen.unmarshalBackend
268
+ );
269
+ /**
270
+ * Update a backend of a given Load Balancer. Update a backend of a given Load Balancer, specified by its backend ID. Note that the request type is PUT and not PATCH. You must set all parameters.
271
+ *
272
+ * @param request - The request {@link ZonedApiUpdateBackendRequest}
273
+ * @returns A Promise of Backend
274
+ */
275
+ updateBackend = (request) => this.client.fetch(
276
+ {
277
+ body: JSON.stringify(
278
+ marshalling_gen.marshalZonedApiUpdateBackendRequest(request, this.client.settings)
279
+ ),
280
+ headers: jsonContentHeaders,
281
+ method: "PUT",
282
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}`
283
+ },
284
+ marshalling_gen.unmarshalBackend
285
+ );
286
+ /**
287
+ * Delete a backend of a given Load Balancer. Delete a backend of a given Load Balancer, specified by its backend ID. This action is irreversible and cannot be undone.
288
+ *
289
+ * @param request - The request {@link ZonedApiDeleteBackendRequest}
290
+ */
291
+ deleteBackend = (request) => this.client.fetch({
292
+ method: "DELETE",
293
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}`
294
+ });
295
+ /**
296
+ * Add a set of backend servers to a given backend. For a given backend specified by its backend ID, add a set of backend servers (identified by their IP addresses) it should forward traffic to. These will be appended to any existing set of backend servers for this backend.
297
+ *
298
+ * @param request - The request {@link ZonedApiAddBackendServersRequest}
299
+ * @returns A Promise of Backend
300
+ */
301
+ addBackendServers = (request) => this.client.fetch(
302
+ {
303
+ body: JSON.stringify(
304
+ marshalling_gen.marshalZonedApiAddBackendServersRequest(
305
+ request,
306
+ this.client.settings
307
+ )
308
+ ),
309
+ headers: jsonContentHeaders,
310
+ method: "POST",
311
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/servers`
312
+ },
313
+ marshalling_gen.unmarshalBackend
314
+ );
315
+ /**
316
+ * Remove a set of servers for a given backend. For a given backend specified by its backend ID, remove the specified backend servers (identified by their IP addresses) so that it no longer forwards traffic to them.
317
+ *
318
+ * @param request - The request {@link ZonedApiRemoveBackendServersRequest}
319
+ * @returns A Promise of Backend
320
+ */
321
+ removeBackendServers = (request) => this.client.fetch(
322
+ {
323
+ body: JSON.stringify(
324
+ marshalling_gen.marshalZonedApiRemoveBackendServersRequest(
325
+ request,
326
+ this.client.settings
327
+ )
328
+ ),
329
+ headers: jsonContentHeaders,
330
+ method: "DELETE",
331
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/servers`
332
+ },
333
+ marshalling_gen.unmarshalBackend
334
+ );
335
+ /**
336
+ * Define all backend servers for a given backend. For a given backend specified by its backend ID, define the set of backend servers (identified by their IP addresses) that it should forward traffic to. Any existing backend servers configured for this backend will be removed.
337
+ *
338
+ * @param request - The request {@link ZonedApiSetBackendServersRequest}
339
+ * @returns A Promise of Backend
340
+ */
341
+ setBackendServers = (request) => this.client.fetch(
342
+ {
343
+ body: JSON.stringify(
344
+ marshalling_gen.marshalZonedApiSetBackendServersRequest(
345
+ request,
346
+ this.client.settings
347
+ )
348
+ ),
349
+ headers: jsonContentHeaders,
350
+ method: "PUT",
351
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/servers`
352
+ },
353
+ marshalling_gen.unmarshalBackend
354
+ );
355
+ /**
356
+ * Update a health check for a given backend. Update the configuration of the health check performed by a given backend to verify the health of its backend servers, identified by its backend ID. Note that the request type is PUT and not PATCH. You must set all parameters.
357
+ *
358
+ * @param request - The request {@link ZonedApiUpdateHealthCheckRequest}
359
+ * @returns A Promise of HealthCheck
360
+ */
361
+ updateHealthCheck = (request) => this.client.fetch(
362
+ {
363
+ body: JSON.stringify(
364
+ marshalling_gen.marshalZonedApiUpdateHealthCheckRequest(
365
+ request,
366
+ this.client.settings
367
+ )
368
+ ),
369
+ headers: jsonContentHeaders,
370
+ method: "PUT",
371
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/healthcheck`
372
+ },
373
+ marshalling_gen.unmarshalHealthCheck
374
+ );
375
+ pageOfListFrontends = (request) => this.client.fetch(
376
+ {
377
+ method: "GET",
378
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/frontends`,
379
+ urlParams: sdkClient.urlParams(
380
+ ["name", request.name],
381
+ ["order_by", request.orderBy],
382
+ ["page", request.page],
383
+ [
384
+ "page_size",
385
+ request.pageSize ?? this.client.settings.defaultPageSize
386
+ ]
387
+ )
388
+ },
389
+ marshalling_gen.unmarshalListFrontendsResponse
390
+ );
391
+ /**
392
+ * List frontends of a given Load Balancer. List all the frontends of a Load Balancer, specified by its Load Balancer ID. By default, results are returned in ascending order by the creation date of each frontend. The response is an array of frontend objects, containing full details of each one including the port they listen on and the backend they are attached to.
393
+ *
394
+ * @param request - The request {@link ZonedApiListFrontendsRequest}
395
+ * @returns A Promise of ListFrontendsResponse
396
+ */
397
+ listFrontends = (request) => sdkClient.enrichForPagination("frontends", this.pageOfListFrontends, request);
398
+ /**
399
+ * Create a frontend in a given Load Balancer. Create a new frontend for a given Load Balancer, specifying its configuration including the port it should listen on and the backend to attach it to.
400
+ *
401
+ * @param request - The request {@link ZonedApiCreateFrontendRequest}
402
+ * @returns A Promise of Frontend
403
+ */
404
+ createFrontend = (request) => this.client.fetch(
405
+ {
406
+ body: JSON.stringify(
407
+ marshalling_gen.marshalZonedApiCreateFrontendRequest(request, this.client.settings)
408
+ ),
409
+ headers: jsonContentHeaders,
410
+ method: "POST",
411
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/frontends`
412
+ },
413
+ marshalling_gen.unmarshalFrontend
414
+ );
415
+ /**
416
+ * Get a frontend. Get the full details of a given frontend, specified by its frontend ID. The response contains the frontend's full configuration parameters including the backend it is attached to, the port it listens on, and any certificates it has.
417
+ *
418
+ * @param request - The request {@link ZonedApiGetFrontendRequest}
419
+ * @returns A Promise of Frontend
420
+ */
421
+ getFrontend = (request) => this.client.fetch(
422
+ {
423
+ method: "GET",
424
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}`
425
+ },
426
+ marshalling_gen.unmarshalFrontend
427
+ );
428
+ /**
429
+ * Update a frontend. Update a given frontend, specified by its frontend ID. You can update configuration parameters including its name and the port it listens on. Note that the request type is PUT and not PATCH. You must set all parameters.
430
+ *
431
+ * @param request - The request {@link ZonedApiUpdateFrontendRequest}
432
+ * @returns A Promise of Frontend
433
+ */
434
+ updateFrontend = (request) => this.client.fetch(
435
+ {
436
+ body: JSON.stringify(
437
+ marshalling_gen.marshalZonedApiUpdateFrontendRequest(request, this.client.settings)
438
+ ),
439
+ headers: jsonContentHeaders,
440
+ method: "PUT",
441
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}`
442
+ },
443
+ marshalling_gen.unmarshalFrontend
444
+ );
445
+ /**
446
+ * Delete a frontend. Delete a given frontend, specified by its frontend ID. This action is irreversible and cannot be undone.
447
+ *
448
+ * @param request - The request {@link ZonedApiDeleteFrontendRequest}
449
+ */
450
+ deleteFrontend = (request) => this.client.fetch({
451
+ method: "DELETE",
452
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}`
453
+ });
454
+ pageOfListRoutes = (request = {}) => this.client.fetch(
455
+ {
456
+ method: "GET",
457
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes`,
458
+ urlParams: sdkClient.urlParams(
459
+ ["frontend_id", request.frontendId],
460
+ ["order_by", request.orderBy],
461
+ ["page", request.page],
462
+ [
463
+ "page_size",
464
+ request.pageSize ?? this.client.settings.defaultPageSize
465
+ ]
466
+ )
467
+ },
468
+ marshalling_gen.unmarshalListRoutesResponse
469
+ );
470
+ /**
471
+ * List all routes. List all routes for a given frontend. The response is an array of routes, each one with a specified backend to direct to if a certain condition is matched (based on the value of the SNI field or HTTP Host header).
472
+ *
473
+ * @param request - The request {@link ZonedApiListRoutesRequest}
474
+ * @returns A Promise of ListRoutesResponse
475
+ */
476
+ listRoutes = (request = {}) => sdkClient.enrichForPagination("routes", this.pageOfListRoutes, request);
477
+ /**
478
+ * Create a route. Create a new route on a given frontend. To configure a route, specify the backend to direct to if a certain condition is matched (based on the value of the SNI field or HTTP Host header).
479
+ *
480
+ * @param request - The request {@link ZonedApiCreateRouteRequest}
481
+ * @returns A Promise of Route
482
+ */
483
+ createRoute = (request) => this.client.fetch(
484
+ {
485
+ body: JSON.stringify(
486
+ marshalling_gen.marshalZonedApiCreateRouteRequest(request, this.client.settings)
487
+ ),
488
+ headers: jsonContentHeaders,
489
+ method: "POST",
490
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes`
491
+ },
492
+ marshalling_gen.unmarshalRoute
493
+ );
494
+ /**
495
+ * Get a route. Retrieve information about an existing route, specified by its route ID. Its full details, origin frontend, target backend and match condition, are returned in the response object.
496
+ *
497
+ * @param request - The request {@link ZonedApiGetRouteRequest}
498
+ * @returns A Promise of Route
499
+ */
500
+ getRoute = (request) => this.client.fetch(
501
+ {
502
+ method: "GET",
503
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
504
+ },
505
+ marshalling_gen.unmarshalRoute
506
+ );
507
+ /**
508
+ * Update a route. Update the configuration of an existing route, specified by its route ID.
509
+ *
510
+ * @param request - The request {@link ZonedApiUpdateRouteRequest}
511
+ * @returns A Promise of Route
512
+ */
513
+ updateRoute = (request) => this.client.fetch(
514
+ {
515
+ body: JSON.stringify(
516
+ marshalling_gen.marshalZonedApiUpdateRouteRequest(request, this.client.settings)
517
+ ),
518
+ headers: jsonContentHeaders,
519
+ method: "PUT",
520
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
521
+ },
522
+ marshalling_gen.unmarshalRoute
523
+ );
524
+ /**
525
+ * Delete a route. Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone.
526
+ *
527
+ * @param request - The request {@link ZonedApiDeleteRouteRequest}
528
+ */
529
+ deleteRoute = (request) => this.client.fetch({
530
+ method: "DELETE",
531
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
532
+ });
533
+ /**
534
+ * Get usage statistics of a given Load Balancer.
535
+ *
536
+ * @deprecated
537
+ * @param request - The request {@link ZonedApiGetLbStatsRequest}
538
+ * @returns A Promise of LbStats
539
+ */
540
+ getLbStats = (request) => this.client.fetch(
541
+ {
542
+ method: "GET",
543
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/stats`,
544
+ urlParams: sdkClient.urlParams(["backend_id", request.backendId])
545
+ },
546
+ marshalling_gen.unmarshalLbStats
547
+ );
548
+ pageOfListBackendStats = (request) => this.client.fetch(
549
+ {
550
+ method: "GET",
551
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/backend-stats`,
552
+ urlParams: sdkClient.urlParams(
553
+ ["backend_id", request.backendId],
554
+ ["page", request.page],
555
+ [
556
+ "page_size",
557
+ request.pageSize ?? this.client.settings.defaultPageSize
558
+ ]
559
+ )
560
+ },
561
+ marshalling_gen.unmarshalListBackendStatsResponse
562
+ );
563
+ /**
564
+ * List backend server statistics. List information about your backend servers, including their state and the result of their last health check.
565
+ *
566
+ * @param request - The request {@link ZonedApiListBackendStatsRequest}
567
+ * @returns A Promise of ListBackendStatsResponse
568
+ */
569
+ listBackendStats = (request) => sdkClient.enrichForPagination(
570
+ "backendServersStats",
571
+ this.pageOfListBackendStats,
572
+ request
573
+ );
574
+ pageOfListAcls = (request) => this.client.fetch(
575
+ {
576
+ method: "GET",
577
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}/acls`,
578
+ urlParams: sdkClient.urlParams(
579
+ ["name", request.name],
580
+ ["order_by", request.orderBy],
581
+ ["page", request.page],
582
+ [
583
+ "page_size",
584
+ request.pageSize ?? this.client.settings.defaultPageSize
585
+ ]
586
+ )
587
+ },
588
+ marshalling_gen.unmarshalListAclResponse
589
+ );
590
+ /**
591
+ * List ACLs for a given frontend. List the ACLs for a given frontend, specified by its frontend ID. The response is an array of ACL objects, each one representing an ACL that denies or allows traffic based on certain conditions.
592
+ *
593
+ * @param request - The request {@link ZonedApiListAclsRequest}
594
+ * @returns A Promise of ListAclResponse
595
+ */
596
+ listAcls = (request) => sdkClient.enrichForPagination("acls", this.pageOfListAcls, request);
597
+ /**
598
+ * Create an ACL for a given frontend. Create a new ACL for a given frontend. Each ACL must have a name, an action to perform (allow or deny), and a match rule (the action is carried out when the incoming traffic matches the rule).
599
+ *
600
+ * @param request - The request {@link ZonedApiCreateAclRequest}
601
+ * @returns A Promise of Acl
602
+ */
603
+ createAcl = (request) => this.client.fetch(
604
+ {
605
+ body: JSON.stringify(
606
+ marshalling_gen.marshalZonedApiCreateAclRequest(request, this.client.settings)
607
+ ),
608
+ headers: jsonContentHeaders,
609
+ method: "POST",
610
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}/acls`
611
+ },
612
+ marshalling_gen.unmarshalAcl
613
+ );
614
+ /**
615
+ * Get an ACL. Get information for a particular ACL, specified by its ACL ID. The response returns full details of the ACL, including its name, action, match rule and frontend.
616
+ *
617
+ * @param request - The request {@link ZonedApiGetAclRequest}
618
+ * @returns A Promise of Acl
619
+ */
620
+ getAcl = (request) => this.client.fetch(
621
+ {
622
+ method: "GET",
623
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
624
+ },
625
+ marshalling_gen.unmarshalAcl
626
+ );
627
+ /**
628
+ * Update an ACL. Update a particular ACL, specified by its ACL ID. You can update details including its name, action and match rule.
629
+ *
630
+ * @param request - The request {@link ZonedApiUpdateAclRequest}
631
+ * @returns A Promise of Acl
632
+ */
633
+ updateAcl = (request) => this.client.fetch(
634
+ {
635
+ body: JSON.stringify(
636
+ marshalling_gen.marshalZonedApiUpdateAclRequest(request, this.client.settings)
637
+ ),
638
+ headers: jsonContentHeaders,
639
+ method: "PUT",
640
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
641
+ },
642
+ marshalling_gen.unmarshalAcl
643
+ );
644
+ /**
645
+ * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is irreversible and cannot be undone.
646
+ *
647
+ * @param request - The request {@link ZonedApiDeleteAclRequest}
648
+ */
649
+ deleteAcl = (request) => this.client.fetch({
650
+ method: "DELETE",
651
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
652
+ });
653
+ /**
654
+ * Define all ACLs for a given frontend. For a given frontend specified by its frontend ID, define and add the complete set of ACLS for that frontend. Any existing ACLs on this frontend will be removed.
655
+ *
656
+ * @param request - The request {@link ZonedApiSetAclsRequest}
657
+ * @returns A Promise of SetAclsResponse
658
+ */
659
+ setAcls = (request) => this.client.fetch(
660
+ {
661
+ body: JSON.stringify(
662
+ marshalling_gen.marshalZonedApiSetAclsRequest(request, this.client.settings)
663
+ ),
664
+ headers: jsonContentHeaders,
665
+ method: "PUT",
666
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}/acls`
667
+ },
668
+ marshalling_gen.unmarshalSetAclsResponse
669
+ );
670
+ /**
671
+ * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a given Load Balancer. You can choose to create a Let's Encrypt certificate, or import a custom certificate.
672
+ *
673
+ * @param request - The request {@link ZonedApiCreateCertificateRequest}
674
+ * @returns A Promise of Certificate
675
+ */
676
+ createCertificate = (request) => this.client.fetch(
677
+ {
678
+ body: JSON.stringify(
679
+ marshalling_gen.marshalZonedApiCreateCertificateRequest(
680
+ request,
681
+ this.client.settings
682
+ )
683
+ ),
684
+ headers: jsonContentHeaders,
685
+ method: "POST",
686
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/certificates`
687
+ },
688
+ marshalling_gen.unmarshalCertificate
689
+ );
690
+ pageOfListCertificates = (request) => this.client.fetch(
691
+ {
692
+ method: "GET",
693
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/certificates`,
694
+ urlParams: sdkClient.urlParams(
695
+ ["name", request.name],
696
+ ["order_by", request.orderBy],
697
+ ["page", request.page],
698
+ [
699
+ "page_size",
700
+ request.pageSize ?? this.client.settings.defaultPageSize
701
+ ]
702
+ )
703
+ },
704
+ marshalling_gen.unmarshalListCertificatesResponse
705
+ );
706
+ /**
707
+ * List all SSL/TLS certificates on a given Load Balancer. List all the SSL/TLS certificates on a given Load Balancer. The response is an array of certificate objects, which are by default listed in ascending order of creation date.
708
+ *
709
+ * @param request - The request {@link ZonedApiListCertificatesRequest}
710
+ * @returns A Promise of ListCertificatesResponse
711
+ */
712
+ listCertificates = (request) => sdkClient.enrichForPagination("certificates", this.pageOfListCertificates, request);
713
+ /**
714
+ * Get an SSL/TLS certificate. Get information for a particular SSL/TLS certificate, specified by its certificate ID. The response returns full details of the certificate, including its type, main domain name, and alternative domain names.
715
+ *
716
+ * @param request - The request {@link ZonedApiGetCertificateRequest}
717
+ * @returns A Promise of Certificate
718
+ */
719
+ getCertificate = (request) => this.client.fetch(
720
+ {
721
+ method: "GET",
722
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/certificates/${sdkClient.validatePathParam("certificateId", request.certificateId)}`
723
+ },
724
+ marshalling_gen.unmarshalCertificate
725
+ );
726
+ /**
727
+ * Waits for {@link Certificate} to be in a final state.
728
+ *
729
+ * @param request - The request {@link ZonedApiGetCertificateRequest}
730
+ * @param options - The waiting options
731
+ * @returns A Promise of Certificate
732
+ */
733
+ waitForCertificate = (request, options) => sdkClient.waitForResource(
734
+ options?.stop ?? ((res) => Promise.resolve(
735
+ !content_gen.CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)
736
+ )),
737
+ this.getCertificate,
738
+ request,
739
+ options
740
+ );
741
+ /**
742
+ * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS certificate, specified by its certificate ID.
743
+ *
744
+ * @param request - The request {@link ZonedApiUpdateCertificateRequest}
745
+ * @returns A Promise of Certificate
746
+ */
747
+ updateCertificate = (request) => this.client.fetch(
748
+ {
749
+ body: JSON.stringify(
750
+ marshalling_gen.marshalZonedApiUpdateCertificateRequest(
751
+ request,
752
+ this.client.settings
753
+ )
754
+ ),
755
+ headers: jsonContentHeaders,
756
+ method: "PUT",
757
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/certificates/${sdkClient.validatePathParam("certificateId", request.certificateId)}`
758
+ },
759
+ marshalling_gen.unmarshalCertificate
760
+ );
761
+ /**
762
+ * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by its certificate ID. Deleting a certificate is irreversible and cannot be undone.
763
+ *
764
+ * @param request - The request {@link ZonedApiDeleteCertificateRequest}
765
+ */
766
+ deleteCertificate = (request) => this.client.fetch({
767
+ method: "DELETE",
768
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/certificates/${sdkClient.validatePathParam("certificateId", request.certificateId)}`
769
+ });
770
+ pageOfListLbTypes = (request = {}) => this.client.fetch(
771
+ {
772
+ method: "GET",
773
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb-types`,
774
+ urlParams: sdkClient.urlParams(
775
+ ["page", request.page],
776
+ [
777
+ "page_size",
778
+ request.pageSize ?? this.client.settings.defaultPageSize
779
+ ]
780
+ )
781
+ },
782
+ marshalling_gen.unmarshalListLbTypesResponse
783
+ );
784
+ /**
785
+ * List all Load Balancer offer types. List all the different commercial Load Balancer types. The response includes an array of offer types, each with a name, description, and information about its stock availability.
786
+ *
787
+ * @param request - The request {@link ZonedApiListLbTypesRequest}
788
+ * @returns A Promise of ListLbTypesResponse
789
+ */
790
+ listLbTypes = (request = {}) => sdkClient.enrichForPagination("lbTypes", this.pageOfListLbTypes, request);
791
+ /**
792
+ * Create a subscriber. Create a new subscriber, either with an email configuration or a webhook configuration, for a specified Scaleway Project.
793
+ *
794
+ * @param request - The request {@link ZonedApiCreateSubscriberRequest}
795
+ * @returns A Promise of Subscriber
796
+ */
797
+ createSubscriber = (request) => this.client.fetch(
798
+ {
799
+ body: JSON.stringify(
800
+ marshalling_gen.marshalZonedApiCreateSubscriberRequest(request, this.client.settings)
801
+ ),
802
+ headers: jsonContentHeaders,
803
+ method: "POST",
804
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers`
805
+ },
806
+ marshalling_gen.unmarshalSubscriber
807
+ );
808
+ /**
809
+ * Get a subscriber. Retrieve information about an existing subscriber, specified by its subscriber ID. Its full details, including name and email/webhook configuration, are returned in the response object.
810
+ *
811
+ * @param request - The request {@link ZonedApiGetSubscriberRequest}
812
+ * @returns A Promise of Subscriber
813
+ */
814
+ getSubscriber = (request) => this.client.fetch(
815
+ {
816
+ method: "GET",
817
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers/${sdkClient.validatePathParam("subscriberId", request.subscriberId)}`
818
+ },
819
+ marshalling_gen.unmarshalSubscriber
820
+ );
821
+ pageOfListSubscriber = (request = {}) => this.client.fetch(
822
+ {
823
+ method: "GET",
824
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers`,
825
+ urlParams: sdkClient.urlParams(
826
+ ["name", request.name],
827
+ ["order_by", request.orderBy],
828
+ ["organization_id", request.organizationId],
829
+ ["page", request.page],
830
+ [
831
+ "page_size",
832
+ request.pageSize ?? this.client.settings.defaultPageSize
833
+ ],
834
+ ["project_id", request.projectId]
835
+ )
836
+ },
837
+ marshalling_gen.unmarshalListSubscriberResponse
838
+ );
839
+ /**
840
+ * List all subscribers. List all subscribers to Load Balancer alerts. By default, returns all subscribers to Load Balancer alerts for the Organization associated with the authentication token used for the request.
841
+ *
842
+ * @param request - The request {@link ZonedApiListSubscriberRequest}
843
+ * @returns A Promise of ListSubscriberResponse
844
+ */
845
+ listSubscriber = (request = {}) => sdkClient.enrichForPagination("subscribers", this.pageOfListSubscriber, request);
846
+ /**
847
+ * Update a subscriber. Update the parameters of a given subscriber (e.g. name, webhook configuration, email configuration), specified by its subscriber ID.
848
+ *
849
+ * @param request - The request {@link ZonedApiUpdateSubscriberRequest}
850
+ * @returns A Promise of Subscriber
851
+ */
852
+ updateSubscriber = (request) => this.client.fetch(
853
+ {
854
+ body: JSON.stringify(
855
+ marshalling_gen.marshalZonedApiUpdateSubscriberRequest(request, this.client.settings)
856
+ ),
857
+ headers: jsonContentHeaders,
858
+ method: "PUT",
859
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers/${sdkClient.validatePathParam("subscriberId", request.subscriberId)}`
860
+ },
861
+ marshalling_gen.unmarshalSubscriber
862
+ );
863
+ /**
864
+ * Delete a subscriber. Delete an existing subscriber, specified by its subscriber ID. Deleting a subscriber is permanent, and cannot be undone.
865
+ *
866
+ * @param request - The request {@link ZonedApiDeleteSubscriberRequest}
867
+ */
868
+ deleteSubscriber = (request) => this.client.fetch({
869
+ method: "DELETE",
870
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${sdkClient.validatePathParam("subscriberId", request.subscriberId)}`
871
+ });
872
+ /**
873
+ * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an existing subscriber to alerts for a given Load Balancer.
874
+ *
875
+ * @param request - The request {@link ZonedApiSubscribeToLbRequest}
876
+ * @returns A Promise of Lb
877
+ */
878
+ subscribeToLb = (request) => this.client.fetch(
879
+ {
880
+ body: JSON.stringify(
881
+ marshalling_gen.marshalZonedApiSubscribeToLbRequest(request, this.client.settings)
882
+ ),
883
+ headers: jsonContentHeaders,
884
+ method: "POST",
885
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb/${sdkClient.validatePathParam("lbId", request.lbId)}/subscribe`
886
+ },
887
+ marshalling_gen.unmarshalLb
888
+ );
889
+ /**
890
+ * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe a subscriber from alerts for a given Load Balancer. The subscriber is not deleted, and can be resubscribed in the future if necessary.
891
+ *
892
+ * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest}
893
+ * @returns A Promise of Lb
894
+ */
895
+ unsubscribeFromLb = (request) => this.client.fetch(
896
+ {
897
+ method: "DELETE",
898
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb/${sdkClient.validatePathParam("lbId", request.lbId)}/unsubscribe`
899
+ },
900
+ marshalling_gen.unmarshalLb
901
+ );
902
+ pageOfListLbPrivateNetworks = (request) => this.client.fetch(
903
+ {
904
+ method: "GET",
905
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/private-networks`,
906
+ urlParams: sdkClient.urlParams(
907
+ ["order_by", request.orderBy],
908
+ ["page", request.page],
909
+ [
910
+ "page_size",
911
+ request.pageSize ?? this.client.settings.defaultPageSize
912
+ ]
913
+ )
914
+ },
915
+ marshalling_gen.unmarshalListLbPrivateNetworksResponse
916
+ );
917
+ /**
918
+ * List Private Networks attached to a Load Balancer. List the Private Networks attached to a given Load Balancer, specified by its Load Balancer ID. The response is an array of Private Network objects, giving information including the status, configuration, name and creation date of each Private Network.
919
+ *
920
+ * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest}
921
+ * @returns A Promise of ListLbPrivateNetworksResponse
922
+ */
923
+ listLbPrivateNetworks = (request) => sdkClient.enrichForPagination(
924
+ "privateNetwork",
925
+ this.pageOfListLbPrivateNetworks,
926
+ request
927
+ );
928
+ /**
929
+ * Attach a Load Balancer to a Private Network. Attach a specified Load Balancer to a specified Private Network, defining a static or DHCP configuration for the Load Balancer on the network.
930
+ *
931
+ * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest}
932
+ * @returns A Promise of PrivateNetwork
933
+ */
934
+ attachPrivateNetwork = (request) => this.client.fetch(
935
+ {
936
+ body: JSON.stringify(
937
+ marshalling_gen.marshalZonedApiAttachPrivateNetworkRequest(
938
+ request,
939
+ this.client.settings
940
+ )
941
+ ),
942
+ headers: jsonContentHeaders,
943
+ method: "POST",
944
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/attach-private-network`
945
+ },
946
+ marshalling_gen.unmarshalPrivateNetwork
947
+ );
948
+ /**
949
+ * Detach Load Balancer from Private Network. Detach a specified Load Balancer from a specified Private Network.
950
+ *
951
+ * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest}
952
+ */
953
+ detachPrivateNetwork = (request) => this.client.fetch({
954
+ body: JSON.stringify(
955
+ marshalling_gen.marshalZonedApiDetachPrivateNetworkRequest(
956
+ request,
957
+ this.client.settings
958
+ )
959
+ ),
960
+ headers: jsonContentHeaders,
961
+ method: "POST",
962
+ path: `/lb/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/detach-private-network`
963
+ });
964
+ }
965
+ class API extends sdkClient.API {
966
+ /** Lists the available regions of the API. */
967
+ static LOCALITIES = [
968
+ "fr-par",
969
+ "nl-ams",
970
+ "pl-waw"
971
+ ];
972
+ pageOfListLbs = (request = {}) => this.client.fetch(
973
+ {
974
+ method: "GET",
975
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs`,
976
+ urlParams: sdkClient.urlParams(
977
+ ["name", request.name],
978
+ ["order_by", request.orderBy],
979
+ ["organization_id", request.organizationId],
980
+ ["page", request.page],
981
+ [
982
+ "page_size",
983
+ request.pageSize ?? this.client.settings.defaultPageSize
984
+ ],
985
+ ["project_id", request.projectId],
986
+ ["tags", request.tags]
987
+ )
988
+ },
989
+ marshalling_gen.unmarshalListLbsResponse
990
+ );
991
+ /**
992
+ * List load balancers.
993
+ *
994
+ * @param request - The request {@link ListLbsRequest}
995
+ * @returns A Promise of ListLbsResponse
996
+ */
997
+ listLbs = (request = {}) => sdkClient.enrichForPagination("lbs", this.pageOfListLbs, request);
998
+ /**
999
+ * Create a load balancer.
1000
+ *
1001
+ * @param request - The request {@link CreateLbRequest}
1002
+ * @returns A Promise of Lb
1003
+ */
1004
+ createLb = (request) => this.client.fetch(
1005
+ {
1006
+ body: JSON.stringify(
1007
+ marshalling_gen.marshalCreateLbRequest(request, this.client.settings)
1008
+ ),
1009
+ headers: jsonContentHeaders,
1010
+ method: "POST",
1011
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs`
1012
+ },
1013
+ marshalling_gen.unmarshalLb
1014
+ );
1015
+ /**
1016
+ * Get a load balancer.
1017
+ *
1018
+ * @param request - The request {@link GetLbRequest}
1019
+ * @returns A Promise of Lb
1020
+ */
1021
+ getLb = (request) => this.client.fetch(
1022
+ {
1023
+ method: "GET",
1024
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}`
1025
+ },
1026
+ marshalling_gen.unmarshalLb
1027
+ );
1028
+ /**
1029
+ * Waits for {@link Lb} to be in a final state.
1030
+ *
1031
+ * @param request - The request {@link GetLbRequest}
1032
+ * @param options - The waiting options
1033
+ * @returns A Promise of Lb
1034
+ */
1035
+ waitForLb = (request, options) => sdkClient.waitForResource(
1036
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.LB_TRANSIENT_STATUSES.includes(res.status))),
1037
+ this.getLb,
1038
+ request,
1039
+ options
1040
+ );
1041
+ /**
1042
+ * Update a load balancer.
1043
+ *
1044
+ * @param request - The request {@link UpdateLbRequest}
1045
+ * @returns A Promise of Lb
1046
+ */
1047
+ updateLb = (request) => this.client.fetch(
1048
+ {
1049
+ body: JSON.stringify(
1050
+ marshalling_gen.marshalUpdateLbRequest(request, this.client.settings)
1051
+ ),
1052
+ headers: jsonContentHeaders,
1053
+ method: "PUT",
1054
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}`
1055
+ },
1056
+ marshalling_gen.unmarshalLb
1057
+ );
1058
+ /**
1059
+ * Delete a load balancer.
1060
+ *
1061
+ * @param request - The request {@link DeleteLbRequest}
1062
+ */
1063
+ deleteLb = (request) => this.client.fetch({
1064
+ method: "DELETE",
1065
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}`,
1066
+ urlParams: sdkClient.urlParams(["release_ip", request.releaseIp])
1067
+ });
1068
+ /**
1069
+ * Migrate a load balancer.
1070
+ *
1071
+ * @param request - The request {@link MigrateLbRequest}
1072
+ * @returns A Promise of Lb
1073
+ */
1074
+ migrateLb = (request) => this.client.fetch(
1075
+ {
1076
+ body: JSON.stringify(
1077
+ marshalling_gen.marshalMigrateLbRequest(request, this.client.settings)
1078
+ ),
1079
+ headers: jsonContentHeaders,
1080
+ method: "POST",
1081
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/migrate`
1082
+ },
1083
+ marshalling_gen.unmarshalLb
1084
+ );
1085
+ pageOfListIPs = (request = {}) => this.client.fetch(
1086
+ {
1087
+ method: "GET",
1088
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`,
1089
+ urlParams: sdkClient.urlParams(
1090
+ ["ip_address", request.ipAddress],
1091
+ ["ip_type", request.ipType],
1092
+ ["organization_id", request.organizationId],
1093
+ ["page", request.page],
1094
+ [
1095
+ "page_size",
1096
+ request.pageSize ?? this.client.settings.defaultPageSize
1097
+ ],
1098
+ ["project_id", request.projectId],
1099
+ ["tags", request.tags]
1100
+ )
1101
+ },
1102
+ marshalling_gen.unmarshalListIpsResponse
1103
+ );
1104
+ /**
1105
+ * List IPs.
1106
+ *
1107
+ * @param request - The request {@link ListIPsRequest}
1108
+ * @returns A Promise of ListIpsResponse
1109
+ */
1110
+ listIPs = (request = {}) => sdkClient.enrichForPagination("ips", this.pageOfListIPs, request);
1111
+ /**
1112
+ * Create an IP.
1113
+ *
1114
+ * @param request - The request {@link CreateIpRequest}
1115
+ * @returns A Promise of Ip
1116
+ */
1117
+ createIp = (request) => this.client.fetch(
1118
+ {
1119
+ body: JSON.stringify(
1120
+ marshalling_gen.marshalCreateIpRequest(request, this.client.settings)
1121
+ ),
1122
+ headers: jsonContentHeaders,
1123
+ method: "POST",
1124
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`
1125
+ },
1126
+ marshalling_gen.unmarshalIp
1127
+ );
1128
+ /**
1129
+ * Get an IP.
1130
+ *
1131
+ * @param request - The request {@link GetIpRequest}
1132
+ * @returns A Promise of Ip
1133
+ */
1134
+ getIp = (request) => this.client.fetch(
1135
+ {
1136
+ method: "GET",
1137
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
1138
+ },
1139
+ marshalling_gen.unmarshalIp
1140
+ );
1141
+ /**
1142
+ * Delete an IP.
1143
+ *
1144
+ * @param request - The request {@link ReleaseIpRequest}
1145
+ */
1146
+ releaseIp = (request) => this.client.fetch({
1147
+ method: "DELETE",
1148
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
1149
+ });
1150
+ /**
1151
+ * Update an IP.
1152
+ *
1153
+ * @param request - The request {@link UpdateIpRequest}
1154
+ * @returns A Promise of Ip
1155
+ */
1156
+ updateIp = (request) => this.client.fetch(
1157
+ {
1158
+ body: JSON.stringify(
1159
+ marshalling_gen.marshalUpdateIpRequest(request, this.client.settings)
1160
+ ),
1161
+ headers: jsonContentHeaders,
1162
+ method: "PATCH",
1163
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
1164
+ },
1165
+ marshalling_gen.unmarshalIp
1166
+ );
1167
+ pageOfListBackends = (request) => this.client.fetch(
1168
+ {
1169
+ method: "GET",
1170
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/backends`,
1171
+ urlParams: sdkClient.urlParams(
1172
+ ["name", request.name],
1173
+ ["order_by", request.orderBy],
1174
+ ["page", request.page],
1175
+ [
1176
+ "page_size",
1177
+ request.pageSize ?? this.client.settings.defaultPageSize
1178
+ ]
1179
+ )
1180
+ },
1181
+ marshalling_gen.unmarshalListBackendsResponse
1182
+ );
1183
+ /**
1184
+ * List backends in a given load balancer.
1185
+ *
1186
+ * @param request - The request {@link ListBackendsRequest}
1187
+ * @returns A Promise of ListBackendsResponse
1188
+ */
1189
+ listBackends = (request) => sdkClient.enrichForPagination("backends", this.pageOfListBackends, request);
1190
+ /**
1191
+ * Create a backend in a given load balancer.
1192
+ *
1193
+ * @param request - The request {@link CreateBackendRequest}
1194
+ * @returns A Promise of Backend
1195
+ */
1196
+ createBackend = (request) => this.client.fetch(
1197
+ {
1198
+ body: JSON.stringify(
1199
+ marshalling_gen.marshalCreateBackendRequest(request, this.client.settings)
1200
+ ),
1201
+ headers: jsonContentHeaders,
1202
+ method: "POST",
1203
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/backends`
1204
+ },
1205
+ marshalling_gen.unmarshalBackend
1206
+ );
1207
+ /**
1208
+ * Get a backend in a given load balancer.
1209
+ *
1210
+ * @param request - The request {@link GetBackendRequest}
1211
+ * @returns A Promise of Backend
1212
+ */
1213
+ getBackend = (request) => this.client.fetch(
1214
+ {
1215
+ method: "GET",
1216
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}`
1217
+ },
1218
+ marshalling_gen.unmarshalBackend
1219
+ );
1220
+ /**
1221
+ * Update a backend in a given load balancer.
1222
+ *
1223
+ * @param request - The request {@link UpdateBackendRequest}
1224
+ * @returns A Promise of Backend
1225
+ */
1226
+ updateBackend = (request) => this.client.fetch(
1227
+ {
1228
+ body: JSON.stringify(
1229
+ marshalling_gen.marshalUpdateBackendRequest(request, this.client.settings)
1230
+ ),
1231
+ headers: jsonContentHeaders,
1232
+ method: "PUT",
1233
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}`
1234
+ },
1235
+ marshalling_gen.unmarshalBackend
1236
+ );
1237
+ /**
1238
+ * Delete a backend in a given load balancer.
1239
+ *
1240
+ * @param request - The request {@link DeleteBackendRequest}
1241
+ */
1242
+ deleteBackend = (request) => this.client.fetch({
1243
+ method: "DELETE",
1244
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}`
1245
+ });
1246
+ /**
1247
+ * Add a set of servers in a given backend.
1248
+ *
1249
+ * @param request - The request {@link AddBackendServersRequest}
1250
+ * @returns A Promise of Backend
1251
+ */
1252
+ addBackendServers = (request) => this.client.fetch(
1253
+ {
1254
+ body: JSON.stringify(
1255
+ marshalling_gen.marshalAddBackendServersRequest(request, this.client.settings)
1256
+ ),
1257
+ headers: jsonContentHeaders,
1258
+ method: "POST",
1259
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/servers`
1260
+ },
1261
+ marshalling_gen.unmarshalBackend
1262
+ );
1263
+ /**
1264
+ * Remove a set of servers for a given backend.
1265
+ *
1266
+ * @param request - The request {@link RemoveBackendServersRequest}
1267
+ * @returns A Promise of Backend
1268
+ */
1269
+ removeBackendServers = (request) => this.client.fetch(
1270
+ {
1271
+ body: JSON.stringify(
1272
+ marshalling_gen.marshalRemoveBackendServersRequest(request, this.client.settings)
1273
+ ),
1274
+ headers: jsonContentHeaders,
1275
+ method: "DELETE",
1276
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/servers`
1277
+ },
1278
+ marshalling_gen.unmarshalBackend
1279
+ );
1280
+ /**
1281
+ * Define all servers in a given backend.
1282
+ *
1283
+ * @param request - The request {@link SetBackendServersRequest}
1284
+ * @returns A Promise of Backend
1285
+ */
1286
+ setBackendServers = (request) => this.client.fetch(
1287
+ {
1288
+ body: JSON.stringify(
1289
+ marshalling_gen.marshalSetBackendServersRequest(request, this.client.settings)
1290
+ ),
1291
+ headers: jsonContentHeaders,
1292
+ method: "PUT",
1293
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/servers`
1294
+ },
1295
+ marshalling_gen.unmarshalBackend
1296
+ );
1297
+ /**
1298
+ * Update an health check for a given backend.
1299
+ *
1300
+ * @param request - The request {@link UpdateHealthCheckRequest}
1301
+ * @returns A Promise of HealthCheck
1302
+ */
1303
+ updateHealthCheck = (request) => this.client.fetch(
1304
+ {
1305
+ body: JSON.stringify(
1306
+ marshalling_gen.marshalUpdateHealthCheckRequest(request, this.client.settings)
1307
+ ),
1308
+ headers: jsonContentHeaders,
1309
+ method: "PUT",
1310
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${sdkClient.validatePathParam("backendId", request.backendId)}/healthcheck`
1311
+ },
1312
+ marshalling_gen.unmarshalHealthCheck
1313
+ );
1314
+ pageOfListFrontends = (request) => this.client.fetch(
1315
+ {
1316
+ method: "GET",
1317
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/frontends`,
1318
+ urlParams: sdkClient.urlParams(
1319
+ ["name", request.name],
1320
+ ["order_by", request.orderBy],
1321
+ ["page", request.page],
1322
+ [
1323
+ "page_size",
1324
+ request.pageSize ?? this.client.settings.defaultPageSize
1325
+ ]
1326
+ )
1327
+ },
1328
+ marshalling_gen.unmarshalListFrontendsResponse
1329
+ );
1330
+ /**
1331
+ * List frontends in a given load balancer.
1332
+ *
1333
+ * @param request - The request {@link ListFrontendsRequest}
1334
+ * @returns A Promise of ListFrontendsResponse
1335
+ */
1336
+ listFrontends = (request) => sdkClient.enrichForPagination("frontends", this.pageOfListFrontends, request);
1337
+ /**
1338
+ * Create a frontend in a given load balancer.
1339
+ *
1340
+ * @param request - The request {@link CreateFrontendRequest}
1341
+ * @returns A Promise of Frontend
1342
+ */
1343
+ createFrontend = (request) => this.client.fetch(
1344
+ {
1345
+ body: JSON.stringify(
1346
+ marshalling_gen.marshalCreateFrontendRequest(request, this.client.settings)
1347
+ ),
1348
+ headers: jsonContentHeaders,
1349
+ method: "POST",
1350
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/frontends`
1351
+ },
1352
+ marshalling_gen.unmarshalFrontend
1353
+ );
1354
+ /**
1355
+ * Get a frontend.
1356
+ *
1357
+ * @param request - The request {@link GetFrontendRequest}
1358
+ * @returns A Promise of Frontend
1359
+ */
1360
+ getFrontend = (request) => this.client.fetch(
1361
+ {
1362
+ method: "GET",
1363
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}`
1364
+ },
1365
+ marshalling_gen.unmarshalFrontend
1366
+ );
1367
+ /**
1368
+ * Update a frontend.
1369
+ *
1370
+ * @param request - The request {@link UpdateFrontendRequest}
1371
+ * @returns A Promise of Frontend
1372
+ */
1373
+ updateFrontend = (request) => this.client.fetch(
1374
+ {
1375
+ body: JSON.stringify(
1376
+ marshalling_gen.marshalUpdateFrontendRequest(request, this.client.settings)
1377
+ ),
1378
+ headers: jsonContentHeaders,
1379
+ method: "PUT",
1380
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}`
1381
+ },
1382
+ marshalling_gen.unmarshalFrontend
1383
+ );
1384
+ /**
1385
+ * Delete a frontend.
1386
+ *
1387
+ * @param request - The request {@link DeleteFrontendRequest}
1388
+ */
1389
+ deleteFrontend = (request) => this.client.fetch({
1390
+ method: "DELETE",
1391
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}`
1392
+ });
1393
+ pageOfListRoutes = (request = {}) => this.client.fetch(
1394
+ {
1395
+ method: "GET",
1396
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`,
1397
+ urlParams: sdkClient.urlParams(
1398
+ ["frontend_id", request.frontendId],
1399
+ ["order_by", request.orderBy],
1400
+ ["page", request.page],
1401
+ [
1402
+ "page_size",
1403
+ request.pageSize ?? this.client.settings.defaultPageSize
1404
+ ]
1405
+ )
1406
+ },
1407
+ marshalling_gen.unmarshalListRoutesResponse
1408
+ );
1409
+ /**
1410
+ * List all backend redirections.
1411
+ *
1412
+ * @param request - The request {@link ListRoutesRequest}
1413
+ * @returns A Promise of ListRoutesResponse
1414
+ */
1415
+ listRoutes = (request = {}) => sdkClient.enrichForPagination("routes", this.pageOfListRoutes, request);
1416
+ /**
1417
+ * Create a backend redirection.
1418
+ *
1419
+ * @param request - The request {@link CreateRouteRequest}
1420
+ * @returns A Promise of Route
1421
+ */
1422
+ createRoute = (request) => this.client.fetch(
1423
+ {
1424
+ body: JSON.stringify(
1425
+ marshalling_gen.marshalCreateRouteRequest(request, this.client.settings)
1426
+ ),
1427
+ headers: jsonContentHeaders,
1428
+ method: "POST",
1429
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
1430
+ },
1431
+ marshalling_gen.unmarshalRoute
1432
+ );
1433
+ /**
1434
+ * Get single backend redirection.
1435
+ *
1436
+ * @param request - The request {@link GetRouteRequest}
1437
+ * @returns A Promise of Route
1438
+ */
1439
+ getRoute = (request) => this.client.fetch(
1440
+ {
1441
+ method: "GET",
1442
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
1443
+ },
1444
+ marshalling_gen.unmarshalRoute
1445
+ );
1446
+ /**
1447
+ * Edit a backend redirection.
1448
+ *
1449
+ * @param request - The request {@link UpdateRouteRequest}
1450
+ * @returns A Promise of Route
1451
+ */
1452
+ updateRoute = (request) => this.client.fetch(
1453
+ {
1454
+ body: JSON.stringify(
1455
+ marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings)
1456
+ ),
1457
+ headers: jsonContentHeaders,
1458
+ method: "PUT",
1459
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
1460
+ },
1461
+ marshalling_gen.unmarshalRoute
1462
+ );
1463
+ /**
1464
+ * Delete a backend redirection.
1465
+ *
1466
+ * @param request - The request {@link DeleteRouteRequest}
1467
+ */
1468
+ deleteRoute = (request) => this.client.fetch({
1469
+ method: "DELETE",
1470
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
1471
+ });
1472
+ /**
1473
+ * Get usage statistics of a given load balancer.
1474
+ *
1475
+ * @deprecated
1476
+ * @param request - The request {@link GetLbStatsRequest}
1477
+ * @returns A Promise of LbStats
1478
+ */
1479
+ getLbStats = (request) => this.client.fetch(
1480
+ {
1481
+ method: "GET",
1482
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/stats`,
1483
+ urlParams: sdkClient.urlParams(["backend_id", request.backendId])
1484
+ },
1485
+ marshalling_gen.unmarshalLbStats
1486
+ );
1487
+ pageOfListBackendStats = (request) => this.client.fetch(
1488
+ {
1489
+ method: "GET",
1490
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/backend-stats`,
1491
+ urlParams: sdkClient.urlParams(
1492
+ ["backend_id", request.backendId],
1493
+ ["page", request.page],
1494
+ [
1495
+ "page_size",
1496
+ request.pageSize ?? this.client.settings.defaultPageSize
1497
+ ]
1498
+ )
1499
+ },
1500
+ marshalling_gen.unmarshalListBackendStatsResponse
1501
+ );
1502
+ /**
1503
+ * List backend server statistics.
1504
+ *
1505
+ * @param request - The request {@link ListBackendStatsRequest}
1506
+ * @returns A Promise of ListBackendStatsResponse
1507
+ */
1508
+ listBackendStats = (request) => sdkClient.enrichForPagination(
1509
+ "backendServersStats",
1510
+ this.pageOfListBackendStats,
1511
+ request
1512
+ );
1513
+ pageOfListAcls = (request) => this.client.fetch(
1514
+ {
1515
+ method: "GET",
1516
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}/acls`,
1517
+ urlParams: sdkClient.urlParams(
1518
+ ["name", request.name],
1519
+ ["order_by", request.orderBy],
1520
+ ["page", request.page],
1521
+ [
1522
+ "page_size",
1523
+ request.pageSize ?? this.client.settings.defaultPageSize
1524
+ ]
1525
+ )
1526
+ },
1527
+ marshalling_gen.unmarshalListAclResponse
1528
+ );
1529
+ /**
1530
+ * List ACL for a given frontend.
1531
+ *
1532
+ * @param request - The request {@link ListAclsRequest}
1533
+ * @returns A Promise of ListAclResponse
1534
+ */
1535
+ listAcls = (request) => sdkClient.enrichForPagination("acls", this.pageOfListAcls, request);
1536
+ /**
1537
+ * Create an ACL for a given frontend.
1538
+ *
1539
+ * @param request - The request {@link CreateAclRequest}
1540
+ * @returns A Promise of Acl
1541
+ */
1542
+ createAcl = (request) => this.client.fetch(
1543
+ {
1544
+ body: JSON.stringify(
1545
+ marshalling_gen.marshalCreateAclRequest(request, this.client.settings)
1546
+ ),
1547
+ headers: jsonContentHeaders,
1548
+ method: "POST",
1549
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${sdkClient.validatePathParam("frontendId", request.frontendId)}/acls`
1550
+ },
1551
+ marshalling_gen.unmarshalAcl
1552
+ );
1553
+ /**
1554
+ * Get an ACL.
1555
+ *
1556
+ * @param request - The request {@link GetAclRequest}
1557
+ * @returns A Promise of Acl
1558
+ */
1559
+ getAcl = (request) => this.client.fetch(
1560
+ {
1561
+ method: "GET",
1562
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
1563
+ },
1564
+ marshalling_gen.unmarshalAcl
1565
+ );
1566
+ /**
1567
+ * Update an ACL.
1568
+ *
1569
+ * @param request - The request {@link UpdateAclRequest}
1570
+ * @returns A Promise of Acl
1571
+ */
1572
+ updateAcl = (request) => this.client.fetch(
1573
+ {
1574
+ body: JSON.stringify(
1575
+ marshalling_gen.marshalUpdateAclRequest(request, this.client.settings)
1576
+ ),
1577
+ headers: jsonContentHeaders,
1578
+ method: "PUT",
1579
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
1580
+ },
1581
+ marshalling_gen.unmarshalAcl
1582
+ );
1583
+ /**
1584
+ * Delete an ACL.
1585
+ *
1586
+ * @param request - The request {@link DeleteAclRequest}
1587
+ */
1588
+ deleteAcl = (request) => this.client.fetch({
1589
+ method: "DELETE",
1590
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
1591
+ });
1592
+ /**
1593
+ * Create a TLS certificate. Generate a new TLS certificate using Let's Encrypt or import your certificate.
1594
+ *
1595
+ * @param request - The request {@link CreateCertificateRequest}
1596
+ * @returns A Promise of Certificate
1597
+ */
1598
+ createCertificate = (request) => this.client.fetch(
1599
+ {
1600
+ body: JSON.stringify(
1601
+ marshalling_gen.marshalCreateCertificateRequest(request, this.client.settings)
1602
+ ),
1603
+ headers: jsonContentHeaders,
1604
+ method: "POST",
1605
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/certificates`
1606
+ },
1607
+ marshalling_gen.unmarshalCertificate
1608
+ );
1609
+ pageOfListCertificates = (request) => this.client.fetch(
1610
+ {
1611
+ method: "GET",
1612
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/certificates`,
1613
+ urlParams: sdkClient.urlParams(
1614
+ ["name", request.name],
1615
+ ["order_by", request.orderBy],
1616
+ ["page", request.page],
1617
+ [
1618
+ "page_size",
1619
+ request.pageSize ?? this.client.settings.defaultPageSize
1620
+ ]
1621
+ )
1622
+ },
1623
+ marshalling_gen.unmarshalListCertificatesResponse
1624
+ );
1625
+ /**
1626
+ * List all TLS certificates on a given load balancer.
1627
+ *
1628
+ * @param request - The request {@link ListCertificatesRequest}
1629
+ * @returns A Promise of ListCertificatesResponse
1630
+ */
1631
+ listCertificates = (request) => sdkClient.enrichForPagination("certificates", this.pageOfListCertificates, request);
1632
+ /**
1633
+ * Get a TLS certificate.
1634
+ *
1635
+ * @param request - The request {@link GetCertificateRequest}
1636
+ * @returns A Promise of Certificate
1637
+ */
1638
+ getCertificate = (request) => this.client.fetch(
1639
+ {
1640
+ method: "GET",
1641
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/certificates/${sdkClient.validatePathParam("certificateId", request.certificateId)}`
1642
+ },
1643
+ marshalling_gen.unmarshalCertificate
1644
+ );
1645
+ /**
1646
+ * Waits for {@link Certificate} to be in a final state.
1647
+ *
1648
+ * @param request - The request {@link GetCertificateRequest}
1649
+ * @param options - The waiting options
1650
+ * @returns A Promise of Certificate
1651
+ */
1652
+ waitForCertificate = (request, options) => sdkClient.waitForResource(
1653
+ options?.stop ?? ((res) => Promise.resolve(
1654
+ !content_gen.CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)
1655
+ )),
1656
+ this.getCertificate,
1657
+ request,
1658
+ options
1659
+ );
1660
+ /**
1661
+ * Update a TLS certificate.
1662
+ *
1663
+ * @param request - The request {@link UpdateCertificateRequest}
1664
+ * @returns A Promise of Certificate
1665
+ */
1666
+ updateCertificate = (request) => this.client.fetch(
1667
+ {
1668
+ body: JSON.stringify(
1669
+ marshalling_gen.marshalUpdateCertificateRequest(request, this.client.settings)
1670
+ ),
1671
+ headers: jsonContentHeaders,
1672
+ method: "PUT",
1673
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/certificates/${sdkClient.validatePathParam("certificateId", request.certificateId)}`
1674
+ },
1675
+ marshalling_gen.unmarshalCertificate
1676
+ );
1677
+ /**
1678
+ * Delete a TLS certificate.
1679
+ *
1680
+ * @param request - The request {@link DeleteCertificateRequest}
1681
+ */
1682
+ deleteCertificate = (request) => this.client.fetch({
1683
+ method: "DELETE",
1684
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/certificates/${sdkClient.validatePathParam("certificateId", request.certificateId)}`
1685
+ });
1686
+ pageOfListLbTypes = (request = {}) => this.client.fetch(
1687
+ {
1688
+ method: "GET",
1689
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb-types`,
1690
+ urlParams: sdkClient.urlParams(
1691
+ ["page", request.page],
1692
+ [
1693
+ "page_size",
1694
+ request.pageSize ?? this.client.settings.defaultPageSize
1695
+ ]
1696
+ )
1697
+ },
1698
+ marshalling_gen.unmarshalListLbTypesResponse
1699
+ );
1700
+ /**
1701
+ * List all load balancer offer type.
1702
+ *
1703
+ * @param request - The request {@link ListLbTypesRequest}
1704
+ * @returns A Promise of ListLbTypesResponse
1705
+ */
1706
+ listLbTypes = (request = {}) => sdkClient.enrichForPagination("lbTypes", this.pageOfListLbTypes, request);
1707
+ /**
1708
+ * Create a subscriber, webhook or email.
1709
+ *
1710
+ * @param request - The request {@link CreateSubscriberRequest}
1711
+ * @returns A Promise of Subscriber
1712
+ */
1713
+ createSubscriber = (request) => this.client.fetch(
1714
+ {
1715
+ body: JSON.stringify(
1716
+ marshalling_gen.marshalCreateSubscriberRequest(request, this.client.settings)
1717
+ ),
1718
+ headers: jsonContentHeaders,
1719
+ method: "POST",
1720
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers`
1721
+ },
1722
+ marshalling_gen.unmarshalSubscriber
1723
+ );
1724
+ /**
1725
+ * Get a subscriber.
1726
+ *
1727
+ * @param request - The request {@link GetSubscriberRequest}
1728
+ * @returns A Promise of Subscriber
1729
+ */
1730
+ getSubscriber = (request) => this.client.fetch(
1731
+ {
1732
+ method: "GET",
1733
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers/${sdkClient.validatePathParam("subscriberId", request.subscriberId)}`
1734
+ },
1735
+ marshalling_gen.unmarshalSubscriber
1736
+ );
1737
+ pageOfListSubscriber = (request = {}) => this.client.fetch(
1738
+ {
1739
+ method: "GET",
1740
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers`,
1741
+ urlParams: sdkClient.urlParams(
1742
+ ["name", request.name],
1743
+ ["order_by", request.orderBy],
1744
+ ["organization_id", request.organizationId],
1745
+ ["page", request.page],
1746
+ [
1747
+ "page_size",
1748
+ request.pageSize ?? this.client.settings.defaultPageSize
1749
+ ],
1750
+ ["project_id", request.projectId]
1751
+ )
1752
+ },
1753
+ marshalling_gen.unmarshalListSubscriberResponse
1754
+ );
1755
+ /**
1756
+ * List all subscriber.
1757
+ *
1758
+ * @param request - The request {@link ListSubscriberRequest}
1759
+ * @returns A Promise of ListSubscriberResponse
1760
+ */
1761
+ listSubscriber = (request = {}) => sdkClient.enrichForPagination("subscribers", this.pageOfListSubscriber, request);
1762
+ /**
1763
+ * Update a subscriber.
1764
+ *
1765
+ * @param request - The request {@link UpdateSubscriberRequest}
1766
+ * @returns A Promise of Subscriber
1767
+ */
1768
+ updateSubscriber = (request) => this.client.fetch(
1769
+ {
1770
+ body: JSON.stringify(
1771
+ marshalling_gen.marshalUpdateSubscriberRequest(request, this.client.settings)
1772
+ ),
1773
+ headers: jsonContentHeaders,
1774
+ method: "PUT",
1775
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers/${sdkClient.validatePathParam("subscriberId", request.subscriberId)}`
1776
+ },
1777
+ marshalling_gen.unmarshalSubscriber
1778
+ );
1779
+ /**
1780
+ * Delete a subscriber.
1781
+ *
1782
+ * @param request - The request {@link DeleteSubscriberRequest}
1783
+ */
1784
+ deleteSubscriber = (request) => this.client.fetch({
1785
+ method: "DELETE",
1786
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${sdkClient.validatePathParam("subscriberId", request.subscriberId)}`
1787
+ });
1788
+ /**
1789
+ * Subscribe a subscriber to a given load balancer.
1790
+ *
1791
+ * @param request - The request {@link SubscribeToLbRequest}
1792
+ * @returns A Promise of Lb
1793
+ */
1794
+ subscribeToLb = (request) => this.client.fetch(
1795
+ {
1796
+ body: JSON.stringify(
1797
+ marshalling_gen.marshalSubscribeToLbRequest(request, this.client.settings)
1798
+ ),
1799
+ headers: jsonContentHeaders,
1800
+ method: "POST",
1801
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb/${sdkClient.validatePathParam("lbId", request.lbId)}/subscribe`
1802
+ },
1803
+ marshalling_gen.unmarshalLb
1804
+ );
1805
+ /**
1806
+ * Unsubscribe a subscriber from a given load balancer.
1807
+ *
1808
+ * @param request - The request {@link UnsubscribeFromLbRequest}
1809
+ * @returns A Promise of Lb
1810
+ */
1811
+ unsubscribeFromLb = (request) => this.client.fetch(
1812
+ {
1813
+ method: "DELETE",
1814
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb/${sdkClient.validatePathParam("lbId", request.lbId)}/unsubscribe`
1815
+ },
1816
+ marshalling_gen.unmarshalLb
1817
+ );
1818
+ pageOfListLbPrivateNetworks = (request) => this.client.fetch(
1819
+ {
1820
+ method: "GET",
1821
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/private-networks`,
1822
+ urlParams: sdkClient.urlParams(
1823
+ ["order_by", request.orderBy],
1824
+ ["page", request.page],
1825
+ [
1826
+ "page_size",
1827
+ request.pageSize ?? this.client.settings.defaultPageSize
1828
+ ]
1829
+ )
1830
+ },
1831
+ marshalling_gen.unmarshalListLbPrivateNetworksResponse
1832
+ );
1833
+ /**
1834
+ * List attached private network of load balancer.
1835
+ *
1836
+ * @param request - The request {@link ListLbPrivateNetworksRequest}
1837
+ * @returns A Promise of ListLbPrivateNetworksResponse
1838
+ */
1839
+ listLbPrivateNetworks = (request) => sdkClient.enrichForPagination(
1840
+ "privateNetwork",
1841
+ this.pageOfListLbPrivateNetworks,
1842
+ request
1843
+ );
1844
+ /**
1845
+ * Add load balancer on instance private network.
1846
+ *
1847
+ * @param request - The request {@link AttachPrivateNetworkRequest}
1848
+ * @returns A Promise of PrivateNetwork
1849
+ */
1850
+ attachPrivateNetwork = (request) => this.client.fetch(
1851
+ {
1852
+ body: JSON.stringify(
1853
+ marshalling_gen.marshalAttachPrivateNetworkRequest(request, this.client.settings)
1854
+ ),
1855
+ headers: jsonContentHeaders,
1856
+ method: "POST",
1857
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/private-networks/${sdkClient.validatePathParam("privateNetworkId", request.privateNetworkId)}/attach`
1858
+ },
1859
+ marshalling_gen.unmarshalPrivateNetwork
1860
+ );
1861
+ /**
1862
+ * Remove load balancer of private network.
1863
+ *
1864
+ * @param request - The request {@link DetachPrivateNetworkRequest}
1865
+ */
1866
+ detachPrivateNetwork = (request) => this.client.fetch({
1867
+ body: "{}",
1868
+ headers: jsonContentHeaders,
1869
+ method: "POST",
1870
+ path: `/lb/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${sdkClient.validatePathParam("lbId", request.lbId)}/private-networks/${sdkClient.validatePathParam("privateNetworkId", request.privateNetworkId)}/detach`
1871
+ });
1872
+ }
1873
+ exports.API = API;
1874
+ exports.ZonedAPI = ZonedAPI;