Files
zeekay 189ce08e51 Regenerate against the document the deployment answers for
The projection these were generated from was a month old and predated the
compute migration, so every one of them described /v1/visor — which the API
serves at zero paths now. That is why a hand-written console client and a
generated one had drifted the same way at the same time.

No /v1/visor path survives here. The word still appears as a source-plane
value and inside gvisor and supervisor, which are not this rename.
2026-09-05 18:07:13 -07:00

211 lines
7.4 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 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
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* TargetView.h
*
*
*/
#ifndef HANZO_MODEL_TargetView_H_
#define HANZO_MODEL_TargetView_H_
#include <boost/optional.hpp>
#include "hanzo/ModelBase.h"
#include "hanzo/model/Metrics.h"
#include <cpprest/details/basic_types.h>
#include "hanzo/model/Spec.h"
namespace hanzo {
namespace model {
class Metrics;
class Spec;
class TargetView
: public ModelBase
{
public:
TargetView();
virtual ~TargetView();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
bool fromJson(const web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// TargetView members
/// <summary>
/// Capacity is a human summary of what the machine has (\&quot;8 vCPU / 32G\&quot;, \&quot;1× GB10\&quot;), up to 256 characters. Prose for a card — Spec is the same thing in a form a scheduler can read, and nothing derives one from the other.
/// </summary>
utility::string_t getCapacity() const;
bool capacityIsSet() const;
void unsetCapacity();
void setCapacity(const utility::string_t& value);
/// <summary>
/// CreatedAt is when the machine was first registered, RFC 3339 in UTC. A re-link refreshes the row and leaves this alone, so it dates the machine and not the connection.
/// </summary>
utility::string_t getCreatedAt() const;
bool createdAtIsSet() const;
void unsetCreatedAt();
void setCreatedAt(const utility::string_t& value);
/// <summary>
/// Host is the hostname sessions on this machine report, and it is a JOIN KEY, not a label: a session naming this host counts against the load below even when it names no target id, and a re-link of the same (org, host, owner) refreshes this row instead of creating a second. Empty means the machine is addressable only by ID.
/// </summary>
utility::string_t getHost() const;
bool hostIsSet() const;
void unsetHost();
void setHost(const utility::string_t& value);
/// <summary>
/// ID is the machine&#39;s handle, minted as \&quot;tgt_\&quot; + 32 hex characters. It is what a session records to say it ran here, and what every later patch, claim or delete addresses.
/// </summary>
utility::string_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(const utility::string_t& value);
/// <summary>
/// Kind is what sort of destination this is, from a closed five: laptop | cloud | gpu | cluster | machine. A register that named none is a &#x60;machine&#x60;.
/// </summary>
utility::string_t getKind() const;
bool kindIsSet() const;
void unsetKind();
void setKind(const utility::string_t& value);
/// <summary>
/// Label is the name a person gave the machine (\&quot;workshop\&quot;), up to 128 characters. Required at register, free text, and the only field here meant for reading rather than matching.
/// </summary>
utility::string_t getLabel() const;
bool labelIsSet() const;
void unsetLabel();
void setLabel(const utility::string_t& value);
/// <summary>
/// Metrics is what the machine was DOING at its last heartbeat — loadavg, memory, accelerator utilization. Absent when it has never beaten. It is a SNAPSHOT: the series over time lives in the fleet samples, not here.
/// </summary>
std::shared_ptr<Metrics> getMetrics() const;
bool metricsIsSet() const;
void unsetMetrics();
void setMetrics(const std::shared_ptr<Metrics>& value);
/// <summary>
/// MetricsAt is when that heartbeat was recorded, RFC 3339 in UTC, and the SERVER stamps it — a client cannot backdate or forge the staleness clock. Absent means never beaten, which is exactly the case where Status is taken at its word.
/// </summary>
utility::string_t getMetricsAt() const;
bool metricsAtIsSet() const;
void unsetMetricsAt();
void setMetricsAt(const utility::string_t& value);
/// <summary>
/// Running is how many of those are in &#x60;running&#x60; right now — the number a dispatcher weighs against Capacity. paused sessions are in Sessions and not here.
/// </summary>
int64_t getRunning() const;
bool runningIsSet() const;
void unsetRunning();
void setRunning(int64_t value);
/// <summary>
/// Sessions is how many of the org&#39;s sessions are mapped to this machine, by target id OR by matching Host. All of them, whatever their status.
/// </summary>
int64_t getSessions() const;
bool sessionsIsSet() const;
void unsetSessions();
void setSessions(int64_t value);
/// <summary>
/// Spec is what the machine IS — os, arch, cores, RAM, accelerators — the static half, changed only when something reports it again. Absent when nothing has ever been reported, and a scheduler reads absence as \&quot;cannot satisfy a floor\&quot; rather than as \&quot;no limits\&quot;.
/// </summary>
std::shared_ptr<Spec> getSpec() const;
bool specIsSet() const;
void unsetSpec();
void setSpec(const std::shared_ptr<Spec>& value);
/// <summary>
/// Status is the EFFECTIVE liveness — online | offline | draining — not the stored one. offline and draining are operator INTENT and are reported as they stand; &#x60;online&#x60; is checked against the heartbeat, and a machine that has beaten before but not in the last 90 seconds reports offline whatever its row says. A target that has NEVER beaten keeps its stored status, because a hand-registered destination has no fact to check.
/// </summary>
utility::string_t getStatus() const;
bool statusIsSet() const;
void unsetStatus();
void setStatus(const utility::string_t& value);
/// <summary>
/// UpdatedAt is the last write to the row, same format — which for a beating machine is its last heartbeat, since a heartbeat IS a write.
/// </summary>
utility::string_t getUpdatedAt() const;
bool updatedAtIsSet() const;
void unsetUpdatedAt();
void setUpdatedAt(const utility::string_t& value);
protected:
utility::string_t m_Capacity;
bool m_CapacityIsSet;
utility::string_t m_CreatedAt;
bool m_CreatedAtIsSet;
utility::string_t m_Host;
bool m_HostIsSet;
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Kind;
bool m_KindIsSet;
utility::string_t m_Label;
bool m_LabelIsSet;
std::shared_ptr<Metrics> m_Metrics;
bool m_MetricsIsSet;
utility::string_t m_MetricsAt;
bool m_MetricsAtIsSet;
int64_t m_Running;
bool m_RunningIsSet;
int64_t m_Sessions;
bool m_SessionsIsSet;
std::shared_ptr<Spec> m_Spec;
bool m_SpecIsSet;
utility::string_t m_Status;
bool m_StatusIsSet;
utility::string_t m_UpdatedAt;
bool m_UpdatedAtIsSet;
};
}
}
#endif /* HANZO_MODEL_TargetView_H_ */