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.
242 lines
8.7 KiB
C++
242 lines
8.7 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.
|
||
*/
|
||
|
||
/*
|
||
* MachineView.h
|
||
*
|
||
*
|
||
*/
|
||
|
||
#ifndef HANZO_MODEL_MachineView_H_
|
||
#define HANZO_MODEL_MachineView_H_
|
||
|
||
#include <boost/optional.hpp>
|
||
|
||
#include "hanzo/ModelBase.h"
|
||
|
||
#include "hanzo/model/AgentBinding.h"
|
||
#include <cpprest/details/basic_types.h>
|
||
|
||
namespace hanzo {
|
||
namespace model {
|
||
|
||
class AgentBinding;
|
||
|
||
|
||
class MachineView
|
||
: public ModelBase
|
||
{
|
||
public:
|
||
MachineView();
|
||
virtual ~MachineView();
|
||
|
||
/////////////////////////////////////////////
|
||
/// 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;
|
||
|
||
|
||
/////////////////////////////////////////////
|
||
/// MachineView members
|
||
|
||
|
||
/// <summary>
|
||
/// Agent is the cloud Agent this machine runs, lifted out of the binding so a list reads without following one. Empty means nothing is bound — for a kind=bot machine that means it costs money and answers nothing.
|
||
/// </summary>
|
||
utility::string_t getAgent() const;
|
||
bool agentIsSet() const;
|
||
void unsetAgent();
|
||
void setAgent(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Binding is the record joining this machine to that agent, carrying vm's own reconciled status and its reason. Absent means no runtime is bound, which is also what a stopped bot looks like: stopping unbinds and leaves the machine running.
|
||
/// </summary>
|
||
std::shared_ptr<AgentBinding> getBinding() const;
|
||
bool bindingIsSet() const;
|
||
void unsetBinding();
|
||
void setBinding(const std::shared_ptr<AgentBinding>& value);
|
||
|
||
/// <summary>
|
||
/// CreatedTime is when the machine came into being: the provider's own creation timestamp for a Visor machine, passed through in whatever form it states it, and for a BYO machine the RFC 3339 moment it first dialed in.
|
||
/// </summary>
|
||
utility::string_t getCreatedTime() const;
|
||
bool createdTimeIsSet() const;
|
||
void unsetCreatedTime();
|
||
void setCreatedTime(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// GPU names the accelerators this machine holds (\"H100\", or \"2× NVIDIA GB10\" for a BYO machine reporting a matched pair). Empty means the machine is not a GPU machine — the size slug does not parse as one, or nvidia-smi found nothing.
|
||
/// </summary>
|
||
utility::string_t getGpu() const;
|
||
bool gpuIsSet() const;
|
||
void unsetGpu();
|
||
void setGpu(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// ID addresses this machine on the /v1/compute/machines/:id routes: the org-scoped NAME Visor keys a machine by, falling back to the provider id for a machine that has no name. A BYO machine's is the id it dialed in under.
|
||
/// </summary>
|
||
utility::string_t getId() const;
|
||
bool idIsSet() const;
|
||
void unsetId();
|
||
void setId(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Image is the OS image the machine booted from, as the provider names it.
|
||
/// </summary>
|
||
utility::string_t getImage() const;
|
||
bool imageIsSet() const;
|
||
void unsetImage();
|
||
void setImage(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Mem is system RAM rendered for a human (\"8 GB\"), not a number to compute with. Empty when the provider's figure is ambiguous, or when the only figure available is a GPU slug's gb — that is VRAM, and reporting it as system RAM would be a fabrication. A BYO machine's RAM is on /v1/compute/fleet/workers.
|
||
/// </summary>
|
||
utility::string_t getMem() const;
|
||
bool memIsSet() const;
|
||
void unsetMem();
|
||
void setMem(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Name is the label to show a human — Visor's displayName, or the machine name when it carries none. A BYO machine's is its hostname. It is not an address: ID is what the routes take.
|
||
/// </summary>
|
||
utility::string_t getName() const;
|
||
bool nameIsSet() const;
|
||
void unsetName();
|
||
void setName(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Os is the operating system on the machine — Visor's record for a provisioned one, the host's own report (linux, darwin, windows) for a BYO one.
|
||
/// </summary>
|
||
utility::string_t getOs() const;
|
||
bool osIsSet() const;
|
||
void unsetOs();
|
||
void setOs(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// PrivateIp is the address on the provider's own network, reachable from the org's other machines in the same region. Empty on the same terms as PublicIp.
|
||
/// </summary>
|
||
utility::string_t getPrivateIp() const;
|
||
bool privateIpIsSet() const;
|
||
void unsetPrivateIp();
|
||
void setPrivateIp(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Provider is the cloud that runs the machine (\"digitalocean\"), or \"byo\" for one the operator dialed in with `hanzo link`.
|
||
/// </summary>
|
||
utility::string_t getProvider() const;
|
||
bool providerIsSet() const;
|
||
void unsetProvider();
|
||
void setProvider(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// PublicIp is the internet-facing address the provider assigned. Empty while a machine is still provisioning, and empty for a BYO machine — it dials out from behind NAT, so no address is ever learned for it.
|
||
/// </summary>
|
||
utility::string_t getPublicIp() const;
|
||
bool publicIpIsSet() const;
|
||
void unsetPublicIp();
|
||
void setPublicIp(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Region is the provider region slug (\"sfo3\"), or the zone when the provider reports only that. \"on-prem\" for a BYO machine, which has no cloud region.
|
||
/// </summary>
|
||
utility::string_t getRegion() const;
|
||
bool regionIsSet() const;
|
||
void unsetRegion();
|
||
void setRegion(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Status is the lifecycle state in the PROVIDER's own words (\"active\", \"running\", \"off\"), passed through rather than mapped onto a vocabulary of ours. A BYO machine's is \"online\" or \"offline\", decided by whether its last heartbeat is within 90s.
|
||
/// </summary>
|
||
utility::string_t getStatus() const;
|
||
bool statusIsSet() const;
|
||
void unsetStatus();
|
||
void setStatus(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Type is the provider SIZE SLUG the machine runs at (\"s-2vcpu-4gb\", \"gpu-h100x8-640gb\") — the value a launch asks for, and what Vcpu/Mem/GPU are read out of when the provider states them no other way. \"byo-gpu\" for a dialed-in machine, which was never bought from a size catalog.
|
||
/// </summary>
|
||
utility::string_t getType() const;
|
||
bool typeIsSet() const;
|
||
void unsetType();
|
||
void setType(const utility::string_t& value);
|
||
|
||
/// <summary>
|
||
/// Vcpu is logical cores — the provider's own cpuSize when that is a clean integer, else the count read out of the size slug (4 from \"s-4vcpu-8gb\"). ABSENT, never 0, when neither says. A BYO machine leaves it absent here; its real core count is on GET /v1/compute/fleet/workers.
|
||
/// </summary>
|
||
int64_t getVcpu() const;
|
||
bool vcpuIsSet() const;
|
||
void unsetVcpu();
|
||
void setVcpu(int64_t value);
|
||
|
||
|
||
protected:
|
||
utility::string_t m_Agent;
|
||
bool m_AgentIsSet;
|
||
|
||
std::shared_ptr<AgentBinding> m_Binding;
|
||
bool m_BindingIsSet;
|
||
|
||
utility::string_t m_CreatedTime;
|
||
bool m_CreatedTimeIsSet;
|
||
|
||
utility::string_t m_Gpu;
|
||
bool m_GpuIsSet;
|
||
|
||
utility::string_t m_Id;
|
||
bool m_IdIsSet;
|
||
|
||
utility::string_t m_Image;
|
||
bool m_ImageIsSet;
|
||
|
||
utility::string_t m_Mem;
|
||
bool m_MemIsSet;
|
||
|
||
utility::string_t m_Name;
|
||
bool m_NameIsSet;
|
||
|
||
utility::string_t m_Os;
|
||
bool m_OsIsSet;
|
||
|
||
utility::string_t m_PrivateIp;
|
||
bool m_PrivateIpIsSet;
|
||
|
||
utility::string_t m_Provider;
|
||
bool m_ProviderIsSet;
|
||
|
||
utility::string_t m_PublicIp;
|
||
bool m_PublicIpIsSet;
|
||
|
||
utility::string_t m_Region;
|
||
bool m_RegionIsSet;
|
||
|
||
utility::string_t m_Status;
|
||
bool m_StatusIsSet;
|
||
|
||
utility::string_t m_Type;
|
||
bool m_TypeIsSet;
|
||
|
||
int64_t m_Vcpu;
|
||
bool m_VcpuIsSet;
|
||
|
||
};
|
||
|
||
|
||
}
|
||
}
|
||
|
||
#endif /* HANZO_MODEL_MachineView_H_ */
|