@scaleway/sdk-lb 1.4.0 → 2.1.1

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