Skip to main content

hanzo_client/models/
gpu_view.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GpuView {
16    /// ID is the card's address: its host machine's id, \"#\", and the card's ordinal within that machine (\"gpu-1#0\"). Stable for as long as the machine is, and the only id a single accelerator has — providers do not name cards.
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// Location is where the card physically sits, which for every source today is the same value Region carries — the console renders it in its own column.
20    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
21    pub location: Option<String>,
22    /// Machine is the id of the machine holding this card, addressable as-is on /v1/visor/machines/:id.
23    #[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
24    pub machine: Option<String>,
25    /// Memory is the card's VRAM as its own tooling reported it (\"122880 MiB\") — a display string in the reporter's units, not a byte count. BYO cards carry it (nvidia-smi); Visor's machine object states no VRAM, so a rented card leaves it empty and the console renders \"—\" rather than a fabricated 0.
26    #[serde(rename = "memory", skip_serializing_if = "Option::is_none")]
27    pub memory: Option<String>,
28    /// Model is the accelerator: the model token read out of the size slug for a Visor GPU droplet (\"H100\", \"MI300X\"), or the name nvidia-smi reported for a BYO card (\"NVIDIA GB10\").
29    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
30    pub model: Option<String>,
31    /// Name is the HOST MACHINE's display name, not the card's — every card in a gpu-h100x8 node repeats it. Model is what says which accelerator this is.
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// Provider distinguishes a BYO accelerator (\"byo\") from a Visor-provisioned one (the host machine's real provider). It is what tells a card the org owns from a card the org rents.
35    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
36    pub provider: Option<String>,
37    /// Region is the host machine's provider region slug; \"on-prem\" for a BYO card.
38    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
39    pub region: Option<String>,
40    /// Status is the HOST MACHINE's lifecycle state, because nothing upstream reports a card's own health. A card reads running because its machine does.
41    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
42    pub status: Option<String>,
43}
44
45impl GpuView {
46    pub fn new() -> GpuView {
47        GpuView {
48            id: None,
49            location: None,
50            machine: None,
51            memory: None,
52            model: None,
53            name: None,
54            provider: None,
55            region: None,
56            status: None,
57        }
58    }
59}
60