Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/clients/src/api/vpc/v2/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,18 @@ export class API extends ParentAPI {
unmarshalListSubnetsResponse,
)

/**
* List subnets. List any Private Network's subnets. See ListPrivateNetworks
* to list a specific Private Network's subnets.
*
* @param request - The request {@link ListSubnetsRequest}
* @returns A Promise of ListSubnetsResponse
*/
listSubnets = (request: Readonly<ListSubnetsRequest> = {}) =>
enrichForPagination('subnets', this.pageOfListSubnets, request)

/**
* Set the subnets of a Private Network. Set subnets for an existing Private
* Set a Private Network's subnets. Set subnets for an existing Private
* Network. Note that the method is PUT and not PATCH. Any existing subnets
* will be removed in favor of the new specified set of subnets.
*
Expand Down
3 changes: 3 additions & 0 deletions packages/clients/src/api/vpc/v2/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ const unmarshalSubnet = (data: unknown): Subnet => {
return {
createdAt: unmarshalDate(data.created_at),
id: data.id,
privateNetworkId: data.private_network_id,
projectId: data.project_id,
subnet: data.subnet,
updatedAt: unmarshalDate(data.updated_at),
vpcId: data.vpc_id,
} as Subnet
}

Expand Down
22 changes: 22 additions & 0 deletions packages/clients/src/api/vpc/v2/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export interface Subnet {
updatedAt?: Date
/** Subnet CIDR. */
subnet: string
/** Scaleway Project the subnet belongs to. */
projectId: string
/** Private Network the subnet belongs to. */
privateNetworkId: string
/** VPC the subnet belongs to. */
vpcId: string
}

export interface PrivateNetwork {
Expand Down Expand Up @@ -262,12 +268,28 @@ export type ListSubnetsRequest = {
* config.
*/
region?: Region
/** Sort order of the returned subnets. */
orderBy?: ListSubnetsRequestOrderBy
/** Page number to return, from the paginated results. */
page?: number
/** Maximum number of Private Networks to return per page. */
pageSize?: number
/**
* Organization ID to filter for. Only subnets belonging to this Organization
* will be returned.
*/
organizationId?: string
/**
* Project ID to filter for. Only subnets belonging to this Project will be
* returned.
*/
projectId?: string
/**
* Subnet IDs to filter for. Only subnets matching the specified IDs will be
* returned.
*/
subnetIds?: string[]
/** VPC ID to filter for. Only subnets belonging to this VPC will be returned. */
vpcId?: string
}

Expand Down