Skip to content

Commit 706f4a7

Browse files
authored
feat(vpc/v2): allow routing activation on existing VPCs (#1221)
1 parent 48e3b60 commit 706f4a7

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

packages/clients/src/api/vpc/v2/api.gen.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import type {
3434
DeleteSubnetsResponse,
3535
DeleteVPCRequest,
3636
EnableDHCPRequest,
37+
EnableRoutingRequest,
3738
GetPrivateNetworkRequest,
3839
GetVPCRequest,
3940
ListPrivateNetworksRequest,
@@ -310,6 +311,24 @@ export class API extends ParentAPI {
310311
unmarshalPrivateNetwork,
311312
)
312313

314+
/**
315+
* Enable routing on a VPC. Enable routing on an existing VPC. Note that you
316+
* will not be able to deactivate it afterwards.
317+
*
318+
* @param request - The request {@link EnableRoutingRequest}
319+
* @returns A Promise of VPC
320+
*/
321+
enableRouting = (request: Readonly<EnableRoutingRequest>) =>
322+
this.client.fetch<VPC>(
323+
{
324+
body: '{}',
325+
headers: jsonContentHeaders,
326+
method: 'POST',
327+
path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}/enable-routing`,
328+
},
329+
unmarshalVPC,
330+
)
331+
313332
/**
314333
* Set the subnets of a Private Network. Set subnets for an existing Private
315334
* Network. Note that the method is PUT and not PATCH. Any existing subnets

packages/clients/src/api/vpc/v2/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type {
1111
DeleteSubnetsResponse,
1212
DeleteVPCRequest,
1313
EnableDHCPRequest,
14+
EnableRoutingRequest,
1415
GetPrivateNetworkRequest,
1516
GetVPCRequest,
1617
ListPrivateNetworksRequest,

packages/clients/src/api/vpc/v2/types.gen.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ export type EnableDHCPRequest = {
171171
privateNetworkId: string
172172
}
173173

174+
export type EnableRoutingRequest = {
175+
/**
176+
* Region to target. If none is passed will use default region from the
177+
* config.
178+
*/
179+
region?: Region
180+
vpcId: string
181+
}
182+
174183
export type GetPrivateNetworkRequest = {
175184
/**
176185
* Region to target. If none is passed will use default region from the

0 commit comments

Comments
 (0)