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

379 lines
24 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.
*/
/*
* ComputeApi.h
*
*
*/
#ifndef HANZO_API_ComputeApi_H_
#define HANZO_API_ComputeApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/AgentBinding.h"
#include "hanzo/AnyType.h"
#include "hanzo/model/BindAgentReq.h"
#include "hanzo/model/BindingList.h"
#include "hanzo/model/ClusterAttach.h"
#include "hanzo/model/ClusterDetached.h"
#include "hanzo/model/ClusterDetailView.h"
#include "hanzo/model/ClusterList.h"
#include "hanzo/model/ClusterView.h"
#include "hanzo/model/CreateClusterReq.h"
#include "hanzo/model/FleetBoard.h"
#include "hanzo/model/GpuAlertList.h"
#include "hanzo/model/GpuList.h"
#include "hanzo/model/JobCancel.h"
#include "hanzo/model/JobCanceled.h"
#include "hanzo/model/JobList.h"
#include "hanzo/model/MachineList.h"
#include "hanzo/model/MachineView.h"
#include "hanzo/model/NodeList.h"
#include "hanzo/model/NodePoolView.h"
#include "hanzo/model/PoolCreate.h"
#include "hanzo/model/PoolScale.h"
#include "hanzo/model/SampleAccepted.h"
#include "hanzo/model/SampleIngest.h"
#include "hanzo/model/SampleList.h"
#include "hanzo/model/WorkerList.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class ComputeApi
{
public:
explicit ComputeApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~ComputeApi();
/// <summary>
/// Attaches a BYO cluster to the caller&#39;s org — the kubeconfig is validated, KMS-sealed and added to the fleet — and answers 201 with the cluster as it now appears on GET /v1/compute/clusters.
/// </summary>
/// <remarks>
/// Attaches a BYO cluster to the caller&#39;s org — the kubeconfig is validated, KMS-sealed and added to the fleet — and answers 201 with the cluster as it now appears on GET /v1/compute/clusters. Billed the nominal management fee: the customer brings the compute, Hanzo meters the management plane.
/// </remarks>
/// <param name="clusterAttach"></param>
pplx::task<std::shared_ptr<ClusterView>> attachCluster(
std::shared_ptr<ClusterAttach> clusterAttach
) const;
/// <summary>
/// Binds a cloud Agent to one of the caller org&#39;s machines: the machine is recorded as running that Agent&#39;s @hanzo/bot runtime.
/// </summary>
/// <remarks>
/// Binds a cloud Agent to one of the caller org&#39;s machines: the machine is recorded as running that Agent&#39;s @hanzo/bot runtime. The owning org is the validated tenant, never a client field.
/// </remarks>
/// <param name="id">ID is the machine to bind, from the URL path.</param>
/// <param name="bindAgentReq"></param>
pplx::task<std::shared_ptr<AgentBinding>> bindMachineAgent(
utility::string_t id,
std::shared_ptr<BindAgentReq> bindAgentReq
) const;
/// <summary>
/// Cancels a queued or running render in the caller&#39;s org.
/// </summary>
/// <remarks>
/// Cancels a queued or running render in the caller&#39;s org. The engine cancel is org-scoped, so a tenant can only ever cancel its OWN job: a job in another tenant&#39;s shard is 404, exactly like one that never existed. An already-finished job is 409.
/// </remarks>
/// <param name="id">ID is the job (activity) id, from the URL path.</param>
/// <param name="jobCancel"></param>
pplx::task<std::shared_ptr<JobCanceled>> cancelFleetJob(
utility::string_t id,
std::shared_ptr<JobCancel> jobCancel
) const;
/// <summary>
/// Provisions a DOKS cluster for the caller&#39;s org and answers 201.
/// </summary>
/// <remarks>
/// Provisions a DOKS cluster for the caller&#39;s org and answers 201. ADMIN-GATED — a SuperAdmin, or an OrgAdmin of the caller&#39;s own org — because provisioning spends real infrastructure on the house account. The request is validated at this boundary, then Visor owns provisioning and the hanzo-org ownership tag.
/// </remarks>
/// <param name="createClusterReq"></param>
pplx::task<std::shared_ptr<ClusterView>> createKubernetesCluster(
std::shared_ptr<CreateClusterReq> createClusterReq
) const;
/// <summary>
/// Adds a node pool to one of the caller org&#39;s clusters and answers 201 with the created pool.
/// </summary>
/// <remarks>
/// Adds a node pool to one of the caller org&#39;s clusters and answers 201 with the created pool. Only the CreateNodePoolSpec fields are forwarded; owner/provider/clusterId ride in the query exactly as Visor expects them.
/// </remarks>
/// <param name="clusterId">ClusterID is the cluster to add the pool to, from the URL path.</param>
/// <param name="poolCreate"></param>
pplx::task<std::shared_ptr<NodePoolView>> createNodePool(
utility::string_t clusterId,
std::shared_ptr<PoolCreate> poolCreate
) const;
/// <summary>
/// Destroys a DOKS cluster by id and answers 204.
/// </summary>
/// <remarks>
/// Destroys a DOKS cluster by id and answers 204. ADMIN-GATED, like create. Visor scopes the delete to the org (refuses a foreign id), so this can only ever remove the caller org&#39;s own cluster.
/// </remarks>
/// <param name="id">ID is the provider&#39;s DOKS cluster id. Visor scopes the lookup to the caller&#39;s org, so another tenant&#39;s id resolves to not-found rather than their cluster.</param>
pplx::task<void> deleteKubernetesCluster(
utility::string_t id
) const;
/// <summary>
/// Terminates one of the caller org&#39;s machines.
/// </summary>
/// <remarks>
/// Terminates one of the caller org&#39;s machines. Visor takes the machine identity as owner+name, and the owner is the validated principal, so a caller can only ever terminate its own tenant&#39;s machine. Answers 204.
/// </remarks>
/// <param name="id">ID is the machine&#39;s org-scoped NAME — the stable key Visor addresses a machine by (owner/name), not the ephemeral provider id.</param>
pplx::task<void> deleteMachine(
utility::string_t id
) const;
/// <summary>
/// Removes a node pool from one of the caller org&#39;s clusters.
/// </summary>
/// <remarks>
/// Removes a node pool from one of the caller org&#39;s clusters. The owner scopes the delete to the caller&#39;s tenant; provider+clusterId drive the provider-side removal. Answers 204.
/// </remarks>
/// <param name="clusterId">ClusterID and PoolID address the pool, from the URL path.</param>
/// <param name="poolId"></param>
/// <param name="provider">Provider is the cloud the cluster lives on, from ?provider&#x3D;. Required. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<void> deleteNodePool(
utility::string_t clusterId,
utility::string_t poolId,
boost::optional<utility::string_t> provider
) const;
/// <summary>
/// Removes a BYO cluster from the caller org&#39;s fleet.
/// </summary>
/// <remarks>
/// Removes a BYO cluster from the caller org&#39;s fleet. It only ever touches BYO clusters — a managed cluster&#39;s nodes are removed through the node-pool routes — and answers 404 when the name is not in this org&#39;s fleet.
/// </remarks>
/// <param name="id">ID is the cluster&#39;s fleet name (the &#x60;name&#x60; it was attached under), matched lower-cased.</param>
pplx::task<std::shared_ptr<ClusterDetached>> detachCluster(
utility::string_t id
) const;
/// <summary>
/// Regions lists the regions a machine can be launched in.
/// </summary>
/// <remarks>
/// Regions lists the regions a machine can be launched in. The catalog is GLOBAL — identical for every tenant — so no owner is forwarded upstream. It is still org-gated, because a catalog is a map of what this deployment can spend money in and an anonymous caller has no business reading it.
/// </remarks>
pplx::task<std::shared_ptr<AnyType>> getComputeRegions(
) const;
/// <summary>
/// Sizes lists the machine sizes available to launch, with their specifications.
/// </summary>
/// <remarks>
/// Sizes lists the machine sizes available to launch, with their specifications. Global and org-gated, exactly as the region catalog is, and for the same reasons.
/// </remarks>
pplx::task<std::shared_ptr<AnyType>> getComputeSizes(
) const;
/// <summary>
/// Returns one cluster&#39;s detail: node pools + worker nodes.
/// </summary>
/// <remarks>
/// Returns one cluster&#39;s detail: node pools + worker nodes. Visor scopes the lookup to the org (a foreign or missing id resolves to not-found), so a tenant can never read another tenant&#39;s cluster by guessing an id.
/// </remarks>
/// <param name="id">ID is the provider&#39;s DOKS cluster id. Visor scopes the lookup to the caller&#39;s org, so another tenant&#39;s id resolves to not-found rather than their cluster.</param>
pplx::task<std::shared_ptr<ClusterDetailView>> getKubernetesCluster(
utility::string_t id
) const;
/// <summary>
/// Returns one of the caller org&#39;s machines by its org-scoped name.
/// </summary>
/// <remarks>
/// Returns one of the caller org&#39;s machines by its org-scoped name. Visor keys the lookup by owner/name, so an id belonging to another tenant resolves to not-found rather than another org&#39;s machine.
/// </remarks>
/// <param name="id">ID is the machine&#39;s org-scoped NAME — the stable key Visor addresses a machine by (owner/name), not the ephemeral provider id.</param>
pplx::task<std::shared_ptr<MachineView>> getMachine(
utility::string_t id
) const;
/// <summary>
/// Returns the agent binding of one of the caller org&#39;s machines, or 404 when the machine runs no bot runtime.
/// </summary>
/// <remarks>
/// Returns the agent binding of one of the caller org&#39;s machines, or 404 when the machine runs no bot runtime.
/// </remarks>
/// <param name="id">ID is the machine&#39;s org-scoped NAME — the stable key Visor addresses a machine by (owner/name), not the ephemeral provider id.</param>
pplx::task<std::shared_ptr<AgentBinding>> getMachineAgent(
utility::string_t id
) const;
/// <summary>
/// Returns the caller org&#39;s clusters from both sources: the managed clusters projected from Visor&#39;s node pools, and the BYO clusters attached to the caller&#39;s project.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s clusters from both sources: the managed clusters projected from Visor&#39;s node pools, and the BYO clusters attached to the caller&#39;s project. A Visor outage costs the managed half only — the BYO half still lists, because a page that 502s on an optional provider is worse than a page that shows what it can.
/// </remarks>
pplx::task<std::shared_ptr<ClusterList>> listClusters(
) const;
/// <summary>
/// Returns every compute unit the caller&#39;s org has, from every source, each carrying its latest utilization: agent run-targets, the BYO machines that dialed in, attached BYO clusters and Visor-provisioned machines.
/// </summary>
/// <remarks>
/// Returns every compute unit the caller&#39;s org has, from every source, each carrying its latest utilization: agent run-targets, the BYO machines that dialed in, attached BYO clusters and Visor-provisioned machines. A unit with a live snapshot of its own keeps it; the rest are overlaid from the utilization series, and only when the sample agrees about the SOURCE — two planes could mint the same unit id, and a board must never show one machine&#39;s load on another&#39;s row. BYO GPU units also carry their gpu-jobs queue depth. Every source is folded in independently: a broken one costs its own rows and nothing else.
/// </remarks>
pplx::task<std::shared_ptr<FleetBoard>> listFleet(
) const;
/// <summary>
/// Returns the caller org&#39;s gpu-jobs render queue, each row tagged with the GPU it targets (empty &#x3D; the shared any-GPU lane) and the node claiming it, optionally narrowed to one GPU&#39;s queue and/or one status.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s gpu-jobs render queue, each row tagged with the GPU it targets (empty &#x3D; the shared any-GPU lane) and the node claiming it, optionally narrowed to one GPU&#39;s queue and/or one status. A job whose worker died — STARTED with an elapsed lease and not yet reclaimed — reads \&quot;stalled\&quot;, not \&quot;running\&quot;. Fail-soft: an unavailable tasks engine yields an empty queue rather than an error.
/// </remarks>
/// <param name="gpu">GPU selects one node&#39;s lane: jobs TARGETED at it (gpu:&lt;node&gt;) or CLAIMED by it. The literal \&quot;shared\&quot; selects the any-GPU lane — no target, no claimant. Matched case-insensitively. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="status">Status selects one lifecycle state: queued, running, stalled, completed, failed or canceled. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<JobList>> listFleetJobs(
boost::optional<utility::string_t> gpu,
boost::optional<utility::string_t> status
) const;
/// <summary>
/// Returns the caller org&#39;s utilization series, oldest first.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s utilization series, oldest first. A rejected narrower is a 400 carrying its own reason (the vocabulary is ours and safe to echo); a warehouse failure is logged and answered 503 \&quot;unavailable\&quot;, because a chart that silently reads \&quot;no load\&quot; when the truth is \&quot;we cannot tell\&quot; is worse than one that says so. An ABSENT warehouse is different again: it returns an empty series, which renders honestly as \&quot;no samples yet\&quot;.
/// </remarks>
/// <param name="unit">Unit selects one compute unit&#39;s series by its source-local id. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="source">Source selects one plane: \&quot;agent\&quot;, \&quot;byo\&quot; or \&quot;visor\&quot;. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="range">Range is the lookback window (e.g. \&quot;1h\&quot;, \&quot;24h\&quot;, \&quot;7d\&quot;); empty takes the warehouse default. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<SampleList>> listFleetSamples(
boost::optional<utility::string_t> unit,
boost::optional<utility::string_t> source,
boost::optional<utility::string_t> range
) const;
/// <summary>
/// Returns the caller org&#39;s BYO machines — the ones that dialed in via &#x60;hanzo link&#x60; — with everything each host reported about itself.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s BYO machines — the ones that dialed in via &#x60;hanzo link&#x60; — with everything each host reported about itself. The Machines and GPUs pages fold the same data into their normalized shapes; this is the canonical raw list a fleet view (or the CLI&#39;s &#x60;status&#x60;) reads.
/// </remarks>
pplx::task<std::shared_ptr<WorkerList>> listFleetWorkers(
) const;
/// <summary>
/// Is an HONEST empty surface: Visor exposes no GPU alert inventory, so this returns [] rather than fabricating alerts.
/// </summary>
/// <remarks>
/// Is an HONEST empty surface: Visor exposes no GPU alert inventory, so this returns [] rather than fabricating alerts. It stays a real, tenant-gated route so the console&#39;s alerts fetch resolves (200 [], not a 404) — an honest \&quot;no alerts\&quot;, the same discipline the rest of the surface follows.
/// </remarks>
pplx::task<std::shared_ptr<GpuAlertList>> listGpuAlerts(
) const;
/// <summary>
/// Returns one row per physical accelerator the caller&#39;s org has, derived from its real GPU machines (the size slug says how many cards a node holds) and from the accelerators BYO workers report through nvidia-smi.
/// </summary>
/// <remarks>
/// Returns one row per physical accelerator the caller&#39;s org has, derived from its real GPU machines (the size slug says how many cards a node holds) and from the accelerators BYO workers report through nvidia-smi. Live telemetry is absent on Visor rows because Visor&#39;s machine object carries none — an honest omission the console renders as \&quot;—\&quot;, never a fabricated 0.
/// </remarks>
pplx::task<std::shared_ptr<GpuList>> listGpus(
) const;
/// <summary>
/// Lists the org&#39;s DOKS clusters (Visor, house account) folded with the org&#39;s BYO clusters — ONE fleet cluster view under the unified k8s noun.
/// </summary>
/// <remarks>
/// Lists the org&#39;s DOKS clusters (Visor, house account) folded with the org&#39;s BYO clusters — ONE fleet cluster view under the unified k8s noun. A Visor outage is logged and skipped so a down optional provider never hides the BYO list.
/// </remarks>
pplx::task<std::shared_ptr<ClusterList>> listKubernetesClusters(
) const;
/// <summary>
/// Returns every DOKS worker node in the org&#39;s clusters as a machine — the SAME set the fleet folds in (managedMachines), exposed directly under the k8s noun.
/// </summary>
/// <remarks>
/// Returns every DOKS worker node in the org&#39;s clusters as a machine — the SAME set the fleet folds in (managedMachines), exposed directly under the k8s noun. House account (hanzo-org cluster tag) + BYOC, deduped by Visor.
/// </remarks>
pplx::task<std::shared_ptr<NodeList>> listKubernetesNodes(
) const;
/// <summary>
/// Returns every agent↔machine binding in the caller&#39;s org — which machines are running which cloud Agent, with vm&#39;s own reconciled status.
/// </summary>
/// <remarks>
/// Returns every agent↔machine binding in the caller&#39;s org — which machines are running which cloud Agent, with vm&#39;s own reconciled status.
/// </remarks>
pplx::task<std::shared_ptr<BindingList>> listMachineAgents(
) const;
/// <summary>
/// Returns every machine the caller&#39;s org has — Visor&#39;s registry, the live DigitalOcean droplets and the DOKS worker nodes (deduped into one union), plus the BYO machines that dialed in via &#x60;hanzo link&#x60; (provider \&quot;byo\&quot;).
/// </summary>
/// <remarks>
/// Returns every machine the caller&#39;s org has — Visor&#39;s registry, the live DigitalOcean droplets and the DOKS worker nodes (deduped into one union), plus the BYO machines that dialed in via &#x60;hanzo link&#x60; (provider \&quot;byo\&quot;). A source Visor cannot answer for is logged and skipped, never an error: one wedged upstream must not hide the machines the other sources can see.
/// </remarks>
/// <param name="kind"> (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<MachineList>> listMachines(
boost::optional<utility::string_t> kind
) const;
/// <summary>
/// Launch a metered machine for your org, or price one first with dryRun
/// </summary>
/// <remarks>
/// Provisions a machine owned by the caller&#39;s org and answers 201 with the machine. Send &#x60;dryRun: true&#x60; to get a PRICE QUOTE instead: 200 with the upstream quote passed through verbatim, nothing launched and nothing spent. Two response shapes on one address is the rule to know, and it is why this is not a typed op. Metering is not this plane&#39;s: the launch fronts the compute provider&#39;s resell endpoint, which owns the balance gate and the per-hour meter, and cloud only forwards the tenant. Ownership is the validated principal&#39;s org and is never read from the body, so a launch always lands in the caller&#39;s OWN tenant and the machine it creates is only ever visible to that tenant. Fails closed: a validated principal is required (403 without one) and &#x60;size&#x60; (or its &#x60;instanceType&#x60; alias) is required (400).
/// </remarks>
pplx::task<void> postComputeMachines(
) const;
/// <summary>
/// Message a bot, or stop it, by naming the action in the path
/// </summary>
/// <remarks>
/// Dispatches one verb against a bot the caller&#39;s org owns. &#x60;message&#x60; runs the bot&#39;s bound agent with the request body as the message and streams the agent&#39;s answer back VERBATIM — the upstream body, its content type and its status — so a message is a real agent run, recorded, billed and traced exactly like any other, under the caller&#39;s own identity rather than a fabricated one. &#x60;stop&#x60; and &#x60;pause&#x60; are the same single honest capability: they halt the runtime by unbinding the agent while LEAVING THE MACHINE UP, so the bot stops answering but keeps costing — rebind to resume, or delete the bot to tear it down. Stopping is idempotent; a bot with no binding still reports stopped. Org-scoped and fails closed: a validated principal is required (403 without one) and the bot is addressed under the caller&#39;s OWN org, so another tenant&#39;s id is not reachable. An unknown action is a clean 400 naming the three it accepts, never a silent no-op, and messaging a bot with no bound agent is a 400.
/// </remarks>
/// <param name="id"></param>
/// <param name="action"></param>
pplx::task<void> postComputeMachinesByIdByAction(
utility::string_t id,
utility::string_t action
) const;
/// <summary>
/// Records a BYO worker&#39;s live GPU utilization into the SAME series the fleet board overlays.
/// </summary>
/// <remarks>
/// Records a BYO worker&#39;s live GPU utilization into the SAME series the fleet board overlays. The org is the validated principal and source/kind are fixed server-side, so a worker names only its own metrics — never another tenant or another source. Answers 202: the warehouse write is DETACHED (its own bounded context, never in the response path), so a slow or absent warehouse cannot stall a heartbeat.
/// </remarks>
/// <param name="sampleIngest"></param>
pplx::task<std::shared_ptr<SampleAccepted>> recordFleetSample(
std::shared_ptr<SampleIngest> sampleIngest
) const;
/// <summary>
/// Resizes a node pool to an absolute node count and returns the pool as Visor reports it after the change.
/// </summary>
/// <remarks>
/// Resizes a node pool to an absolute node count and returns the pool as Visor reports it after the change.
/// </remarks>
/// <param name="clusterId">ClusterID is the cluster holding the pool, from the URL path.</param>
/// <param name="poolId">PoolID is the pool to resize, from the URL path — the &#x60;poolId&#x60; a cluster read reports for it. Required.</param>
/// <param name="poolScale"></param>
pplx::task<std::shared_ptr<NodePoolView>> scaleNodePool(
utility::string_t clusterId,
utility::string_t poolId,
std::shared_ptr<PoolScale> poolScale
) const;
/// <summary>
/// Detaches the agent runtime from one of the caller org&#39;s machines.
/// </summary>
/// <remarks>
/// Detaches the agent runtime from one of the caller org&#39;s machines. The machine stays — this halts the bot, it does not terminate the compute. Answers 204.
/// </remarks>
/// <param name="id">ID is the machine&#39;s org-scoped NAME — the stable key Visor addresses a machine by (owner/name), not the ephemeral provider id.</param>
pplx::task<void> unbindMachineAgent(
utility::string_t id
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_ComputeApi_H_ */