Skip to main content

hanzo_client/models/
create_app_req.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 CreateAppReq {
16    /// BuildType is `pack` — the zero-config default that detects any project — or `dockerfile`, the explicit escape hatch. An image app never builds.
17    #[serde(rename = "buildType", skip_serializing_if = "Option::is_none")]
18    pub build_type: Option<String>,
19    /// Description is free text about what the application is.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// Dockerfile is the path to build from, for buildType `dockerfile`.
23    #[serde(rename = "dockerfile", skip_serializing_if = "Option::is_none")]
24    pub dockerfile: Option<String>,
25    /// 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.
26    #[serde(rename = "domains", skip_serializing_if = "Option::is_none")]
27    pub domains: Option<Vec<String>>,
28    /// 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.
29    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
30    pub env: Option<Vec<models::EnvVarJson>>,
31    /// Environment is the deploy target this app names (\"production\" by default).
32    #[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
33    pub environment: Option<String>,
34    /// Image is the container image to run, for source `image`.
35    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
36    pub image: Option<Box<models::ImageOrigin>>,
37    /// Name is the application's display name. Required; the slug is derived from it when none is given.
38    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
39    pub name: Option<String>,
40    /// Port is the container port the app listens on.
41    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
42    pub port: Option<i32>,
43    /// Project is the project to create the application under, from the path.
44    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
45    pub project: Option<String>,
46    /// Replicas is how many copies to run; clamped to the deployment's limit rather than refused.
47    #[serde(rename = "replicas", skip_serializing_if = "Option::is_none")]
48    pub replicas: Option<i32>,
49    /// Repo is the git source to build from, for source `git`.
50    #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
51    pub repo: Option<Box<models::GitOrigin>>,
52    /// 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.
53    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
54    pub slug: Option<String>,
55    /// Source is `git`, which requires repo.url, or `image`, which requires image.repository. Anything else is 400.
56    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
57    pub source: Option<String>,
58    /// StorageGB is the persistent volume size in GiB; absent means stateless. Clamped to the deployment's limit rather than refused.
59    #[serde(rename = "storageGb", skip_serializing_if = "Option::is_none")]
60    pub storage_gb: Option<i32>,
61}
62
63impl CreateAppReq {
64    pub fn new() -> CreateAppReq {
65        CreateAppReq {
66            build_type: None,
67            description: None,
68            dockerfile: None,
69            domains: None,
70            env: None,
71            environment: None,
72            image: None,
73            name: None,
74            port: None,
75            project: None,
76            replicas: None,
77            repo: None,
78            slug: None,
79            source: None,
80            storage_gb: None,
81        }
82    }
83}
84