Skip to content

Commit 1be85c7

Browse files
feat(vpc): enable call to enable vpc custom routes and pn default route propagation as unlisted (#2162)
Co-authored-by: Mia-Cross <[email protected]>
1 parent eed20a9 commit 1be85c7

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

packages_generated/vpc/src/v2/api.gen.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import type {
3939
DeleteSubnetsRequest,
4040
DeleteSubnetsResponse,
4141
DeleteVPCRequest,
42+
EnableCustomRoutesPropagationRequest,
4243
EnableDHCPRequest,
4344
EnableRoutingRequest,
4445
GetAclRequest,
@@ -312,6 +313,25 @@ export class API extends ParentAPI {
312313
unmarshalVPC,
313314
)
314315

316+
/**
317+
* Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
318+
*
319+
* @param request - The request {@link EnableCustomRoutesPropagationRequest}
320+
* @returns A Promise of VPC
321+
*/
322+
enableCustomRoutesPropagation = (
323+
request: Readonly<EnableCustomRoutesPropagationRequest>,
324+
) =>
325+
this.client.fetch<VPC>(
326+
{
327+
body: '{}',
328+
headers: jsonContentHeaders,
329+
method: 'POST',
330+
path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}/enable-custom-routes-propagation`,
331+
},
332+
unmarshalVPC,
333+
)
334+
315335
protected pageOfListSubnets = (request: Readonly<ListSubnetsRequest> = {}) =>
316336
this.client.fetch<ListSubnetsResponse>(
317337
{

packages_generated/vpc/src/v2/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export type {
1616
DeleteSubnetsRequest,
1717
DeleteSubnetsResponse,
1818
DeleteVPCRequest,
19+
EnableCustomRoutesPropagationRequest,
1920
EnableDHCPRequest,
2021
EnableRoutingRequest,
2122
GetAclRequest,

packages_generated/vpc/src/v2/marshalling.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const unmarshalVPC = (data: unknown): VPC => {
103103

104104
return {
105105
createdAt: unmarshalDate(data.created_at),
106+
customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
106107
id: data.id,
107108
isDefault: data.is_default,
108109
name: data.name,

packages_generated/vpc/src/v2/types.gen.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ export interface VPC {
233233
* Defines whether the VPC routes traffic between its Private Networks.
234234
*/
235235
routingEnabled: boolean
236+
/**
237+
* Defines whether the VPC advertises custom routes between its Private Networks.
238+
*/
239+
customRoutesPropagationEnabled: boolean
236240
}
237241

238242
export type AddSubnetsRequest = {
@@ -391,6 +395,17 @@ export type DeleteVPCRequest = {
391395
vpcId: string
392396
}
393397

398+
export type EnableCustomRoutesPropagationRequest = {
399+
/**
400+
* Region to target. If none is passed will use default region from the config.
401+
*/
402+
region?: ScwRegion
403+
/**
404+
* VPC ID.
405+
*/
406+
vpcId: string
407+
}
408+
394409
export type EnableDHCPRequest = {
395410
/**
396411
* Region to target. If none is passed will use default region from the config.

0 commit comments

Comments
 (0)