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/instance/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export type {
ServerSummary,
ServerType,
ServerTypeCapabilities,
ServerTypeGPUInfo,
ServerTypeNetwork,
ServerTypeNetworkInterface,
ServerTypeVolumeConstraintSizes,
Expand Down
18 changes: 18 additions & 0 deletions packages/clients/src/api/instance/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ import type {
ServerSummary,
ServerType,
ServerTypeCapabilities,
ServerTypeGPUInfo,
ServerTypeNetwork,
ServerTypeNetworkInterface,
ServerTypeVolumeConstraintSizes,
Expand Down Expand Up @@ -1156,6 +1157,20 @@ const unmarshalServerTypeCapabilities = (
} as ServerTypeCapabilities
}

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

return {
gpuManufacturer: data.gpu_manufacturer,
gpuMemory: data.gpu_memory,
gpuName: data.gpu_name,
} as ServerTypeGPUInfo
}

const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -1207,6 +1222,9 @@ const unmarshalServerType = (data: unknown): ServerType => {
: undefined,
endOfService: data.end_of_service,
gpu: data.gpu,
gpuInfo: data.gpu_info
? unmarshalServerTypeGPUInfo(data.gpu_info)
: undefined,
hourlyPrice: data.hourly_price,
monthlyPrice: data.monthly_price,
ncpus: data.ncpus,
Expand Down
11 changes: 11 additions & 0 deletions packages/clients/src/api/instance/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ export interface ServerTypeCapabilities {
bootTypes: BootType[]
}

export interface ServerTypeGPUInfo {
/** GPU manufacturer. */
gpuManufacturer: string
/** GPU model name. */
gpuName: string
/** RAM of a single GPU, in bytes. */
gpuMemory: number
}

export interface ServerTypeNetwork {
/** List of available network interfaces. */
interfaces: ServerTypeNetworkInterface[]
Expand Down Expand Up @@ -681,6 +690,8 @@ export interface ServerType {
gpu?: number
/** Available RAM in bytes. */
ram: number
/** GPU information. */
gpuInfo?: ServerTypeGPUInfo
/** CPU architecture. */
arch: Arch
/** True if it is a baremetal Instance. */
Expand Down
Loading