#[non_exhaustive]pub struct NetworkInterface {Show 19 fields
pub access_configs: Vec<AccessConfig>,
pub alias_ip_ranges: Vec<AliasIpRange>,
pub fingerprint: Option<Bytes>,
pub igmp_query: Option<IgmpQuery>,
pub internal_ipv_6_prefix_length: Option<i32>,
pub ipv_6_access_configs: Vec<AccessConfig>,
pub ipv_6_access_type: Option<Ipv6AccessType>,
pub ipv_6_address: Option<String>,
pub kind: Option<String>,
pub name: Option<String>,
pub network: Option<String>,
pub network_attachment: Option<String>,
pub network_ip: Option<String>,
pub nic_type: Option<NicType>,
pub parent_nic_name: Option<String>,
pub queue_count: Option<i32>,
pub stack_type: Option<StackType>,
pub subnetwork: Option<String>,
pub vlan: Option<i32>,
/* private fields */
}instance-templates or instances or machine-images or region-instance-templates or region-instances only.Expand description
A network interface resource attached to an instance.
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.access_configs: Vec<AccessConfig>An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are noaccessConfigs specified, then this instance will have no external internet access.
alias_ip_ranges: Vec<AliasIpRange>An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks.
fingerprint: Option<Bytes>Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update theNetworkInterface. The request will fail with error400 Bad Request if the fingerprint is not provided, or412 Precondition Failed if the fingerprint is out of date.
igmp_query: Option<IgmpQuery>Indicate whether igmp query is enabled on the network interface or not. If enabled, also indicates the version of IGMP supported.
internal_ipv_6_prefix_length: Option<i32>The prefix length of the primary internal IPv6 range.
ipv_6_access_configs: Vec<AccessConfig>An array of IPv6 access configurations for this interface. Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig specified, then this instance will have no external IPv6 Internet access.
ipv_6_access_type: Option<Ipv6AccessType>Output only. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork.
Valid only if stackType is IPV4_IPV6.
ipv_6_address: Option<String>An IPv6 internal network address for this network interface. To use a static internal IP address, it must be unused and in the same region as the instance’s zone. If not specified, Google Cloud will automatically assign an internal IPv6 address from the instance’s subnetwork.
kind: Option<String>Output only. [Output Only] Type of the resource. Alwayscompute#networkInterface for network interfaces.
name: Option<String>[Output Only] The name of the network interface, which is generated by the server. For a VM, the network interface uses the nicN naming format. Where N is a value between 0 and7. The default interface value is nic0.
network: Option<String>URL of the VPC network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used. If the selected project doesn’t have the default network, you must specify a network or subnet. If the network is not specified but the subnetwork is specified, the network is inferred.
If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
- https://www.googleapis.com/compute/v1/projects/project/global/networks/network
- projects/project/global/networks/network
- global/networks/defaultnetwork_attachment: Option<String>The URL of the network attachment that this interface should connect to in the following format: projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}.
network_ip: Option<String>An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.
nic_type: Option<NicType>The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.
parent_nic_name: Option<String>Name of the parent network interface of a dynamic network interface.
queue_count: Option<i32>The networking queue count that’s specified by users for the network interface. Both Rx and Tx queues will be set to this number. It’ll be empty if not specified by the users.
stack_type: Option<StackType>The stack type for this network interface. To assign only IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, useIPV4_IPV6. If not specified, IPV4_ONLY is used.
This field can be both set at instance creation and update network interface operations.
subnetwork: Option<String>The URL of the Subnetwork resource for this instance. If the network resource is inlegacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
- https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork- regions/region/subnetworks/subnetwork
vlan: Option<i32>VLAN tag of a dynamic network interface, must be an integer in the range from 2 to 255 inclusively.
Implementations§
Source§impl NetworkInterface
impl NetworkInterface
pub fn new() -> Self
Sourcepub fn set_access_configs<T, V>(self, v: T) -> Self
pub fn set_access_configs<T, V>(self, v: T) -> Self
Sets the value of access_configs.
§Example
use google_cloud_compute_v1::model::AccessConfig;
let x = NetworkInterface::new()
.set_access_configs([
AccessConfig::default()/* use setters */,
AccessConfig::default()/* use (different) setters */,
]);Sourcepub fn set_alias_ip_ranges<T, V>(self, v: T) -> Self
pub fn set_alias_ip_ranges<T, V>(self, v: T) -> Self
Sets the value of alias_ip_ranges.
§Example
use google_cloud_compute_v1::model::AliasIpRange;
let x = NetworkInterface::new()
.set_alias_ip_ranges([
AliasIpRange::default()/* use setters */,
AliasIpRange::default()/* use (different) setters */,
]);Sourcepub fn set_fingerprint<T>(self, v: T) -> Self
pub fn set_fingerprint<T>(self, v: T) -> Self
Sets the value of fingerprint.
§Example
let x = NetworkInterface::new().set_fingerprint(bytes::Bytes::from_static(b"example"));Sourcepub fn set_or_clear_fingerprint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_fingerprint<T>(self, v: Option<T>) -> Self
Sets or clears the value of fingerprint.
§Example
let x = NetworkInterface::new().set_or_clear_fingerprint(Some(bytes::Bytes::from_static(b"example")));
let x = NetworkInterface::new().set_or_clear_fingerprint(None::<bytes::Bytes>);Sourcepub fn set_igmp_query<T>(self, v: T) -> Self
pub fn set_igmp_query<T>(self, v: T) -> Self
Sets the value of igmp_query.
§Example
use google_cloud_compute_v1::model::network_interface::IgmpQuery;
let x0 = NetworkInterface::new().set_igmp_query(IgmpQuery::V2);Sourcepub fn set_or_clear_igmp_query<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_igmp_query<T>(self, v: Option<T>) -> Self
Sets or clears the value of igmp_query.
§Example
use google_cloud_compute_v1::model::network_interface::IgmpQuery;
let x0 = NetworkInterface::new().set_or_clear_igmp_query(Some(IgmpQuery::V2));
let x_none = NetworkInterface::new().set_or_clear_igmp_query(None::<IgmpQuery>);Sourcepub fn set_internal_ipv_6_prefix_length<T>(self, v: T) -> Self
pub fn set_internal_ipv_6_prefix_length<T>(self, v: T) -> Self
Sets the value of internal_ipv_6_prefix_length.
§Example
let x = NetworkInterface::new().set_internal_ipv_6_prefix_length(42);Sourcepub fn set_or_clear_internal_ipv_6_prefix_length<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_internal_ipv_6_prefix_length<T>(self, v: Option<T>) -> Self
Sets or clears the value of internal_ipv_6_prefix_length.
§Example
let x = NetworkInterface::new().set_or_clear_internal_ipv_6_prefix_length(Some(42));
let x = NetworkInterface::new().set_or_clear_internal_ipv_6_prefix_length(None::<i32>);Sourcepub fn set_ipv_6_access_configs<T, V>(self, v: T) -> Self
pub fn set_ipv_6_access_configs<T, V>(self, v: T) -> Self
Sets the value of ipv_6_access_configs.
§Example
use google_cloud_compute_v1::model::AccessConfig;
let x = NetworkInterface::new()
.set_ipv_6_access_configs([
AccessConfig::default()/* use setters */,
AccessConfig::default()/* use (different) setters */,
]);Sourcepub fn set_ipv_6_access_type<T>(self, v: T) -> Selfwhere
T: Into<Ipv6AccessType>,
pub fn set_ipv_6_access_type<T>(self, v: T) -> Selfwhere
T: Into<Ipv6AccessType>,
Sets the value of ipv_6_access_type.
§Example
use google_cloud_compute_v1::model::network_interface::Ipv6AccessType;
let x0 = NetworkInterface::new().set_ipv_6_access_type(Ipv6AccessType::Internal);Sourcepub fn set_or_clear_ipv_6_access_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<Ipv6AccessType>,
pub fn set_or_clear_ipv_6_access_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<Ipv6AccessType>,
Sets or clears the value of ipv_6_access_type.
§Example
use google_cloud_compute_v1::model::network_interface::Ipv6AccessType;
let x0 = NetworkInterface::new().set_or_clear_ipv_6_access_type(Some(Ipv6AccessType::Internal));
let x_none = NetworkInterface::new().set_or_clear_ipv_6_access_type(None::<Ipv6AccessType>);Sourcepub fn set_ipv_6_address<T>(self, v: T) -> Self
pub fn set_ipv_6_address<T>(self, v: T) -> Self
Sets the value of ipv_6_address.
§Example
let x = NetworkInterface::new().set_ipv_6_address("example");Sourcepub fn set_or_clear_ipv_6_address<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_ipv_6_address<T>(self, v: Option<T>) -> Self
Sets or clears the value of ipv_6_address.
§Example
let x = NetworkInterface::new().set_or_clear_ipv_6_address(Some("example"));
let x = NetworkInterface::new().set_or_clear_ipv_6_address(None::<String>);Sourcepub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
Sourcepub fn set_network<T>(self, v: T) -> Self
pub fn set_network<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_network<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_network<T>(self, v: Option<T>) -> Self
Sourcepub fn set_network_attachment<T>(self, v: T) -> Self
pub fn set_network_attachment<T>(self, v: T) -> Self
Sets the value of network_attachment.
§Example
let x = NetworkInterface::new().set_network_attachment("example");Sourcepub fn set_or_clear_network_attachment<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_network_attachment<T>(self, v: Option<T>) -> Self
Sets or clears the value of network_attachment.
§Example
let x = NetworkInterface::new().set_or_clear_network_attachment(Some("example"));
let x = NetworkInterface::new().set_or_clear_network_attachment(None::<String>);Sourcepub fn set_network_ip<T>(self, v: T) -> Self
pub fn set_network_ip<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_network_ip<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_network_ip<T>(self, v: Option<T>) -> Self
Sets or clears the value of network_ip.
§Example
let x = NetworkInterface::new().set_or_clear_network_ip(Some("example"));
let x = NetworkInterface::new().set_or_clear_network_ip(None::<String>);Sourcepub fn set_nic_type<T>(self, v: T) -> Self
pub fn set_nic_type<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_nic_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_nic_type<T>(self, v: Option<T>) -> Self
Sets or clears the value of nic_type.
§Example
use google_cloud_compute_v1::model::network_interface::NicType;
let x0 = NetworkInterface::new().set_or_clear_nic_type(Some(NicType::Idpf));
let x1 = NetworkInterface::new().set_or_clear_nic_type(Some(NicType::Irdma));
let x2 = NetworkInterface::new().set_or_clear_nic_type(Some(NicType::Mrdma));
let x_none = NetworkInterface::new().set_or_clear_nic_type(None::<NicType>);Sourcepub fn set_parent_nic_name<T>(self, v: T) -> Self
pub fn set_parent_nic_name<T>(self, v: T) -> Self
Sets the value of parent_nic_name.
§Example
let x = NetworkInterface::new().set_parent_nic_name("example");Sourcepub fn set_or_clear_parent_nic_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_parent_nic_name<T>(self, v: Option<T>) -> Self
Sets or clears the value of parent_nic_name.
§Example
let x = NetworkInterface::new().set_or_clear_parent_nic_name(Some("example"));
let x = NetworkInterface::new().set_or_clear_parent_nic_name(None::<String>);Sourcepub fn set_queue_count<T>(self, v: T) -> Self
pub fn set_queue_count<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_queue_count<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_queue_count<T>(self, v: Option<T>) -> Self
Sets or clears the value of queue_count.
§Example
let x = NetworkInterface::new().set_or_clear_queue_count(Some(42));
let x = NetworkInterface::new().set_or_clear_queue_count(None::<i32>);Sourcepub fn set_stack_type<T>(self, v: T) -> Self
pub fn set_stack_type<T>(self, v: T) -> Self
Sets the value of stack_type.
§Example
use google_cloud_compute_v1::model::network_interface::StackType;
let x0 = NetworkInterface::new().set_stack_type(StackType::Ipv4Only);
let x1 = NetworkInterface::new().set_stack_type(StackType::Ipv6Only);Sourcepub fn set_or_clear_stack_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_stack_type<T>(self, v: Option<T>) -> Self
Sets or clears the value of stack_type.
§Example
use google_cloud_compute_v1::model::network_interface::StackType;
let x0 = NetworkInterface::new().set_or_clear_stack_type(Some(StackType::Ipv4Only));
let x1 = NetworkInterface::new().set_or_clear_stack_type(Some(StackType::Ipv6Only));
let x_none = NetworkInterface::new().set_or_clear_stack_type(None::<StackType>);Sourcepub fn set_subnetwork<T>(self, v: T) -> Self
pub fn set_subnetwork<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_subnetwork<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_subnetwork<T>(self, v: Option<T>) -> Self
Sets or clears the value of subnetwork.
§Example
let x = NetworkInterface::new().set_or_clear_subnetwork(Some("example"));
let x = NetworkInterface::new().set_or_clear_subnetwork(None::<String>);Trait Implementations§
Source§impl Clone for NetworkInterface
impl Clone for NetworkInterface
Source§fn clone(&self) -> NetworkInterface
fn clone(&self) -> NetworkInterface
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more