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.
138 lines
8.7 KiB
C++
138 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.
|
|
*/
|
|
|
|
/*
|
|
* DatasetApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_DatasetApi_H_
|
|
#define HANZO_API_DatasetApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/RiskDataset.h"
|
|
#include "hanzo/model/RiskDatasetDisposal.h"
|
|
#include "hanzo/model/RiskDatasetList.h"
|
|
#include "hanzo/model/RiskDatasetRows.h"
|
|
#include "hanzo/model/RiskDatasetSpec.h"
|
|
#include "hanzo/model/RiskDatasetVersions.h"
|
|
#include "hanzo/model/RiskLineage.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class DatasetApi
|
|
{
|
|
public:
|
|
|
|
explicit DatasetApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~DatasetApi();
|
|
|
|
/// <summary>
|
|
/// Declare the next version of a dataset
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Declares the next version of a dataset from a bound query over this org's own feature surface. It mints a VERSION and writes no rows: a version is declared, then materialised once, then never rewritten. Version numbers are monotone and never reused, so \"version 3 of signups\" means one thing forever — which is the whole reason a model can cite one. The window is bounded by the source's retention, the horizon by a year, the rows by the plane's cap, and the number of datasets and versions per org by their own limits. Every refusal names which bound it hit.
|
|
/// </remarks>
|
|
/// <param name="riskDatasetSpec"></param>
|
|
pplx::task<std::shared_ptr<RiskDataset>> riskCreateDataset(
|
|
std::shared_ptr<RiskDatasetSpec> riskDatasetSpec
|
|
) const;
|
|
/// <summary>
|
|
/// Describe every version of one dataset
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Dataset describes every version of one dataset, newest first — the whole history, because the point of a version is that the older ones are still there and a model fitted last quarter cites one of them. A name this org does not own answers 404, exactly as an unknown name does, so a probe learns nothing about another tenant's datasets.
|
|
/// </remarks>
|
|
/// <param name="name">Name is the dataset, from the path.</param>
|
|
pplx::task<std::shared_ptr<RiskDatasetVersions>> riskDataset(
|
|
utility::string_t name
|
|
) const;
|
|
/// <summary>
|
|
/// Show where a version's rows came from, and whether that can still be demonstrated
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Shows where a version's rows came from and whether that can still be demonstrated. The answer is MEASURED, not recalled: the plane asks the source the same bounded question again and compares it to the fingerprint taken when the version was built. Anything but exact agreement is reported as drift — the source is fed by a rollup that runs behind the events, so \"it holds more now\" is the ordinary case and it means re-running the spec would not reproduce this version. An admitted gap is actionable; an unfalsifiable claim is not. IT IS A PRICED, BOUNDED READ, because it is the same statement a materialisation is charged for: an exact distinct-count over up to 400 days of this org's feature surface. It takes the org's ONE source-scan slot, so a tenant looping it spends one scan and not a thousand; it counts against the plane's ceiling, so the fleet's warehouse is bounded too; and it runs under this plane's own deadline rather than the caller's patience.
|
|
/// </remarks>
|
|
/// <param name="name">Name is the dataset, from the path.</param>
|
|
/// <param name="version">Version is the version to trace. Zero takes the newest published one. (optional, default to 0L)</param>
|
|
pplx::task<std::shared_ptr<RiskLineage>> riskDatasetLineage(
|
|
utility::string_t name,
|
|
boost::optional<int64_t> version
|
|
) const;
|
|
/// <summary>
|
|
/// List this org's datasets
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Datasets lists this org's datasets, each with its newest version. An org that has declared none gets an empty list; a store that cannot be reached gets a refusal, never an empty list, because the two read identically and only one of them is true.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<RiskDatasetList>> riskDatasets(
|
|
) const;
|
|
/// <summary>
|
|
/// Dispose of one dataset and every version of it
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Disposes of one dataset and every version of it: the rows are dropped and the register is marked with what went. This is the ONLY expiry in this plane. Neither table carries a TTL, deliberately: a table TTL is a fleet-wide clock no tenant can hold longer or shorten, which is the opposite of a retention decision belonging to the tenant whose records they are. The drop is a partition drop on (org, dataset), so the tenant is the first component of the thing being dropped and a disposal cannot be spelled across one. The BYTES are what goes. The register keeps one `disposed` row per version — the name, the number, the spec, the digest and who disposed of it when — for two reasons: a retention obligation is answered by a record of the deletion, not by silence; and version numbers must stay monotone, so that after `orders` is disposed of and declared again the next version is 4 and not 1. A number that could be reused would make every citation of `orders v3` ambiguous forever. It is not reversible and there is no soft state in between. A version a model cited has no rows once this returns, and every read of it says so.
|
|
/// </remarks>
|
|
/// <param name="name">Name is the dataset, from the path.</param>
|
|
pplx::task<std::shared_ptr<RiskDatasetDisposal>> riskDeleteDataset(
|
|
utility::string_t name
|
|
) const;
|
|
/// <summary>
|
|
/// Read a version's rows back, one page at a time
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads a published version's rows back, one bounded page at a time, in the version's own stable row order. Only a published version can be exported. Rows written by an attempt that never completed are inert — no register row names them — and they are disposed of with the dataset.
|
|
/// </remarks>
|
|
/// <param name="name">Name is the dataset, from the path.</param>
|
|
/// <param name="version">Version is the version to read. Zero takes the newest published one. (optional, default to 0L)</param>
|
|
/// <param name="split">Split narrows to train, val or test. Empty reads every split. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="offset">Offset is where the page starts, in the version's own row order (by id, which is derived from the row and therefore stable forever). (optional, default to 0L)</param>
|
|
/// <param name="limit">Limit is how many rows to return. Zero and anything above the plane's bound take the bound. (optional, default to 0L)</param>
|
|
pplx::task<std::shared_ptr<RiskDatasetRows>> riskExportDataset(
|
|
utility::string_t name,
|
|
boost::optional<int64_t> version,
|
|
boost::optional<utility::string_t> split,
|
|
boost::optional<int64_t> offset,
|
|
boost::optional<int64_t> limit
|
|
) const;
|
|
/// <summary>
|
|
/// Materialise the declared version into immutable rows
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Builds the declared version into immutable rows and answers 202 as soon as the attempt is on record. It never holds the request open for the work: a materialisation is a bounded warehouse scan, and letting an HTTP client's timeout be a data plane's timeout is how one tenant's retry loop becomes everyone's outage. ONE materialisation runs per org at a time; a second is refused rather than queued, because a queue admits the same work later and the honest answer to \"again\" while one is running is that one is running. Only a DECLARED version is admitted. A published version is immutable, and a version whose earlier attempt did not complete is never re-attempted — that would union two runs' rows under one number and make the digest a lie. In both cases the answer is to declare a new version, which is what a second run over a moving source honestly is.
|
|
/// </remarks>
|
|
/// <param name="name">Name is the dataset, from the path.</param>
|
|
pplx::task<std::shared_ptr<RiskDataset>> riskMaterializeDataset(
|
|
utility::string_t name
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_DatasetApi_H_ */
|
|
|