Skip to main content

Subnet

Struct Subnet 

Source
pub struct Subnet {
Show 23 fields pub cidr_block: String, pub compartment_id: String, pub id: String, pub lifecycle_state: SubnetLifecycleState, pub route_table_id: String, pub vcn_id: String, pub virtual_router_ip: String, pub virtual_router_mac: String, pub availability_domain: Option<String>, pub ipv4_cidr_blocks: Option<Vec<String>>, pub defined_tags: Option<HashMap<String, HashMap<String, Value>>>, pub dhcp_options_id: Option<String>, pub display_name: Option<String>, pub dns_label: Option<String>, pub freeform_tags: Option<HashMap<String, String>>, pub ipv6_cidr_block: Option<String>, pub ipv6_cidr_blocks: Option<Vec<String>>, pub ipv6_virtual_router_ip: Option<String>, pub prohibit_internet_ingress: Option<bool>, pub prohibit_public_ip_on_vnic: Option<bool>, pub security_list_ids: Option<Vec<String>>, pub subnet_domain_name: Option<String>, pub time_created: Option<DateTime<Utc>>,
}
Expand description

A logical subdivision of a VCN. Each subnet consists of a contiguous range of IP addresses that do not overlap with other subnets in the VCN. Example: 172.16.1.0/24. For more information, see Overview of the Networking Service and VCNs and Subnets.

To use any of the API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see Getting Started with Policies.

Fields§

§cidr_block: String

The subnet’s CIDR block.

Example: {@code 10.0.1.0/24}

§compartment_id: String

The OCID of the compartment containing the subnet.

§id: String

The subnet’s Oracle ID (OCID).

§lifecycle_state: SubnetLifecycleState

The subnet’s current state.

§route_table_id: String

The OCID of the route table that the subnet uses.

§vcn_id: String

The OCID of the VCN the subnet is in.

§virtual_router_ip: String

The IP address of the virtual router.

Example: {@code 10.0.14.1}

§virtual_router_mac: String

The MAC address of the virtual router.

Example: {@code 00:00:00:00:00:01}

§availability_domain: Option<String>

The subnet’s availability domain. This attribute will be null if this is a regional subnet instead of an AD-specific subnet. Oracle recommends creating regional subnets.

Example: {@code Uocm:PHX-AD-1}

§ipv4_cidr_blocks: Option<Vec<String>>

The list of all IPv4 CIDR blocks for the subnet that meets the following criteria: - Ipv4 CIDR blocks must be valid. - Multiple Ipv4 CIDR blocks must not overlap each other or the on-premises network CIDR block. - The number of prefixes must not exceed the limit of IPv4 prefixes allowed to a subnet.

§defined_tags: Option<HashMap<String, HashMap<String, Value>>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {@code {"Operations": {"CostCenter": "42"}}}

§dhcp_options_id: Option<String>

The OCID of the set of DHCP options that the subnet uses.

§display_name: Option<String>

A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.

§dns_label: Option<String>

A DNS label for the subnet, used in conjunction with the VNIC’s hostname and VCN’s DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, {@code bminstance1.subnet123.vcn1.oraclevcn.com}). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.

The absence of this parameter means the Internet and VCN Resolver will not resolve hostnames of instances in this subnet.

For more information, see DNS in Your Virtual Cloud Network.

Example: {@code subnet123}

§freeform_tags: Option<HashMap<String, String>>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {@code {"Department": "Finance"}}

§ipv6_cidr_block: Option<String>

For an IPv6-enabled subnet, this is the IPv6 prefix for the subnet’s IP address space. The subnet size is always /64. See IPv6 Addresses.

Example: {@code 2001:0db8:0123:1111::/64}

§ipv6_cidr_blocks: Option<Vec<String>>

The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet.

§ipv6_virtual_router_ip: Option<String>

For an IPv6-enabled subnet, this is the IPv6 address of the virtual router.

Example: {@code 2001:0db8:0123:1111:89ab:cdef:1234:5678}

§prohibit_internet_ingress: Option<bool>

Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.

For IPV4, {@code prohibitInternetIngress} behaves similarly to {@code prohibitPublicIpOnVnic}. If it is set to false, VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the {@code assignPublicIp} flag in {@link CreateVnicDetails}). If {@code prohibitInternetIngress} is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it’s a privatesubnet).

For IPv6, if {@code prohibitInternetIngress} is set to {@code true}, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.

Example: {@code true}

§prohibit_public_ip_on_vnic: Option<bool>

Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the {@code assignPublicIp} flag in {@link CreateVnicDetails}). If {@code prohibitPublicIpOnVnic} is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it’s a private subnet).

Example: {@code true}

§security_list_ids: Option<Vec<String>>

The OCIDs of the security list or lists that the subnet uses. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.

§subnet_domain_name: Option<String>

The subnet’s domain name, which consists of the subnet’s DNS label, the VCN’s DNS label, and the {@code oraclevcn.com} domain.

For more information, see DNS in Your Virtual Cloud Network.

Example: {@code subnet123.vcn1.oraclevcn.com}

§time_created: Option<DateTime<Utc>>

