Skip to content

feat(rdb): add volume_type for snapshots #1062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2023
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
1 change: 1 addition & 0 deletions packages/clients/src/api/rdb/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export type {
SetPrivilegeRequest,
Snapshot,
SnapshotStatus,
SnapshotVolumeType,
StorageClass,
UpdateDatabaseBackupRequest,
UpdateInstanceRequest,
Expand Down
17 changes: 17 additions & 0 deletions packages/clients/src/api/rdb/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import type {
SetInstanceSettingsResponse,
SetPrivilegeRequest,
Snapshot,
SnapshotVolumeType,
UpdateDatabaseBackupRequest,
UpdateInstanceRequest,
UpdateSnapshotRequest,
Expand Down Expand Up @@ -381,6 +382,19 @@ export const unmarshalPrivilege = (data: unknown): Privilege => {
} as Privilege
}

const unmarshalSnapshotVolumeType = (data: unknown): SnapshotVolumeType => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`,
)
}

return {
class: data.class,
type: data.type,
} as SnapshotVolumeType
}

export const unmarshalSnapshot = (data: unknown): Snapshot => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -400,6 +414,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => {
size: data.size,
status: data.status,
updatedAt: unmarshalDate(data.updated_at),
volumeType: data.volume_type
? unmarshalSnapshotVolumeType(data.volume_type)
: undefined,
} as Snapshot
}

Expand Down
7 changes: 7 additions & 0 deletions packages/clients/src/api/rdb/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ export interface NodeTypeVolumeType {
class: StorageClass
}

export interface SnapshotVolumeType {
type: VolumeType
class: StorageClass
}

export interface ACLRuleRequest {
ip: string
description: string
Expand Down Expand Up @@ -599,6 +604,8 @@ export interface Snapshot {
instanceName: string
/** Source node type. */
nodeType: string
/** Type of volume where data is stored (lssd, bssd or sbs). */
volumeType?: SnapshotVolumeType
/** Region of this snapshot. */
region: Region
}
Expand Down