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.
134 lines
8.4 KiB
C++
134 lines
8.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.
|
|
*/
|
|
|
|
/*
|
|
* NetworkApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_NetworkApi_H_
|
|
#define HANZO_API_NetworkApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/IdentityIn.h"
|
|
#include "hanzo/model/IdentityList.h"
|
|
#include "hanzo/model/IdentityView.h"
|
|
#include "hanzo/model/MeshServiceList.h"
|
|
#include "hanzo/model/NetworkList.h"
|
|
#include "hanzo/model/NetworkView.h"
|
|
#include "hanzo/model/PublishedView.h"
|
|
#include "hanzo/model/RouterList.h"
|
|
#include "hanzo/model/ServiceIn.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class NetworkApi
|
|
{
|
|
public:
|
|
|
|
explicit NetworkApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~NetworkApi();
|
|
|
|
/// <summary>
|
|
/// Removes one of the org's fabric identities.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one of the org's fabric identities. The device's credential stops authenticating and its enrollment, if unspent, stops enrolling. An id belonging to another org — or to nothing — is 404 before any write reaches the controller: whether an identity exists is itself a cross-tenant fact, and a delete may only ever act on what the caller could list.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the identity id from the path. The URL is the addressing authority, so it binds from there whatever else the request carries.</param>
|
|
pplx::task<void> deleteNetworkIdentitiesById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller's org overlay network on the Zero Trust fabric.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller's org overlay network on the Zero Trust fabric. The org has at most ONE overlay, projected from the edge-routers tagged with its \"org-<org>\" role attribute: nodes is the real router count and status is \"connected\" once at least one router has dialed home, \"provisioning\" while none has. An org with no routers gets an empty list, never a fabricated network. The read degrades rather than erroring: a deployment with no ZT credential, and a controller that cannot be reached, both answer 200 with an empty list so the console's Networks page renders a clean empty state instead of an error.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<NetworkList>> getNetwork(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns one overlay network by id, scoped to the caller's org.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns one overlay network by id, scoped to the caller's org. The org has exactly one overlay network and its id is derived from the org, so any other id — another tenant's, or one that does not exist — is 404 rather than a peek across the tenant boundary. An org whose network exists but has no edge-routers is 404 too, for the same reason the list is empty: there is no overlay until something is on it.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the network id from the path. The URL is the addressing authority, so it binds from there whatever else the request carries.</param>
|
|
pplx::task<std::shared_ptr<NetworkView>> getNetworkById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the fabric identities the caller's org owns.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the fabric identities the caller's org owns. One row per identity tagged with the org's \"org-<org>\" role attribute — a device minted here, enrolled or not. An identity that has not yet enrolled still carries its one-time enrollment, so a mislaid JWT is read again here rather than re-minted. A tenancy read over the full inventory, so like the mesh list it does NOT degrade: an unconfigured deployment answers 503.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<IdentityList>> getNetworkIdentities(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the Zero Trust routers the caller's org owns.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the Zero Trust routers the caller's org owns. One row per real ZT edge-router tagged with the org's \"org-<org>\" role attribute, carrying the controller's own health signal: \"online\" when connected, \"disabled\" when administratively disabled, \"offline\" otherwise. region is filled only from a \"region-<slug>\" role attribute and omitted when the router carries none, so the column renders \"—\" rather than a guess. The read degrades rather than erroring: a deployment with no ZT credential, and a controller that cannot be reached, both answer 200 with an empty list.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<RouterList>> getNetworkRouters(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the Zero Trust edge services the caller's org owns.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the Zero Trust edge services the caller's org owns. One row per real ZT edge service tagged with the org's \"org-<org>\" role attribute: mtls is \"required\" when the service mandates end-to-end encryption and \"enabled\" otherwise (the fabric always mutually authenticates every link), and status is \"active\" because a listed service is a configured, dialable entry. A service tagged for another org, or tagged for none, is invisible here. Unlike the network and router reads this does NOT degrade: an unconfigured deployment answers 503 and an unreachable controller surfaces the upstream's status, so a mesh page never renders \"no services\" for a fabric it simply could not read.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<MeshServiceList>> getNetworkServices(
|
|
) const;
|
|
/// <summary>
|
|
/// Mints a fabric identity for a device the caller's org brings.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Mints a fabric identity for a device the caller's org brings. The identity is created of type Device, tagged with the org's \"org-<org>\" role attribute plus any supplied roles — each scoped to the org, and a \"<service>-host\" role refused unless the org has published that service. The answer carries the controller's one-time enrollment JWT: the device presents it once to join the fabric, and until it does the same token can be read back off GET /v1/network/identities. A write, so it does not degrade: an unconfigured deployment answers 503.
|
|
/// </remarks>
|
|
/// <param name="identityIn"></param>
|
|
pplx::task<std::shared_ptr<IdentityView>> postNetworkIdentities(
|
|
std::shared_ptr<IdentityIn> identityIn
|
|
) const;
|
|
/// <summary>
|
|
/// Puts a name on the org's overlay: a fabric service forwarding to host:port on whichever of the org's devices carries the \"<name>-host\" role, dialable at \"<name>.<org>.zt\" by any of the org's identities — and by the cloud's own, which is what lets a BYO cluster's apiserver be attached to the fleet with a \".zt\" kubeconfig.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Puts a name on the org's overlay: a fabric service forwarding to host:port on whichever of the org's devices carries the \"<name>-host\" role, dialable at \"<name>.<org>.zt\" by any of the org's identities — and by the cloud's own, which is what lets a BYO cluster's apiserver be attached to the fleet with a \".zt\" kubeconfig. Answers 201 with the service and its DNS name. The objects behind it are created in dependency order and unwound on failure, so a half-published service never lingers on the fabric. A write, so it does not degrade: an unconfigured deployment answers 503.
|
|
/// </remarks>
|
|
/// <param name="serviceIn"></param>
|
|
pplx::task<std::shared_ptr<PublishedView>> postNetworkServices(
|
|
std::shared_ptr<ServiceIn> serviceIn
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_NetworkApi_H_ */
|
|
|