postPlatformApps method

Future<void> postPlatformApps()

Deploy an app through cd.hanzo.ai

Builds a git repository into an image and writes the declaration that names it — a values file in hanzoai/universe under charts/app/values/<namespace>/<name>.yaml, which the fleet ApplicationSet renders as one Application. That file IS the deployment: nothing else has to be applied. mode decides whether anything can go live. The default, branch, pushes to deploy/<namespace>/<name>/<tag> and returns a review URL; the generator reads main, so a branch declaration deploys NOTHING and merging the review is the deliberate act. commit writes main, and proves the image is pullable first — a declaration naming an image the registry cannot serve is an ImagePullBackOff with no rollback path. Omit tag to build; give it to declare an image an earlier call already built, which is how a green build is released without rebuilding it. An org is its name: the values DIRECTORY, the destination NAMESPACE and the AppProject FENCE are all <org>, and the image is <registry>/<org>/<app>. None of them is a request field — the directory decides what CD admits the sync under and the repository decides what the cluster pulls, so a caller who could name either could reach outside its own org. org is an ACT-AS, not a placement field: it defaults to the caller's own, and naming another requires SuperAdmin. So does naming a RESERVED org — the platform's own namespace family (the brands and their environments, the control and delivery planes, admin) — even when it is the caller's own, because an IAM org named kube-system does not own Kubernetes. Both refuse rather than downgrade, so an escape attempt is never indistinguishable from a normal request. A host outside the caller's org subtree is refused: claim and verify a custom domain first.

Implementation

Future<void> postPlatformApps() async {
  final response = await postPlatformAppsWithHttpInfo();
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
}