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
4 changes: 0 additions & 4 deletions packages/clients/src/api/baremetal/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,12 @@ export type {
SchemaDisk,
SchemaFilesystem,
SchemaFilesystemFormat,
SchemaLVM,
SchemaLogicalVolume,
SchemaLogicalVolumeType,
SchemaPartition,
SchemaPartitionLabel,
SchemaPool,
SchemaPoolType,
SchemaRAID,
SchemaRAIDLevel,
SchemaVolumeGroup,
SchemaZFS,
Server,
ServerBootType,
Expand Down
87 changes: 0 additions & 87 deletions packages/clients/src/api/baremetal/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ import type {
Schema,
SchemaDisk,
SchemaFilesystem,
SchemaLVM,
SchemaLogicalVolume,
SchemaPartition,
SchemaPool,
SchemaRAID,
SchemaVolumeGroup,
SchemaZFS,
Server,
ServerEvent,
Expand All @@ -68,22 +65,6 @@ import type {
ValidatePartitioningSchemaRequest,
} from './types.gen'

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

return {
mirrorNumber: data.mirror_number,
name: data.name,
size: data.size,
stripedNumber: data.striped_number,
type: data.type,
} as SchemaLogicalVolume
}

const unmarshalSchemaPartition = (data: unknown): SchemaPartition => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -98,23 +79,6 @@ const unmarshalSchemaPartition = (data: unknown): SchemaPartition => {
} as SchemaPartition
}

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

return {
logicalVolumes: unmarshalArrayOfObject(
data.logical_volumes,
unmarshalSchemaLogicalVolume,
),
physicalVolumes: data.physical_volumes,
volumeGroupName: data.volume_group_name,
} as SchemaVolumeGroup
}

const unmarshalSchemaPool = (data: unknown): SchemaPool => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -161,21 +125,6 @@ const unmarshalSchemaFilesystem = (data: unknown): SchemaFilesystem => {
} as SchemaFilesystem
}

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

return {
volumeGroups: unmarshalArrayOfObject(
data.volume_groups,
unmarshalSchemaVolumeGroup,
),
} as SchemaLVM
}

const unmarshalSchemaRAID = (data: unknown): SchemaRAID => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -215,7 +164,6 @@ export const unmarshalSchema = (data: unknown): Schema => {
data.filesystems,
unmarshalSchemaFilesystem,
),
lvm: data.lvm ? unmarshalSchemaLVM(data.lvm) : undefined,
raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : undefined,
} as Schema
Expand Down Expand Up @@ -922,17 +870,6 @@ export const marshalUpdateSettingRequest = (
enabled: request.enabled,
})

const marshalSchemaLogicalVolume = (
request: SchemaLogicalVolume,
defaults: DefaultValues,
): Record<string, unknown> => ({
mirror_number: request.mirrorNumber,
name: request.name,
size: request.size,
striped_number: request.stripedNumber,
type: request.type,
})

const marshalSchemaPartition = (
request: SchemaPartition,
defaults: DefaultValues,
Expand All @@ -942,17 +879,6 @@ const marshalSchemaPartition = (
size: request.size,
})

const marshalSchemaVolumeGroup = (
request: SchemaVolumeGroup,
defaults: DefaultValues,
): Record<string, unknown> => ({
logical_volumes: request.logicalVolumes.map(elt =>
marshalSchemaLogicalVolume(elt, defaults),
),
physical_volumes: request.physicalVolumes,
volume_group_name: request.volumeGroupName,
})

const marshalSchemaPool = (
request: SchemaPool,
defaults: DefaultValues,
Expand Down Expand Up @@ -983,15 +909,6 @@ const marshalSchemaFilesystem = (
mountpoint: request.mountpoint,
})

const marshalSchemaLVM = (
request: SchemaLVM,
defaults: DefaultValues,
): Record<string, unknown> => ({
volume_groups: request.volumeGroups.map(elt =>
marshalSchemaVolumeGroup(elt, defaults),
),
})

const marshalSchemaRAID = (
request: SchemaRAID,
defaults: DefaultValues,
Expand All @@ -1016,10 +933,6 @@ export const marshalSchema = (
filesystems: request.filesystems.map(elt =>
marshalSchemaFilesystem(elt, defaults),
),
lvm:
request.lvm !== undefined
? marshalSchemaLVM(request.lvm, defaults)
: undefined,
raids: request.raids.map(elt => marshalSchemaRAID(elt, defaults)),
zfs:
request.zfs !== undefined
Expand Down
31 changes: 1 addition & 30 deletions packages/clients/src/api/baremetal/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ export type SchemaFilesystemFormat =
| 'ext4'
| 'swap'
| 'zfs'

export type SchemaLogicalVolumeType =
| 'unknown_raid_type'
| 'striped'
| 'mirror'
| 'raid0'
| 'raid1'
| 'raid5'
| 'raid6'
| 'raid10'
| 'xfs'

export type SchemaPartitionLabel =
| 'unknown_partition_label'
Expand All @@ -54,7 +45,6 @@ export type SchemaPartitionLabel =
| 'data'
| 'home'
| 'raid'
| 'lvm'
| 'zfs'

export type SchemaPoolType =
Expand Down Expand Up @@ -117,26 +107,12 @@ export type ServerStatus =

export type SettingType = 'unknown' | 'smtp'

export interface SchemaLogicalVolume {
name: string
type: SchemaLogicalVolumeType
size: number
stripedNumber: number
mirrorNumber: number
}

export interface SchemaPartition {
label: SchemaPartitionLabel
number: number
size: number
}

export interface SchemaVolumeGroup {
volumeGroupName: string
physicalVolumes: string[]
logicalVolumes: SchemaLogicalVolume[]
}

export interface SchemaPool {
name: string
type: SchemaPoolType
Expand All @@ -156,10 +132,6 @@ export interface SchemaFilesystem {
mountpoint: string
}

export interface SchemaLVM {
volumeGroups: SchemaVolumeGroup[]
}

export interface SchemaRAID {
name: string
level: SchemaRAIDLevel
Expand Down Expand Up @@ -188,7 +160,6 @@ export interface Schema {
disks: SchemaDisk[]
raids: SchemaRAID[]
filesystems: SchemaFilesystem[]
lvm?: SchemaLVM
zfs?: SchemaZFS
}

Expand Down
Loading