Class Subnet.Builder

  • Enclosing class:
    Subnet

    public static class Subnet.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • availabilityDomain

        public Subnet.Builder availabilityDomain​(String availabilityDomain)
        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: Uocm:PHX-AD-1

        Parameters:
        availabilityDomain - the value to set
        Returns:
        this builder
      • cidrBlock

        public Subnet.Builder cidrBlock​(String cidrBlock)
        The subnet’s CIDR block.

        Example: 10.0.1.0/24

        Parameters:
        cidrBlock - the value to set
        Returns:
        this builder
      • compartmentId

        public Subnet.Builder compartmentId​(String compartmentId)
        The OCID of the compartment containing the subnet.
        Parameters:
        compartmentId - the value to set
        Returns:
        this builder
      • definedTags

        public Subnet.Builder definedTags​(Map<String,​Map<String,​Object>> definedTags)
        Defined tags for this resource.

        Each key is predefined and scoped to a namespace. Example: {“foo-namespace”: {“bar-key”: “value”}}

        Parameters:
        definedTags - the value to set
        Returns:
        this builder
      • dhcpOptionsId

        public Subnet.Builder dhcpOptionsId​(String dhcpOptionsId)
        The OCID of the set of DHCP options that the subnet uses.
        Parameters:
        dhcpOptionsId - the value to set
        Returns:
        this builder
      • displayName

        public Subnet.Builder displayName​(String displayName)
        A user-friendly name.

        Does not have to be unique, and it’s changeable. Avoid entering confidential information.

        Parameters:
        displayName - the value to set
        Returns:
        this builder
      • dnsLabel

        public Subnet.Builder dnsLabel​(String dnsLabel)
        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, 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](https://docs.oracle.com/iaas/Content/Network/Concepts/dns.htm).

        Example: subnet123

        Parameters:
        dnsLabel - the value to set
        Returns:
        this builder
      • freeformTags

        public Subnet.Builder freeformTags​(Map<String,​String> freeformTags)
        Simple key-value pair that is applied without any predefined name, type or scope.

        Exists for cross-compatibility only. Example: {“bar-key”: “value”}

        Parameters:
        freeformTags - the value to set
        Returns:
        this builder
      • id

        public Subnet.Builder id​(String id)
        The subnet’s Oracle ID (OCID).
        Parameters:
        id - the value to set
        Returns:
        this builder
      • ipv6CidrBlock

        public Subnet.Builder ipv6CidrBlock​(String ipv6CidrBlock)
        For an IPv6-enabled subnet, this is the IPv6 CIDR block for the subnet’s IP address space.

        The subnet size is always /64. See IPv6 Addresses.

        Example: 2001:0db8:0123:1111::/64

        Parameters:
        ipv6CidrBlock - the value to set
        Returns:
        this builder
      • ipv6CidrBlocks

        public Subnet.Builder ipv6CidrBlocks​(List<String> ipv6CidrBlocks)
        The list of all IPv6 CIDR blocks (Oracle allocated IPv6 GUA, ULA or private IPv6 CIDR blocks, BYOIPv6 CIDR blocks) for the subnet.
        Parameters:
        ipv6CidrBlocks - the value to set
        Returns:
        this builder
      • ipv6VirtualRouterIp

        public Subnet.Builder ipv6VirtualRouterIp​(String ipv6VirtualRouterIp)
        For an IPv6-enabled subnet, this is the IPv6 address of the virtual router.

        Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678

        Parameters:
        ipv6VirtualRouterIp - the value to set
        Returns:
        this builder
      • lifecycleState

        public Subnet.Builder lifecycleState​(Subnet.LifecycleState lifecycleState)
        The subnet’s current state.
        Parameters:
        lifecycleState - the value to set
        Returns:
        this builder
      • prohibitInternetIngress

        public Subnet.Builder prohibitInternetIngress​(Boolean prohibitInternetIngress)
        Whether to disallow ingress internet traffic to VNICs within this subnet.

        Defaults to false.

        For IPV4, prohibitInternetIngress behaves similarly to 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 assignPublicIp flag in CreateVnicDetails). If prohibitInternetIngress is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a privatesubnet).

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

        Example: true

        Parameters:
        prohibitInternetIngress - the value to set
        Returns:
        this builder
      • prohibitPublicIpOnVnic

        public Subnet.Builder prohibitPublicIpOnVnic​(Boolean prohibitPublicIpOnVnic)
        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 assignPublicIp flag in CreateVnicDetails). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it’s a private subnet).

        Example: true

        Parameters:
        prohibitPublicIpOnVnic - the value to set
        Returns:
        this builder
      • routeTableId

        public Subnet.Builder routeTableId​(String routeTableId)
        The OCID of the route table that the subnet uses.
        Parameters:
        routeTableId - the value to set
        Returns:
        this builder
      • securityListIds

        public Subnet.Builder securityListIds​(List<String> securityListIds)
        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.

        Parameters:
        securityListIds - the value to set
        Returns:
        this builder
      • subnetDomainName

        public Subnet.Builder subnetDomainName​(String subnetDomainName)
        The subnet’s domain name, which consists of the subnet’s DNS label, the VCN’s DNS label, and the oraclevcn.com domain.

        For more information, see [DNS in Your Virtual Cloud Network](https://docs.oracle.com/iaas/Content/Network/Concepts/dns.htm).

        Example: subnet123.vcn1.oraclevcn.com

        Parameters:
        subnetDomainName - the value to set
        Returns:
        this builder
      • timeCreated

        public Subnet.Builder timeCreated​(Date timeCreated)
        The date and time the subnet was created, in the format defined by RFC3339.

        Example: 2016-08-25T21:10:29.600Z

        Parameters:
        timeCreated - the value to set
        Returns:
        this builder
      • vcnId

        public Subnet.Builder vcnId​(String vcnId)
        The OCID of the VCN the subnet is in.
        Parameters:
        vcnId - the value to set
        Returns:
        this builder
      • virtualRouterIp

        public Subnet.Builder virtualRouterIp​(String virtualRouterIp)
        The IP address of the virtual router.

        Example: 10.0.14.1

        Parameters:
        virtualRouterIp - the value to set
        Returns:
        this builder
      • virtualRouterMac

        public Subnet.Builder virtualRouterMac​(String virtualRouterMac)
        The MAC address of the virtual router.

        Example: 00:00:00:00:00:01

        Parameters:
        virtualRouterMac - the value to set
        Returns:
        this builder
      • build

        public Subnet build()