@scaleway/sdk-interlink 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,469 +1,298 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
1
  import { DEDICATED_CONNECTION_TRANSIENT_STATUSES, LINK_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListDedicatedConnectionsResponse, unmarshalDedicatedConnection, unmarshalListPartnersResponse, unmarshalPartner, unmarshalListPopsResponse, unmarshalPop, unmarshalListLinksResponse, unmarshalLink, marshalCreateLinkRequest, marshalUpdateLinkRequest, marshalAttachVpcRequest, marshalAttachRoutingPolicyRequest, marshalDetachRoutingPolicyRequest, marshalSetRoutingPolicyRequest, unmarshalListRoutingPoliciesResponse, unmarshalRoutingPolicy, marshalCreateRoutingPolicyRequest, marshalUpdateRoutingPolicyRequest } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type ∈ {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- regions: ["fr-par", "nl-ams", "pl-waw"]
14
- });
15
- pageOfListDedicatedConnections = (request = {}) => this.client.fetch(
16
- {
17
- method: "GET",
18
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections`,
19
- urlParams: urlParams(
20
- ["bandwidth_mbps", request.bandwidthMbps],
21
- ["name", request.name],
22
- ["order_by", request.orderBy],
23
- ["organization_id", request.organizationId],
24
- ["page", request.page],
25
- [
26
- "page_size",
27
- request.pageSize ?? this.client.settings.defaultPageSize
28
- ],
29
- ["pop_id", request.popId],
30
- ["project_id", request.projectId],
31
- ["status", request.status],
32
- ["tags", request.tags]
33
- )
34
- },
35
- unmarshalListDedicatedConnectionsResponse
36
- );
37
- /**
38
- * List dedicated connections. For self-hosted users, list their dedicated physical connections in a given region. By default, the connections returned in the list are ordered by name in ascending order, though this can be modified via the `order_by` field.
39
- *
40
- * @param request - The request {@link ListDedicatedConnectionsRequest}
41
- * @returns A Promise of ListDedicatedConnectionsResponse
42
- */
43
- listDedicatedConnections = (request = {}) => enrichForPagination(
44
- "connections",
45
- this.pageOfListDedicatedConnections,
46
- request
47
- );
48
- /**
49
- * Get a dedicated connection. For self-hosted users, get a dedicated physical connection corresponding to the given ID. The response object includes information such as the connection's name, status and total bandwidth.
50
- *
51
- * @param request - The request {@link GetDedicatedConnectionRequest}
52
- * @returns A Promise of DedicatedConnection
53
- */
54
- getDedicatedConnection = (request) => this.client.fetch(
55
- {
56
- method: "GET",
57
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections/${validatePathParam("connectionId", request.connectionId)}`
58
- },
59
- unmarshalDedicatedConnection
60
- );
61
- /**
62
- * Waits for {@link DedicatedConnection} to be in a final state.
63
- *
64
- * @param request - The request {@link GetDedicatedConnectionRequest}
65
- * @param options - The waiting options
66
- * @returns A Promise of DedicatedConnection
67
- */
68
- waitForDedicatedConnection = (request, options) => waitForResource(
69
- options?.stop ?? ((res) => Promise.resolve(
70
- !DEDICATED_CONNECTION_TRANSIENT_STATUSES.includes(
71
- res.status
72
- )
73
- )),
74
- this.getDedicatedConnection,
75
- request,
76
- options
77
- );
78
- pageOfListPartners = (request = {}) => this.client.fetch(
79
- {
80
- method: "GET",
81
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners`,
82
- urlParams: urlParams(
83
- ["order_by", request.orderBy],
84
- ["page", request.page],
85
- [
86
- "page_size",
87
- request.pageSize ?? this.client.settings.defaultPageSize
88
- ],
89
- ["pop_ids", request.popIds]
90
- )
91
- },
92
- unmarshalListPartnersResponse
93
- );
94
- /**
95
- * List available partners. List all available partners. By default, the partners returned in the list are ordered by name in ascending order, though this can be modified via the `order_by` field.
96
- *
97
- * @param request - The request {@link ListPartnersRequest}
98
- * @returns A Promise of ListPartnersResponse
99
- */
100
- listPartners = (request = {}) => enrichForPagination("partners", this.pageOfListPartners, request);
101
- /**
102
- * Get a partner. Get a partner for the given partner IP. The response object includes information such as the partner's name, email address and portal URL.
103
- *
104
- * @param request - The request {@link GetPartnerRequest}
105
- * @returns A Promise of Partner
106
- */
107
- getPartner = (request) => this.client.fetch(
108
- {
109
- method: "GET",
110
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners/${validatePathParam("partnerId", request.partnerId)}`
111
- },
112
- unmarshalPartner
113
- );
114
- pageOfListPops = (request = {}) => this.client.fetch(
115
- {
116
- method: "GET",
117
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops`,
118
- urlParams: urlParams(
119
- ["dedicated_available", request.dedicatedAvailable],
120
- ["hosting_provider_name", request.hostingProviderName],
121
- ["link_bandwidth_mbps", request.linkBandwidthMbps],
122
- ["name", request.name],
123
- ["order_by", request.orderBy],
124
- ["page", request.page],
125
- [
126
- "page_size",
127
- request.pageSize ?? this.client.settings.defaultPageSize
128
- ],
129
- ["partner_id", request.partnerId]
130
- )
131
- },
132
- unmarshalListPopsResponse
133
- );
134
- /**
135
- * List PoPs. List all available PoPs (locations) for a given region. By default, the results are returned in ascending alphabetical order by name.
136
- *
137
- * @param request - The request {@link ListPopsRequest}
138
- * @returns A Promise of ListPopsResponse
139
- */
140
- listPops = (request = {}) => enrichForPagination("pops", this.pageOfListPops, request);
141
- /**
142
- * Get a PoP. Get a PoP for the given PoP ID. The response object includes the PoP's name and information about its physical location.
143
- *
144
- * @param request - The request {@link GetPopRequest}
145
- * @returns A Promise of Pop
146
- */
147
- getPop = (request) => this.client.fetch(
148
- {
149
- method: "GET",
150
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops/${validatePathParam("popId", request.popId)}`
151
- },
152
- unmarshalPop
153
- );
154
- pageOfListLinks = (request = {}) => this.client.fetch(
155
- {
156
- method: "GET",
157
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`,
158
- urlParams: urlParams(
159
- ["bandwidth_mbps", request.bandwidthMbps],
160
- ["bgp_v4_status", request.bgpV4Status],
161
- ["bgp_v6_status", request.bgpV6Status],
162
- ["connection_id", request.connectionId],
163
- ["kind", request.kind],
164
- ["name", request.name],
165
- ["order_by", request.orderBy],
166
- ["organization_id", request.organizationId],
167
- ["page", request.page],
168
- [
169
- "page_size",
170
- request.pageSize ?? this.client.settings.defaultPageSize
171
- ],
172
- ["pairing_key", request.pairingKey],
173
- ["partner_id", request.partnerId],
174
- ["pop_id", request.popId],
175
- ["project_id", request.projectId],
176
- ["routing_policy_id", request.routingPolicyId],
177
- ["status", request.status],
178
- ["tags", request.tags],
179
- ["vpc_id", request.vpcId]
180
- )
181
- },
182
- unmarshalListLinksResponse
183
- );
184
- /**
185
- * List links. List all your links (InterLink connections). A number of filters are available, including Project ID, name, tags and status.
186
- *
187
- * @param request - The request {@link ListLinksRequest}
188
- * @returns A Promise of ListLinksResponse
189
- */
190
- listLinks = (request = {}) => enrichForPagination("links", this.pageOfListLinks, request);
191
- /**
192
- * Get a link. Get a link (InterLink session / logical InterLink resource) for the given link ID. The response object includes information about the link's various configuration details.
193
- *
194
- * @param request - The request {@link GetLinkRequest}
195
- * @returns A Promise of Link
196
- */
197
- getLink = (request) => this.client.fetch(
198
- {
199
- method: "GET",
200
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
201
- },
202
- unmarshalLink
203
- );
204
- /**
205
- * Waits for {@link Link} to be in a final state.
206
- *
207
- * @param request - The request {@link GetLinkRequest}
208
- * @param options - The waiting options
209
- * @returns A Promise of Link
210
- */
211
- waitForLink = (request, options) => waitForResource(
212
- options?.stop ?? ((res) => Promise.resolve(
213
- !LINK_TRANSIENT_STATUSES.includes(res.status)
214
- )),
215
- this.getLink,
216
- request,
217
- options
218
- );
219
- /**
220
- * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
221
- *
222
- * @param request - The request {@link CreateLinkRequest}
223
- * @returns A Promise of Link
224
- */
225
- createLink = (request) => this.client.fetch(
226
- {
227
- body: JSON.stringify(
228
- marshalCreateLinkRequest(request, this.client.settings)
229
- ),
230
- headers: jsonContentHeaders,
231
- method: "POST",
232
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`
233
- },
234
- unmarshalLink
235
- );
236
- /**
237
- * Update a link. Update an existing link, specified by its link ID. Only its name and tags can be updated.
238
- *
239
- * @param request - The request {@link UpdateLinkRequest}
240
- * @returns A Promise of Link
241
- */
242
- updateLink = (request) => this.client.fetch(
243
- {
244
- body: JSON.stringify(
245
- marshalUpdateLinkRequest(request, this.client.settings)
246
- ),
247
- headers: jsonContentHeaders,
248
- method: "PATCH",
249
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
250
- },
251
- unmarshalLink
252
- );
253
- /**
254
- * Delete a link. Delete an existing link, specified by its link ID. Note that as well as deleting the link here on the Scaleway side, it is also necessary to request deletion from the partner on their side. Only when this action has been carried out on both sides will the resource be completely deleted.
255
- *
256
- * @param request - The request {@link DeleteLinkRequest}
257
- * @returns A Promise of Link
258
- */
259
- deleteLink = (request) => this.client.fetch(
260
- {
261
- method: "DELETE",
262
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
263
- },
264
- unmarshalLink
265
- );
266
- /**
267
- * Attach a VPC. Attach a VPC to an existing link. This facilitates communication between the resources in your Scaleway VPC, and your on-premises infrastructure.
268
- *
269
- * @param request - The request {@link AttachVpcRequest}
270
- * @returns A Promise of Link
271
- */
272
- attachVpc = (request) => this.client.fetch(
273
- {
274
- body: JSON.stringify(
275
- marshalAttachVpcRequest(request, this.client.settings)
276
- ),
277
- headers: jsonContentHeaders,
278
- method: "POST",
279
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-vpc`
280
- },
281
- unmarshalLink
282
- );
283
- /**
284
- * Detach a VPC. Detach a VPC from an existing link.
285
- *
286
- * @param request - The request {@link DetachVpcRequest}
287
- * @returns A Promise of Link
288
- */
289
- detachVpc = (request) => this.client.fetch(
290
- {
291
- body: "{}",
292
- headers: jsonContentHeaders,
293
- method: "POST",
294
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-vpc`
295
- },
296
- unmarshalLink
297
- );
298
- /**
299
- * Attach a routing policy. Attach a routing policy to an existing link. As all routes across the link are blocked by default, you must attach a routing policy to set IP prefix filters for allowed routes, facilitating traffic flow.
300
- *
301
- * @param request - The request {@link AttachRoutingPolicyRequest}
302
- * @returns A Promise of Link
303
- */
304
- attachRoutingPolicy = (request) => this.client.fetch(
305
- {
306
- body: JSON.stringify(
307
- marshalAttachRoutingPolicyRequest(request, this.client.settings)
308
- ),
309
- headers: jsonContentHeaders,
310
- method: "POST",
311
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-routing-policy`
312
- },
313
- unmarshalLink
314
- );
315
- /**
316
- * Detach a routing policy. Detach a routing policy from an existing link. Without a routing policy, all routes across the link are blocked by default.
317
- *
318
- * @param request - The request {@link DetachRoutingPolicyRequest}
319
- * @returns A Promise of Link
320
- */
321
- detachRoutingPolicy = (request) => this.client.fetch(
322
- {
323
- body: JSON.stringify(
324
- marshalDetachRoutingPolicyRequest(request, this.client.settings)
325
- ),
326
- headers: jsonContentHeaders,
327
- method: "POST",
328
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-routing-policy`
329
- },
330
- unmarshalLink
331
- );
332
- /**
333
- * Set a routing policy. Replace a routing policy from an existing link. This is useful when route propagation is enabled because it changes the routing policy "in place", without blocking all routes like a attach / detach would do.
334
- *
335
- * @param request - The request {@link SetRoutingPolicyRequest}
336
- * @returns A Promise of Link
337
- */
338
- setRoutingPolicy = (request) => this.client.fetch(
339
- {
340
- body: JSON.stringify(
341
- marshalSetRoutingPolicyRequest(request, this.client.settings)
342
- ),
343
- headers: jsonContentHeaders,
344
- method: "POST",
345
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/set-routing-policy`
346
- },
347
- unmarshalLink
348
- );
349
- /**
350
- * Enable route propagation. Enable all allowed prefixes (defined in a routing policy) to be announced in the BGP session. This allows traffic to flow between the attached VPC and the on-premises infrastructure along the announced routes. Note that by default, even when route propagation is enabled, all routes are blocked. It is essential to attach a routing policy to define the ranges of routes to announce.
351
- *
352
- * @param request - The request {@link EnableRoutePropagationRequest}
353
- * @returns A Promise of Link
354
- */
355
- enableRoutePropagation = (request) => this.client.fetch(
356
- {
357
- body: "{}",
358
- headers: jsonContentHeaders,
359
- method: "POST",
360
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/enable-route-propagation`
361
- },
362
- unmarshalLink
363
- );
364
- /**
365
- * Disable route propagation. Prevent any prefixes from being announced in the BGP session. Traffic will not be able to flow over the InterLink until route propagation is re-enabled.
366
- *
367
- * @param request - The request {@link DisableRoutePropagationRequest}
368
- * @returns A Promise of Link
369
- */
370
- disableRoutePropagation = (request) => this.client.fetch(
371
- {
372
- body: "{}",
373
- headers: jsonContentHeaders,
374
- method: "POST",
375
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/disable-route-propagation`
376
- },
377
- unmarshalLink
378
- );
379
- pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
380
- {
381
- method: "GET",
382
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
383
- urlParams: urlParams(
384
- ["ipv6", request.ipv6],
385
- ["name", request.name],
386
- ["order_by", request.orderBy],
387
- ["organization_id", request.organizationId],
388
- ["page", request.page],
389
- [
390
- "page_size",
391
- request.pageSize ?? this.client.settings.defaultPageSize
392
- ],
393
- ["project_id", request.projectId],
394
- ["tags", request.tags]
395
- )
396
- },
397
- unmarshalListRoutingPoliciesResponse
398
- );
399
- /**
400
- * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple links (InterLink connections).
401
- *
402
- * @param request - The request {@link ListRoutingPoliciesRequest}
403
- * @returns A Promise of ListRoutingPoliciesResponse
404
- */
405
- listRoutingPolicies = (request = {}) => enrichForPagination(
406
- "routingPolicies",
407
- this.pageOfListRoutingPolicies,
408
- request
409
- );
410
- /**
411
- * Get routing policy. Get a routing policy for the given routing policy ID. The response object gives information including the policy's name, tags and prefix filters.
412
- *
413
- * @param request - The request {@link GetRoutingPolicyRequest}
414
- * @returns A Promise of RoutingPolicy
415
- */
416
- getRoutingPolicy = (request) => this.client.fetch(
417
- {
418
- method: "GET",
419
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
420
- },
421
- unmarshalRoutingPolicy
422
- );
423
- /**
424
- * Create a routing policy. Create a routing policy. Routing policies allow you to set IP prefix filters to define the incoming route announcements to accept from the peer, and the outgoing routes to announce to the peer.
425
- *
426
- * @param request - The request {@link CreateRoutingPolicyRequest}
427
- * @returns A Promise of RoutingPolicy
428
- */
429
- createRoutingPolicy = (request) => this.client.fetch(
430
- {
431
- body: JSON.stringify(
432
- marshalCreateRoutingPolicyRequest(request, this.client.settings)
433
- ),
434
- headers: jsonContentHeaders,
435
- method: "POST",
436
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
437
- },
438
- unmarshalRoutingPolicy
439
- );
440
- /**
441
- * Update a routing policy. Update an existing routing policy, specified by its routing policy ID. Its name, tags and incoming/outgoing prefix filters can be updated.
442
- *
443
- * @param request - The request {@link UpdateRoutingPolicyRequest}
444
- * @returns A Promise of RoutingPolicy
445
- */
446
- updateRoutingPolicy = (request) => this.client.fetch(
447
- {
448
- body: JSON.stringify(
449
- marshalUpdateRoutingPolicyRequest(request, this.client.settings)
450
- ),
451
- headers: jsonContentHeaders,
452
- method: "PATCH",
453
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
454
- },
455
- unmarshalRoutingPolicy
456
- );
457
- /**
458
- * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
459
- *
460
- * @param request - The request {@link DeleteRoutingPolicyRequest}
461
- */
462
- deleteRoutingPolicy = (request) => this.client.fetch({
463
- method: "DELETE",
464
- path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
465
- });
466
- }
467
- export {
468
- API
2
+ import { marshalAttachRoutingPolicyRequest, marshalAttachVpcRequest, marshalCreateLinkRequest, marshalCreateRoutingPolicyRequest, marshalDetachRoutingPolicyRequest, marshalSetRoutingPolicyRequest, marshalUpdateLinkRequest, marshalUpdateRoutingPolicyRequest, unmarshalDedicatedConnection, unmarshalLink, unmarshalListDedicatedConnectionsResponse, unmarshalListLinksResponse, unmarshalListPartnersResponse, unmarshalListPopsResponse, unmarshalListRoutingPoliciesResponse, unmarshalPartner, unmarshalPop, unmarshalRoutingPolicy } 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
+ * InterLink API.
7
+
8
+ This API allows you to manage your Scaleway InterLink, to connect your on-premises infrastructure with your Scaleway VPC.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Locality of this API.
13
+ * type ∈ {'zone','region','global','unspecified'}
14
+ */
15
+ static LOCALITY = toApiLocality({ regions: [
16
+ "fr-par",
17
+ "nl-ams",
18
+ "pl-waw"
19
+ ] });
20
+ pageOfListDedicatedConnections = (request = {}) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections`,
23
+ urlParams: urlParams(["bandwidth_mbps", request.bandwidthMbps], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["pop_id", request.popId], ["project_id", request.projectId], ["status", request.status], ["tags", request.tags])
24
+ }, unmarshalListDedicatedConnectionsResponse);
25
+ /**
26
+ * List dedicated connections. For self-hosted users, list their dedicated physical connections in a given region. By default, the connections returned in the list are ordered by name in ascending order, though this can be modified via the `order_by` field.
27
+ *
28
+ * @param request - The request {@link ListDedicatedConnectionsRequest}
29
+ * @returns A Promise of ListDedicatedConnectionsResponse
30
+ */
31
+ listDedicatedConnections = (request = {}) => enrichForPagination("connections", this.pageOfListDedicatedConnections, request);
32
+ /**
33
+ * Get a dedicated connection. For self-hosted users, get a dedicated physical connection corresponding to the given ID. The response object includes information such as the connection's name, status and total bandwidth.
34
+ *
35
+ * @param request - The request {@link GetDedicatedConnectionRequest}
36
+ * @returns A Promise of DedicatedConnection
37
+ */
38
+ getDedicatedConnection = (request) => this.client.fetch({
39
+ method: "GET",
40
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections/${validatePathParam("connectionId", request.connectionId)}`
41
+ }, unmarshalDedicatedConnection);
42
+ /**
43
+ * Waits for {@link DedicatedConnection} to be in a final state.
44
+ *
45
+ * @param request - The request {@link GetDedicatedConnectionRequest}
46
+ * @param options - The waiting options
47
+ * @returns A Promise of DedicatedConnection
48
+ */
49
+ waitForDedicatedConnection = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DEDICATED_CONNECTION_TRANSIENT_STATUSES.includes(res.status))), this.getDedicatedConnection, request, options);
50
+ pageOfListPartners = (request = {}) => this.client.fetch({
51
+ method: "GET",
52
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners`,
53
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["pop_ids", request.popIds])
54
+ }, unmarshalListPartnersResponse);
55
+ /**
56
+ * List available partners. List all available partners. By default, the partners returned in the list are ordered by name in ascending order, though this can be modified via the `order_by` field.
57
+ *
58
+ * @param request - The request {@link ListPartnersRequest}
59
+ * @returns A Promise of ListPartnersResponse
60
+ */
61
+ listPartners = (request = {}) => enrichForPagination("partners", this.pageOfListPartners, request);
62
+ /**
63
+ * Get a partner. Get a partner for the given partner IP. The response object includes information such as the partner's name, email address and portal URL.
64
+ *
65
+ * @param request - The request {@link GetPartnerRequest}
66
+ * @returns A Promise of Partner
67
+ */
68
+ getPartner = (request) => this.client.fetch({
69
+ method: "GET",
70
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners/${validatePathParam("partnerId", request.partnerId)}`
71
+ }, unmarshalPartner);
72
+ pageOfListPops = (request = {}) => this.client.fetch({
73
+ method: "GET",
74
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops`,
75
+ urlParams: urlParams(["dedicated_available", request.dedicatedAvailable], ["hosting_provider_name", request.hostingProviderName], ["link_bandwidth_mbps", request.linkBandwidthMbps], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["partner_id", request.partnerId])
76
+ }, unmarshalListPopsResponse);
77
+ /**
78
+ * List PoPs. List all available PoPs (locations) for a given region. By default, the results are returned in ascending alphabetical order by name.
79
+ *
80
+ * @param request - The request {@link ListPopsRequest}
81
+ * @returns A Promise of ListPopsResponse
82
+ */
83
+ listPops = (request = {}) => enrichForPagination("pops", this.pageOfListPops, request);
84
+ /**
85
+ * Get a PoP. Get a PoP for the given PoP ID. The response object includes the PoP's name and information about its physical location.
86
+ *
87
+ * @param request - The request {@link GetPopRequest}
88
+ * @returns A Promise of Pop
89
+ */
90
+ getPop = (request) => this.client.fetch({
91
+ method: "GET",
92
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops/${validatePathParam("popId", request.popId)}`
93
+ }, unmarshalPop);
94
+ pageOfListLinks = (request = {}) => this.client.fetch({
95
+ method: "GET",
96
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`,
97
+ urlParams: urlParams(["bandwidth_mbps", request.bandwidthMbps], ["bgp_v4_status", request.bgpV4Status], ["bgp_v6_status", request.bgpV6Status], ["connection_id", request.connectionId], ["kind", request.kind], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["pairing_key", request.pairingKey], ["partner_id", request.partnerId], ["pop_id", request.popId], ["project_id", request.projectId], ["routing_policy_id", request.routingPolicyId], ["status", request.status], ["tags", request.tags], ["vpc_id", request.vpcId])
98
+ }, unmarshalListLinksResponse);
99
+ /**
100
+ * List links. List all your links (InterLink connections). A number of filters are available, including Project ID, name, tags and status.
101
+ *
102
+ * @param request - The request {@link ListLinksRequest}
103
+ * @returns A Promise of ListLinksResponse
104
+ */
105
+ listLinks = (request = {}) => enrichForPagination("links", this.pageOfListLinks, request);
106
+ /**
107
+ * Get a link. Get a link (InterLink session / logical InterLink resource) for the given link ID. The response object includes information about the link's various configuration details.
108
+ *
109
+ * @param request - The request {@link GetLinkRequest}
110
+ * @returns A Promise of Link
111
+ */
112
+ getLink = (request) => this.client.fetch({
113
+ method: "GET",
114
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
115
+ }, unmarshalLink);
116
+ /**
117
+ * Waits for {@link Link} to be in a final state.
118
+ *
119
+ * @param request - The request {@link GetLinkRequest}
120
+ * @param options - The waiting options
121
+ * @returns A Promise of Link
122
+ */
123
+ waitForLink = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!LINK_TRANSIENT_STATUSES.includes(res.status))), this.getLink, request, options);
124
+ /**
125
+ * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
126
+ *
127
+ * @param request - The request {@link CreateLinkRequest}
128
+ * @returns A Promise of Link
129
+ */
130
+ createLink = (request) => this.client.fetch({
131
+ body: JSON.stringify(marshalCreateLinkRequest(request, this.client.settings)),
132
+ headers: jsonContentHeaders,
133
+ method: "POST",
134
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`
135
+ }, unmarshalLink);
136
+ /**
137
+ * Update a link. Update an existing link, specified by its link ID. Only its name and tags can be updated.
138
+ *
139
+ * @param request - The request {@link UpdateLinkRequest}
140
+ * @returns A Promise of Link
141
+ */
142
+ updateLink = (request) => this.client.fetch({
143
+ body: JSON.stringify(marshalUpdateLinkRequest(request, this.client.settings)),
144
+ headers: jsonContentHeaders,
145
+ method: "PATCH",
146
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
147
+ }, unmarshalLink);
148
+ /**
149
+ * Delete a link. Delete an existing link, specified by its link ID. Note that as well as deleting the link here on the Scaleway side, it is also necessary to request deletion from the partner on their side. Only when this action has been carried out on both sides will the resource be completely deleted.
150
+ *
151
+ * @param request - The request {@link DeleteLinkRequest}
152
+ * @returns A Promise of Link
153
+ */
154
+ deleteLink = (request) => this.client.fetch({
155
+ method: "DELETE",
156
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
157
+ }, unmarshalLink);
158
+ /**
159
+ * Attach a VPC. Attach a VPC to an existing link. This facilitates communication between the resources in your Scaleway VPC, and your on-premises infrastructure.
160
+ *
161
+ * @param request - The request {@link AttachVpcRequest}
162
+ * @returns A Promise of Link
163
+ */
164
+ attachVpc = (request) => this.client.fetch({
165
+ body: JSON.stringify(marshalAttachVpcRequest(request, this.client.settings)),
166
+ headers: jsonContentHeaders,
167
+ method: "POST",
168
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-vpc`
169
+ }, unmarshalLink);
170
+ /**
171
+ * Detach a VPC. Detach a VPC from an existing link.
172
+ *
173
+ * @param request - The request {@link DetachVpcRequest}
174
+ * @returns A Promise of Link
175
+ */
176
+ detachVpc = (request) => this.client.fetch({
177
+ body: "{}",
178
+ headers: jsonContentHeaders,
179
+ method: "POST",
180
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-vpc`
181
+ }, unmarshalLink);
182
+ /**
183
+ * Attach a routing policy. Attach a routing policy to an existing link. As all routes across the link are blocked by default, you must attach a routing policy to set IP prefix filters for allowed routes, facilitating traffic flow.
184
+ *
185
+ * @param request - The request {@link AttachRoutingPolicyRequest}
186
+ * @returns A Promise of Link
187
+ */
188
+ attachRoutingPolicy = (request) => this.client.fetch({
189
+ body: JSON.stringify(marshalAttachRoutingPolicyRequest(request, this.client.settings)),
190
+ headers: jsonContentHeaders,
191
+ method: "POST",
192
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-routing-policy`
193
+ }, unmarshalLink);
194
+ /**
195
+ * Detach a routing policy. Detach a routing policy from an existing link. Without a routing policy, all routes across the link are blocked by default.
196
+ *
197
+ * @param request - The request {@link DetachRoutingPolicyRequest}
198
+ * @returns A Promise of Link
199
+ */
200
+ detachRoutingPolicy = (request) => this.client.fetch({
201
+ body: JSON.stringify(marshalDetachRoutingPolicyRequest(request, this.client.settings)),
202
+ headers: jsonContentHeaders,
203
+ method: "POST",
204
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-routing-policy`
205
+ }, unmarshalLink);
206
+ /**
207
+ * Set a routing policy. Replace a routing policy from an existing link. This is useful when route propagation is enabled because it changes the routing policy "in place", without blocking all routes like a attach / detach would do.
208
+ *
209
+ * @param request - The request {@link SetRoutingPolicyRequest}
210
+ * @returns A Promise of Link
211
+ */
212
+ setRoutingPolicy = (request) => this.client.fetch({
213
+ body: JSON.stringify(marshalSetRoutingPolicyRequest(request, this.client.settings)),
214
+ headers: jsonContentHeaders,
215
+ method: "POST",
216
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/set-routing-policy`
217
+ }, unmarshalLink);
218
+ /**
219
+ * Enable route propagation. Enable all allowed prefixes (defined in a routing policy) to be announced in the BGP session. This allows traffic to flow between the attached VPC and the on-premises infrastructure along the announced routes. Note that by default, even when route propagation is enabled, all routes are blocked. It is essential to attach a routing policy to define the ranges of routes to announce.
220
+ *
221
+ * @param request - The request {@link EnableRoutePropagationRequest}
222
+ * @returns A Promise of Link
223
+ */
224
+ enableRoutePropagation = (request) => this.client.fetch({
225
+ body: "{}",
226
+ headers: jsonContentHeaders,
227
+ method: "POST",
228
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/enable-route-propagation`
229
+ }, unmarshalLink);
230
+ /**
231
+ * Disable route propagation. Prevent any prefixes from being announced in the BGP session. Traffic will not be able to flow over the InterLink until route propagation is re-enabled.
232
+ *
233
+ * @param request - The request {@link DisableRoutePropagationRequest}
234
+ * @returns A Promise of Link
235
+ */
236
+ disableRoutePropagation = (request) => this.client.fetch({
237
+ body: "{}",
238
+ headers: jsonContentHeaders,
239
+ method: "POST",
240
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/disable-route-propagation`
241
+ }, unmarshalLink);
242
+ pageOfListRoutingPolicies = (request = {}) => this.client.fetch({
243
+ method: "GET",
244
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
245
+ urlParams: urlParams(["ipv6", request.ipv6], ["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])
246
+ }, unmarshalListRoutingPoliciesResponse);
247
+ /**
248
+ * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple links (InterLink connections).
249
+ *
250
+ * @param request - The request {@link ListRoutingPoliciesRequest}
251
+ * @returns A Promise of ListRoutingPoliciesResponse
252
+ */
253
+ listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
254
+ /**
255
+ * Get routing policy. Get a routing policy for the given routing policy ID. The response object gives information including the policy's name, tags and prefix filters.
256
+ *
257
+ * @param request - The request {@link GetRoutingPolicyRequest}
258
+ * @returns A Promise of RoutingPolicy
259
+ */
260
+ getRoutingPolicy = (request) => this.client.fetch({
261
+ method: "GET",
262
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
263
+ }, unmarshalRoutingPolicy);
264
+ /**
265
+ * Create a routing policy. Create a routing policy. Routing policies allow you to set IP prefix filters to define the incoming route announcements to accept from the peer, and the outgoing routes to announce to the peer.
266
+ *
267
+ * @param request - The request {@link CreateRoutingPolicyRequest}
268
+ * @returns A Promise of RoutingPolicy
269
+ */
270
+ createRoutingPolicy = (request) => this.client.fetch({
271
+ body: JSON.stringify(marshalCreateRoutingPolicyRequest(request, this.client.settings)),
272
+ headers: jsonContentHeaders,
273
+ method: "POST",
274
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
275
+ }, unmarshalRoutingPolicy);
276
+ /**
277
+ * Update a routing policy. Update an existing routing policy, specified by its routing policy ID. Its name, tags and incoming/outgoing prefix filters can be updated.
278
+ *
279
+ * @param request - The request {@link UpdateRoutingPolicyRequest}
280
+ * @returns A Promise of RoutingPolicy
281
+ */
282
+ updateRoutingPolicy = (request) => this.client.fetch({
283
+ body: JSON.stringify(marshalUpdateRoutingPolicyRequest(request, this.client.settings)),
284
+ headers: jsonContentHeaders,
285
+ method: "PATCH",
286
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
287
+ }, unmarshalRoutingPolicy);
288
+ /**
289
+ * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
290
+ *
291
+ * @param request - The request {@link DeleteRoutingPolicyRequest}
292
+ */
293
+ deleteRoutingPolicy = (request) => this.client.fetch({
294
+ method: "DELETE",
295
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
296
+ });
469
297
  };
298
+ export { API$1 as API };