@scaleway/sdk-interlink 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ https://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2019 Scaleway.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ https://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const index_gen = require("./v1beta1/index.gen.cjs");
4
+ exports.Interlinkv1beta1 = index_gen;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as Interlinkv1beta1 from './v1beta1/index.gen';
@@ -0,0 +1,4 @@
1
+ import * as index_gen from "./v1beta1/index.gen.js";
2
+ export {
3
+ index_gen as Interlinkv1beta1
4
+ };
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class API extends sdkClient.API {
10
+ /** Lists the available regions of the API. */
11
+ static LOCALITIES = [
12
+ "fr-par",
13
+ "nl-ams",
14
+ "pl-waw"
15
+ ];
16
+ pageOfListDedicatedConnections = (request = {}) => this.client.fetch(
17
+ {
18
+ method: "GET",
19
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections`,
20
+ urlParams: sdkClient.urlParams(
21
+ ["bandwidth_mbps", request.bandwidthMbps],
22
+ ["name", request.name],
23
+ ["order_by", request.orderBy],
24
+ ["organization_id", request.organizationId],
25
+ ["page", request.page],
26
+ [
27
+ "page_size",
28
+ request.pageSize ?? this.client.settings.defaultPageSize
29
+ ],
30
+ ["pop_id", request.popId],
31
+ ["project_id", request.projectId],
32
+ ["status", request.status],
33
+ ["tags", request.tags]
34
+ )
35
+ },
36
+ marshalling_gen.unmarshalListDedicatedConnectionsResponse
37
+ );
38
+ /**
39
+ * 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.
40
+ *
41
+ * @param request - The request {@link ListDedicatedConnectionsRequest}
42
+ * @returns A Promise of ListDedicatedConnectionsResponse
43
+ */
44
+ listDedicatedConnections = (request = {}) => sdkClient.enrichForPagination(
45
+ "connections",
46
+ this.pageOfListDedicatedConnections,
47
+ request
48
+ );
49
+ /**
50
+ * 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.
51
+ *
52
+ * @param request - The request {@link GetDedicatedConnectionRequest}
53
+ * @returns A Promise of DedicatedConnection
54
+ */
55
+ getDedicatedConnection = (request) => this.client.fetch(
56
+ {
57
+ method: "GET",
58
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}`
59
+ },
60
+ marshalling_gen.unmarshalDedicatedConnection
61
+ );
62
+ /**
63
+ * Waits for {@link DedicatedConnection} to be in a final state.
64
+ *
65
+ * @param request - The request {@link GetDedicatedConnectionRequest}
66
+ * @param options - The waiting options
67
+ * @returns A Promise of DedicatedConnection
68
+ */
69
+ waitForDedicatedConnection = (request, options) => sdkClient.waitForResource(
70
+ options?.stop ?? ((res) => Promise.resolve(
71
+ !content_gen.DEDICATED_CONNECTION_TRANSIENT_STATUSES.includes(
72
+ res.status
73
+ )
74
+ )),
75
+ this.getDedicatedConnection,
76
+ request,
77
+ options
78
+ );
79
+ pageOfListPartners = (request = {}) => this.client.fetch(
80
+ {
81
+ method: "GET",
82
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners`,
83
+ urlParams: sdkClient.urlParams(
84
+ ["order_by", request.orderBy],
85
+ ["page", request.page],
86
+ [
87
+ "page_size",
88
+ request.pageSize ?? this.client.settings.defaultPageSize
89
+ ],
90
+ ["pop_ids", request.popIds]
91
+ )
92
+ },
93
+ marshalling_gen.unmarshalListPartnersResponse
94
+ );
95
+ /**
96
+ * 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.
97
+ *
98
+ * @param request - The request {@link ListPartnersRequest}
99
+ * @returns A Promise of ListPartnersResponse
100
+ */
101
+ listPartners = (request = {}) => sdkClient.enrichForPagination("partners", this.pageOfListPartners, request);
102
+ /**
103
+ * 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.
104
+ *
105
+ * @param request - The request {@link GetPartnerRequest}
106
+ * @returns A Promise of Partner
107
+ */
108
+ getPartner = (request) => this.client.fetch(
109
+ {
110
+ method: "GET",
111
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners/${sdkClient.validatePathParam("partnerId", request.partnerId)}`
112
+ },
113
+ marshalling_gen.unmarshalPartner
114
+ );
115
+ pageOfListPops = (request = {}) => this.client.fetch(
116
+ {
117
+ method: "GET",
118
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops`,
119
+ urlParams: sdkClient.urlParams(
120
+ ["dedicated_available", request.dedicatedAvailable],
121
+ ["hosting_provider_name", request.hostingProviderName],
122
+ ["link_bandwidth_mbps", request.linkBandwidthMbps],
123
+ ["name", request.name],
124
+ ["order_by", request.orderBy],
125
+ ["page", request.page],
126
+ [
127
+ "page_size",
128
+ request.pageSize ?? this.client.settings.defaultPageSize
129
+ ],
130
+ ["partner_id", request.partnerId]
131
+ )
132
+ },
133
+ marshalling_gen.unmarshalListPopsResponse
134
+ );
135
+ /**
136
+ * List PoPs. List all available PoPs (locations) for a given region. By default, the results are returned in ascending alphabetical order by name.
137
+ *
138
+ * @param request - The request {@link ListPopsRequest}
139
+ * @returns A Promise of ListPopsResponse
140
+ */
141
+ listPops = (request = {}) => sdkClient.enrichForPagination("pops", this.pageOfListPops, request);
142
+ /**
143
+ * 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.
144
+ *
145
+ * @param request - The request {@link GetPopRequest}
146
+ * @returns A Promise of Pop
147
+ */
148
+ getPop = (request) => this.client.fetch(
149
+ {
150
+ method: "GET",
151
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops/${sdkClient.validatePathParam("popId", request.popId)}`
152
+ },
153
+ marshalling_gen.unmarshalPop
154
+ );
155
+ pageOfListLinks = (request = {}) => this.client.fetch(
156
+ {
157
+ method: "GET",
158
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`,
159
+ urlParams: sdkClient.urlParams(
160
+ ["bandwidth_mbps", request.bandwidthMbps],
161
+ ["bgp_v4_status", request.bgpV4Status],
162
+ ["bgp_v6_status", request.bgpV6Status],
163
+ ["connection_id", request.connectionId],
164
+ ["kind", request.kind],
165
+ ["name", request.name],
166
+ ["order_by", request.orderBy],
167
+ ["organization_id", request.organizationId],
168
+ ["page", request.page],
169
+ [
170
+ "page_size",
171
+ request.pageSize ?? this.client.settings.defaultPageSize
172
+ ],
173
+ ["pairing_key", request.pairingKey],
174
+ ["partner_id", request.partnerId],
175
+ ["pop_id", request.popId],
176
+ ["project_id", request.projectId],
177
+ ["routing_policy_id", request.routingPolicyId],
178
+ ["status", request.status],
179
+ ["tags", request.tags],
180
+ ["vpc_id", request.vpcId]
181
+ )
182
+ },
183
+ marshalling_gen.unmarshalListLinksResponse
184
+ );
185
+ /**
186
+ * List links. List all your links (InterLink connections). A number of filters are available, including Project ID, name, tags and status.
187
+ *
188
+ * @param request - The request {@link ListLinksRequest}
189
+ * @returns A Promise of ListLinksResponse
190
+ */
191
+ listLinks = (request = {}) => sdkClient.enrichForPagination("links", this.pageOfListLinks, request);
192
+ /**
193
+ * 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.
194
+ *
195
+ * @param request - The request {@link GetLinkRequest}
196
+ * @returns A Promise of Link
197
+ */
198
+ getLink = (request) => this.client.fetch(
199
+ {
200
+ method: "GET",
201
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}`
202
+ },
203
+ marshalling_gen.unmarshalLink
204
+ );
205
+ /**
206
+ * Waits for {@link Link} to be in a final state.
207
+ *
208
+ * @param request - The request {@link GetLinkRequest}
209
+ * @param options - The waiting options
210
+ * @returns A Promise of Link
211
+ */
212
+ waitForLink = (request, options) => sdkClient.waitForResource(
213
+ options?.stop ?? ((res) => Promise.resolve(
214
+ !content_gen.LINK_TRANSIENT_STATUSES.includes(res.status)
215
+ )),
216
+ this.getLink,
217
+ request,
218
+ options
219
+ );
220
+ /**
221
+ * 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).
222
+ *
223
+ * @param request - The request {@link CreateLinkRequest}
224
+ * @returns A Promise of Link
225
+ */
226
+ createLink = (request) => this.client.fetch(
227
+ {
228
+ body: JSON.stringify(
229
+ marshalling_gen.marshalCreateLinkRequest(request, this.client.settings)
230
+ ),
231
+ headers: jsonContentHeaders,
232
+ method: "POST",
233
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`
234
+ },
235
+ marshalling_gen.unmarshalLink
236
+ );
237
+ /**
238
+ * Update a link. Update an existing link, specified by its link ID. Only its name and tags can be updated.
239
+ *
240
+ * @param request - The request {@link UpdateLinkRequest}
241
+ * @returns A Promise of Link
242
+ */
243
+ updateLink = (request) => this.client.fetch(
244
+ {
245
+ body: JSON.stringify(
246
+ marshalling_gen.marshalUpdateLinkRequest(request, this.client.settings)
247
+ ),
248
+ headers: jsonContentHeaders,
249
+ method: "PATCH",
250
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}`
251
+ },
252
+ marshalling_gen.unmarshalLink
253
+ );
254
+ /**
255
+ * 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.
256
+ *
257
+ * @param request - The request {@link DeleteLinkRequest}
258
+ * @returns A Promise of Link
259
+ */
260
+ deleteLink = (request) => this.client.fetch(
261
+ {
262
+ method: "DELETE",
263
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}`
264
+ },
265
+ marshalling_gen.unmarshalLink
266
+ );
267
+ /**
268
+ * 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.
269
+ *
270
+ * @param request - The request {@link AttachVpcRequest}
271
+ * @returns A Promise of Link
272
+ */
273
+ attachVpc = (request) => this.client.fetch(
274
+ {
275
+ body: JSON.stringify(
276
+ marshalling_gen.marshalAttachVpcRequest(request, this.client.settings)
277
+ ),
278
+ headers: jsonContentHeaders,
279
+ method: "POST",
280
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/attach-vpc`
281
+ },
282
+ marshalling_gen.unmarshalLink
283
+ );
284
+ /**
285
+ * Detach a VPC. Detach a VPC from an existing link.
286
+ *
287
+ * @param request - The request {@link DetachVpcRequest}
288
+ * @returns A Promise of Link
289
+ */
290
+ detachVpc = (request) => this.client.fetch(
291
+ {
292
+ body: "{}",
293
+ headers: jsonContentHeaders,
294
+ method: "POST",
295
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/detach-vpc`
296
+ },
297
+ marshalling_gen.unmarshalLink
298
+ );
299
+ /**
300
+ * 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.
301
+ *
302
+ * @param request - The request {@link AttachRoutingPolicyRequest}
303
+ * @returns A Promise of Link
304
+ */
305
+ attachRoutingPolicy = (request) => this.client.fetch(
306
+ {
307
+ body: JSON.stringify(
308
+ marshalling_gen.marshalAttachRoutingPolicyRequest(request, this.client.settings)
309
+ ),
310
+ headers: jsonContentHeaders,
311
+ method: "POST",
312
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/attach-routing-policy`
313
+ },
314
+ marshalling_gen.unmarshalLink
315
+ );
316
+ /**
317
+ * 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.
318
+ *
319
+ * @param request - The request {@link DetachRoutingPolicyRequest}
320
+ * @returns A Promise of Link
321
+ */
322
+ detachRoutingPolicy = (request) => this.client.fetch(
323
+ {
324
+ body: "{}",
325
+ headers: jsonContentHeaders,
326
+ method: "POST",
327
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/detach-routing-policy`
328
+ },
329
+ marshalling_gen.unmarshalLink
330
+ );
331
+ /**
332
+ * 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.
333
+ *
334
+ * @param request - The request {@link EnableRoutePropagationRequest}
335
+ * @returns A Promise of Link
336
+ */
337
+ enableRoutePropagation = (request) => this.client.fetch(
338
+ {
339
+ body: "{}",
340
+ headers: jsonContentHeaders,
341
+ method: "POST",
342
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/enable-route-propagation`
343
+ },
344
+ marshalling_gen.unmarshalLink
345
+ );
346
+ /**
347
+ * 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.
348
+ *
349
+ * @param request - The request {@link DisableRoutePropagationRequest}
350
+ * @returns A Promise of Link
351
+ */
352
+ disableRoutePropagation = (request) => this.client.fetch(
353
+ {
354
+ body: "{}",
355
+ headers: jsonContentHeaders,
356
+ method: "POST",
357
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/disable-route-propagation`
358
+ },
359
+ marshalling_gen.unmarshalLink
360
+ );
361
+ pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
362
+ {
363
+ method: "GET",
364
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
365
+ urlParams: sdkClient.urlParams(
366
+ ["name", request.name],
367
+ ["order_by", request.orderBy],
368
+ ["organization_id", request.organizationId],
369
+ ["page", request.page],
370
+ [
371
+ "page_size",
372
+ request.pageSize ?? this.client.settings.defaultPageSize
373
+ ],
374
+ ["project_id", request.projectId],
375
+ ["tags", request.tags]
376
+ )
377
+ },
378
+ marshalling_gen.unmarshalListRoutingPoliciesResponse
379
+ );
380
+ /**
381
+ * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple links (InterLink connections).
382
+ *
383
+ * @param request - The request {@link ListRoutingPoliciesRequest}
384
+ * @returns A Promise of ListRoutingPoliciesResponse
385
+ */
386
+ listRoutingPolicies = (request = {}) => sdkClient.enrichForPagination(
387
+ "routingPolicies",
388
+ this.pageOfListRoutingPolicies,
389
+ request
390
+ );
391
+ /**
392
+ * 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.
393
+ *
394
+ * @param request - The request {@link GetRoutingPolicyRequest}
395
+ * @returns A Promise of RoutingPolicy
396
+ */
397
+ getRoutingPolicy = (request) => this.client.fetch(
398
+ {
399
+ method: "GET",
400
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${sdkClient.validatePathParam("routingPolicyId", request.routingPolicyId)}`
401
+ },
402
+ marshalling_gen.unmarshalRoutingPolicy
403
+ );
404
+ /**
405
+ * 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.
406
+ *
407
+ * @param request - The request {@link CreateRoutingPolicyRequest}
408
+ * @returns A Promise of RoutingPolicy
409
+ */
410
+ createRoutingPolicy = (request) => this.client.fetch(
411
+ {
412
+ body: JSON.stringify(
413
+ marshalling_gen.marshalCreateRoutingPolicyRequest(request, this.client.settings)
414
+ ),
415
+ headers: jsonContentHeaders,
416
+ method: "POST",
417
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
418
+ },
419
+ marshalling_gen.unmarshalRoutingPolicy
420
+ );
421
+ /**
422
+ * 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.
423
+ *
424
+ * @param request - The request {@link UpdateRoutingPolicyRequest}
425
+ * @returns A Promise of RoutingPolicy
426
+ */
427
+ updateRoutingPolicy = (request) => this.client.fetch(
428
+ {
429
+ body: JSON.stringify(
430
+ marshalling_gen.marshalUpdateRoutingPolicyRequest(request, this.client.settings)
431
+ ),
432
+ headers: jsonContentHeaders,
433
+ method: "PATCH",
434
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${sdkClient.validatePathParam("routingPolicyId", request.routingPolicyId)}`
435
+ },
436
+ marshalling_gen.unmarshalRoutingPolicy
437
+ );
438
+ /**
439
+ * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
440
+ *
441
+ * @param request - The request {@link DeleteRoutingPolicyRequest}
442
+ */
443
+ deleteRoutingPolicy = (request) => this.client.fetch({
444
+ method: "DELETE",
445
+ path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${sdkClient.validatePathParam("routingPolicyId", request.routingPolicyId)}`
446
+ });
447
+ }
448
+ exports.API = API;