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