@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 +191 -0
- package/dist/index.gen.cjs +4 -0
- package/dist/index.gen.d.ts +5 -0
- package/dist/index.gen.js +4 -0
- package/dist/v1beta1/api.gen.cjs +448 -0
- package/dist/v1beta1/api.gen.d.ts +201 -0
- package/dist/v1beta1/api.gen.js +448 -0
- package/dist/v1beta1/content.gen.cjs +6 -0
- package/dist/v1beta1/content.gen.d.ts +5 -0
- package/dist/v1beta1/content.gen.js +6 -0
- package/dist/v1beta1/index.gen.cjs +26 -0
- package/dist/v1beta1/index.gen.d.ts +5 -0
- package/dist/v1beta1/index.gen.js +26 -0
- package/dist/v1beta1/marshalling.gen.cjs +254 -0
- package/dist/v1beta1/marshalling.gen.d.ts +18 -0
- package/dist/v1beta1/marshalling.gen.js +254 -0
- package/dist/v1beta1/types.gen.d.ts +810 -0
- package/dist/v1beta1/validation-rules.gen.cjs +132 -0
- package/dist/v1beta1/validation-rules.gen.d.ts +116 -0
- package/dist/v1beta1/validation-rules.gen.js +132 -0
- package/package.json +51 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Region as ScwRegion, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
+
import type { AttachRoutingPolicyRequest, AttachVpcRequest, CreateLinkRequest, CreateRoutingPolicyRequest, DedicatedConnection, DeleteLinkRequest, DeleteRoutingPolicyRequest, DetachRoutingPolicyRequest, DetachVpcRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GetDedicatedConnectionRequest, GetLinkRequest, GetPartnerRequest, GetPopRequest, GetRoutingPolicyRequest, Link, ListDedicatedConnectionsRequest, ListDedicatedConnectionsResponse, ListLinksRequest, ListLinksResponse, ListPartnersRequest, ListPartnersResponse, ListPopsRequest, ListPopsResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesResponse, Partner, Pop, RoutingPolicy, UpdateLinkRequest, UpdateRoutingPolicyRequest } from './types.gen';
|
|
4
|
+
/**
|
|
5
|
+
* InterLink API.
|
|
6
|
+
|
|
7
|
+
This API allows you to manage your Scaleway InterLink, to connect your on-premises infrastructure with your Scaleway VPC.
|
|
8
|
+
*/
|
|
9
|
+
export declare class API extends ParentAPI {
|
|
10
|
+
/** Lists the available regions of the API. */
|
|
11
|
+
static readonly LOCALITIES: ScwRegion[];
|
|
12
|
+
protected pageOfListDedicatedConnections: (request?: Readonly<ListDedicatedConnectionsRequest>) => Promise<ListDedicatedConnectionsResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* 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.
|
|
15
|
+
*
|
|
16
|
+
* @param request - The request {@link ListDedicatedConnectionsRequest}
|
|
17
|
+
* @returns A Promise of ListDedicatedConnectionsResponse
|
|
18
|
+
*/
|
|
19
|
+
listDedicatedConnections: (request?: Readonly<ListDedicatedConnectionsRequest>) => Promise<ListDedicatedConnectionsResponse> & {
|
|
20
|
+
all: () => Promise<DedicatedConnection[]>;
|
|
21
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<DedicatedConnection[], void, void>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 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.
|
|
25
|
+
*
|
|
26
|
+
* @param request - The request {@link GetDedicatedConnectionRequest}
|
|
27
|
+
* @returns A Promise of DedicatedConnection
|
|
28
|
+
*/
|
|
29
|
+
getDedicatedConnection: (request: Readonly<GetDedicatedConnectionRequest>) => Promise<DedicatedConnection>;
|
|
30
|
+
/**
|
|
31
|
+
* Waits for {@link DedicatedConnection} to be in a final state.
|
|
32
|
+
*
|
|
33
|
+
* @param request - The request {@link GetDedicatedConnectionRequest}
|
|
34
|
+
* @param options - The waiting options
|
|
35
|
+
* @returns A Promise of DedicatedConnection
|
|
36
|
+
*/
|
|
37
|
+
waitForDedicatedConnection: (request: Readonly<GetDedicatedConnectionRequest>, options?: Readonly<WaitForOptions<DedicatedConnection>>) => Promise<DedicatedConnection>;
|
|
38
|
+
protected pageOfListPartners: (request?: Readonly<ListPartnersRequest>) => Promise<ListPartnersResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* 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.
|
|
41
|
+
*
|
|
42
|
+
* @param request - The request {@link ListPartnersRequest}
|
|
43
|
+
* @returns A Promise of ListPartnersResponse
|
|
44
|
+
*/
|
|
45
|
+
listPartners: (request?: Readonly<ListPartnersRequest>) => Promise<ListPartnersResponse> & {
|
|
46
|
+
all: () => Promise<Partner[]>;
|
|
47
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Partner[], void, void>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* 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.
|
|
51
|
+
*
|
|
52
|
+
* @param request - The request {@link GetPartnerRequest}
|
|
53
|
+
* @returns A Promise of Partner
|
|
54
|
+
*/
|
|
55
|
+
getPartner: (request: Readonly<GetPartnerRequest>) => Promise<Partner>;
|
|
56
|
+
protected pageOfListPops: (request?: Readonly<ListPopsRequest>) => Promise<ListPopsResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* List PoPs. List all available PoPs (locations) for a given region. By default, the results are returned in ascending alphabetical order by name.
|
|
59
|
+
*
|
|
60
|
+
* @param request - The request {@link ListPopsRequest}
|
|
61
|
+
* @returns A Promise of ListPopsResponse
|
|
62
|
+
*/
|
|
63
|
+
listPops: (request?: Readonly<ListPopsRequest>) => Promise<ListPopsResponse> & {
|
|
64
|
+
all: () => Promise<Pop[]>;
|
|
65
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Pop[], void, void>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* 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.
|
|
69
|
+
*
|
|
70
|
+
* @param request - The request {@link GetPopRequest}
|
|
71
|
+
* @returns A Promise of Pop
|
|
72
|
+
*/
|
|
73
|
+
getPop: (request: Readonly<GetPopRequest>) => Promise<Pop>;
|
|
74
|
+
protected pageOfListLinks: (request?: Readonly<ListLinksRequest>) => Promise<ListLinksResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* List links. List all your links (InterLink connections). A number of filters are available, including Project ID, name, tags and status.
|
|
77
|
+
*
|
|
78
|
+
* @param request - The request {@link ListLinksRequest}
|
|
79
|
+
* @returns A Promise of ListLinksResponse
|
|
80
|
+
*/
|
|
81
|
+
listLinks: (request?: Readonly<ListLinksRequest>) => Promise<ListLinksResponse> & {
|
|
82
|
+
all: () => Promise<Link[]>;
|
|
83
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Link[], void, void>;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* 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.
|
|
87
|
+
*
|
|
88
|
+
* @param request - The request {@link GetLinkRequest}
|
|
89
|
+
* @returns A Promise of Link
|
|
90
|
+
*/
|
|
91
|
+
getLink: (request: Readonly<GetLinkRequest>) => Promise<Link>;
|
|
92
|
+
/**
|
|
93
|
+
* Waits for {@link Link} to be in a final state.
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link GetLinkRequest}
|
|
96
|
+
* @param options - The waiting options
|
|
97
|
+
* @returns A Promise of Link
|
|
98
|
+
*/
|
|
99
|
+
waitForLink: (request: Readonly<GetLinkRequest>, options?: Readonly<WaitForOptions<Link>>) => Promise<Link>;
|
|
100
|
+
/**
|
|
101
|
+
* 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).
|
|
102
|
+
*
|
|
103
|
+
* @param request - The request {@link CreateLinkRequest}
|
|
104
|
+
* @returns A Promise of Link
|
|
105
|
+
*/
|
|
106
|
+
createLink: (request: Readonly<CreateLinkRequest>) => Promise<Link>;
|
|
107
|
+
/**
|
|
108
|
+
* Update a link. Update an existing link, specified by its link ID. Only its name and tags can be updated.
|
|
109
|
+
*
|
|
110
|
+
* @param request - The request {@link UpdateLinkRequest}
|
|
111
|
+
* @returns A Promise of Link
|
|
112
|
+
*/
|
|
113
|
+
updateLink: (request: Readonly<UpdateLinkRequest>) => Promise<Link>;
|
|
114
|
+
/**
|
|
115
|
+
* 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.
|
|
116
|
+
*
|
|
117
|
+
* @param request - The request {@link DeleteLinkRequest}
|
|
118
|
+
* @returns A Promise of Link
|
|
119
|
+
*/
|
|
120
|
+
deleteLink: (request: Readonly<DeleteLinkRequest>) => Promise<Link>;
|
|
121
|
+
/**
|
|
122
|
+
* 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.
|
|
123
|
+
*
|
|
124
|
+
* @param request - The request {@link AttachVpcRequest}
|
|
125
|
+
* @returns A Promise of Link
|
|
126
|
+
*/
|
|
127
|
+
attachVpc: (request: Readonly<AttachVpcRequest>) => Promise<Link>;
|
|
128
|
+
/**
|
|
129
|
+
* Detach a VPC. Detach a VPC from an existing link.
|
|
130
|
+
*
|
|
131
|
+
* @param request - The request {@link DetachVpcRequest}
|
|
132
|
+
* @returns A Promise of Link
|
|
133
|
+
*/
|
|
134
|
+
detachVpc: (request: Readonly<DetachVpcRequest>) => Promise<Link>;
|
|
135
|
+
/**
|
|
136
|
+
* 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.
|
|
137
|
+
*
|
|
138
|
+
* @param request - The request {@link AttachRoutingPolicyRequest}
|
|
139
|
+
* @returns A Promise of Link
|
|
140
|
+
*/
|
|
141
|
+
attachRoutingPolicy: (request: Readonly<AttachRoutingPolicyRequest>) => Promise<Link>;
|
|
142
|
+
/**
|
|
143
|
+
* 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.
|
|
144
|
+
*
|
|
145
|
+
* @param request - The request {@link DetachRoutingPolicyRequest}
|
|
146
|
+
* @returns A Promise of Link
|
|
147
|
+
*/
|
|
148
|
+
detachRoutingPolicy: (request: Readonly<DetachRoutingPolicyRequest>) => Promise<Link>;
|
|
149
|
+
/**
|
|
150
|
+
* 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.
|
|
151
|
+
*
|
|
152
|
+
* @param request - The request {@link EnableRoutePropagationRequest}
|
|
153
|
+
* @returns A Promise of Link
|
|
154
|
+
*/
|
|
155
|
+
enableRoutePropagation: (request: Readonly<EnableRoutePropagationRequest>) => Promise<Link>;
|
|
156
|
+
/**
|
|
157
|
+
* 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.
|
|
158
|
+
*
|
|
159
|
+
* @param request - The request {@link DisableRoutePropagationRequest}
|
|
160
|
+
* @returns A Promise of Link
|
|
161
|
+
*/
|
|
162
|
+
disableRoutePropagation: (request: Readonly<DisableRoutePropagationRequest>) => Promise<Link>;
|
|
163
|
+
protected pageOfListRoutingPolicies: (request?: Readonly<ListRoutingPoliciesRequest>) => Promise<ListRoutingPoliciesResponse>;
|
|
164
|
+
/**
|
|
165
|
+
* List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple links (InterLink connections).
|
|
166
|
+
*
|
|
167
|
+
* @param request - The request {@link ListRoutingPoliciesRequest}
|
|
168
|
+
* @returns A Promise of ListRoutingPoliciesResponse
|
|
169
|
+
*/
|
|
170
|
+
listRoutingPolicies: (request?: Readonly<ListRoutingPoliciesRequest>) => Promise<ListRoutingPoliciesResponse> & {
|
|
171
|
+
all: () => Promise<RoutingPolicy[]>;
|
|
172
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<RoutingPolicy[], void, void>;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* 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.
|
|
176
|
+
*
|
|
177
|
+
* @param request - The request {@link GetRoutingPolicyRequest}
|
|
178
|
+
* @returns A Promise of RoutingPolicy
|
|
179
|
+
*/
|
|
180
|
+
getRoutingPolicy: (request: Readonly<GetRoutingPolicyRequest>) => Promise<RoutingPolicy>;
|
|
181
|
+
/**
|
|
182
|
+
* 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.
|
|
183
|
+
*
|
|
184
|
+
* @param request - The request {@link CreateRoutingPolicyRequest}
|
|
185
|
+
* @returns A Promise of RoutingPolicy
|
|
186
|
+
*/
|
|
187
|
+
createRoutingPolicy: (request: Readonly<CreateRoutingPolicyRequest>) => Promise<RoutingPolicy>;
|
|
188
|
+
/**
|
|
189
|
+
* 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.
|
|
190
|
+
*
|
|
191
|
+
* @param request - The request {@link UpdateRoutingPolicyRequest}
|
|
192
|
+
* @returns A Promise of RoutingPolicy
|
|
193
|
+
*/
|
|
194
|
+
updateRoutingPolicy: (request: Readonly<UpdateRoutingPolicyRequest>) => Promise<RoutingPolicy>;
|
|
195
|
+
/**
|
|
196
|
+
* Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
|
|
197
|
+
*
|
|
198
|
+
* @param request - The request {@link DeleteRoutingPolicyRequest}
|
|
199
|
+
*/
|
|
200
|
+
deleteRoutingPolicy: (request: Readonly<DeleteRoutingPolicyRequest>) => Promise<void>;
|
|
201
|
+
}
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import { API as API$1, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
|
|
2
|
+
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, 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
|
+
/** Lists the available regions of the API. */
|
|
9
|
+
static LOCALITIES = [
|
|
10
|
+
"fr-par",
|
|
11
|
+
"nl-ams",
|
|
12
|
+
"pl-waw"
|
|
13
|
+
];
|
|
14
|
+
pageOfListDedicatedConnections = (request = {}) => this.client.fetch(
|
|
15
|
+
{
|
|
16
|
+
method: "GET",
|
|
17
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections`,
|
|
18
|
+
urlParams: urlParams(
|
|
19
|
+
["bandwidth_mbps", request.bandwidthMbps],
|
|
20
|
+
["name", request.name],
|
|
21
|
+
["order_by", request.orderBy],
|
|
22
|
+
["organization_id", request.organizationId],
|
|
23
|
+
["page", request.page],
|
|
24
|
+
[
|
|
25
|
+
"page_size",
|
|
26
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
27
|
+
],
|
|
28
|
+
["pop_id", request.popId],
|
|
29
|
+
["project_id", request.projectId],
|
|
30
|
+
["status", request.status],
|
|
31
|
+
["tags", request.tags]
|
|
32
|
+
)
|
|
33
|
+
},
|
|
34
|
+
unmarshalListDedicatedConnectionsResponse
|
|
35
|
+
);
|
|
36
|
+
/**
|
|
37
|
+
* 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.
|
|
38
|
+
*
|
|
39
|
+
* @param request - The request {@link ListDedicatedConnectionsRequest}
|
|
40
|
+
* @returns A Promise of ListDedicatedConnectionsResponse
|
|
41
|
+
*/
|
|
42
|
+
listDedicatedConnections = (request = {}) => enrichForPagination(
|
|
43
|
+
"connections",
|
|
44
|
+
this.pageOfListDedicatedConnections,
|
|
45
|
+
request
|
|
46
|
+
);
|
|
47
|
+
/**
|
|
48
|
+
* 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.
|
|
49
|
+
*
|
|
50
|
+
* @param request - The request {@link GetDedicatedConnectionRequest}
|
|
51
|
+
* @returns A Promise of DedicatedConnection
|
|
52
|
+
*/
|
|
53
|
+
getDedicatedConnection = (request) => this.client.fetch(
|
|
54
|
+
{
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/dedicated-connections/${validatePathParam("connectionId", request.connectionId)}`
|
|
57
|
+
},
|
|
58
|
+
unmarshalDedicatedConnection
|
|
59
|
+
);
|
|
60
|
+
/**
|
|
61
|
+
* Waits for {@link DedicatedConnection} to be in a final state.
|
|
62
|
+
*
|
|
63
|
+
* @param request - The request {@link GetDedicatedConnectionRequest}
|
|
64
|
+
* @param options - The waiting options
|
|
65
|
+
* @returns A Promise of DedicatedConnection
|
|
66
|
+
*/
|
|
67
|
+
waitForDedicatedConnection = (request, options) => waitForResource(
|
|
68
|
+
options?.stop ?? ((res) => Promise.resolve(
|
|
69
|
+
!DEDICATED_CONNECTION_TRANSIENT_STATUSES.includes(
|
|
70
|
+
res.status
|
|
71
|
+
)
|
|
72
|
+
)),
|
|
73
|
+
this.getDedicatedConnection,
|
|
74
|
+
request,
|
|
75
|
+
options
|
|
76
|
+
);
|
|
77
|
+
pageOfListPartners = (request = {}) => this.client.fetch(
|
|
78
|
+
{
|
|
79
|
+
method: "GET",
|
|
80
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners`,
|
|
81
|
+
urlParams: urlParams(
|
|
82
|
+
["order_by", request.orderBy],
|
|
83
|
+
["page", request.page],
|
|
84
|
+
[
|
|
85
|
+
"page_size",
|
|
86
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
87
|
+
],
|
|
88
|
+
["pop_ids", request.popIds]
|
|
89
|
+
)
|
|
90
|
+
},
|
|
91
|
+
unmarshalListPartnersResponse
|
|
92
|
+
);
|
|
93
|
+
/**
|
|
94
|
+
* 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.
|
|
95
|
+
*
|
|
96
|
+
* @param request - The request {@link ListPartnersRequest}
|
|
97
|
+
* @returns A Promise of ListPartnersResponse
|
|
98
|
+
*/
|
|
99
|
+
listPartners = (request = {}) => enrichForPagination("partners", this.pageOfListPartners, request);
|
|
100
|
+
/**
|
|
101
|
+
* 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.
|
|
102
|
+
*
|
|
103
|
+
* @param request - The request {@link GetPartnerRequest}
|
|
104
|
+
* @returns A Promise of Partner
|
|
105
|
+
*/
|
|
106
|
+
getPartner = (request) => this.client.fetch(
|
|
107
|
+
{
|
|
108
|
+
method: "GET",
|
|
109
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners/${validatePathParam("partnerId", request.partnerId)}`
|
|
110
|
+
},
|
|
111
|
+
unmarshalPartner
|
|
112
|
+
);
|
|
113
|
+
pageOfListPops = (request = {}) => this.client.fetch(
|
|
114
|
+
{
|
|
115
|
+
method: "GET",
|
|
116
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops`,
|
|
117
|
+
urlParams: urlParams(
|
|
118
|
+
["dedicated_available", request.dedicatedAvailable],
|
|
119
|
+
["hosting_provider_name", request.hostingProviderName],
|
|
120
|
+
["link_bandwidth_mbps", request.linkBandwidthMbps],
|
|
121
|
+
["name", request.name],
|
|
122
|
+
["order_by", request.orderBy],
|
|
123
|
+
["page", request.page],
|
|
124
|
+
[
|
|
125
|
+
"page_size",
|
|
126
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
127
|
+
],
|
|
128
|
+
["partner_id", request.partnerId]
|
|
129
|
+
)
|
|
130
|
+
},
|
|
131
|
+
unmarshalListPopsResponse
|
|
132
|
+
);
|
|
133
|
+
/**
|
|
134
|
+
* List PoPs. List all available PoPs (locations) for a given region. By default, the results are returned in ascending alphabetical order by name.
|
|
135
|
+
*
|
|
136
|
+
* @param request - The request {@link ListPopsRequest}
|
|
137
|
+
* @returns A Promise of ListPopsResponse
|
|
138
|
+
*/
|
|
139
|
+
listPops = (request = {}) => enrichForPagination("pops", this.pageOfListPops, request);
|
|
140
|
+
/**
|
|
141
|
+
* 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.
|
|
142
|
+
*
|
|
143
|
+
* @param request - The request {@link GetPopRequest}
|
|
144
|
+
* @returns A Promise of Pop
|
|
145
|
+
*/
|
|
146
|
+
getPop = (request) => this.client.fetch(
|
|
147
|
+
{
|
|
148
|
+
method: "GET",
|
|
149
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops/${validatePathParam("popId", request.popId)}`
|
|
150
|
+
},
|
|
151
|
+
unmarshalPop
|
|
152
|
+
);
|
|
153
|
+
pageOfListLinks = (request = {}) => this.client.fetch(
|
|
154
|
+
{
|
|
155
|
+
method: "GET",
|
|
156
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`,
|
|
157
|
+
urlParams: urlParams(
|
|
158
|
+
["bandwidth_mbps", request.bandwidthMbps],
|
|
159
|
+
["bgp_v4_status", request.bgpV4Status],
|
|
160
|
+
["bgp_v6_status", request.bgpV6Status],
|
|
161
|
+
["connection_id", request.connectionId],
|
|
162
|
+
["kind", request.kind],
|
|
163
|
+
["name", request.name],
|
|
164
|
+
["order_by", request.orderBy],
|
|
165
|
+
["organization_id", request.organizationId],
|
|
166
|
+
["page", request.page],
|
|
167
|
+
[
|
|
168
|
+
"page_size",
|
|
169
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
170
|
+
],
|
|
171
|
+
["pairing_key", request.pairingKey],
|
|
172
|
+
["partner_id", request.partnerId],
|
|
173
|
+
["pop_id", request.popId],
|
|
174
|
+
["project_id", request.projectId],
|
|
175
|
+
["routing_policy_id", request.routingPolicyId],
|
|
176
|
+
["status", request.status],
|
|
177
|
+
["tags", request.tags],
|
|
178
|
+
["vpc_id", request.vpcId]
|
|
179
|
+
)
|
|
180
|
+
},
|
|
181
|
+
unmarshalListLinksResponse
|
|
182
|
+
);
|
|
183
|
+
/**
|
|
184
|
+
* List links. List all your links (InterLink connections). A number of filters are available, including Project ID, name, tags and status.
|
|
185
|
+
*
|
|
186
|
+
* @param request - The request {@link ListLinksRequest}
|
|
187
|
+
* @returns A Promise of ListLinksResponse
|
|
188
|
+
*/
|
|
189
|
+
listLinks = (request = {}) => enrichForPagination("links", this.pageOfListLinks, request);
|
|
190
|
+
/**
|
|
191
|
+
* 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.
|
|
192
|
+
*
|
|
193
|
+
* @param request - The request {@link GetLinkRequest}
|
|
194
|
+
* @returns A Promise of Link
|
|
195
|
+
*/
|
|
196
|
+
getLink = (request) => this.client.fetch(
|
|
197
|
+
{
|
|
198
|
+
method: "GET",
|
|
199
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
|
|
200
|
+
},
|
|
201
|
+
unmarshalLink
|
|
202
|
+
);
|
|
203
|
+
/**
|
|
204
|
+
* Waits for {@link Link} to be in a final state.
|
|
205
|
+
*
|
|
206
|
+
* @param request - The request {@link GetLinkRequest}
|
|
207
|
+
* @param options - The waiting options
|
|
208
|
+
* @returns A Promise of Link
|
|
209
|
+
*/
|
|
210
|
+
waitForLink = (request, options) => waitForResource(
|
|
211
|
+
options?.stop ?? ((res) => Promise.resolve(
|
|
212
|
+
!LINK_TRANSIENT_STATUSES.includes(res.status)
|
|
213
|
+
)),
|
|
214
|
+
this.getLink,
|
|
215
|
+
request,
|
|
216
|
+
options
|
|
217
|
+
);
|
|
218
|
+
/**
|
|
219
|
+
* 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).
|
|
220
|
+
*
|
|
221
|
+
* @param request - The request {@link CreateLinkRequest}
|
|
222
|
+
* @returns A Promise of Link
|
|
223
|
+
*/
|
|
224
|
+
createLink = (request) => this.client.fetch(
|
|
225
|
+
{
|
|
226
|
+
body: JSON.stringify(
|
|
227
|
+
marshalCreateLinkRequest(request, this.client.settings)
|
|
228
|
+
),
|
|
229
|
+
headers: jsonContentHeaders,
|
|
230
|
+
method: "POST",
|
|
231
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`
|
|
232
|
+
},
|
|
233
|
+
unmarshalLink
|
|
234
|
+
);
|
|
235
|
+
/**
|
|
236
|
+
* Update a link. Update an existing link, specified by its link ID. Only its name and tags can be updated.
|
|
237
|
+
*
|
|
238
|
+
* @param request - The request {@link UpdateLinkRequest}
|
|
239
|
+
* @returns A Promise of Link
|
|
240
|
+
*/
|
|
241
|
+
updateLink = (request) => this.client.fetch(
|
|
242
|
+
{
|
|
243
|
+
body: JSON.stringify(
|
|
244
|
+
marshalUpdateLinkRequest(request, this.client.settings)
|
|
245
|
+
),
|
|
246
|
+
headers: jsonContentHeaders,
|
|
247
|
+
method: "PATCH",
|
|
248
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
|
|
249
|
+
},
|
|
250
|
+
unmarshalLink
|
|
251
|
+
);
|
|
252
|
+
/**
|
|
253
|
+
* 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.
|
|
254
|
+
*
|
|
255
|
+
* @param request - The request {@link DeleteLinkRequest}
|
|
256
|
+
* @returns A Promise of Link
|
|
257
|
+
*/
|
|
258
|
+
deleteLink = (request) => this.client.fetch(
|
|
259
|
+
{
|
|
260
|
+
method: "DELETE",
|
|
261
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
|
|
262
|
+
},
|
|
263
|
+
unmarshalLink
|
|
264
|
+
);
|
|
265
|
+
/**
|
|
266
|
+
* 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.
|
|
267
|
+
*
|
|
268
|
+
* @param request - The request {@link AttachVpcRequest}
|
|
269
|
+
* @returns A Promise of Link
|
|
270
|
+
*/
|
|
271
|
+
attachVpc = (request) => this.client.fetch(
|
|
272
|
+
{
|
|
273
|
+
body: JSON.stringify(
|
|
274
|
+
marshalAttachVpcRequest(request, this.client.settings)
|
|
275
|
+
),
|
|
276
|
+
headers: jsonContentHeaders,
|
|
277
|
+
method: "POST",
|
|
278
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-vpc`
|
|
279
|
+
},
|
|
280
|
+
unmarshalLink
|
|
281
|
+
);
|
|
282
|
+
/**
|
|
283
|
+
* Detach a VPC. Detach a VPC from an existing link.
|
|
284
|
+
*
|
|
285
|
+
* @param request - The request {@link DetachVpcRequest}
|
|
286
|
+
* @returns A Promise of Link
|
|
287
|
+
*/
|
|
288
|
+
detachVpc = (request) => this.client.fetch(
|
|
289
|
+
{
|
|
290
|
+
body: "{}",
|
|
291
|
+
headers: jsonContentHeaders,
|
|
292
|
+
method: "POST",
|
|
293
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-vpc`
|
|
294
|
+
},
|
|
295
|
+
unmarshalLink
|
|
296
|
+
);
|
|
297
|
+
/**
|
|
298
|
+
* 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.
|
|
299
|
+
*
|
|
300
|
+
* @param request - The request {@link AttachRoutingPolicyRequest}
|
|
301
|
+
* @returns A Promise of Link
|
|
302
|
+
*/
|
|
303
|
+
attachRoutingPolicy = (request) => this.client.fetch(
|
|
304
|
+
{
|
|
305
|
+
body: JSON.stringify(
|
|
306
|
+
marshalAttachRoutingPolicyRequest(request, this.client.settings)
|
|
307
|
+
),
|
|
308
|
+
headers: jsonContentHeaders,
|
|
309
|
+
method: "POST",
|
|
310
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-routing-policy`
|
|
311
|
+
},
|
|
312
|
+
unmarshalLink
|
|
313
|
+
);
|
|
314
|
+
/**
|
|
315
|
+
* 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.
|
|
316
|
+
*
|
|
317
|
+
* @param request - The request {@link DetachRoutingPolicyRequest}
|
|
318
|
+
* @returns A Promise of Link
|
|
319
|
+
*/
|
|
320
|
+
detachRoutingPolicy = (request) => this.client.fetch(
|
|
321
|
+
{
|
|
322
|
+
body: "{}",
|
|
323
|
+
headers: jsonContentHeaders,
|
|
324
|
+
method: "POST",
|
|
325
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-routing-policy`
|
|
326
|
+
},
|
|
327
|
+
unmarshalLink
|
|
328
|
+
);
|
|
329
|
+
/**
|
|
330
|
+
* 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.
|
|
331
|
+
*
|
|
332
|
+
* @param request - The request {@link EnableRoutePropagationRequest}
|
|
333
|
+
* @returns A Promise of Link
|
|
334
|
+
*/
|
|
335
|
+
enableRoutePropagation = (request) => this.client.fetch(
|
|
336
|
+
{
|
|
337
|
+
body: "{}",
|
|
338
|
+
headers: jsonContentHeaders,
|
|
339
|
+
method: "POST",
|
|
340
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/enable-route-propagation`
|
|
341
|
+
},
|
|
342
|
+
unmarshalLink
|
|
343
|
+
);
|
|
344
|
+
/**
|
|
345
|
+
* 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.
|
|
346
|
+
*
|
|
347
|
+
* @param request - The request {@link DisableRoutePropagationRequest}
|
|
348
|
+
* @returns A Promise of Link
|
|
349
|
+
*/
|
|
350
|
+
disableRoutePropagation = (request) => this.client.fetch(
|
|
351
|
+
{
|
|
352
|
+
body: "{}",
|
|
353
|
+
headers: jsonContentHeaders,
|
|
354
|
+
method: "POST",
|
|
355
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/disable-route-propagation`
|
|
356
|
+
},
|
|
357
|
+
unmarshalLink
|
|
358
|
+
);
|
|
359
|
+
pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
|
|
360
|
+
{
|
|
361
|
+
method: "GET",
|
|
362
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
|
|
363
|
+
urlParams: urlParams(
|
|
364
|
+
["name", request.name],
|
|
365
|
+
["order_by", request.orderBy],
|
|
366
|
+
["organization_id", request.organizationId],
|
|
367
|
+
["page", request.page],
|
|
368
|
+
[
|
|
369
|
+
"page_size",
|
|
370
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
371
|
+
],
|
|
372
|
+
["project_id", request.projectId],
|
|
373
|
+
["tags", request.tags]
|
|
374
|
+
)
|
|
375
|
+
},
|
|
376
|
+
unmarshalListRoutingPoliciesResponse
|
|
377
|
+
);
|
|
378
|
+
/**
|
|
379
|
+
* List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple links (InterLink connections).
|
|
380
|
+
*
|
|
381
|
+
* @param request - The request {@link ListRoutingPoliciesRequest}
|
|
382
|
+
* @returns A Promise of ListRoutingPoliciesResponse
|
|
383
|
+
*/
|
|
384
|
+
listRoutingPolicies = (request = {}) => enrichForPagination(
|
|
385
|
+
"routingPolicies",
|
|
386
|
+
this.pageOfListRoutingPolicies,
|
|
387
|
+
request
|
|
388
|
+
);
|
|
389
|
+
/**
|
|
390
|
+
* 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.
|
|
391
|
+
*
|
|
392
|
+
* @param request - The request {@link GetRoutingPolicyRequest}
|
|
393
|
+
* @returns A Promise of RoutingPolicy
|
|
394
|
+
*/
|
|
395
|
+
getRoutingPolicy = (request) => this.client.fetch(
|
|
396
|
+
{
|
|
397
|
+
method: "GET",
|
|
398
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
|
|
399
|
+
},
|
|
400
|
+
unmarshalRoutingPolicy
|
|
401
|
+
);
|
|
402
|
+
/**
|
|
403
|
+
* 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.
|
|
404
|
+
*
|
|
405
|
+
* @param request - The request {@link CreateRoutingPolicyRequest}
|
|
406
|
+
* @returns A Promise of RoutingPolicy
|
|
407
|
+
*/
|
|
408
|
+
createRoutingPolicy = (request) => this.client.fetch(
|
|
409
|
+
{
|
|
410
|
+
body: JSON.stringify(
|
|
411
|
+
marshalCreateRoutingPolicyRequest(request, this.client.settings)
|
|
412
|
+
),
|
|
413
|
+
headers: jsonContentHeaders,
|
|
414
|
+
method: "POST",
|
|
415
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
|
|
416
|
+
},
|
|
417
|
+
unmarshalRoutingPolicy
|
|
418
|
+
);
|
|
419
|
+
/**
|
|
420
|
+
* 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.
|
|
421
|
+
*
|
|
422
|
+
* @param request - The request {@link UpdateRoutingPolicyRequest}
|
|
423
|
+
* @returns A Promise of RoutingPolicy
|
|
424
|
+
*/
|
|
425
|
+
updateRoutingPolicy = (request) => this.client.fetch(
|
|
426
|
+
{
|
|
427
|
+
body: JSON.stringify(
|
|
428
|
+
marshalUpdateRoutingPolicyRequest(request, this.client.settings)
|
|
429
|
+
),
|
|
430
|
+
headers: jsonContentHeaders,
|
|
431
|
+
method: "PATCH",
|
|
432
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
|
|
433
|
+
},
|
|
434
|
+
unmarshalRoutingPolicy
|
|
435
|
+
);
|
|
436
|
+
/**
|
|
437
|
+
* Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
|
|
438
|
+
*
|
|
439
|
+
* @param request - The request {@link DeleteRoutingPolicyRequest}
|
|
440
|
+
*/
|
|
441
|
+
deleteRoutingPolicy = (request) => this.client.fetch({
|
|
442
|
+
method: "DELETE",
|
|
443
|
+
path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
export {
|
|
447
|
+
API
|
|
448
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const DEDICATED_CONNECTION_TRANSIENT_STATUSES = ["configuring"];
|
|
4
|
+
const LINK_TRANSIENT_STATUSES = ["configuring"];
|
|
5
|
+
exports.DEDICATED_CONNECTION_TRANSIENT_STATUSES = DEDICATED_CONNECTION_TRANSIENT_STATUSES;
|
|
6
|
+
exports.LINK_TRANSIENT_STATUSES = LINK_TRANSIENT_STATUSES;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DedicatedConnectionStatus, LinkStatus } from './types.gen';
|
|
2
|
+
/** Lists transient statutes of the enum {@link DedicatedConnectionStatus}. */
|
|
3
|
+
export declare const DEDICATED_CONNECTION_TRANSIENT_STATUSES: DedicatedConnectionStatus[];
|
|
4
|
+
/** Lists transient statutes of the enum {@link LinkStatus}. */
|
|
5
|
+
export declare const LINK_TRANSIENT_STATUSES: LinkStatus[];
|