#[non_exhaustive]pub struct NetworkEndpoint {
pub annotations: HashMap<String, String>,
pub client_destination_port: Option<i32>,
pub fqdn: Option<String>,
pub instance: Option<String>,
pub ip_address: Option<String>,
pub ipv_6_address: Option<String>,
pub port: Option<i32>,
/* private fields */
}global-network-endpoint-groups or network-endpoint-groups or region-network-endpoint-groups only.Expand description
The network endpoint.
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.annotations: HashMap<String, String>Optional metadata defined as annotations on the network endpoint.
client_destination_port: Option<i32>Represents the port number to which PSC consumer sends packets.
Optional. Only valid for network endpoint groups created withGCE_VM_IP_PORTMAP endpoint type.
fqdn: Option<String>Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type isNON_GCP_FQDN_PORT.
instance: Option<String>The name or a URL of VM instance of this network endpoint. Optional, the field presence depends on the network endpoint type. The field is required for network endpoints of type GCE_VM_IP andGCE_VM_IP_PORT.
The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance.
The name must be 1-63 characters long, and comply withRFC1035 or be a valid URL pointing to an existing instance.
ip_address: Option<String>Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used.
This field is redundant and need not be set for network endpoints of typeGCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork.
ipv_6_address: Option<String>Optional IPv6 address of network endpoint.
port: Option<i32>Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used.
This field can not be set for network endpoints of typeGCE_VM_IP.
Implementations§
Source§impl NetworkEndpoint
impl NetworkEndpoint
pub fn new() -> Self
Sourcepub fn set_annotations<T, K, V>(self, v: T) -> Self
pub fn set_annotations<T, K, V>(self, v: T) -> Self
Sets the value of annotations.
§Example
let x = NetworkEndpoint::new().set_annotations([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_client_destination_port<T>(self, v: T) -> Self
pub fn set_client_destination_port<T>(self, v: T) -> Self
Sets the value of client_destination_port.
§Example
let x = NetworkEndpoint::new().set_client_destination_port(42);Sourcepub fn set_or_clear_client_destination_port<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_client_destination_port<T>(self, v: Option<T>) -> Self
Sets or clears the value of client_destination_port.
§Example
let x = NetworkEndpoint::new().set_or_clear_client_destination_port(Some(42));
let x = NetworkEndpoint::new().set_or_clear_client_destination_port(None::<i32>);Sourcepub fn set_or_clear_fqdn<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_fqdn<T>(self, v: Option<T>) -> Self
Sourcepub fn set_instance<T>(self, v: T) -> Self
pub fn set_instance<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_instance<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_instance<T>(self, v: Option<T>) -> Self
Sourcepub fn set_ip_address<T>(self, v: T) -> Self
pub fn set_ip_address<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_ip_address<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_ip_address<T>(self, v: Option<T>) -> Self
Sets or clears the value of ip_address.
§Example
let x = NetworkEndpoint::new().set_or_clear_ip_address(Some("example"));
let x = NetworkEndpoint::new().set_or_clear_ip_address(None::<String>);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 = NetworkEndpoint::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 = NetworkEndpoint::new().set_or_clear_ipv_6_address(Some("example"));
let x = NetworkEndpoint::new().set_or_clear_ipv_6_address(None::<String>);Trait Implementations§
Source§impl Clone for NetworkEndpoint
impl Clone for NetworkEndpoint
Source§fn clone(&self) -> NetworkEndpoint
fn clone(&self) -> NetworkEndpoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more