#[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
Sourcepub fn set_machine_type<T: Into<String>>(self, v: T) -> Self
pub fn set_machine_type<T: Into<String>>(self, v: T) -> Self
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.
§Example
use google_cloud_notebooks_v2::model::AcceleratorConfig;
let x = GceSetup::new()
.set_accelerator_configs([
AcceleratorConfig::default()/* use setters */,
AcceleratorConfig::default()/* use (different) setters */,
]);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.
§Example
use google_cloud_notebooks_v2::model::ServiceAccount;
let x = GceSetup::new()
.set_service_accounts([
ServiceAccount::default()/* use setters */,
ServiceAccount::default()/* use (different) setters */,
]);Sourcepub fn set_boot_disk<T>(self, v: T) -> Self
pub fn set_boot_disk<T>(self, v: T) -> Self
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
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.
§Example
use google_cloud_notebooks_v2::model::DataDisk;
let x = GceSetup::new()
.set_data_disks([
DataDisk::default()/* use setters */,
DataDisk::default()/* use (different) setters */,
]);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.
§Example
use google_cloud_notebooks_v2::model::ShieldedInstanceConfig;
let x = GceSetup::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);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.
§Example
use google_cloud_notebooks_v2::model::ShieldedInstanceConfig;
let x = GceSetup::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
let x = GceSetup::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);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.
§Example
use google_cloud_notebooks_v2::model::NetworkInterface;
let x = GceSetup::new()
.set_network_interfaces([
NetworkInterface::default()/* use setters */,
NetworkInterface::default()/* use (different) setters */,
]);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
Sourcepub fn set_metadata<T, K, V>(self, v: T) -> Self
pub fn set_metadata<T, K, V>(self, v: T) -> Self
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.
§Example
let x = GceSetup::new().set_enable_ip_forwarding(true);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.
§Example
use google_cloud_notebooks_v2::model::GPUDriverConfig;
let x = GceSetup::new().set_gpu_driver_config(GPUDriverConfig::default()/* use setters */);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.
§Example
use google_cloud_notebooks_v2::model::GPUDriverConfig;
let x = GceSetup::new().set_or_clear_gpu_driver_config(Some(GPUDriverConfig::default()/* use setters */));
let x = GceSetup::new().set_or_clear_gpu_driver_config(None::<GPUDriverConfig>);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.
§Example
use google_cloud_notebooks_v2::model::VmImage;
let x = GceSetup::new().set_vm_image(VmImage::default()/* use setters */);
assert!(x.vm_image().is_some());
assert!(x.container_image().is_none());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.
§Example
use google_cloud_notebooks_v2::model::ContainerImage;
let x = GceSetup::new().set_container_image(ContainerImage::default()/* use setters */);
assert!(x.container_image().is_some());
assert!(x.vm_image().is_none());Trait Implementations§
impl StructuralPartialEq for GceSetup
Auto Trait Implementations§
impl Freeze for GceSetup
impl RefUnwindSafe for GceSetup
impl Send for GceSetup
impl Sync for GceSetup
impl Unpin for GceSetup
impl UnsafeUnpin for GceSetup
impl UnwindSafe for GceSetup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request