The date and time the subnet was created, in the format defined by RFC3339.

Example: {@code 2016-08-25T21:10:29.600Z}

Implementations§

Source§

impl Subnet

Source

pub fn new(required: SubnetRequired) -> Self

Create a new Subnet with required fields

Source

pub fn set_availability_domain(self, value: Option<String>) -> Self

Set availability_domain

Source

pub fn set_cidr_block(self, value: String) -> Self

Set cidr_block

Source

pub fn set_ipv4_cidr_blocks(self, value: Option<Vec<String>>) -> Self

Set ipv4_cidr_blocks

Source

pub fn set_compartment_id(self, value: String) -> Self

Set compartment_id

Source

pub fn set_defined_tags( self, value: Option<HashMap<String, HashMap<String, Value>>>, ) -> Self

Set defined_tags

Source

pub fn set_dhcp_options_id(self, value: Option<String>) -> Self

Set dhcp_options_id

Source

pub fn set_display_name(self, value: Option<String>) -> Self

Set display_name

Source

pub fn set_dns_label(self, value: Option<String>) -> Self

Set dns_label

Source

pub fn set_freeform_tags(self, value: Option<HashMap<String, String>>) -> Self

Set freeform_tags

Source

pub fn set_id(self, value: String) -> Self

Set id

Source

pub fn set_ipv6_cidr_block(self, value: Option<String>) -> Self

Set ipv6_cidr_block

Source

pub fn set_ipv6_cidr_blocks(self, value: Option<Vec<String>>) -> Self

Set ipv6_cidr_blocks

Source

pub fn set_ipv6_virtual_router_ip(self, value: Option<String>) -> Self

Set ipv6_virtual_router_ip

Source

pub fn set_lifecycle_state(self, value: SubnetLifecycleState) -> Self

Set lifecycle_state

Source

pub fn set_prohibit_internet_ingress(self, value: Option<bool>) -> Self

Set prohibit_internet_ingress

Source

pub fn set_prohibit_public_ip_on_vnic(self, value: Option<bool>) -> Self

Set prohibit_public_ip_on_vnic

Source

pub fn set_route_table_id(self, value: String) -> Self

Set route_table_id

Source

pub fn set_security_list_ids(self, value: Option<Vec<String>>) -> Self

Set security_list_ids

Source

pub fn set_subnet_domain_name(self, value: Option<String>) -> Self

Set subnet_domain_name

Source

pub fn set_time_created(self, value: Option<DateTime<Utc>>) -> Self

Set time_created

Source

pub fn set_vcn_id(self, value: String) -> Self

Set vcn_id

Source

pub fn set_virtual_router_ip(self, value: String) -> Self

Set virtual_router_ip

Source

pub fn set_virtual_router_mac(self, value: String) -> Self

Set virtual_router_mac

Source

pub fn with_availability_domain(self, value: impl Into<String>) -> Self

Set availability_domain (unwraps Option)

Source

pub fn with_ipv4_cidr_blocks(self, value: Vec<String>) -> Self

Set ipv4_cidr_blocks (unwraps Option)

Source

pub fn with_defined_tags( self, value: HashMap<String, HashMap<String, Value>>, ) -> Self

Set defined_tags (unwraps Option)

Source

pub fn with_dhcp_options_id(self, value: impl Into<String>) -> Self

Set dhcp_options_id (unwraps Option)

Source

pub fn with_display_name(self, value: impl Into<String>) -> Self

Set display_name (unwraps Option)

Source

pub fn with_dns_label(self, value: impl Into<String>) -> Self

Set dns_label (unwraps Option)

Source

pub fn with_freeform_tags(self, value: HashMap<String, String>) -> Self

Set freeform_tags (unwraps Option)

Source

pub fn with_ipv6_cidr_block(self, value: impl Into<String>) -> Self

Set ipv6_cidr_block (unwraps Option)

Source

pub fn with_ipv6_cidr_blocks(self, value: Vec<String>) -> Self

Set ipv6_cidr_blocks (unwraps Option)

Source

pub fn with_ipv6_virtual_router_ip(self, value: impl Into<String>) -> Self

Set ipv6_virtual_router_ip (unwraps Option)

Source

pub fn with_prohibit_internet_ingress(self, value: bool) -> Self

Set prohibit_internet_ingress (unwraps Option)

Source

pub fn with_prohibit_public_ip_on_vnic(self, value: bool) -> Self

Set prohibit_public_ip_on_vnic (unwraps Option)

Source

pub fn with_security_list_ids(self, value: Vec<String>) -> Self

Set security_list_ids (unwraps Option)

Source

pub fn with_subnet_domain_name(self, value: impl Into<String>) -> Self

Set subnet_domain_name (unwraps Option)

Source

pub fn with_time_created(self, value: DateTime<Utc>) -> Self

Set time_created (unwraps Option)

Trait Implementations§

Source§

impl Clone for Subnet

Source§

fn clone(&self) -> Subnet

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 Subnet

Source§

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

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

impl<'de> Deserialize<'de> for Subnet

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Subnet

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

Source§

type Output = T

Should always be Self
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>,