Skip to main content

AccessConfig

Struct AccessConfig 

Source
#[non_exhaustive]
pub struct AccessConfig { pub external_ipv_6: Option<String>, pub external_ipv_6_prefix_length: Option<i32>, pub kind: Option<String>, pub name: Option<String>, pub nat_ip: Option<String>, pub network_tier: Option<NetworkTier>, pub public_ptr_domain_name: Option<String>, pub security_policy: Option<String>, pub set_public_ptr: Option<bool>, pub type: Option<Type>, /* private fields */ }
Available on crate features instance-templates or instances or machine-images or region-instance-templates or region-instances only.
Expand description

An access configuration attached to an instance’s network interface. Only one access config per instance is supported.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§external_ipv_6: Option<String>

Applies to ipv6AccessConfigs only. The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored inexternalIpv6PrefixLength in ipv6AccessConfig. To use a static external 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 external IPv6 address from the instance’s subnetwork.

§external_ipv_6_prefix_length: Option<i32>

Applies to ipv6AccessConfigs only. The prefix length of the external IPv6 range.

§kind: Option<String>

Output only. [Output Only] Type of the resource. Alwayscompute#accessConfig for access configs.

§name: Option<String>

The name of this access configuration. In accessConfigs (IPv4), the default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP orNetwork Access. In ipv6AccessConfigs, the recommend name is External IPv6.

§nat_ip: Option<String>

Applies to accessConfigs (IPv4) only. Anexternal IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.

§network_tier: Option<NetworkTier>

This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM,STANDARD.

If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier.

If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP.

§public_ptr_domain_name: Option<String>

The DNS domain name for the public PTR record.

You can set this field only if the setPublicPtr field is enabled inaccessConfig. If this field is unspecified inipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range.

§security_policy: Option<String>

The resource URL for the security policy associated with this access config.

§set_public_ptr: Option<bool>

Specifies whether a public DNS ‘PTR’ record should be created to map the external IP address of the instance to a DNS domain name.

This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated.

§type: Option<Type>

The type of configuration. In accessConfigs (IPv4), the default and only option is ONE_TO_ONE_NAT. Inipv6AccessConfigs, the default and only option isDIRECT_IPV6.

Implementations§

Source§

impl AccessConfig

Source

pub fn new() -> Self

Source

pub fn set_external_ipv_6<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of external_ipv_6.

§Example
let x = AccessConfig::new().set_external_ipv_6("example");
Source

pub fn set_or_clear_external_ipv_6<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of external_ipv_6.

§Example
let x = AccessConfig::new().set_or_clear_external_ipv_6(Some("example"));
let x = AccessConfig::new().set_or_clear_external_ipv_6(None::<String>);
Source

pub fn set_external_ipv_6_prefix_length<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of external_ipv_6_prefix_length.

§Example
let x = AccessConfig::new().set_external_ipv_6_prefix_length(42);
Source

pub fn set_or_clear_external_ipv_6_prefix_length<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

Sets or clears the value of external_ipv_6_prefix_length.

§Example
let x = AccessConfig::new().set_or_clear_external_ipv_6_prefix_length(Some(42));
let x = AccessConfig::new().set_or_clear_external_ipv_6_prefix_length(None::<i32>);
Source

pub fn set_kind<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of kind.

§Example
let x = AccessConfig::new().set_kind("example");
Source

pub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of kind.

§Example
let x = AccessConfig::new().set_or_clear_kind(Some("example"));
let x = AccessConfig::new().set_or_clear_kind(None::<String>);
Source

pub fn set_name<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of name.

§Example
let x = AccessConfig::new().set_name("example");
Source

pub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of name.

§Example
let x = AccessConfig::new().set_or_clear_name(Some("example"));
let x = AccessConfig::new().set_or_clear_name(None::<String>);
Source

pub fn set_nat_ip<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of nat_ip.

§Example
let x = AccessConfig::new().set_nat_ip("example");
Source

pub fn set_or_clear_nat_ip<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of nat_ip.

§Example
let x = AccessConfig::new().set_or_clear_nat_ip(Some("example"));
let x = AccessConfig::new().set_or_clear_nat_ip(None::<String>);
Source

pub fn set_network_tier<T>(self, v: T) -> Self
where T: Into<NetworkTier>,

Sets the value of network_tier.

§Example
use google_cloud_compute_v1::model::access_config::NetworkTier;
let x0 = AccessConfig::new().set_network_tier(NetworkTier::Premium);
let x1 = AccessConfig::new().set_network_tier(NetworkTier::Standard);
let x2 = AccessConfig::new().set_network_tier(NetworkTier::StandardOverridesFixedStandard);
Source

pub fn set_or_clear_network_tier<T>(self, v: Option<T>) -> Self
where T: Into<NetworkTier>,

Sets or clears the value of network_tier.

§Example
use google_cloud_compute_v1::model::access_config::NetworkTier;
let x0 = AccessConfig::new().set_or_clear_network_tier(Some(NetworkTier::Premium));
let x1 = AccessConfig::new().set_or_clear_network_tier(Some(NetworkTier::Standard));
let x2 = AccessConfig::new().set_or_clear_network_tier(Some(NetworkTier::StandardOverridesFixedStandard));
let x_none = AccessConfig::new().set_or_clear_network_tier(None::<NetworkTier>);
Source

pub fn set_public_ptr_domain_name<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of public_ptr_domain_name.

§Example
let x = AccessConfig::new().set_public_ptr_domain_name("example");
Source

pub fn set_or_clear_public_ptr_domain_name<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of public_ptr_domain_name.

§Example
let x = AccessConfig::new().set_or_clear_public_ptr_domain_name(Some("example"));
let x = AccessConfig::new().set_or_clear_public_ptr_domain_name(None::<String>);
Source

pub fn set_security_policy<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of security_policy.

§Example
let x = AccessConfig::new().set_security_policy("example");
Source

pub fn set_or_clear_security_policy<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of security_policy.

§Example
let x = AccessConfig::new().set_or_clear_security_policy(Some("example"));
let x = AccessConfig::new().set_or_clear_security_policy(None::<String>);
Source

pub fn set_set_public_ptr<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of set_public_ptr.

§Example
let x = AccessConfig::new().set_set_public_ptr(true);
Source

pub fn set_or_clear_set_public_ptr<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

Sets or clears the value of set_public_ptr.

§Example
let x = AccessConfig::new().set_or_clear_set_public_ptr(Some(false));
let x = AccessConfig::new().set_or_clear_set_public_ptr(None::<bool>);
Source

pub fn set_type<T>(self, v: T) -> Self
where T: Into<Type>,

Sets the value of r#type.

§Example
use google_cloud_compute_v1::model::access_config::Type;
let x0 = AccessConfig::new().set_type(Type::OneToOneNat);
Source

pub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
where T: Into<Type>,

Sets or clears the value of r#type.

§Example
use google_cloud_compute_v1::model::access_config::Type;
let x0 = AccessConfig::new().set_or_clear_type(Some(Type::OneToOneNat));
let x_none = AccessConfig::new().set_or_clear_type(None::<Type>);

Trait Implementations§

Source§

impl Clone for AccessConfig

Source§

fn clone(&self) -> AccessConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AccessConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AccessConfig

Source§

fn default() -> AccessConfig

Returns the “default value” for a type. Read more
Source§

impl Message for AccessConfig

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for AccessConfig

Source§

fn eq(&self, other: &AccessConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AccessConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,