#[non_exhaustive]pub struct GceSetup {Show 13 fields
pub machine_type: String,
pub accelerator_configs: Vec<AcceleratorConfig>,
pub service_accounts: Vec<ServiceAccount>,
pub boot_disk: Option<BootDisk>,
pub data_disks: Vec<DataDisk>,
pub shielded_instance_config: Option<ShieldedInstanceConfig>,
pub network_interfaces: Vec<NetworkInterface>,
pub disable_public_ip: bool,
pub tags: Vec<String>,
pub metadata: HashMap<String, String>,
pub enable_ip_forwarding: bool,
pub gpu_driver_config: Option<GPUDriverConfig>,
pub image: Option<Image>,
/* private fields */
}Expand description
The definition of how to configure a VM instance outside of Resources and Identity.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.machine_type: StringOptional. The machine type of the VM instance. https://cloud.google.com/compute/docs/machine-resource
accelerator_configs: Vec<AcceleratorConfig>Optional. The hardware accelerators used on this instance. If you use
accelerators, make sure that your configuration has
enough vCPUs and memory to support the machine_type you have
selected.
Currently supports only one accelerator configuration.
service_accounts: Vec<ServiceAccount>Optional. The service account that serves as an identity for the VM instance. Currently supports only one service account.
boot_disk: Option<BootDisk>Optional. The boot disk for the VM.
data_disks: Vec<DataDisk>Optional. Data disks attached to the VM instance. Currently supports only one data disk.
shielded_instance_config: Option<ShieldedInstanceConfig>Optional. Shielded VM configuration. Images using supported Shielded VM features.
network_interfaces: Vec<NetworkInterface>Optional. The network interfaces for the VM. Supports only one interface.
disable_public_ip: boolOptional. If true, no external IP will be assigned to this VM instance.
Optional. The Compute Engine tags to add to runtime (see Tagging instances).
metadata: HashMap<String, String>Optional. Custom metadata to apply to this instance.
enable_ip_forwarding: boolOptional. Flag to enable ip forwarding or not, default false/off. https://cloud.google.com/vpc/docs/using-routes#canipforward
gpu_driver_config: Option<GPUDriverConfig>Optional. Configuration for GPU drivers.
image: Option<Image>Type of the image; can be one of VM image, or container image.
Implementations§
Source§impl GceSetup
impl GceSetup
pub fn new() -> Self
Sourcepub fn set_machine_type<T: Into<String>>(self, v: T) -> Self
pub fn set_machine_type<T: Into<String>>(self, v: T) -> Self
Sets the value of machine_type.
Sourcepub fn set_accelerator_configs<T, V>(self, v: T) -> Self
pub fn set_accelerator_configs<T, V>(self, v: T) -> Self
Sets the value of accelerator_configs.
Sourcepub fn set_service_accounts<T, V>(self, v: T) -> Self
pub fn set_service_accounts<T, V>(self, v: T) -> Self
Sets the value of service_accounts.
Sourcepub fn set_boot_disk<T>(self, v: T) -> Self
pub fn set_boot_disk<T>(self, v: T) -> Self
Sets the value of boot_disk.
Sourcepub fn set_or_clear_boot_disk<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_boot_disk<T>(self, v: Option<T>) -> Self
Sets or clears the value of boot_disk.
Sourcepub fn set_data_disks<T, V>(self, v: T) -> Self
pub fn set_data_disks<T, V>(self, v: T) -> Self
Sets the value of data_disks.
Sourcepub fn set_shielded_instance_config<T>(self, v: T) -> Selfwhere
T: Into<ShieldedInstanceConfig>,
pub fn set_shielded_instance_config<T>(self, v: T) -> Selfwhere
T: Into<ShieldedInstanceConfig>,
Sets the value of shielded_instance_config.
Sourcepub fn set_or_clear_shielded_instance_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ShieldedInstanceConfig>,
pub fn set_or_clear_shielded_instance_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ShieldedInstanceConfig>,
Sets or clears the value of shielded_instance_config.
Sourcepub fn set_network_interfaces<T, V>(self, v: T) -> Self
pub fn set_network_interfaces<T, V>(self, v: T) -> Self
Sets the value of network_interfaces.
Sourcepub fn set_disable_public_ip<T: Into<bool>>(self, v: T) -> Self
pub fn set_disable_public_ip<T: Into<bool>>(self, v: T) -> Self
Sets the value of disable_public_ip.
Sets the value of tags.
Sourcepub fn set_metadata<T, K, V>(self, v: T) -> Self
pub fn set_metadata<T, K, V>(self, v: T) -> Self
Sets the value of metadata.
Sourcepub fn set_enable_ip_forwarding<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_ip_forwarding<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_ip_forwarding.
Sourcepub fn set_gpu_driver_config<T>(self, v: T) -> Selfwhere
T: Into<GPUDriverConfig>,
pub fn set_gpu_driver_config<T>(self, v: T) -> Selfwhere
T: Into<GPUDriverConfig>,
Sets the value of gpu_driver_config.
Sourcepub fn set_or_clear_gpu_driver_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<GPUDriverConfig>,
pub fn set_or_clear_gpu_driver_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<GPUDriverConfig>,
Sets or clears the value of gpu_driver_config.
Sourcepub fn set_image<T: Into<Option<Image>>>(self, v: T) -> Self
pub fn set_image<T: Into<Option<Image>>>(self, v: T) -> Self
Sets the value of image.
Note that all the setters affecting image are mutually
exclusive.
Sourcepub fn vm_image(&self) -> Option<&Box<VmImage>>
pub fn vm_image(&self) -> Option<&Box<VmImage>>
The value of image
if it holds a VmImage, None if the field is not set or
holds a different branch.
Sourcepub fn set_vm_image<T: Into<Box<VmImage>>>(self, v: T) -> Self
pub fn set_vm_image<T: Into<Box<VmImage>>>(self, v: T) -> Self
Sets the value of image
to hold a VmImage.
Note that all the setters affecting image are
mutually exclusive.
Sourcepub fn container_image(&self) -> Option<&Box<ContainerImage>>
pub fn container_image(&self) -> Option<&Box<ContainerImage>>
The value of image
if it holds a ContainerImage, None if the field is not set or
holds a different branch.
Sourcepub fn set_container_image<T: Into<Box<ContainerImage>>>(self, v: T) -> Self
pub fn set_container_image<T: Into<Box<ContainerImage>>>(self, v: T) -> Self
Sets the value of image
to hold a ContainerImage.
Note that all the setters affecting image are
mutually exclusive.