Skip to content

Commit 1035a22

Browse files
authored
feat(rdb): add sameZone for cross-zones ReadReplica (#673)
1 parent 693ce6b commit 1035a22

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/clients/src/api/rdb/v1/marshalling.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export const unmarshalReadReplica = (data: unknown) => {
290290
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
291291
id: data.id,
292292
region: data.region,
293+
sameZone: data.same_zone,
293294
status: data.status,
294295
} as ReadReplica
295296
}
@@ -1042,6 +1043,7 @@ export const marshalCreateReadReplicaRequest = (
10421043
)
10431044
: undefined,
10441045
instance_id: request.instanceId,
1046+
same_zone: request.sameZone,
10451047
})
10461048

10471049
export const marshalCreateSnapshotRequest = (

packages/clients/src/api/rdb/v1/types.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,11 @@ export interface ReadReplica {
641641
status: ReadReplicaStatus
642642
/** Region the Read Replica is in. */
643643
region: Region
644+
/**
645+
* Whether the replica is in the same availability zone as the main instance
646+
* nodes or not.
647+
*/
648+
sameZone: boolean
644649
}
645650

646651
/** Read replica endpoint spec. */
@@ -1114,6 +1119,11 @@ export type CreateReadReplicaRequest = {
11141119
instanceId: string
11151120
/** Specification of the endpoint you want to create. */
11161121
endpointSpec?: ReadReplicaEndpointSpec[]
1122+
/**
1123+
* Defines whether to create the replica in the same availability zone as the
1124+
* main instance nodes or not.
1125+
*/
1126+
sameZone?: boolean
11171127
}
11181128

11191129
export type GetReadReplicaRequest = {

0 commit comments

Comments
 (0)