Files
zeekay 645325a641 regenerate from cloud 939b09d4
The projection was 113 commits behind the document it claims to describe, and
`generate.py --all --check` reported every one of the thirteen clients DRIFTED —
the same +19 models in each, because they all fell behind the same emission.

Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4
(sha256 087024f6…), which is the only description of this API that cannot name a
route the binary does not serve. `--check` is clean across all thirteen after.

.spec-lock moved with the code. The generator READS that file and never writes
it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous
document. A lock that disagrees with the tree beside it is worse than no lock:
the next `--check` without `--spec` fetches what production serves, compares it
to a digest that was already wrong, and reports drift that is really staleness.
2026-08-24 23:32:53 -07:00

122 lines
7.4 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.
*/
/*
* MlApi.h
*
*
*/
#ifndef HANZO_API_MlApi_H_
#define HANZO_API_MlApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/MlCreate.h"
#include "hanzo/model/MlResource.h"
#include "hanzo/model/MlResourceList.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class MlApi
{
public:
explicit MlApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~MlApi();
/// <summary>
/// Deletes a deployed inference model.
/// </summary>
/// <remarks>
/// Deletes a deployed inference model. kserve owns the teardown: the InferenceService goes away and the serving deployment behind it follows, so the model stops answering predict calls. Answers 204, or 404 for a name the caller&#39;s org does not own.
/// </remarks>
/// <param name="name">Name is the resource to act on, taken from the path. Lower-cased and trimmed to the DNS-1123 label a CustomResource&#39;s metadata.name must be.</param>
pplx::task<void> deleteMlModelsByName(
utility::string_t name
) const;
/// <summary>
/// Whether model serving can actually work right now
/// </summary>
/// <remarks>
/// Reports whether the model-serving plane is genuinely usable: that the Kubernetes API answers, that the InferenceService CRD is actually served by this cluster, and that the cluster holds at least one serving runtime to run a model ON. It is a REAL probe, not status theatre — it makes a live call rather than reporting a flag set at boot. 200 only when everything checks out. Otherwise 503 CARRYING THE REPORT — which component failed, and the real error — and that body is the reason this is not a typed op: a typed op reaches a non-2xx by returning an error, and the envelope that produces would drop exactly the detail the probe exists to deliver. The runtime count is reported as its own field and is a SEPARATE fact from the CRD being served: a cluster with the CRD but no runtime accepts a deploy and then never schedules it, so reporting only the CRD would answer 200 while every model hangs. A runtime list this service cannot read reports the read error instead of a count, because a missing grant is a broken probe and not an empty cluster. It answers about the cluster, not about a tenant, so it takes no org and reveals no tenant data. A cluster with no kserve CRD reports degraded honestly rather than failing later at the first deploy.
/// </remarks>
pplx::task<void> getMlHealth(
) const;
/// <summary>
/// Lists the inference models deployed in the caller&#39;s org.
/// </summary>
/// <remarks>
/// Lists the inference models deployed in the caller&#39;s org. Each entry carries the model&#39;s name, when Kubernetes admitted it, and kserve&#39;s live status — the spec is on the single-model read. An org that has deployed nothing gets an empty list.
/// </remarks>
pplx::task<std::shared_ptr<MlResourceList>> getMlModels(
) const;
/// <summary>
/// Returns one deployed inference model.
/// </summary>
/// <remarks>
/// Returns one deployed inference model. Its spec comes with it, and kserve&#39;s live status, which is where readiness and the serving address appear. A name the caller&#39;s org does not own answers 404, exactly as an unknown name does, so a probe learns nothing about another tenant&#39;s models.
/// </remarks>
/// <param name="name">Name is the resource to act on, taken from the path. Lower-cased and trimmed to the DNS-1123 label a CustomResource&#39;s metadata.name must be.</param>
pplx::task<std::shared_ptr<MlResource>> getMlModelsByName(
utility::string_t name
) const;
/// <summary>
/// Change a deployed model in place
/// </summary>
/// <remarks>
/// Applies a JSON merge patch to one of the caller org&#39;s deployed models and answers the updated resource — the way to change a model&#39;s image, replica count or resource requests without tearing the deployment down. The body is relayed to Kubernetes VERBATIM. That is deliberate and it is why this route is not a typed op: re-encoding a merge patch changes what it means, because an integer that round-trips through a generic decoder comes back a float. Merge-patch semantics apply as written — a null removes a field, and a list is replaced whole rather than merged. Scoped to the caller&#39;s own tenant namespace, resolved from the validated org and project; a name the caller&#39;s tenant does not hold is a 404, never another tenant&#39;s resource. An empty body is refused, and a patch Kubernetes rejects comes back 422 with its reason rather than being silently dropped.
/// </remarks>
/// <param name="name"></param>
pplx::task<void> patchMlModelsByName(
utility::string_t name
) const;
/// <summary>
/// Deploys one inference model for the caller&#39;s org, and answers 201 with the model as Kubernetes admitted it.
/// </summary>
/// <remarks>
/// Deploys one inference model for the caller&#39;s org, and answers 201 with the model as Kubernetes admitted it. The &#x60;spec&#x60; is a kserve InferenceService spec, passed through unchanged — this plane owns the tenancy, the billing and the namespace, and kserve owns what a model IS. An unfunded org is refused BEFORE anything is created, so nobody runs free GPU compute and nobody is charged for a resource that was never made.
/// </remarks>
/// <param name="mlCreate"></param>
pplx::task<std::shared_ptr<MlResource>> postMlModels(
std::shared_ptr<MlCreate> mlCreate
) const;
/// <summary>
/// Run inference against one of your deployed models
/// </summary>
/// <remarks>
/// Sends the request body to the named model&#39;s predictor and answers the predictor&#39;s reply — its status code, its body bytes and its Content-Type, all unchanged. This is the inference call itself, not a description of one. VERBATIM IS THE CONTRACT, and it is why this route is not a typed op: a model-side error has to surface as the model&#39;s own error, not as this layer&#39;s paraphrase of it. The body shape is the kserve v2 inference protocol&#39;s, which means the runtime decides it, not this API. The v2 model name defaults to the resource name — kserve&#39;s single-model convention — and a multi-model runtime selects one with the &#x60;model&#x60; query parameter. A model that exists but has no serving address yet answers 503 &#39;not ready&#39; rather than a confusing connection error: deployed is not the same as serving. Scoped to the caller&#39;s own tenant namespace from the validated org and project, so a name another tenant owns is simply a 404. The predictor&#39;s response body is read up to a fixed ceiling.
/// </remarks>
/// <param name="name"></param>
pplx::task<void> postMlModelsByNamePredict(
utility::string_t name
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_MlApi_H_ */