Skip to content

Commit 5ff7195

Browse files
authored
Merge branch 'main' into v1.6834.0
2 parents b695e14 + 17935b3 commit 5ff7195

File tree

6 files changed

+132
-0
lines changed

6 files changed

+132
-0
lines changed

packages_generated/k8s/src/v1/marshalling.gen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,12 @@ export const unmarshalCluster = (data: unknown): Cluster => {
231231
? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config)
232232
: undefined,
233233
organizationId: data.organization_id,
234+
podCidr: data.pod_cidr,
234235
privateNetworkId: data.private_network_id,
235236
projectId: data.project_id,
236237
region: data.region,
238+
serviceCidr: data.service_cidr,
239+
serviceDnsIp: data.service_dns_ip,
237240
status: data.status,
238241
tags: data.tags,
239242
type: data.type,
@@ -694,13 +697,16 @@ export const marshalCreateClusterRequest = (
694697
defaults,
695698
)
696699
: undefined,
700+
pod_cidr: request.podCidr,
697701
pools:
698702
request.pools !== undefined
699703
? request.pools.map(elt =>
700704
marshalCreateClusterRequestPoolConfig(elt, defaults),
701705
)
702706
: undefined,
703707
private_network_id: request.privateNetworkId,
708+
service_cidr: request.serviceCidr,
709+
service_dns_ip: request.serviceDnsIp,
704710
tags: request.tags,
705711
type: request.type,
706712
version: request.version,

packages_generated/k8s/src/v1/types.gen.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,18 @@ export interface Cluster {
734734
* @deprecated Defines whether all pools are migrated to new images.
735735
*/
736736
newImagesEnabled?: boolean
737+
/**
738+
* Subnet used for the Pod CIDR.
739+
*/
740+
podCidr: string
741+
/**
742+
* Subnet used for the Service CIDR.
743+
*/
744+
serviceCidr: string
745+
/**
746+
* IP used for the DNS Service.
747+
*/
748+
serviceDnsIp: string
737749
}
738750

