scaleway_api_rs 0.1.8

Generated library to interact with Scaleway API.
Documentation
/*
 * Account API
 *
 * # Introduction  The Account API allows you to manage projects. Project is Scaleway’s resource management feature. Designed to help you organize your infrastructure and cloud services, the feature allows resources to be isolated and grouped into specific projects.
 *
 * The version of the OpenAPI document: v2
 *
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreatePoolRequest {
    /// The name of the pool
    #[serde(rename = "name")]
    pub name: String,
    /// The node type is the type of Scaleway Instance wanted for the pool. Nodes with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST). 'external' is a special node type used to provision instances from other cloud providers.
    #[serde(rename = "node_type")]
    pub node_type: String,
    /// The placement group ID in which all the nodes of the pool will be created
    #[serde(
        rename = "placement_group_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub placement_group_id: Option<Option<String>>,
    /// The enablement of the autoscaling feature for the pool
    #[serde(rename = "autoscaling", skip_serializing_if = "Option::is_none")]
    pub autoscaling: Option<bool>,
    /// The size (number of nodes) of the pool
    #[serde(rename = "size")]
    pub size: i32,
    /// The minimum size of the pool. Note that this field will be used only when autoscaling is enabled.
    #[serde(
        rename = "min_size",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub min_size: Option<Option<i32>>,
    /// The maximum size of the pool. Note that this field will be used only when autoscaling is enabled.
    #[serde(
        rename = "max_size",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_size: Option<Option<i32>>,
    /// The customization of the container runtime is available for each pool. Note that `docker` is deprecated since 1.20 and will be removed in 1.24.
    #[serde(rename = "container_runtime", skip_serializing_if = "Option::is_none")]
    pub container_runtime: Option<ContainerRuntime>,
    /// The enablement of the autohealing feature for the pool
    #[serde(rename = "autohealing", skip_serializing_if = "Option::is_none")]
    pub autohealing: Option<bool>,
    /// The tags associated with the pool
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    #[serde(rename = "kubelet_args", skip_serializing_if = "Option::is_none")]
    pub kubelet_args: Option<crate::models::CreatePoolRequestKubeletArgs>,
    #[serde(rename = "upgrade_policy", skip_serializing_if = "Option::is_none")]
    pub upgrade_policy: Option<Box<crate::models::CreatePoolRequestUpgradePolicy>>,
    /// The Zone in which the Pool's node will be spawn in
    #[serde(rename = "zone", skip_serializing_if = "Option::is_none")]
    pub zone: Option<String>,
    /// The system volume disk type, we provide two different types of volume (`volume_type`):   - `l_ssd` is a local block storage: your system is stored locally on     the hypervisor of your node.   - `b_ssd` is a remote block storage: your system is stored on a     centralised and resilient cluster.
    #[serde(rename = "root_volume_type", skip_serializing_if = "Option::is_none")]
    pub root_volume_type: Option<RootVolumeType>,
    /// The system volume disk size (in bytes)
    #[serde(
        rename = "root_volume_size",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub root_volume_size: Option<Option<i32>>,
}

impl CreatePoolRequest {
    pub fn new(name: String, node_type: String, size: i32) -> CreatePoolRequest {
        CreatePoolRequest {
            name,
            node_type,
            placement_group_id: None,
            autoscaling: None,
            size,
            min_size: None,
            max_size: None,
            container_runtime: None,
            autohealing: None,
            tags: None,
            kubelet_args: None,
            upgrade_policy: None,
            zone: None,
            root_volume_type: None,
            root_volume_size: None,
        }
    }
}

/// The customization of the container runtime is available for each pool. Note that `docker` is deprecated since 1.20 and will be removed in 1.24.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ContainerRuntime {
    #[serde(rename = "unknown_runtime")]
    UnknownRuntime,
    #[serde(rename = "docker")]
    Docker,
    #[serde(rename = "containerd")]
    Containerd,
    #[serde(rename = "crio")]
    Crio,
}

impl Default for ContainerRuntime {
    fn default() -> ContainerRuntime {
        Self::UnknownRuntime
    }
}
/// The system volume disk type, we provide two different types of volume (`volume_type`):   - `l_ssd` is a local block storage: your system is stored locally on     the hypervisor of your node.   - `b_ssd` is a remote block storage: your system is stored on a     centralised and resilient cluster.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RootVolumeType {
    #[serde(rename = "default_volume_type")]
    DefaultVolumeType,
    #[serde(rename = "l_ssd")]
    LSsd,
    #[serde(rename = "b_ssd")]
    BSsd,
}

impl Default for RootVolumeType {
    fn default() -> RootVolumeType {
        Self::DefaultVolumeType
    }
}