hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * 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/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ByoWorker {
    /// Arch/CPUs/Memory are the connecting host's static CPU spec, mirrored from the registration: Arch is runtime.GOARCH (amd64 | arm64), Memory is total RAM in BYTES — the same fields a code-linked run-target carries, so the /v1/visor/fleet board renders a linked node's arch + cores + RAM like any other unit.
    #[serde(rename = "arch", skip_serializing_if = "Option::is_none")]
    pub arch: Option<String>,
    /// Capabilities is what this worker offers the org: \"studio.render\" when the node can render, \"engine.serve\" when it serves a model endpoint. A node advertises one only once it can honour it, so an absent list means a node that has dialed in but is not ready to serve any of them yet.
    #[serde(rename = "capabilities", skip_serializing_if = "Option::is_none")]
    pub capabilities: Option<Vec<String>>,
    /// CPUModel is the processor as the host names it (\"Apple M3 Max\"), for display.
    #[serde(rename = "cpuModel", skip_serializing_if = "Option::is_none")]
    pub cpu_model: Option<String>,
    /// CPUs is the host's logical core count.
    #[serde(rename = "cpus", skip_serializing_if = "Option::is_none")]
    pub cpus: Option<i32>,
    /// Cuda is the host's CUDA toolkit version. NVIDIA hosts report it.
    #[serde(rename = "cuda", skip_serializing_if = "Option::is_none")]
    pub cuda: Option<String>,
    /// Driver is the host's NVIDIA kernel driver version — distinct from Cuda, and the one that bounds which CUDA versions can run on this box.
    #[serde(rename = "driver", skip_serializing_if = "Option::is_none")]
    pub driver: Option<String>,
    /// Engine is the hanzo-engine model server this node runs, when it runs one (`hanzo link --serve-engine`). Absent means the node takes jobs but serves no model endpoint.
    #[serde(rename = "engine", skip_serializing_if = "Option::is_none")]
    pub engine: Option<Box<models::EngineAdvertisement>>,
    /// FirstSeen is when this node first dialed in, RFC 3339 — the start of its presence record, which `hanzo unlink` ends.
    #[serde(rename = "firstSeen", skip_serializing_if = "Option::is_none")]
    pub first_seen: Option<String>,
    /// GPUs are the accelerators the host found on itself. Empty is a real answer: a CPU-only machine can dial in and take non-GPU work.
    #[serde(rename = "gpus", skip_serializing_if = "Option::is_none")]
    pub gpus: Option<Vec<models::ByoGpu>>,
    /// Hip is the host's HIP runtime version, the AMD counterpart to Cuda.
    #[serde(rename = "hip", skip_serializing_if = "Option::is_none")]
    pub hip: Option<String>,
    /// Hostname is what the host calls itself. It equals ID for any hostname already in the [a-z0-9-] alphabet, and differs when sanitizing had to change it.
    #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
    pub hostname: Option<String>,
    /// ID is the node's id in the fleet — the sanitized hostname it registered under, which is also the `unit` its samples and its gpu-jobs lane key on. This is the id to use everywhere else on the compute surface.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// JobQueue is the tasks NAMESPACE this worker claims render jobs out of — \"gpu-jobs\" unless `hanzo link` was pointed at another. Within it, a job aimed at this node alone rides the task-queue value \"gpu:<id>\".
    #[serde(rename = "jobQueue", skip_serializing_if = "Option::is_none")]
    pub job_queue: Option<String>,
    /// LastHeartbeat is the most recent beat this node sent, RFC 3339. It is what Status is computed from, so a reader can check the judgement.
    #[serde(rename = "lastHeartbeat", skip_serializing_if = "Option::is_none")]
    pub last_heartbeat: Option<String>,
    /// Location is always \"on-prem\" — a machine that dialed in has no cloud region, and inventing one would put it somewhere it is not.
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,
    /// Memory is the host's total RAM in BYTES.
    #[serde(rename = "memory", skip_serializing_if = "Option::is_none")]
    pub memory: Option<i32>,
    /// Os is the host's operating system: linux, darwin or windows.
    #[serde(rename = "os", skip_serializing_if = "Option::is_none")]
    pub os: Option<String>,
    /// Provider is always \"byo\": this machine is the operator's, not one Hanzo provisioned. It exists so a fold into the machines/GPUs pages says which rows are rented and which are the customer's own.
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<String>,
    /// Rocm is the host's ROCm version. AMD hosts report it; empty otherwise.
    #[serde(rename = "rocm", skip_serializing_if = "Option::is_none")]
    pub rocm: Option<String>,
    /// Status is \"online\" when the last heartbeat landed within 90s, else \"offline\" — so it is a fact about heartbeat freshness, not about the box being powered on. A worker that has never beaten reads offline.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Version is the `hanzo` CLI version running on the node. It is what to check when a worker is missing a field a newer registration reports.
    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

impl ByoWorker {
    pub fn new() -> ByoWorker {
        ByoWorker {
            arch: None,
            capabilities: None,
            cpu_model: None,
            cpus: None,
            cuda: None,
            driver: None,
            engine: None,
            first_seen: None,
            gpus: None,
            hip: None,
            hostname: None,
            id: None,
            job_queue: None,
            last_heartbeat: None,
            location: None,
            memory: None,
            os: None,
            provider: None,
            rocm: None,
            status: None,
            version: None,
        }
    }
}