postPlatformProjectsByProjectApps method
Creates an application from a git repo or a container image.
Creates an application from a git repo or a container image. It registers a new application under one of the caller org's projects and answers 201 with it. Creating does NOT deploy: the app lands in draft and nothing reaches the cluster until /deploy. source is git — which requires repo.url — or image, which requires image.repository; anything else is 400. A git app builds with zero-config pack by default and may opt into dockerfile; an image app never builds. The repo URL and Dockerfile path are validated here against the SAME allowlist the privileged build enforces, so an unsafe source is refused before it is ever persisted. The slug is the app's identity in the cluster: given or derived from name, it must match ^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$, and a slug already used in this project is 409. replicas and storageGb are clamped to the deployment's limits rather than refused. Env keys must match ^[A-Za-z_][A-Za-z0-9_]*$. A variable marked secret: true is SEALED into KMS and its plaintext is never written to the database — and if KMS is unavailable the create fails 503 rather than falling back to storing a secret in the clear. The app is seeded with its canonical default host, so it has a working HTTPS URL the moment it deploys. A bare custom domain cannot be attached here — it has to go through add-domain and DNS verification first. Requires a validated principal; 403 without one, and every cluster object it will later create lands in that org's own tenant-<org> namespace.
Parameters:
-
String project (required): Project is the project to create the application under, from the path.
-
CreateAppReq createAppReq (required):
Implementation
Future<AppView?> postPlatformProjectsByProjectApps(String project, CreateAppReq createAppReq,) async {
final response = await postPlatformProjectsByProjectAppsWithHttpInfo(project, createAppReq,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AppView',) as AppView;
}
return null;
}