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.
229 lines
8.7 KiB
C++
229 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.
|
|
*/
|
|
|
|
/*
|
|
* Sandbox.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_Sandbox_H_
|
|
#define HANZO_MODEL_Sandbox_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include <cpprest/details/basic_types.h>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
|
|
|
|
class Sandbox
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
Sandbox();
|
|
virtual ~Sandbox();
|
|
|
|
/////////////////////////////////////////////
|
|
/// 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;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// Sandbox members
|
|
|
|
|
|
/// <summary>
|
|
/// Class is what the sandbox is FOR, and it decides the image, the working directory and the isolation: \"exec\" for a code-interpreter call (workdir /mnt/data, no project, bounded per org), \"dev\" for a workspace bound to a project (workdir /work, single-attach), \"desktop\" for one with a screen.
|
|
/// </summary>
|
|
utility::string_t getRClass() const;
|
|
bool rClassIsSet() const;
|
|
void unsetr_class();
|
|
void setRClass(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Cluster is the attached cluster this sandbox runs on — the fleet-local name the lease named — or empty for the home cluster. Immutable for the life of the lease, like the pod it locates: every later call into the sandbox reads it to reach the right apiserver.
|
|
/// </summary>
|
|
utility::string_t getCluster() const;
|
|
bool clusterIsSet() const;
|
|
void unsetCluster();
|
|
void setCluster(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// ConnectedAt is when somebody was last known to have this sandbox's project OPEN, Unix seconds. It is a fact with an EXPIRY rather than a flag: a watcher restamps it every beat of its stream, and it goes stale on its own when the stream dies, so nothing has to be turned off by a process that may not be there any more. The reaper reads it to choose WHICH idle allowance applies — see lifecycle.go. Zero means nobody has said so, which puts the sandbox on the short clock.
|
|
/// </summary>
|
|
int64_t getConnectedAt() const;
|
|
bool connectedAtIsSet() const;
|
|
void unsetConnectedAt();
|
|
void setConnectedAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// CreatedAt is when the lease was first taken, Unix seconds.
|
|
/// </summary>
|
|
int64_t getCreatedAt() const;
|
|
bool createdAtIsSet() const;
|
|
void unsetCreatedAt();
|
|
void setCreatedAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Error is why the sandbox could not come up, in plain words. Present only with status \"error\", and it is the field to read rather than inferring a cause from the absence of a pod.
|
|
/// </summary>
|
|
utility::string_t getError() const;
|
|
bool errorIsSet() const;
|
|
void unsetError();
|
|
void setError(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// ExpiresAt is when the lease ends, Unix seconds. Past it the reaper may take the sandbox at any time; it is a deadline, not a guarantee of survival until then, since an idle sandbox goes sooner.
|
|
/// </summary>
|
|
int64_t getExpiresAt() const;
|
|
bool expiresAtIsSet() const;
|
|
void unsetExpiresAt();
|
|
void setExpiresAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// ID is the sandbox's server-minted handle and what every operation addresses it by. The caller does not choose it.
|
|
/// </summary>
|
|
utility::string_t getId() const;
|
|
bool idIsSet() const;
|
|
void unsetId();
|
|
void setId(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Image is the container image this sandbox is actually running — the one the class chose, or an override the policy admitted. It is what ran, not what was asked for.
|
|
/// </summary>
|
|
utility::string_t getImage() const;
|
|
bool imageIsSet() const;
|
|
void unsetImage();
|
|
void setImage(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Kind is the resource family this row belongs to. Always \"sandbox\" here; it exists because the store this shares is keyed across kinds.
|
|
/// </summary>
|
|
utility::string_t getKind() const;
|
|
bool kindIsSet() const;
|
|
void unsetKind();
|
|
void setKind(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// LastUsedAt is when the sandbox last did work, Unix seconds. The reaper reads it: a sandbox idle past the idle window is reclaimed even inside its TTL, because an idle lease is capacity nobody is using.
|
|
/// </summary>
|
|
int64_t getLastUsedAt() const;
|
|
bool lastUsedAtIsSet() const;
|
|
void unsetLastUsedAt();
|
|
void setLastUsedAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Org is the org that holds the lease — the validated caller's, never a value a request supplied. It is also the store's key, so a sandbox is not merely filtered out of another org's answers; it is unreachable from them.
|
|
/// </summary>
|
|
utility::string_t getOrg() const;
|
|
bool orgIsSet() const;
|
|
void unsetOrg();
|
|
void setOrg(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Project is the project this sandbox is bound to. A dev or desktop sandbox has one and is SINGLE-ATTACH under it, so asking twice resumes rather than leasing a second; an exec sandbox has none.
|
|
/// </summary>
|
|
utility::string_t getProject() const;
|
|
bool projectIsSet() const;
|
|
void unsetProject();
|
|
void setProject(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Runtime is the isolation boundary this sandbox GOT, which is not always the one it asked for: a caller states a preference and runtimeFor answers with what the sandbox can actually have. Reported so a person comparing two runtimes is comparing the runtimes they got rather than the ones they typed — the difference between those two is the whole reason to record it. Empty means the node's default runtime, which is a real answer and not a missing one. This is not a copy that can go stale. runtimeClassName is IMMUTABLE on a pod, a sandbox's pod is created once and never recreated (restartPolicy Never, no pool), and its name is never reused — so for as long as the pod this row names exists, it is running this runtime. The alternative, asking the apiserver on every read, buys nothing and costs a round trip per row.
|
|
/// </summary>
|
|
utility::string_t getRuntime() const;
|
|
bool runtimeIsSet() const;
|
|
void unsetRuntime();
|
|
void setRuntime(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Status is where the sandbox is in its life: \"pending\" while the pod is coming up, \"running\" once it can take work, \"error\" when it cannot. Only a running sandbox takes an exec or mints an interactive ticket.
|
|
/// </summary>
|
|
utility::string_t getStatus() const;
|
|
bool statusIsSet() const;
|
|
void unsetStatus();
|
|
void setStatus(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Volume is the persistent volume attached to the sandbox, when it has one. A dev sandbox keeps its work across leases through it; an exec sandbox has none and loses everything outside /mnt/data when the lease ends.
|
|
/// </summary>
|
|
utility::string_t getVolume() const;
|
|
bool volumeIsSet() const;
|
|
void unsetVolume();
|
|
void setVolume(const utility::string_t& value);
|
|
|
|
|
|
protected:
|
|
utility::string_t m_r_class;
|
|
bool m_r_classIsSet;
|
|
|
|
utility::string_t m_Cluster;
|
|
bool m_ClusterIsSet;
|
|
|
|
int64_t m_ConnectedAt;
|
|
bool m_ConnectedAtIsSet;
|
|
|
|
int64_t m_CreatedAt;
|
|
bool m_CreatedAtIsSet;
|
|
|
|
utility::string_t m_Error;
|
|
bool m_ErrorIsSet;
|
|
|
|
int64_t m_ExpiresAt;
|
|
bool m_ExpiresAtIsSet;
|
|
|
|
utility::string_t m_Id;
|
|
bool m_IdIsSet;
|
|
|
|
utility::string_t m_Image;
|
|
bool m_ImageIsSet;
|
|
|
|
utility::string_t m_Kind;
|
|
bool m_KindIsSet;
|
|
|
|
int64_t m_LastUsedAt;
|
|
bool m_LastUsedAtIsSet;
|
|
|
|
utility::string_t m_Org;
|
|
bool m_OrgIsSet;
|
|
|
|
utility::string_t m_Project;
|
|
bool m_ProjectIsSet;
|
|
|
|
utility::string_t m_Runtime;
|
|
bool m_RuntimeIsSet;
|
|
|
|
utility::string_t m_Status;
|
|
bool m_StatusIsSet;
|
|
|
|
utility::string_t m_Volume;
|
|
bool m_VolumeIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_Sandbox_H_ */
|