mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
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.
189 lines
6.3 KiB
C++
189 lines
6.3 KiB
C++
/**
|
|
* 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.
|
|
*/
|
|
|
|
/*
|
|
* FleetUnit.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_FleetUnit_H_
|
|
#define HANZO_MODEL_FleetUnit_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include "hanzo/model/FleetSpec.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include "hanzo/model/FleetMetrics.h"
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
class FleetMetrics;
|
|
class FleetSpec;
|
|
|
|
|
|
class FleetUnit
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
FleetUnit();
|
|
virtual ~FleetUnit();
|
|
|
|
/////////////////////////////////////////////
|
|
/// 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;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// FleetUnit members
|
|
|
|
|
|
/// <summary>
|
|
/// Host is the unit's hostname. Empty for a unit that is not one host: a cluster row has no hostname to report.
|
|
/// </summary>
|
|
utility::string_t getHost() const;
|
|
bool hostIsSet() const;
|
|
void unsetHost();
|
|
void setHost(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Kind is what the unit IS: laptop, cloud, gpu, cluster, machine or worker.
|
|
/// </summary>
|
|
utility::string_t getKind() const;
|
|
bool kindIsSet() const;
|
|
void unsetKind();
|
|
void setKind(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
utility::string_t getLabel() const;
|
|
bool labelIsSet() const;
|
|
void unsetLabel();
|
|
void setLabel(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
std::shared_ptr<FleetMetrics> getMetrics() const;
|
|
bool metricsIsSet() const;
|
|
void unsetMetrics();
|
|
void setMetrics(const std::shared_ptr<FleetMetrics>& value);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
int64_t getQueued() const;
|
|
bool queuedIsSet() const;
|
|
void unsetQueued();
|
|
void setQueued(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Running is what the unit is executing right now: agent sessions in flight for a run-target, claimed renders for a BYO GPU.
|
|
/// </summary>
|
|
int64_t getRunning() const;
|
|
bool runningIsSet() const;
|
|
void unsetRunning();
|
|
void setRunning(int64_t value);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
int64_t getSessions() const;
|
|
bool sessionsIsSet() const;
|
|
void unsetSessions();
|
|
void setSessions(int64_t value);
|
|
|
|
/// <summary>
|
|
/// 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/agent/targets, /v1/compute/fleet/workers, /v1/compute/machines.
|
|
/// </summary>
|
|
utility::string_t getSource() const;
|
|
bool sourceIsSet() const;
|
|
void unsetSource();
|
|
void setSource(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Spec is the unit's static capability. Absent when the source reported none — unknown capability, never a zeroed one.
|
|
/// </summary>
|
|
std::shared_ptr<FleetSpec> getSpec() const;
|
|
bool specIsSet() const;
|
|
void unsetSpec();
|
|
void setSpec(const std::shared_ptr<FleetSpec>& value);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
utility::string_t getStatus() const;
|
|
bool statusIsSet() const;
|
|
void unsetStatus();
|
|
void setStatus(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
utility::string_t getUnit() const;
|
|
bool unitIsSet() const;
|
|
void unsetUnit();
|
|
void setUnit(const utility::string_t& value);
|
|
|
|
|
|
protected:
|
|
utility::string_t m_Host;
|
|
bool m_HostIsSet;
|
|
|
|
utility::string_t m_Kind;
|
|
bool m_KindIsSet;
|
|
|
|
utility::string_t m_Label;
|
|
bool m_LabelIsSet;
|
|
|
|
std::shared_ptr<FleetMetrics> m_Metrics;
|
|
bool m_MetricsIsSet;
|
|
|
|
int64_t m_Queued;
|
|
bool m_QueuedIsSet;
|
|
|
|
int64_t m_Running;
|
|
bool m_RunningIsSet;
|
|
|
|
int64_t m_Sessions;
|
|
bool m_SessionsIsSet;
|
|
|
|
utility::string_t m_Source;
|
|
bool m_SourceIsSet;
|
|
|
|
std::shared_ptr<FleetSpec> m_Spec;
|
|
bool m_SpecIsSet;
|
|
|
|
utility::string_t m_Status;
|
|
bool m_StatusIsSet;
|
|
|
|
utility::string_t m_Unit;
|
|
bool m_UnitIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_FleetUnit_H_ */
|