739751
export interface Node {
@@ -993,6 +1005,18 @@ export type CreateClusterRequest = {
9931005
* Private network ID for internal cluster communication (cannot be changed later).
9941006
*/
9951007
privateNetworkId?: string
1008+
/**
1009+
* Subnet used for the Pod CIDR (cannot be changed later).
1010+
*/
1011+
podCidr?: string
1012+
/**
1013+
* Subnet used for the Service CIDR (cannot be changed later).
1014+
*/
1015+
serviceCidr?: string
1016+
/**
1017+
* IP used for the DNS Service (cannot be changes later). If unset, default to Service CIDR's network + 10.
1018+
*/
1019+
serviceDnsIp?: string
9961020
}
9971021

9981022
export type CreateExternalNodeRequest = {

packages_generated/mongodb/src/v1/api.gen.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
marshalUpgradeInstanceRequest,
2828
unmarshalEndpoint,
2929
unmarshalInstance,
30+
unmarshalListDatabasesResponse,
3031
unmarshalListInstancesResponse,
3132
unmarshalListNodeTypesResponse,
3233
unmarshalListSnapshotsResponse,
@@ -49,6 +50,8 @@ import type {
4950
GetInstanceRequest,
5051
GetSnapshotRequest,
5152
Instance,
53+
ListDatabasesRequest,
54+
ListDatabasesResponse,
5255
ListInstancesRequest,
5356
ListInstancesResponse,
5457
ListNodeTypesRequest,
@@ -534,6 +537,32 @@ export class API extends ParentAPI {
534537
unmarshalUser,
535538
)
536539

540+
protected pageOfListDatabases = (request: Readonly<ListDatabasesRequest>) =>
541+
this.client.fetch<ListDatabasesResponse>(
542+
{
543+
method: 'GET',
544+
path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`,
545+
urlParams: urlParams(
546+
['order_by', request.orderBy],
547+
['page', request.page],
548+
[
549+
'page_size',
550+
request.pageSize ?? this.client.settings.defaultPageSize,
551+
],
552+
),
553+
},
554+
unmarshalListDatabasesResponse,
555+
)
556+
557+
/**
558+
* List databases in a Database Instance. List all databases of a given Database Instance.
559+
*
560+
* @param request - The request {@link ListDatabasesRequest}
561+
* @returns A Promise of ListDatabasesResponse
562+
*/
563+
listDatabases = (request: Readonly<ListDatabasesRequest>) =>
564+
enrichForPagination('databases', this.pageOfListDatabases, request)
565+
537566
/**
538567
* Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint.
539568
*

packages_generated/mongodb/src/v1/marshalling.gen.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
CreateInstanceRequest,
1414
CreateSnapshotRequest,
1515
CreateUserRequest,
16+
Database,
1617
Endpoint,
1718
EndpointPrivateNetworkDetails,
1819
EndpointPublicNetworkDetails,
@@ -21,6 +22,7 @@ import type {
2122
EndpointSpecPublicNetworkDetails,
2223
Instance,
2324
InstanceSnapshotSchedule,
25+
ListDatabasesResponse,
2426
ListInstancesResponse,
2527
ListNodeTypesResponse,
2628
ListSnapshotsResponse,
@@ -195,6 +197,33 @@ export const unmarshalUser = (data: unknown): User => {
195197
} as User
196198
}
197199

200+
const unmarshalDatabase = (data: unknown): Database => {
201+
if (!isJSONObject(data)) {
202+
throw new TypeError(
203+
`Unmarshalling the type 'Database' failed as data isn't a dictionary.`,
204+
)
205+
}
206+
207+
return {
208+
name: data.name,
209+
} as Database
210+
}
211+
212+
export const unmarshalListDatabasesResponse = (
213+
data: unknown,
214+
): ListDatabasesResponse => {
215+
if (!isJSONObject(data)) {
216+
throw new TypeError(
217+
`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`,
218+
)
219+
}
220+
221+
return {
222+
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
223+
totalCount: data.total_count,
224+
} as ListDatabasesResponse
225+
}
226+
198227
export const unmarshalListInstancesResponse = (
199228
data: unknown,
200229
): ListInstancesResponse => {

packages_generated/mongodb/src/v1/types.gen.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export type InstanceStatus =
1313
| 'locked'
1414
| 'snapshotting'
1515

16+
export type ListDatabasesRequestOrderBy = 'name_asc' | 'name_desc'
17+
1618
export type ListInstancesRequestOrderBy =
1719
| 'created_at_asc'
1820
| 'created_at_desc'
@@ -180,6 +182,10 @@ export interface EndpointSpec {
180182
privateNetwork?: EndpointSpecPrivateNetworkDetails
181183
}
182184

185+
export interface Database {
186+
name: string
187+
}
188+
183189
export interface Instance {
184190
/**
185191
* UUID of the Database Instance.
@@ -532,6 +538,34 @@ export type GetSnapshotRequest = {
532538
snapshotId: string
533539
}
534540

541+
export type ListDatabasesRequest = {
542+
/**
543+
* Region to target. If none is passed will use default region from the config.
544+
*/
545+
region?: ScwRegion
546+
/**
547+
* UUID of the Database Instance.
548+
*/
549+
instanceId: string
550+
/**
551+
* Criteria to use when requesting user listing.
552+
*/
553+
orderBy?: ListDatabasesRequestOrderBy
554+
page?: number
555+
pageSize?: number
556+
}
557+
558+
export interface ListDatabasesResponse {
559+
/**
560+
* List of the databases.
561+
*/
562+
databases: Database[]
563+
/**
564+
* Total count of databases present on a Database Instance.
565+
*/
566+
totalCount: number
567+
}
568+
535569
export type ListInstancesRequest = {
536570
/**
537571
* Region to target. If none is passed will use default region from the config.

packages_generated/mongodb/src/v1/validation-rules.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ export const DeleteUserRequest = {
5858
},
5959
}
6060

61+
export const ListDatabasesRequest = {
62+
page: {
63+
greaterThanOrEqual: 1,
64+
},
65+
pageSize: {
66+
greaterThanOrEqual: 1,
67+
lessThanOrEqual: 100,
68+
},
69+
}
70+
6171
export const ListInstancesRequest = {
6272
name: {
6373
maxLength: 255,

0 commit comments

Comments
 (0)