hanzo_client/models/app_view.rs
1/*
2 * Hanzo Cloud API
3 *
4 * 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/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AppView {
16 /// BuildType is how a git app builds: `pack`, the zero-config default that detects the project, or `dockerfile`. An image app carries `image`, which means it never builds.
17 #[serde(rename = "buildType", skip_serializing_if = "Option::is_none")]
18 pub build_type: Option<String>,
19 /// CreatedAt is when the app was created, unix seconds.
20 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
21 pub created_at: Option<i32>,
22 /// CurrentDeploymentID is the deployment that is live — the pointer a deploy advances monotonically by version, so it never regresses to an older one. Empty until the first deploy reaches the cluster.
23 #[serde(rename = "currentDeploymentId", skip_serializing_if = "Option::is_none")]
24 pub current_deployment_id: Option<String>,
25 /// Description is free text about what the app is. Nothing derives from it.
26 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27 pub description: Option<String>,
28 /// Dockerfile is the path inside the repo to build from, for buildType `dockerfile`. The build path keys off its presence, and it is validated at create against the same allowlist the privileged build enforces.
29 #[serde(rename = "dockerfile", skip_serializing_if = "Option::is_none")]
30 pub dockerfile: Option<String>,
31 /// Domains are the ingress hosts rendered into the app's CR, its own `<slug>.<org>.<sites host>` first. That one is seeded at create and cannot be removed; a custom host joins only after add-domain and DNS verification.
32 #[serde(rename = "domains", skip_serializing_if = "Option::is_none")]
33 pub domains: Option<Vec<String>>,
34 /// Env is the app's environment variables, with every SECRET value masked to \"\" — the plaintext is in KMS and this surface never echoes it. That masking is why an empty secret value means \"keep what is sealed\" when posted back.
35 #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
36 pub env: Option<Vec<models::EnvVarJson>>,
37 /// Environment is the deploy target this app names, `production` when none was given. It is a LABEL: /v1/platform/environments derives the environment list from the apps that name one, so an environment exists as long as an app points at it and no route creates or deletes one.
38 #[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
39 pub environment: Option<String>,
40 /// Health rolls ready-vs-desired replicas up to a colour: green (all ready), yellow (some ready, or deliberately scaled to zero), red (none), or \"\" when the cluster reports no replica counts at all — unknown, never a guessed green.
41 #[serde(rename = "health", skip_serializing_if = "Option::is_none")]
42 pub health: Option<String>,
43 /// ID is the server-minted application id (`app_…`). Routes address an app by project and slug; this is the key its deployments and builds carry.
44 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
45 pub id: Option<String>,
46 /// Image is the image a source `image` app runs. For a git app only the tag is filled, stamped by the deploy that went live; the built ref is on the deployment.
47 #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
48 pub image: Option<Box<models::ImageView>>,
49 /// Name is the display name. It is not an address — the slug is.
50 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
51 pub name: Option<String>,
52 /// Namespace is where the app's cluster objects live, `tenant-<org>`. It is derived from the validated org and is never accepted from a request.
53 #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
54 pub namespace: Option<String>,
55 /// Org is the tenant that owns the app. It comes from the validated identity, never from the request, and it is the boundary every route is scoped to.
56 #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
57 pub org: Option<String>,
58 /// Phase is the operator's own `status.phase` for the app's Service CR, read from the cluster on this request. Empty when there is no CR yet or the cluster could not be read.
59 #[serde(rename = "phase", skip_serializing_if = "Option::is_none")]
60 pub phase: Option<String>,
61 /// Port is the container port traffic is sent to. 8080 when the create asked for none, or for one outside 1–65535.
62 #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
63 pub port: Option<i32>,
64 /// ProjectID is the IAM project the app lives under, and it is that project's NAME — the (org,name) key IAM identifies it by, which is also what the `:project` path segment carries. There is no platform-minted project id.
65 #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
66 pub project_id: Option<String>,
67 /// Replicas is how many copies the CR declares. It is CLAMPED to the deployment's ceiling rather than refused, so it can be below what was asked.
68 #[serde(rename = "replicas", skip_serializing_if = "Option::is_none")]
69 pub replicas: Option<i32>,
70 /// Repo is the git origin a source `git` app builds from, and the repo+branch a landed push has to match to build it.
71 #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
72 pub repo: Option<Box<models::GitSource>>,
73 /// SecretSync is how far the app's secret env has got into the cluster: \"\"|pending|syncing|ready|failed (secrets.go). It is best-effort and never fails a deploy, so `pending` is ordinary right after one.
74 #[serde(rename = "secretSync", skip_serializing_if = "Option::is_none")]
75 pub secret_sync: Option<String>,
76 /// SecretSyncDetail is the honest reason when the sync is not ready — a missing CRD, an RBAC grant, a per-tenant credential. Empty when it is.
77 #[serde(rename = "secretSyncDetail", skip_serializing_if = "Option::is_none")]
78 pub secret_sync_detail: Option<String>,
79 /// Slug is the app's identity in the cluster: the operator CR's name, the first label of its default host, and the `:app` path segment. Unique per project.
80 #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
81 pub slug: Option<String>,
82 /// Source is what the app deploys FROM: `git`, which builds Repo, or `image`, which runs Image as it is. It decides whether a deploy builds at all.
83 #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
84 pub source: Option<String>,
85 /// Status is the lifecycle THIS store records: draft (created, nothing in the cluster yet), building, deploying, live, stopped or error. What the cluster itself says is Phase and Health.
86 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
87 pub status: Option<String>,
88 /// StorageGB is the persistent volume size in GiB. Absent means stateless — no volume at all — and it is clamped like Replicas.
89 #[serde(rename = "storageGb", skip_serializing_if = "Option::is_none")]
90 pub storage_gb: Option<i32>,
91 /// UpdatedAt is when it last changed, unix seconds. Every lifecycle transition moves it, so it tracks deploys as well as edits.
92 #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
93 pub updated_at: Option<i32>,
94}
95
96impl AppView {
97 pub fn new() -> AppView {
98 AppView {
99 build_type: None,
100 created_at: None,
101 current_deployment_id: None,
102 description: None,
103 dockerfile: None,
104 domains: None,
105 env: None,
106 environment: None,
107 health: None,
108 id: None,
109 image: None,
110 name: None,
111 namespace: None,
112 org: None,
113 phase: None,
114 port: None,
115 project_id: None,
116 replicas: None,
117 repo: None,
118 secret_sync: None,
119 secret_sync_detail: None,
120 slug: None,
121 source: None,
122 status: None,
123 storage_gb: None,
124 updated_at: None,
125 }
126 }
127}
128