Skip to main content

hanzo_client/models/
run_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 RunReq {
16    /// Env is the run's environment. Keys must match `^[A-Za-z_][A-Za-z0-9_]*$`; a variable marked `secret: true` is sealed into KMS.
17    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
18    pub env: Option<Vec<models::EnvVarJson>>,
19    /// GPU is how many GPUs the run asks for; a negative value is 400.
20    #[serde(rename = "gpu", skip_serializing_if = "Option::is_none")]
21    pub gpu: Option<i32>,
22    /// Image is the container image to run. Required.
23    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
24    pub image: Option<String>,
25    /// MaxScale above the floor declares an autoscaling ceiling; 0 means no autoscaler at all — a fixed run at the floor.
26    #[serde(rename = "maxScale", skip_serializing_if = "Option::is_none")]
27    pub max_scale: Option<i32>,
28    /// MinScale is the replica floor, clamped to the deployment's limit.
29    #[serde(rename = "minScale", skip_serializing_if = "Option::is_none")]
30    pub min_scale: Option<i32>,
31    /// Name is the run's name, and the slug is derived from it. Required, and it must resolve to `^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$`. Re-running the same name updates that run in place.
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// Port is the container port the run listens on.
35    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
36    pub port: Option<i32>,
37    /// Runtime is accepted for the client contract and echoed nowhere: the image IS the runtime unit.
38    #[serde(rename = "runtime", skip_serializing_if = "Option::is_none")]
39    pub runtime: Option<String>,
40    /// Shape is a compute size label, echoed back; sizing is the operator's default. Defaults to \"auto\".
41    #[serde(rename = "shape", skip_serializing_if = "Option::is_none")]
42    pub shape: Option<String>,
43}
44
45impl RunReq {
46    pub fn new() -> RunReq {
47        RunReq {
48            env: None,
49            gpu: None,
50            image: None,
51            max_scale: None,
52            min_scale: None,
53            name: None,
54            port: None,
55            runtime: None,
56            shape: None,
57        }
58    }
59}
60