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: StringThe subnet’s CIDR block.
Example: {@code 10.0.1.0/24}
compartment_id: StringThe OCID of the compartment containing the subnet.
id: StringThe subnet’s Oracle ID (OCID).
lifecycle_state: SubnetLifecycleStateThe subnet’s current state.
route_table_id: StringThe OCID of the route table that the subnet uses.
vcn_id: StringThe OCID of the VCN the subnet is in.
virtual_router_ip: StringThe IP address of the virtual router.
Example: {@code 10.0.14.1}
virtual_router_mac: StringThe 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 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}
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
impl Subnet
Sourcepub fn new(required: SubnetRequired) -> Self
pub fn new(required: SubnetRequired) -> Self
Create a new Subnet with required fields
Sourcepub fn set_availability_domain(self, value: Option<String>) -> Self
pub fn set_availability_domain(self, value: Option<String>) -> Self
Set availability_domain
Sourcepub fn set_cidr_block(self, value: String) -> Self
pub fn set_cidr_block(self, value: String) -> Self
Set cidr_block
Sourcepub fn set_ipv4_cidr_blocks(self, value: Option<Vec<String>>) -> Self
pub fn set_ipv4_cidr_blocks(self, value: Option<Vec<String>>) -> Self
Set ipv4_cidr_blocks
Sourcepub fn set_compartment_id(self, value: String) -> Self
pub fn set_compartment_id(self, value: String) -> Self
Set compartment_id
Set defined_tags
Sourcepub fn set_dhcp_options_id(self, value: Option<String>) -> Self
pub fn set_dhcp_options_id(self, value: Option<String>) -> Self
Set dhcp_options_id
Sourcepub fn set_display_name(self, value: Option<String>) -> Self
pub fn set_display_name(self, value: Option<String>) -> Self
Set display_name
Sourcepub fn set_dns_label(self, value: Option<String>) -> Self
pub fn set_dns_label(self, value: Option<String>) -> Self
Set dns_label
Set freeform_tags
Sourcepub fn set_ipv6_cidr_block(self, value: Option<String>) -> Self
pub fn set_ipv6_cidr_block(self, value: Option<String>) -> Self
Set ipv6_cidr_block
Sourcepub fn set_ipv6_cidr_blocks(self, value: Option<Vec<String>>) -> Self
pub fn set_ipv6_cidr_blocks(self, value: Option<Vec<String>>) -> Self
Set ipv6_cidr_blocks
Sourcepub fn set_ipv6_virtual_router_ip(self, value: Option<String>) -> Self
pub fn set_ipv6_virtual_router_ip(self, value: Option<String>) -> Self
Set ipv6_virtual_router_ip
Sourcepub fn set_lifecycle_state(self, value: SubnetLifecycleState) -> Self
pub fn set_lifecycle_state(self, value: SubnetLifecycleState) -> Self
Set lifecycle_state
Sourcepub fn set_prohibit_internet_ingress(self, value: Option<bool>) -> Self
pub fn set_prohibit_internet_ingress(self, value: Option<bool>) -> Self
Set prohibit_internet_ingress
Sourcepub fn set_prohibit_public_ip_on_vnic(self, value: Option<bool>) -> Self
pub fn set_prohibit_public_ip_on_vnic(self, value: Option<bool>) -> Self
Set prohibit_public_ip_on_vnic
Sourcepub fn set_route_table_id(self, value: String) -> Self
pub fn set_route_table_id(self, value: String) -> Self
Set route_table_id
Sourcepub fn set_security_list_ids(self, value: Option<Vec<String>>) -> Self
pub fn set_security_list_ids(self, value: Option<Vec<String>>) -> Self
Set security_list_ids
Sourcepub fn set_subnet_domain_name(self, value: Option<String>) -> Self
pub fn set_subnet_domain_name(self, value: Option<String>) -> Self
Set subnet_domain_name
Sourcepub fn set_time_created(self, value: Option<DateTime<Utc>>) -> Self
pub fn set_time_created(self, value: Option<DateTime<Utc>>) -> Self
Set time_created
Sourcepub fn set_vcn_id(self, value: String) -> Self
pub fn set_vcn_id(self, value: String) -> Self
Set vcn_id
Sourcepub fn set_virtual_router_ip(self, value: String) -> Self
pub fn set_virtual_router_ip(self, value: String) -> Self
Set virtual_router_ip
Sourcepub fn set_virtual_router_mac(self, value: String) -> Self
pub fn set_virtual_router_mac(self, value: String) -> Self
Set virtual_router_mac
Sourcepub fn with_availability_domain(self, value: impl Into<String>) -> Self
pub fn with_availability_domain(self, value: impl Into<String>) -> Self
Set availability_domain (unwraps Option)
Sourcepub fn with_ipv4_cidr_blocks(self, value: Vec<String>) -> Self
pub fn with_ipv4_cidr_blocks(self, value: Vec<String>) -> Self
Set ipv4_cidr_blocks (unwraps Option)
Set defined_tags (unwraps Option)
Sourcepub fn with_dhcp_options_id(self, value: impl Into<String>) -> Self
pub fn with_dhcp_options_id(self, value: impl Into<String>) -> Self
Set dhcp_options_id (unwraps Option)
Sourcepub fn with_display_name(self, value: impl Into<String>) -> Self
pub fn with_display_name(self, value: impl Into<String>) -> Self
Set display_name (unwraps Option)
Sourcepub fn with_dns_label(self, value: impl Into<String>) -> Self
pub fn with_dns_label(self, value: impl Into<String>) -> Self
Set dns_label (unwraps Option)
Set freeform_tags (unwraps Option)
Sourcepub fn with_ipv6_cidr_block(self, value: impl Into<String>) -> Self
pub fn with_ipv6_cidr_block(self, value: impl Into<String>) -> Self
Set ipv6_cidr_block (unwraps Option)
Sourcepub fn with_ipv6_cidr_blocks(self, value: Vec<String>) -> Self
pub fn with_ipv6_cidr_blocks(self, value: Vec<String>) -> Self
Set ipv6_cidr_blocks (unwraps Option)
Sourcepub fn with_ipv6_virtual_router_ip(self, value: impl Into<String>) -> Self
pub fn with_ipv6_virtual_router_ip(self, value: impl Into<String>) -> Self
Set ipv6_virtual_router_ip (unwraps Option)
Sourcepub fn with_prohibit_internet_ingress(self, value: bool) -> Self
pub fn with_prohibit_internet_ingress(self, value: bool) -> Self
Set prohibit_internet_ingress (unwraps Option)
Sourcepub fn with_prohibit_public_ip_on_vnic(self, value: bool) -> Self
pub fn with_prohibit_public_ip_on_vnic(self, value: bool) -> Self
Set prohibit_public_ip_on_vnic (unwraps Option)
Sourcepub fn with_security_list_ids(self, value: Vec<String>) -> Self
pub fn with_security_list_ids(self, value: Vec<String>) -> Self
Set security_list_ids (unwraps Option)
Sourcepub fn with_subnet_domain_name(self, value: impl Into<String>) -> Self
pub fn with_subnet_domain_name(self, value: impl Into<String>) -> Self
Set subnet_domain_name (unwraps Option)
Sourcepub fn with_time_created(self, value: DateTime<Utc>) -> Self
pub fn with_time_created(self, value: DateTime<Utc>) -> Self
Set time_created (unwraps Option)