1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* 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 FleetUnit {
/// Host is the unit's hostname. Empty for a unit that is not one host: a cluster row has no hostname to report.
#[serde(rename = "host", skip_serializing_if = "Option::is_none")]
pub host: Option<String>,
/// Kind is what the unit IS: laptop, cloud, gpu, cluster, machine or worker.
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
/// Label is the name to show a human — a target's label, a worker's hostname, a machine's display name. Empty when the source has none to give.
#[serde(rename = "label", skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
/// Metrics is the unit's latest utilization: its own live snapshot when it keeps one (a run-target's heartbeat wins), else the newest sample from the series for the SAME source. Absent means nothing is known about this unit's load — which is deliberately not the same as a reading of zero.
#[serde(rename = "metrics", skip_serializing_if = "Option::is_none")]
pub metrics: Option<Box<models::FleetMetrics>>,
/// Queued is how many renders are waiting on THIS GPU's own lane in the org's gpu-jobs queue. BYO units only — an agent run-target dispatches, it does not queue — and omitted when nothing is waiting.
#[serde(rename = "queued", skip_serializing_if = "Option::is_none")]
pub queued: Option<i32>,
/// Running is what the unit is executing right now: agent sessions in flight for a run-target, claimed renders for a BYO GPU.
#[serde(rename = "running", skip_serializing_if = "Option::is_none")]
pub running: Option<i32>,
/// Sessions is how many agent sessions are open on this unit. Always present, and 0 for a source that cannot host agent sessions at all — a fact about that plane, not a gap in the reading.
#[serde(rename = "sessions", skip_serializing_if = "Option::is_none")]
pub sessions: Option<i32>,
/// Source is the plane this row came from: \"agent\" (a linked run-target), \"byo\" (a worker or cluster the org dialed in) or \"visor\" (a machine Hanzo provisioned). It is half the row's identity, and it says which face owns the unit — /v1/agents/targets, /v1/visor/fleet/workers, /v1/visor/machines.
#[serde(rename = "source", skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
/// Spec is the unit's static capability. Absent when the source reported none — unknown capability, never a zeroed one.
#[serde(rename = "spec", skip_serializing_if = "Option::is_none")]
pub spec: Option<Box<models::FleetSpec>>,
/// Status is liveness in the SOURCE's own vocabulary, because each plane decides it differently: a run-target's is derived from its heartbeat, a BYO worker's is online/offline on the 90s window, a BYO cluster's is \"attached\", and a Visor machine's is the provider's word for its lifecycle state.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// Unit is the SOURCE's own id for this unit — a run-target id, a BYO worker id, a Visor machine name — so a row links straight back to the face that owns it. It is unique within a source, not across them: two planes may mint the same id, which is why (source, unit) together is the identity.
#[serde(rename = "unit", skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
impl FleetUnit {
pub fn new() -> FleetUnit {
FleetUnit {
host: None,
kind: None,
label: None,
metrics: None,
queued: None,
running: None,
sessions: None,
source: None,
spec: None,
status: None,
unit: None,
}
}
}