1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* 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
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateAppReq {
/// BuildType is `pack` — the zero-config default that detects any project — or `dockerfile`, the explicit escape hatch. An image app never builds.
#[serde(rename = "buildType", skip_serializing_if = "Option::is_none")]
pub build_type: Option<String>,
/// Description is free text about what the application is.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Dockerfile is the path to build from, for buildType `dockerfile`.
#[serde(rename = "dockerfile", skip_serializing_if = "Option::is_none")]
pub dockerfile: Option<String>,
/// Domains are extra ingress hosts. The canonical default host is always attached; a bare custom host is refused here and must go through add-domain → verify first.
#[serde(rename = "domains", skip_serializing_if = "Option::is_none")]
pub domains: Option<Vec<String>>,
/// Env is the application's environment. 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.
#[serde(rename = "env", skip_serializing_if = "Option::is_none")]
pub env: Option<Vec<models::EnvVarJson>>,
/// Environment is the deploy target this app names (\"production\" by default).
#[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
pub environment: Option<String>,
/// Image is the container image to run, for source `image`.
#[serde(rename = "image", skip_serializing_if = "Option::is_none")]
pub image: Option<Box<models::ImageOrigin>>,
/// Name is the application's display name. Required; the slug is derived from it when none is given.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Port is the container port the app listens on.
#[serde(rename = "port", skip_serializing_if = "Option::is_none")]
pub port: Option<i32>,
/// Project is the project to create the application under, from the path.
#[serde(rename = "project", skip_serializing_if = "Option::is_none")]
pub project: Option<String>,
/// Replicas is how many copies to run; clamped to the deployment's limit rather than refused.
#[serde(rename = "replicas", skip_serializing_if = "Option::is_none")]
pub replicas: Option<i32>,
/// Repo is the git source to build from, for source `git`.
#[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
pub repo: Option<Box<models::GitOrigin>>,
/// Slug is the app's identity in the cluster — its CR name and part of its host. Given or derived from Name, it must match `^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$`, and one already used in this project is 409.
#[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
pub slug: Option<String>,
/// Source is `git`, which requires repo.url, or `image`, which requires image.repository. Anything else is 400.
#[serde(rename = "source", skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
/// StorageGB is the persistent volume size in GiB; absent means stateless. Clamped to the deployment's limit rather than refused.
#[serde(rename = "storageGb", skip_serializing_if = "Option::is_none")]
pub storage_gb: Option<i32>,
}
impl CreateAppReq {
pub fn new() -> CreateAppReq {
CreateAppReq {
build_type: None,
description: None,
dockerfile: None,
domains: None,
env: None,
environment: None,
image: None,
name: None,
port: None,
project: None,
replicas: None,
repo: None,
slug: None,
source: None,
storage_gb: None,
}
}
}