Skip to content

Commit 7b31ffb

Browse files
committed
feat: update generated APIs
1 parent 54576e5 commit 7b31ffb

File tree

7 files changed

+129
-1
lines changed

7 files changed

+129
-1
lines changed

packages_generated/instance/src/v1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export type {
116116
PlanBlockMigrationRequest,
117117
PrivateNIC,
118118
PrivateNICState,
119+
ReleaseIpToIpamRequest,
119120
SecurityGroup,
120121
SecurityGroupPolicy,
121122
SecurityGroupRule,

packages_generated/interlink/src/v1beta1/api.gen.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
marshalCreateLinkRequest,
2121
marshalCreateRoutingPolicyRequest,
2222
marshalDetachRoutingPolicyRequest,
23+
marshalSetRoutingPolicyRequest,
2324
marshalUpdateLinkRequest,
2425
marshalUpdateRoutingPolicyRequest,
2526
unmarshalDedicatedConnection,
@@ -64,6 +65,7 @@ import type {
6465
Partner,
6566
Pop,
6667
RoutingPolicy,
68+
SetRoutingPolicyRequest,
6769
UpdateLinkRequest,
6870
UpdateRoutingPolicyRequest,
6971
} from './types.gen'
@@ -461,6 +463,25 @@ export class API extends ParentAPI {
461463
unmarshalLink,
462464
)
463465

466+
/**
467+
* Set a routing policy. Replace a routing policy from an existing link. This is usefull when route propagation is enabled because it changes the routing policy "in place", without blocking all routes like a attach / detach would do.
468+
*
469+
* @param request - The request {@link SetRoutingPolicyRequest}
470+
* @returns A Promise of Link
471+
*/
472+
setRoutingPolicy = (request: Readonly<SetRoutingPolicyRequest>) =>
473+
this.client.fetch<Link>(
474+
{
475+
body: JSON.stringify(
476+
marshalSetRoutingPolicyRequest(request, this.client.settings),
477+
),
478+
headers: jsonContentHeaders,
479+
method: 'POST',
480+
path: `/interlink/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam('linkId', request.linkId)}/set-routing-policy`,
481+
},
482+
unmarshalLink,
483+
)
484+
464485
/**
465486
* 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.
466487
*

packages_generated/interlink/src/v1beta1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export type {
4646
Pop,
4747
RoutingPolicy,
4848
SelfHost,
49+
SetRoutingPolicyRequest,
4950
UpdateLinkRequest,
5051
UpdateRoutingPolicyRequest,
5152
} from './types.gen'

packages_generated/interlink/src/v1beta1/marshalling.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import type {
2727
Pop,
2828
RoutingPolicy,
2929
SelfHost,
30+
SetRoutingPolicyRequest,
3031
UpdateLinkRequest,
3132
UpdateRoutingPolicyRequest,
3233
} from './types.gen'
@@ -296,6 +297,8 @@ export const marshalCreateLinkRequest = (
296297
peer_asn: request.peerAsn,
297298
pop_id: request.popId,
298299
project_id: request.projectId ?? defaults.defaultProjectId,
300+
routing_policy_v4_id: request.routingPolicyV4Id,
301+
routing_policy_v6_id: request.routingPolicyV6Id,
299302
tags: request.tags,
300303
vlan: request.vlan,
301304
...resolveOneOf([
@@ -323,6 +326,13 @@ export const marshalDetachRoutingPolicyRequest = (
323326
routing_policy_id: request.routingPolicyId,
324327
})
325328

329+
export const marshalSetRoutingPolicyRequest = (
330+
request: SetRoutingPolicyRequest,
331+
defaults: DefaultValues,
332+
): Record<string, unknown> => ({
333+
routing_policy_id: request.routingPolicyId,
334+
})
335+
326336
export const marshalUpdateLinkRequest = (
327337
request: UpdateLinkRequest,
328338
defaults: DefaultValues,

packages_generated/interlink/src/v1beta1/types.gen.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// If you have any remark or suggestion do not hesitate to open an issue.
33
import type { Region as ScwRegion } from '@scaleway/sdk-client'
44

5-
export type BgpStatus = 'unknown_bgp_status' | 'up' | 'down'
5+
export type BgpStatus = 'unknown_bgp_status' | 'up' | 'down' | 'disabled'
66

77
export type DedicatedConnectionStatus =
88
| 'unknown_status'
@@ -30,6 +30,7 @@ export type LinkStatus =
3030
| 'deprovisioning'
3131
| 'deleted'
3232
| 'locked'
33+
| 'ready'
3334

3435
export type ListDedicatedConnectionsRequestOrderBy =
3536
| 'created_at_asc'
@@ -438,6 +439,14 @@ export type CreateLinkRequest = {
438439
* 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.
439440
*/
440441
vlan?: number
442+
/**
443+
* If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created.
444+
*/
445+
routingPolicyV4Id?: string
446+
/**
447+
* If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created.
448+
*/
449+
routingPolicyV6Id?: string
441450
}
442451

