@scaleway/sdk-interlink 1.0.4 → 1.2.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.
@@ -7,12 +7,13 @@ const jsonContentHeaders = {
7
7
  "Content-Type": "application/json; charset=utf-8"
8
8
  };
9
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
- ];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = sdkClient.toApiLocality({
15
+ regions: ["fr-par", "nl-ams", "pl-waw"]
16
+ });
16
17
  pageOfListDedicatedConnections = (request = {}) => this.client.fetch(
17
18
  {
18
19
  method: "GET",
@@ -321,7 +322,9 @@ class API extends sdkClient.API {
321
322
  */
322
323
  detachRoutingPolicy = (request) => this.client.fetch(
323
324
  {
324
- body: "{}",
325
+ body: JSON.stringify(
326
+ marshalling_gen.marshalDetachRoutingPolicyRequest(request, this.client.settings)
327
+ ),
325
328
  headers: jsonContentHeaders,
326
329
  method: "POST",
327
330
  path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${sdkClient.validatePathParam("linkId", request.linkId)}/detach-routing-policy`
@@ -363,6 +366,7 @@ class API extends sdkClient.API {
363
366
  method: "GET",
364
367
  path: `/interlink/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
365
368
  urlParams: sdkClient.urlParams(
369
+ ["ipv6", request.ipv6],
366
370
  ["name", request.name],
367
371
  ["order_by", request.orderBy],
368
372
  ["organization_id", request.organizationId],
@@ -1,5 +1,5 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Region as ScwRegion, WaitForOptions } from '@scaleway/sdk-client';
2
+ import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
3
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
4
  /**
5
5
  * InterLink API.
@@ -7,8 +7,11 @@ import type { AttachRoutingPolicyRequest, AttachVpcRequest, CreateLinkRequest, C
7
7
  This API allows you to manage your Scaleway InterLink, to connect your on-premises infrastructure with your Scaleway VPC.
8
8
  */
9
9
  export declare class API extends ParentAPI {
10
- /** Lists the available regions of the API. */
11
- static readonly LOCALITIES: ScwRegion[];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
12
15
  protected pageOfListDedicatedConnections: (request?: Readonly<ListDedicatedConnectionsRequest>) => Promise<ListDedicatedConnectionsResponse>;
13
16
  /**
14
17
  * 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.
@@ -1,16 +1,17 @@
1
- import { API as API$1, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
1
+ import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
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";
3
+ import { unmarshalListDedicatedConnectionsResponse, unmarshalDedicatedConnection, unmarshalListPartnersResponse, unmarshalPartner, unmarshalListPopsResponse, unmarshalPop, unmarshalListLinksResponse, unmarshalLink, marshalCreateLinkRequest, marshalUpdateLinkRequest, marshalAttachVpcRequest, marshalAttachRoutingPolicyRequest, marshalDetachRoutingPolicyRequest, unmarshalListRoutingPoliciesResponse, unmarshalRoutingPolicy, marshalCreateRoutingPolicyRequest, marshalUpdateRoutingPolicyRequest } from "./marshalling.gen.js";
4
4
  const jsonContentHeaders = {
5
5
  "Content-Type": "application/json; charset=utf-8"
6
6
  };
7
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
- ];
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
+ });
14
15
  pageOfListDedicatedConnections = (request = {}) => this.client.fetch(
15
16
  {
16
17
  method: "GET",
@@ -319,7 +320,9 @@ class API extends API$1 {
319
320
  */
320
321
  detachRoutingPolicy = (request) => this.client.fetch(
321
322
  {
322
- body: "{}",
323
+ body: JSON.stringify(
324
+ marshalDetachRoutingPolicyRequest(request, this.client.settings)
325
+ ),
323
326
  headers: jsonContentHeaders,
324
327
  method: "POST",
325
328
  path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-routing-policy`
@@ -361,6 +364,7 @@ class API extends API$1 {
361
364
  method: "GET",
362
365
  path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
363
366
  urlParams: urlParams(
367
+ ["ipv6", request.ipv6],
364
368
  ["name", request.name],
365
369
  ["order_by", request.orderBy],
366
370
  ["organization_id", request.organizationId],
@@ -11,6 +11,7 @@ exports.marshalAttachRoutingPolicyRequest = marshalling_gen.marshalAttachRouting
11
11
  exports.marshalAttachVpcRequest = marshalling_gen.marshalAttachVpcRequest;
12
12
  exports.marshalCreateLinkRequest = marshalling_gen.marshalCreateLinkRequest;
13
13
  exports.marshalCreateRoutingPolicyRequest = marshalling_gen.marshalCreateRoutingPolicyRequest;
14
+ exports.marshalDetachRoutingPolicyRequest = marshalling_gen.marshalDetachRoutingPolicyRequest;
14
15
  exports.marshalUpdateLinkRequest = marshalling_gen.marshalUpdateLinkRequest;
15
16
  exports.marshalUpdateRoutingPolicyRequest = marshalling_gen.marshalUpdateRoutingPolicyRequest;
16
17
  exports.unmarshalDedicatedConnection = marshalling_gen.unmarshalDedicatedConnection;
@@ -1,6 +1,6 @@
1
1
  import { API } from "./api.gen.js";
2
2
  import { DEDICATED_CONNECTION_TRANSIENT_STATUSES, LINK_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalAttachRoutingPolicyRequest, marshalAttachVpcRequest, marshalCreateLinkRequest, marshalCreateRoutingPolicyRequest, marshalUpdateLinkRequest, marshalUpdateRoutingPolicyRequest, unmarshalDedicatedConnection, unmarshalLink, unmarshalListDedicatedConnectionsResponse, unmarshalListLinksResponse, unmarshalListPartnersResponse, unmarshalListPopsResponse, unmarshalListRoutingPoliciesResponse, unmarshalPartner, unmarshalPop, unmarshalRoutingPolicy } from "./marshalling.gen.js";
3
+ import { marshalAttachRoutingPolicyRequest, marshalAttachVpcRequest, marshalCreateLinkRequest, marshalCreateRoutingPolicyRequest, marshalDetachRoutingPolicyRequest, marshalUpdateLinkRequest, marshalUpdateRoutingPolicyRequest, unmarshalDedicatedConnection, unmarshalLink, unmarshalListDedicatedConnectionsResponse, unmarshalListLinksResponse, unmarshalListPartnersResponse, unmarshalListPopsResponse, unmarshalListRoutingPoliciesResponse, unmarshalPartner, unmarshalPop, unmarshalRoutingPolicy } from "./marshalling.gen.js";
4
4
  import * as validationRules_gen from "./validation-rules.gen.js";
5
5
  export {
6
6
  API,
@@ -11,6 +11,7 @@ export {
11
11
  marshalAttachVpcRequest,
12
12
  marshalCreateLinkRequest,
13
13
  marshalCreateRoutingPolicyRequest,
14
+ marshalDetachRoutingPolicyRequest,
14
15
  marshalUpdateLinkRequest,
15
16
  marshalUpdateRoutingPolicyRequest,
16
17
  unmarshalDedicatedConnection,
@@ -78,6 +78,8 @@ const unmarshalLink = (data) => {
78
78
  projectId: data.project_id,
79
79
  region: data.region,
80
80
  routingPolicyId: data.routing_policy_id,
81
+ routingPolicyV4Id: data.routing_policy_v4_id,
82
+ routingPolicyV6Id: data.routing_policy_v6_id,
81
83
  scwBgpConfig: data.scw_bgp_config ? unmarshalBgpConfig(data.scw_bgp_config) : void 0,
82
84
  self: data.self ? unmarshalSelfHost(data.self) : void 0,
83
85
  status: data.status,
@@ -129,6 +131,7 @@ const unmarshalRoutingPolicy = (data) => {
129
131
  return {
130
132
  createdAt: sdkClient.unmarshalDate(data.created_at),
131
133
  id: data.id,
134
+ isIpv6: data.is_ipv6,
132
135
  name: data.name,
133
136
  organizationId: data.organization_id,
134
137
  prefixFilterIn: data.prefix_filter_in,
@@ -213,18 +216,23 @@ const marshalCreateLinkRequest = (request, defaults) => ({
213
216
  pop_id: request.popId,
214
217
  project_id: request.projectId ?? defaults.defaultProjectId,
215
218
  tags: request.tags,
219
+ vlan: request.vlan,
216
220
  ...sdkClient.resolveOneOf([
217
221
  { param: "connection_id", value: request.connectionId },
218
222
  { param: "partner_id", value: request.partnerId }
219
223
  ])
220
224
  });
221
225
  const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
226
+ is_ipv6: request.isIpv6,
222
227
  name: request.name,
223
228
  prefix_filter_in: request.prefixFilterIn,
224
229
  prefix_filter_out: request.prefixFilterOut,
225
230
  project_id: request.projectId ?? defaults.defaultProjectId,
226
231
  tags: request.tags
227
232
  });
233
+ const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
234
+ routing_policy_id: request.routingPolicyId
235
+ });
228
236
  const marshalUpdateLinkRequest = (request, defaults) => ({
229
237
  name: request.name,
230
238
  peer_asn: request.peerAsn,
@@ -240,6 +248,7 @@ exports.marshalAttachRoutingPolicyRequest = marshalAttachRoutingPolicyRequest;
240
248
  exports.marshalAttachVpcRequest = marshalAttachVpcRequest;
241
249
  exports.marshalCreateLinkRequest = marshalCreateLinkRequest;
242
250
  exports.marshalCreateRoutingPolicyRequest = marshalCreateRoutingPolicyRequest;
251
+ exports.marshalDetachRoutingPolicyRequest = marshalDetachRoutingPolicyRequest;
243
252
  exports.marshalUpdateLinkRequest = marshalUpdateLinkRequest;
244
253
  exports.marshalUpdateRoutingPolicyRequest = marshalUpdateRoutingPolicyRequest;
245
254
  exports.unmarshalDedicatedConnection = unmarshalDedicatedConnection;
@@ -1,5 +1,5 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { AttachRoutingPolicyRequest, AttachVpcRequest, CreateLinkRequest, CreateRoutingPolicyRequest, DedicatedConnection, Link, ListDedicatedConnectionsResponse, ListLinksResponse, ListPartnersResponse, ListPopsResponse, ListRoutingPoliciesResponse, Partner, Pop, RoutingPolicy, UpdateLinkRequest, UpdateRoutingPolicyRequest } from './types.gen';
2
+ import type { AttachRoutingPolicyRequest, AttachVpcRequest, CreateLinkRequest, CreateRoutingPolicyRequest, DedicatedConnection, DetachRoutingPolicyRequest, Link, ListDedicatedConnectionsResponse, ListLinksResponse, ListPartnersResponse, ListPopsResponse, ListRoutingPoliciesResponse, Partner, Pop, RoutingPolicy, UpdateLinkRequest, UpdateRoutingPolicyRequest } from './types.gen';
3
3
  export declare const unmarshalDedicatedConnection: (data: unknown) => DedicatedConnection;
4
4
  export declare const unmarshalLink: (data: unknown) => Link;
5
5
  export declare const unmarshalPartner: (data: unknown) => Partner;
@@ -14,5 +14,6 @@ export declare const marshalAttachRoutingPolicyRequest: (request: AttachRoutingP
14
14
  export declare const marshalAttachVpcRequest: (request: AttachVpcRequest, defaults: DefaultValues) => Record<string, unknown>;
15
15
  export declare const marshalCreateLinkRequest: (request: CreateLinkRequest, defaults: DefaultValues) => Record<string, unknown>;
16
16
  export declare const marshalCreateRoutingPolicyRequest: (request: CreateRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
17
+ export declare const marshalDetachRoutingPolicyRequest: (request: DetachRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
17
18
  export declare const marshalUpdateLinkRequest: (request: UpdateLinkRequest, defaults: DefaultValues) => Record<string, unknown>;
18
19
  export declare const marshalUpdateRoutingPolicyRequest: (request: UpdateRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
1
+ import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  const unmarshalDedicatedConnection = (data) => {
3
3
  if (!isJSONObject(data)) {
4
4
  throw new TypeError(
@@ -76,6 +76,8 @@ const unmarshalLink = (data) => {
76
76
  projectId: data.project_id,
77
77
  region: data.region,
78
78
  routingPolicyId: data.routing_policy_id,
79
+ routingPolicyV4Id: data.routing_policy_v4_id,
80
+ routingPolicyV6Id: data.routing_policy_v6_id,
79
81
  scwBgpConfig: data.scw_bgp_config ? unmarshalBgpConfig(data.scw_bgp_config) : void 0,
80
82
  self: data.self ? unmarshalSelfHost(data.self) : void 0,
81
83
  status: data.status,
@@ -127,6 +129,7 @@ const unmarshalRoutingPolicy = (data) => {
127
129
  return {
128
130
  createdAt: unmarshalDate(data.created_at),
129
131
  id: data.id,
132
+ isIpv6: data.is_ipv6,
130
133
  name: data.name,
131
134
  organizationId: data.organization_id,
132
135
  prefixFilterIn: data.prefix_filter_in,
@@ -211,18 +214,23 @@ const marshalCreateLinkRequest = (request, defaults) => ({
211
214
  pop_id: request.popId,
212
215
  project_id: request.projectId ?? defaults.defaultProjectId,
213
216
  tags: request.tags,
217
+ vlan: request.vlan,
214
218
  ...resolveOneOf([
215
219
  { param: "connection_id", value: request.connectionId },
216
220
  { param: "partner_id", value: request.partnerId }
217
221
  ])
218
222
  });
219
223
  const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
224
+ is_ipv6: request.isIpv6,
220
225
  name: request.name,
221
226
  prefix_filter_in: request.prefixFilterIn,
222
227
  prefix_filter_out: request.prefixFilterOut,
223
228
  project_id: request.projectId ?? defaults.defaultProjectId,
224
229
  tags: request.tags
225
230
  });
231
+ const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
232
+ routing_policy_id: request.routingPolicyId
233
+ });
226
234
  const marshalUpdateLinkRequest = (request, defaults) => ({
227
235
  name: request.name,
228
236
  peer_asn: request.peerAsn,
@@ -239,6 +247,7 @@ export {
239
247
  marshalAttachVpcRequest,
240
248
  marshalCreateLinkRequest,
241
249
  marshalCreateRoutingPolicyRequest,
250
+ marshalDetachRoutingPolicyRequest,
242
251
  marshalUpdateLinkRequest,
243
252
  marshalUpdateRoutingPolicyRequest,
244
253
  unmarshalDedicatedConnection,
@@ -142,7 +142,7 @@ export interface Link {
142
142
  */
143
143
  vpcId?: string;
144
144
  /**
145
- * ID of the routing policy attached to the link.
145
+ * @deprecated Deprecated. Use routing_policy_v4_id or routing_policy_v6_id instead.
146
146
  */
147
147
  routingPolicyId?: string;
148
148
  /**
@@ -181,6 +181,14 @@ export interface Link {
181
181
  * BGP configuration on peer's side (on-premises or other hosting provider).
182
182
  */
183
183
  peerBgpConfig?: BgpConfig;
184
+ /**
185
+ * ID of the routing policy IPv4 attached to the link.
186
+ */
187
+ routingPolicyV4Id?: string;
188
+ /**
189
+ * ID of the routing policy IPv6 attached to the link.
190
+ */
191
+ routingPolicyV6Id?: string;
184
192
  /**
185
193
  * Region of the link.
186
194
  */
@@ -287,6 +295,10 @@ export interface RoutingPolicy {
287
295
  * Last modification date of the routing policy.
288
296
  */
289
297
  updatedAt?: Date;
298
+ /**
299
+ * IP prefixes version of the routing policy.
300
+ */
301
+ isIpv6: boolean;
290
302
  /**
291
303
  * Region of the routing policy.
292
304
  */
@@ -361,6 +373,10 @@ export type CreateLinkRequest = {
361
373
  * For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
362
374
  */
363
375
  peerAsn?: number;
376
+ /**
377
+ * For self-hosted links only, it is possible to choose the VLAN ID. If the VLAN is not available (ie already taken or out of range), an error is returned.
378
+ */
379
+ vlan?: number;
364
380
  };
365
381
  export type CreateRoutingPolicyRequest = {
366
382
  /**
@@ -387,6 +403,10 @@ export type CreateRoutingPolicyRequest = {
387
403
  * IP prefix filters to advertise to the peer (ranges of routes to advertise).
388
404
  */
389
405
  prefixFilterOut?: string[];
406
+ /**
407
+ * IP prefixes version of the routing policy.
408
+ */
409
+ isIpv6: boolean;
390
410
  };
391
411
  export type DeleteLinkRequest = {
392
412
  /**
@@ -417,6 +437,10 @@ export type DetachRoutingPolicyRequest = {
417
437
  * ID of the link to detach a routing policy from.
418
438
  */
419
439
  linkId: string;
440
+ /**
441
+ * ID of the routing policy to be detached.
442
+ */
443
+ routingPolicyId: string;
420
444
  };
421
445
  export type DetachVpcRequest = {
422
446
  /**
@@ -755,6 +779,10 @@ export type ListRoutingPoliciesRequest = {
755
779
  * Tags to filter for.
756
780
  */
757
781
  tags?: string[];
782
+ /**
783
+ * Filter for the routing policies based on IP prefixes version.
784
+ */
785
+ ipv6?: boolean;
758
786
  };
759
787
  export interface ListRoutingPoliciesResponse {
760
788
  routingPolicies: RoutingPolicy[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-interlink",
3
- "version": "1.0.4",
3
+ "version": "1.2.0",
4
4
  "description": "Scaleway SDK interlink",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.4"
33
+ "@scaleway/sdk-std": "1.0.5"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.3"
36
+ "@scaleway/sdk-client": "^1.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.3"
39
+ "@scaleway/sdk-client": "^1.3.0"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",