@@ -11,18 +11,56 @@ section_menu_id: api
1111url : /docs/platform/{{.version}}/api/
1212aliases :
1313- /docs/platform/{{.version}}/api/README/
14+ - /docs/platform/{{.version}}/api/overview/
1415---
1516
1617# KubeDB Platform API Reference
1718
18- Low-level reference for the KubeDB Platform API. Every endpoint lists its HTTP method, path, authentication, path/query
19- parameters, and request/response shapes so you can implement a client directly
20- against it.
19+ The ** KubeDB Platform API Server** is the backend server of the KubeDB Platform. This page gives you both
20+ the whole-system picture — what the server does, how it is put together, how
21+ requests are authenticated and authorized, and how the pieces fit into typical
22+ flows — and the entry point to the low-level, endpoint-by-endpoint reference. Every
23+ endpoint on the per-group pages lists its HTTP method, path, authentication,
24+ path/query parameters, and request/response shapes so you can implement a client
25+ directly against it.
2126
2227All routes are served under the ` /api/v1 ` prefix unless noted otherwise. The
2328marketplace webhook service is a separate listener rooted at ` /marketplace/api/v1 ` .
2429
25- ## Authentication
30+ A machine-readable [ OpenAPI 3.0.3 specification] ( ../api/openapi.yaml ) of this API is
31+ also available (` openapi.yaml ` ) — load it into any OpenAPI tool (Swagger UI, Redoc,
32+ ` openapi-generator ` ) to explore the API or generate a client. A self-contained
33+ Swagger UI viewer (` api.html ` , with the spec inlined) is available at the repository
34+ root.
35+
36+ ## Overview
37+
38+ The KubeDB Platform API Server combines an identity foundation (users, organizations, teams,
39+ authentication) with a multi-cluster Kubernetes management platform providing:
40+
41+ - ** Identity & access management** — users, organizations, teams, fine-grained authorization.
42+ - ** Cluster management** — import, provision, and operate Kubernetes clusters (hub/spoke via Open Cluster Management, Rancher, cloud providers).
43+ - ** A full Kubernetes API proxy** — the KubeDB Platform UI talks to member clusters through the KubeDB Platform API Server.
44+ - ** Licensing & contracts** — issuing and enforcing product licenses (KubeDB, KubeStash, KubeVault, Voyager, ...).
45+ - ** Billing & usage reporting** — usage aggregation, invoices, cloud-marketplace metering (AWS/Azure/GCP).
46+ - ** Monitoring & telemetry** — telemetry stack provisioning, Prometheus/Trickster auth proxying.
47+
48+ ## System Architecture
49+
50+ ![ KubeDB Platform system architecture] ( ../api/images/architecture.svg )
51+
52+ Key runtime facts:
53+
54+ - One binary, multiple subcommands. The default command is the API server; ` marketplace ` , ` monitor ` ,
55+ ` aggregator ` , and ` summary ` run as separate processes for async/billing workloads.
56+ - ** NATS/JetStream** is the event backbone: member clusters push resource/usage events; ` monitor ` and
57+ ` aggregator ` consume them; the API server also uses NATS for its task manager and per-user credentials.
58+ - ** FluxCD (HelmRelease)** and ** OCM (ManagedCluster)** are used to deploy KubeDB Platform features onto clusters and
59+ to manage hub→spoke relationships.
60+ - Deployment modes are switched by ` DEPLOYMENT_TYPE ` : AppsCode-hosted, self-hosted (incl. offline
61+ installer), or AWS/GCP marketplace deployments. Some API groups only exist in specific modes (noted below).
62+
63+ ## Authentication & Authorization
2664
2765Most endpoints require a personal access token. Send it as an HTTP header:
2866
@@ -35,31 +73,85 @@ endpoints accept HTTP Basic auth. The web console uses a session cookie
3573(` i_like_ace ` ); a session cookie alone does ** not** authenticate the token-guarded
3674REST endpoints — use a token.
3775
38- A machine-readable [ OpenAPI 3.0.3 specification] ( ../api/openapi.yaml ) of this API is
39- also available (` openapi.yaml ` ) — load it into any OpenAPI tool (Swagger UI, Redoc,
40- ` openapi-generator ` ) to explore the API or generate a client. A self-contained
41- Swagger UI viewer (` api.html ` , with the spec inlined) is available at the repository
42- root.
76+ The server supports several authentication mechanisms:
77+
78+ | Mechanism | Used by | Notes |
79+ | ---| ---| ---|
80+ | Session cookie | Web console | Cookie-based sign-in; CSRF-protected |
81+ | Personal access token / Bearer token | API clients, CLI | ` Authorization: token <t> ` , ` ?token= ` , ` ?access_token= ` |
82+ | Basic auth | Token management endpoints | With optional OTP (2FA) |
83+ | OAuth2 / OIDC | SSO; the KubeDB Platform API Server is both provider and consumer | ` /login/oauth/* ` , ` /.well-known/openid-configuration ` |
84+ | LDAP / PAM | Enterprise sign-in sources | Configured by site admins |
85+ | 2FA / WebAuthn | User accounts | TOTP, scratch tokens, security keys |
86+ | License-based auth | Member clusters | Clusters authenticate with issued licenses / cluster tokens |
87+ | Sudo | Site admins | Impersonate a user via ` sudo ` param/header |
88+
89+ Authorization is relationship-based (OpenFGA-style checks, shown as ` authzCheck(<permission>) ` in the
90+ reference tables). Common middleware referenced in the API tables:
91+
92+ - ** Token** — authenticated request required (` reqToken ` ).
93+ - ** Site admin** — platform administrator only.
94+ - ** Org context** — org resolved from path or ` ?org= ` query; membership/ownership verified.
95+ - ** Cluster assignment** — resolves owner+cluster, loads cluster credentials, builds a Kubernetes client.
96+ - ** Public** — no authentication beyond baseline middleware.
97+
98+ Baseline middleware on every ` /api/v1 ` route: optional-sign-in, NATS connection cleanup,
99+ security headers (` nosniff ` ), API context, sudo support.
100+
101+ ## API Groups
102+
103+ The v1 API surface is organized into the following logical groups:
104+
105+ | # | Group | Base path(s) | What it covers | Availability |
106+ | ---| -------| --------------| ----------------| --------------|
107+ | 1 | [ Identity: Users & Settings] ( ../api/users-settings/ ) | ` /api/v1/user ` , ` /api/v1/users ` | Accounts, profile/security settings, tokens, credentials | always |
108+ | 2 | [ Identity: Organizations & Teams] ( ../api/organizations-teams/ ) | ` /api/v1/orgs ` , ` /api/v1/teams ` | Orgs, members, teams, org tokens | always |
109+ | 3 | [ Administration] ( ../api/administration/ ) | ` /api/v1/admin ` , ` /api/v1/accounts/admin ` | Admin console, site settings | always |
110+ | 4 | [ Authorization (Roles & Permissions)] ( ../api/authorization/ ) | ` /api/v1/authz ` | Custom roles & permissions | always |
111+ | 5 | [ Cluster Management (v1 + K8s proxy + Helm)] ( ../api/cluster-management-v1/ ) | ` /api/v1/clusters ` | Cluster lifecycle, Kubernetes proxy, Helm | always |
112+ | 6 | [ Cluster Management v2] ( ../api/cluster-management-v2/ ) | ` /api/v1/clustersv2 ` | Hub-aware cluster API, subscriptions, gateways | always |
113+ | 7 | [ Multi-cluster (OCM hub/spoke)] ( ../api/multicluster-ocm/ ) | ` /api/v1/clusters/:owner/:cluster/... ` | Hub/spoke, cluster sets, feature sets | always |
114+ | 8 | [ Client Organizations] ( ../api/client-organizations/ ) | ` /api/v1/user/client* ` , ` /api/v1/clusters/.../permission ` | Managed-service client orgs | always |
115+ | 9 | [ Cloud Providers] ( ../api/cloud-providers/ ) | ` /api/v1/clouds ` | Provider discovery for provisioning | always |
116+ | 10 | [ Platform Installer] ( ../api/ace-installer/ ) | ` /api/v1/ace-installer ` | Self-host installer bundles | AppsCode-hosted only |
117+ | 11 | [ Platform Upgrade] ( ../api/ace-upgrade/ ) | ` /api/v1/upgrade ` , ` /api/v1/clusters/.../upgrade ` | Platform & cluster upgrades | always |
118+ | 12 | [ Licensing & Contracts] ( ../api/licensing-contracts/ ) | ` /api/v1/contracts ` , ` /api/v1/user/contracts ` , ` /api/v1/register ` , ` /api/v1/license ` | Contracts, licenses, registration | contracts: AppsCode-hosted |
119+ | 13 | [ Billing Dashboard & Usage Reports] ( ../api/billing-dashboard/ ) | ` /api/v1/dashboard ` , ` /api/v1/user/dashboard ` , ` /api/v1/dbaas ` | Usage reports & billing dashboards | billing-enabled deployments |
120+ | 14 | [ Marketplace] ( ../api/marketplace/ ) | ` /api/v1/marketplaces ` (separate service), ` /api/v1/proxy/metered-billing ` | Cloud-marketplace webhooks & metering | marketplace deployments |
121+ | 15 | [ Monitoring & Telemetry] ( ../api/monitoring-telemetry/ ) | ` /api/v1/telemetry ` , ` /api/v1/trickster ` | Telemetry stack, Trickster auth proxy | always |
122+ | 16 | [ Rancher Integration] ( ../api/rancher/ ) | ` /api/v1/rancher ` | Rancher sync & proxy | always |
123+ | 17 | [ Helm Chart Repositories (public)] ( ../api/chart-repositories/ ) | ` /api/v1/chartrepositories ` | Public Helm chart repositories | always |
124+ | 18 | [ Miscellaneous & Site Settings] ( ../api/miscellaneous/ ) | ` /api/v1/version ` , ` /api/v1/markdown ` , ` /api/v1/branding ` , ... | Version, markdown, health | always |
125+
126+ ![ KubeDB Platform /api/v1 API group map] ( ../api/images/api-groups.svg )
127+
128+ ## Typical Request Flows
129+
130+ ### Cluster resource access via the Kubernetes proxy
131+
132+ ![ Kubernetes proxy request flow] ( ../api/images/flow-proxy.svg )
133+
134+ ### License issuance for a contract cluster
135+
136+ ![ License issuance flow] ( ../api/images/flow-license.svg )
137+
138+ ### Usage → billing pipeline
139+
140+ ![ Usage to billing pipeline] ( ../api/images/flow-billing.svg )
141+
142+ ## Deployment Modes
143+
144+ | Mode | ` DEPLOYMENT_TYPE ` | Notes |
145+ | ---| ---| ---|
146+ | AppsCode-hosted (SaaS) | ` Hosted ` | Full surface incl. contracts admin, installer, Firebase tokens |
147+ | Self-hosted | ` SelfHostedProduction ` (offline installs also set the separate ` OfflineInstaller ` flag) | Runs from a generated installer bundle; ` /selfhost ` console URL |
148+ | AWS Marketplace | ` AWSMarketplace ` | Marketplace webhooks + AWS metering proxy enabled |
149+ | GCP Marketplace | ` GoogleCloudMarketplace ` | Marketplace webhooks + GCP metering proxy enabled |
150+ | Azure Marketplace | ` AzureMarketplace ` | Recognized marketplace mode (webhooks); no metering proxy wired up |
151+
152+ Feature gating summary:
43153
44- ## API groups
45-
46- | Group | What it covers |
47- | ---| ---|
48- | [ Identity: Users & Settings] ( ../api/users-settings/public-user-apis/ ) | Accounts, profile/security settings, tokens, credentials |
49- | [ Identity: Organizations & Teams] ( ../api/organizations-teams/organizations/ ) | Orgs, members, teams, org tokens |
50- | [ Administration] ( ../api/administration/admin-org/ ) | Admin console, site settings |
51- | [ Authorization] ( ../api/authorization/roles-permissions/ ) | Custom roles & permissions |
52- | [ Cluster Management v1] ( ../api/cluster-management-v1/lifecycle/ ) | Cluster lifecycle, Kubernetes proxy, Helm |
53- | [ Cluster Management v2] ( ../api/cluster-management-v2/clusters/ ) | Hub-aware cluster API, subscriptions, gateways |
54- | [ Multi-cluster (OCM)] ( ../api/multicluster-ocm/hubs-spokes/ ) | Hub/spoke, cluster sets, feature sets |
55- | [ Client Organizations] ( ../api/client-organizations/management/ ) | Managed-service client orgs |
56- | [ Cloud Providers] ( ../api/cloud-providers/cloud-providers/ ) | Provider discovery for provisioning |
57- | [ Platform Installer] ( ../api/ace-installer/ace-installer/ ) | Self-host installer bundles |
58- | [ Platform Upgrade] ( ../api/ace-upgrade/platform-upgrade/ ) | Platform & cluster upgrades |
59- | [ Licensing & Contracts] ( ../api/licensing-contracts/registration/ ) | Contracts, licenses, registration |
60- | [ Billing Dashboard] ( ../api/billing-dashboard/admin-dashboard/ ) | Usage reports & billing dashboards |
61- | [ Marketplace] ( ../api/marketplace/webhook-service/ ) | Cloud-marketplace webhooks & metering |
62- | [ Monitoring & Telemetry] ( ../api/monitoring-telemetry/telemetry-stack/ ) | Telemetry stack, Trickster auth proxy |
63- | [ Rancher Integration] ( ../api/rancher/rancher/ ) | Rancher sync & proxy |
64- | [ Chart Repositories] ( ../api/chart-repositories/chart-repositories/ ) | Public Helm chart repositories |
65- | [ Miscellaneous] ( ../api/miscellaneous/miscellaneous/ ) | Version, markdown, health |
154+ - ` AppsCodeHosted ` → contracts admin APIs, installer APIs, org claim, Firebase token.
155+ - ` IsBillingEnabled() ` → billing dashboard APIs (admin, user, usage reports).
156+ - ` DeploymentType ` → which marketplace metering proxy (if any) is registered.
157+ - License enforcement is compiled in (` ENFORCE_LICENSE=true ` ); the server validates its own license at startup.
0 commit comments