443452
export type CreateRoutingPolicyRequest = {
@@ -872,6 +881,21 @@ export interface ListRoutingPoliciesResponse {
872881
totalCount: number
873882
}
874883

884+
export type SetRoutingPolicyRequest = {
885+
/**
886+
* Region to target. If none is passed will use default region from the config.
887+
*/
888+
region?: ScwRegion
889+
/**
890+
* ID of the link to set a routing policy from.
891+
*/
892+
linkId: string
893+
/**
894+
* ID of the routing policy to be set.
895+
*/
896+
routingPolicyId: string
897+
}
898+
875899
export type UpdateLinkRequest = {
876900
/**
877901
* Region to target. If none is passed will use default region from the config.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* This file is automatically generated
3+
* PLEASE DO NOT EDIT HERE
4+
*/
5+
6+
export * as S2sVpnv1alpha1 from './v1alpha1/index.gen'
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// This file was automatically generated. DO NOT EDIT.
2+
// If you have any remark or suggestion do not hesitate to open an issue.
3+
export { API } from './api.gen'
4+
export * from './content.gen'
5+
export * from './marshalling.gen'
6+
export type {
7+
BgpSession,
8+
BgpSessionStatus,
9+
Connection,
10+
ConnectionCipher,
11+
ConnectionDhGroup,
12+
ConnectionEncryption,
13+
ConnectionInitiationPolicy,
14+
ConnectionIntegrity,
15+
ConnectionStatus,
16+
CreateConnectionRequest,
17+
CreateConnectionRequestBgpConfig,
18+
CreateConnectionRequestInitiationPolicy,
19+
CreateConnectionResponse,
20+
CreateCustomerGatewayRequest,
21+
CreateRoutingPolicyRequest,
22+
CreateVpnGatewayRequest,
23+
CreateVpnGatewayRequestPublicConfig,
24+
CustomerGateway,
25+
DeleteConnectionRequest,
26+
DeleteCustomerGatewayRequest,
27+
DeleteRoutingPolicyRequest,
28+
DeleteVpnGatewayRequest,
29+
DetachRoutingPolicyRequest,
30+
DisableRoutePropagationRequest,
31+
EnableRoutePropagationRequest,
32+
GatewayType,
33+
GetConnectionRequest,
34+
GetCustomerGatewayRequest,
35+
GetRoutingPolicyRequest,
36+
GetVpnGatewayRequest,
37+
ListConnectionsRequest,
38+
ListConnectionsRequestOrderBy,
39+
ListConnectionsResponse,
40+
ListCustomerGatewaysRequest,
41+
ListCustomerGatewaysRequestOrderBy,
42+
ListCustomerGatewaysResponse,
43+
ListRoutingPoliciesRequest,
44+
ListRoutingPoliciesRequestOrderBy,
45+
ListRoutingPoliciesResponse,
46+
ListVpnGatewaysRequest,
47+
ListVpnGatewaysRequestOrderBy,
48+
ListVpnGatewaysResponse,
49+
ListVpnGatewayTypesRequest,
50+
ListVpnGatewayTypesResponse,
51+
RenewConnectionPskRequest,
52+
RenewConnectionPskResponse,
53+
RoutingPolicy,
54+
SetRoutingPolicyRequest,
55+
TunnelStatus,
56+
UpdateConnectionRequest,
57+
UpdateCustomerGatewayRequest,
58+
UpdateRoutingPolicyRequest,
59+
UpdateVpnGatewayRequest,
60+
VpnGateway,
61+
VpnGatewayPrivateConfig,
62+
VpnGatewayPublicConfig,
63+
VpnGatewayStatus,
64+
} from './types.gen'
65+
export * as ValidationRules from './validation-rules.gen'

0 commit comments

Comments
 (0)