Skip to content

Commit 20643a7

Browse files
authored
feat(rdb): add volume_type for snapshots (#1062)
1 parent 8dc2bb2 commit 20643a7

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export type {
126126
SetPrivilegeRequest,
127127
Snapshot,
128128
SnapshotStatus,
129+
SnapshotVolumeType,
129130
StorageClass,
130131
UpdateDatabaseBackupRequest,
131132
UpdateInstanceRequest,

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import type {
8282
SetInstanceSettingsResponse,
8383
SetPrivilegeRequest,
8484
Snapshot,
85+
SnapshotVolumeType,
8586
UpdateDatabaseBackupRequest,
8687
UpdateInstanceRequest,
8788
UpdateSnapshotRequest,
@@ -381,6 +382,19 @@ export const unmarshalPrivilege = (data: unknown): Privilege => {
381382
} as Privilege
382383
}
383384

385+
const unmarshalSnapshotVolumeType = (data: unknown): SnapshotVolumeType => {
386+
if (!isJSONObject(data)) {
387+
throw new TypeError(
388+
`Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`,
389+
)
390+
}
391+
392+
return {
393+
class: data.class,
394+
type: data.type,
395+
} as SnapshotVolumeType
396+
}
397+
384398
export const unmarshalSnapshot = (data: unknown): Snapshot => {
385399
if (!isJSONObject(data)) {
386400
throw new TypeError(
@@ -400,6 +414,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => {
400414
size: data.size,
401415
status: data.status,
402416
updatedAt: unmarshalDate(data.updated_at),
417+
volumeType: data.volume_type
418+
? unmarshalSnapshotVolumeType(data.volume_type)
419+
: undefined,
403420
} as Snapshot
404421
}
405422

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ export interface NodeTypeVolumeType {
361361
class: StorageClass
362362
}
363363

364+
export interface SnapshotVolumeType {
365+
type: VolumeType
366+
class: StorageClass
367+
}
368+
364369
export interface ACLRuleRequest {
365370
ip: string
366371
description: string
@@ -599,6 +604,8 @@ export interface Snapshot {
599604
instanceName: string
600605
/** Source node type. */
601606
nodeType: string
607+
/** Type of volume where data is stored (lssd, bssd or sbs). */
608+
volumeType?: SnapshotVolumeType
602609
/** Region of this snapshot. */
603610
region: Region
604611
}

0 commit comments

Comments
 (0)