@scaleway/sdk-interlink 1.0.3 → 1.1.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,
@@ -219,12 +222,16 @@ const marshalCreateLinkRequest = (request, defaults) => ({
219
222
  ])
220
223
  });
221
224
  const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
225
+ is_ipv6: request.isIpv6,
222
226
  name: request.name,
223
227
  prefix_filter_in: request.prefixFilterIn,
224
228
  prefix_filter_out: request.prefixFilterOut,
225
229
  project_id: request.projectId ?? defaults.defaultProjectId,
226
230
  tags: request.tags
227
231
  });
232
+ const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
233
+ routing_policy_id: request.routingPolicyId
234
+ });
228
235
  const marshalUpdateLinkRequest = (request, defaults) => ({
229
236
  name: request.name,
230
237
  peer_asn: request.peerAsn,
@@ -240,6 +247,7 @@ exports.marshalAttachRoutingPolicyRequest = marshalAttachRoutingPolicyRequest;
240
247
  exports.marshalAttachVpcRequest = marshalAttachVpcRequest;
241
248
  exports.marshalCreateLinkRequest = marshalCreateLinkRequest;
242
249
  exports.marshalCreateRoutingPolicyRequest = marshalCreateRoutingPolicyRequest;
250
+ exports.marshalDetachRoutingPolicyRequest = marshalDetachRoutingPolicyRequest;
243
251
  exports.marshalUpdateLinkRequest = marshalUpdateLinkRequest;
244
252
  exports.marshalUpdateRoutingPolicyRequest = marshalUpdateRoutingPolicyRequest;
245
253
  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,
@@ -217,12 +220,16 @@ const marshalCreateLinkRequest = (request, defaults) => ({
217
220
  ])
218
221
  });
219
222
  const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
223
+ is_ipv6: request.isIpv6,
220
224
  name: request.name,
221
225
  prefix_filter_in: request.prefixFilterIn,
222
226
  prefix_filter_out: request.prefixFilterOut,
223
227
  project_id: request.projectId ?? defaults.defaultProjectId,
224
228
  tags: request.tags
225
229
  });
230
+ const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
231
+ routing_policy_id: request.routingPolicyId
232
+ });
226
233
  const marshalUpdateLinkRequest = (request, defaults) => ({
227
234
  name: request.name,
228
235
  peer_asn: request.peerAsn,
@@ -239,6 +246,7 @@ export {
239
246
  marshalAttachVpcRequest,
240
247
  marshalCreateLinkRequest,
241
248
  marshalCreateRoutingPolicyRequest,
249
+ marshalDetachRoutingPolicyRequest,
242
250
  marshalUpdateLinkRequest,
243
251
  marshalUpdateRoutingPolicyRequest,
244
252
  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
  */
@@ -387,6 +399,10 @@ export type CreateRoutingPolicyRequest = {
387
399
  * IP prefix filters to advertise to the peer (ranges of routes to advertise).
388
400
  */
389
401
  prefixFilterOut?: string[];
402
+ /**
403
+ * IP prefixes version of the routing policy.
404
+ */
405
+ isIpv6: boolean;
390
406
  };
391
407
  export type DeleteLinkRequest = {
392
408
  /**
@@ -417,6 +433,10 @@ export type DetachRoutingPolicyRequest = {
417
433
  * ID of the link to detach a routing policy from.
418
434
  */
419
435
  linkId: string;
436
+ /**
437
+ * ID of the routing policy to be detached.
438
+ */
439
+ routingPolicyId: string;
420
440
  };
421
441
  export type DetachVpcRequest = {
422
442
  /**
@@ -755,6 +775,10 @@ export type ListRoutingPoliciesRequest = {
755
775
  * Tags to filter for.
756
776
  */
757
777
  tags?: string[];
778
+ /**
779
+ * Filter for the routing policies based on IP prefixes version.
780
+ */
781
+ ipv6?: boolean;
758
782
  };
759
783
  export interface ListRoutingPoliciesResponse {
760
784
  routingPolicies: RoutingPolicy[];
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-interlink",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Scaleway SDK interlink",
5
- "types": "dist/index.d.ts",
5
+ "license": "Apache-2.0",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.3"
33
+ "@scaleway/sdk-std": "1.0.5"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.2"
36
+ "@scaleway/sdk-client": "^1.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.2"
39
+ "@scaleway/sdk-client": "^1.3.0"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",