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
1 change: 1 addition & 0 deletions packages/clients/src/api/baremetal/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type {
DeleteOptionServerRequest,
DeleteServerRequest,
Disk,
GPU,
GetBMCAccessRequest,
GetDefaultPartitioningSchemaRequest,
GetOSRequest,
Expand Down
15 changes: 15 additions & 0 deletions packages/clients/src/api/baremetal/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
CreateServerRequest,
CreateServerRequestInstall,
Disk,
GPU,
GetServerMetricsResponse,
IP,
InstallServerRequest,
Expand Down Expand Up @@ -315,6 +316,19 @@ const unmarshalDisk = (data: unknown): Disk => {
} as Disk
}

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

return {
name: data.name,
vram: data.vram,
} as GPU
}

const unmarshalMemory = (data: unknown): Memory => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -402,6 +416,7 @@ export const unmarshalOffer = (data: unknown): Offer => {
disks: unmarshalArrayOfObject(data.disks, unmarshalDisk),
enable: data.enable,
fee: data.fee ? unmarshalMoney(data.fee) : undefined,
gpus: unmarshalArrayOfObject(data.gpus, unmarshalGPU),
id: data.id,
incompatibleOsIds: data.incompatible_os_ids,
maxBandwidth: data.max_bandwidth,
Expand Down
9 changes: 9 additions & 0 deletions packages/clients/src/api/baremetal/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ export interface Disk {
type: string
}

export interface GPU {
/** Name of the GPU. */
name: string
/** Capacity of the vram in bytes. */
vram: number
}

export interface Memory {
/** Capacity of the memory in bytes. */
capacity: number
Expand Down Expand Up @@ -470,6 +477,8 @@ export interface Offer {
sharedBandwidth: boolean
/** Array of tags attached to the offer. */
tags: string[]
/** GPU specifications of the offer. */
gpus: GPU[]
}

export interface Option {
Expand Down
Loading