mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
86 lines
5.1 KiB
Swift
86 lines
5.1 KiB
Swift
//
|
|
// ClusterView.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ClusterView: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** AmdGPU is the same count for `amd.com/gpu`: AMD accelerators across the BYO cluster's nodes, as of the attach. */
|
|
public var amdGpu: Int64?
|
|
/** CreatedAt is when the cluster started existing: the earliest creation time among its pools for a managed cluster, and for a BYO one the RFC 3339 moment it was attached. Empty when the source states none. */
|
|
public var createdAt: String?
|
|
/** DoClusterID carries the SAME id as DoksClusterID. Both names exist because the console's Cluster type reads either one; neither is a second identifier. */
|
|
public var doClusterId: String?
|
|
/** DoksClusterID is the provider's own id for the cluster, and the value the /v1/compute/k8s/clusters/:id routes take. Empty for a BYO cluster: an attached kubeconfig was never provisioned, so there is no provider id to state. */
|
|
public var doksClusterId: String?
|
|
/** Kind says which of the two kinds of cluster this row is, and there are only two: \"managed\" — Visor provisioned it and Hanzo's account pays the provider — or \"byo\", an existing cluster the org attached by kubeconfig. */
|
|
public var kind: String?
|
|
/** Name is the cluster's name: the provider's for a managed cluster, and for a BYO one the lower-cased fleet name it was attached under — which is also how the detach route addresses it. */
|
|
public var name: String?
|
|
/** NodeCount is how many worker nodes the cluster has — the sum over its pools for a managed cluster, and for a BYO one the node count read off the cluster when it was attached. */
|
|
public var nodeCount: Int64?
|
|
/** NodePools is the authoritative node inventory — every pool, each with its own size and count. It is empty in two cases that are not \"no pools\": a row from the /v1/compute/k8s/clusters LIST, which is deliberately lightweight and whose :id detail carries them, and a BYO cluster, whose pools were never read. */
|
|
public var nodePools: [NodePoolView]?
|
|
/** NodeSize is a display convenience: the size slug of the FIRST pool. A cluster mixing sizes has more than one, and NodePools is where they all are. */
|
|
public var nodeSize: String?
|
|
/** NvidiaGPU is how many NVIDIA accelerators the cluster's nodes advertise, the sum of `nvidia.com/gpu` allocatable across them. BYO only, and counted ONCE when the cluster was attached — it is an inventory, not live capacity. */
|
|
public var nvidiaGpu: Int64?
|
|
/** Region is the provider region slug for a managed cluster. A BYO cluster has no region we can read, so it carries the free-form `provider` label the attach named it with (\"gke\", \"on-prem\") instead. */
|
|
public var region: String?
|
|
/** Status is the cluster's state: the provider's own word for a managed cluster (\"running\", \"provisioning\"), \"unknown\" when the provider stated none, and always \"attached\" for a BYO cluster — that one says the kubeconfig is on file, not that the cluster is reachable this second. */
|
|
public var status: String?
|
|
|
|
public init(amdGpu: Int64? = nil, createdAt: String? = nil, doClusterId: String? = nil, doksClusterId: String? = nil, kind: String? = nil, name: String? = nil, nodeCount: Int64? = nil, nodePools: [NodePoolView]? = nil, nodeSize: String? = nil, nvidiaGpu: Int64? = nil, region: String? = nil, status: String? = nil) {
|
|
self.amdGpu = amdGpu
|
|
self.createdAt = createdAt
|
|
self.doClusterId = doClusterId
|
|
self.doksClusterId = doksClusterId
|
|
self.kind = kind
|
|
self.name = name
|
|
self.nodeCount = nodeCount
|
|
self.nodePools = nodePools
|
|
self.nodeSize = nodeSize
|
|
self.nvidiaGpu = nvidiaGpu
|
|
self.region = region
|
|
self.status = status
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case amdGpu
|
|
case createdAt
|
|
case doClusterId
|
|
case doksClusterId
|
|
case kind
|
|
case name
|
|
case nodeCount
|
|
case nodePools
|
|
case nodeSize
|
|
case nvidiaGpu
|
|
case region
|
|
case status
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(amdGpu, forKey: .amdGpu)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(doClusterId, forKey: .doClusterId)
|
|
try container.encodeIfPresent(doksClusterId, forKey: .doksClusterId)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(nodeCount, forKey: .nodeCount)
|
|
try container.encodeIfPresent(nodePools, forKey: .nodePools)
|
|
try container.encodeIfPresent(nodeSize, forKey: .nodeSize)
|
|
try container.encodeIfPresent(nvidiaGpu, forKey: .nvidiaGpu)
|
|
try container.encodeIfPresent(region, forKey: .region)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
}
|
|
}
|
|
|