1// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2// Code generated. DO NOT EDIT.
3
4// Core Services API
5//
6// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
7// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
8// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
9// to manage resources such as virtual cloud networks (VCNs), compute instances, and
10// block storage volumes.
11//
12
13package core
14
15import (
16	"github.com/oracle/oci-go-sdk/common"
17)
18
19// Subnet A logical subdivision of a VCN. Each subnet exists in a single availability domain and
20// consists of a contiguous range of IP addresses that do not overlap with
21// other subnets in the VCN. Example: 172.16.1.0/24. For more information, see
22// Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm) and
23// VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm).
24// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,
25// talk to an administrator. If you're an administrator who needs to write policies to give users access, see
26// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm).
27// **Warning:** Oracle recommends that you avoid using any confidential information when you
28// supply string values using the API.
29type Subnet struct {
30
31	// The subnet's CIDR block.
32	// Example: `172.16.1.0/24`
33	CidrBlock *string `mandatory:"true" json:"cidrBlock"`
34
35	// The OCID of the compartment containing the subnet.
36	CompartmentId *string `mandatory:"true" json:"compartmentId"`
37
38	// The subnet's Oracle ID (OCID).
39	Id *string `mandatory:"true" json:"id"`
40
41	// The subnet's current state.
42	LifecycleState SubnetLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
43
44	// The OCID of the route table that the subnet uses.
45	RouteTableId *string `mandatory:"true" json:"routeTableId"`
46
47	// The OCID of the VCN the subnet is in.
48	VcnId *string `mandatory:"true" json:"vcnId"`
49
50	// The IP address of the virtual router.
51	// Example: `10.0.14.1`
52	VirtualRouterIp *string `mandatory:"true" json:"virtualRouterIp"`
53
54	// The MAC address of the virtual router.
55	// Example: `00:00:17:B6:4D:DD`
56	VirtualRouterMac *string `mandatory:"true" json:"virtualRouterMac"`
57
58	// The subnet's availability domain. This attribute will be null if this is a regional subnet
59	// instead of an AD-specific subnet. Oracle recommends creating regional subnets.
60	// Example: `Uocm:PHX-AD-1`
61	AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"`
62
63	// Defined tags for this resource. Each key is predefined and scoped to a
64	// namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
65	// Example: `{"Operations": {"CostCenter": "42"}}`
66	DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
67
68	// The OCID of the set of DHCP options that the subnet uses.
69	DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"`
70
71	// A user-friendly name. Does not have to be unique, and it's changeable.
72	// Avoid entering confidential information.
73	DisplayName *string `mandatory:"false" json:"displayName"`
74
75	// A DNS label for the subnet, used in conjunction with the VNIC's hostname and
76	// VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
77	// within this subnet (for example, `bminstance-1.subnet123.vcn1.oraclevcn.com`).
78	// Must be an alphanumeric string that begins with a letter and is unique within the VCN.
79	// The value cannot be changed.
80	// The absence of this parameter means the Internet and VCN Resolver
81	// will not resolve hostnames of instances in this subnet.
82	// For more information, see
83	// DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm).
84	// Example: `subnet123`
85	DnsLabel *string `mandatory:"false" json:"dnsLabel"`
86
87	// Free-form tags for this resource. Each tag is a simple key-value pair with no
88	// predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
89	// Example: `{"Department": "Finance"}`
90	FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
91
92	// For an IPv6-enabled subnet, this is the IPv6 CIDR block for the subnet's private IP address
93	// space. The subnet size is always /64. Note that IPv6 addressing is currently supported only
94	// in the Government Cloud.
95	// Example: `2001:0db8:0123:1111::/64`
96	Ipv6CidrBlock *string `mandatory:"false" json:"ipv6CidrBlock"`
97
98	// For an IPv6-enabled subnet, this is the IPv6 CIDR block for the subnet's public IP address
99	// space. The subnet size is always /64. The left 48 bits are inherited from the
100	// `ipv6PublicCidrBlock` of the Vcn,
101	// and the remaining 16 bits are from the subnet's `ipv6CidrBlock`.
102	// Example: `2001:0db8:0123:1111::/64`
103	Ipv6PublicCidrBlock *string `mandatory:"false" json:"ipv6PublicCidrBlock"`
104
105	// For an IPv6-enabled subnet, this is the IPv6 address of the virtual router.
106	// Example: `2001:0db8:0123:1111:89ab:cdef:1234:5678`
107	Ipv6VirtualRouterIp *string `mandatory:"false" json:"ipv6VirtualRouterIp"`
108
109	// Whether VNICs within this subnet can have public IP addresses.
110	// Defaults to false, which means VNICs created in this subnet will
111	// automatically be assigned public IP addresses unless specified
112	// otherwise during instance launch or VNIC creation (with the
113	// `assignPublicIp` flag in
114	// CreateVnicDetails).
115	// If `prohibitPublicIpOnVnic` is set to true, VNICs created in this
116	// subnet cannot have public IP addresses (that is, it's a private
117	// subnet).
118	// Example: `true`
119	ProhibitPublicIpOnVnic *bool `mandatory:"false" json:"prohibitPublicIpOnVnic"`
120
121	// The OCIDs of the security list or lists that the subnet uses. Remember
122	// that security lists are associated *with the subnet*, but the
123	// rules are applied to the individual VNICs in the subnet.
124	SecurityListIds []string `mandatory:"false" json:"securityListIds"`
125
126	// The subnet's domain name, which consists of the subnet's DNS label,
127	// the VCN's DNS label, and the `oraclevcn.com` domain.
128	// For more information, see
129	// DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm).
130	// Example: `subnet123.vcn1.oraclevcn.com`
131	SubnetDomainName *string `mandatory:"false" json:"subnetDomainName"`
132
133	// The date and time the subnet was created, in the format defined by RFC3339.
134	// Example: `2016-08-25T21:10:29.600Z`
135	TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
136}
137
138func (m Subnet) String() string {
139	return common.PointerString(m)
140}
141
142// SubnetLifecycleStateEnum Enum with underlying type: string
143type SubnetLifecycleStateEnum string
144
145// Set of constants representing the allowable values for SubnetLifecycleStateEnum
146const (
147	SubnetLifecycleStateProvisioning SubnetLifecycleStateEnum = "PROVISIONING"
148	SubnetLifecycleStateAvailable    SubnetLifecycleStateEnum = "AVAILABLE"
149	SubnetLifecycleStateTerminating  SubnetLifecycleStateEnum = "TERMINATING"
150	SubnetLifecycleStateTerminated   SubnetLifecycleStateEnum = "TERMINATED"
151)
152
153var mappingSubnetLifecycleState = map[string]SubnetLifecycleStateEnum{
154	"PROVISIONING": SubnetLifecycleStateProvisioning,
155	"AVAILABLE":    SubnetLifecycleStateAvailable,
156	"TERMINATING":  SubnetLifecycleStateTerminating,
157	"TERMINATED":   SubnetLifecycleStateTerminated,
158}
159
160// GetSubnetLifecycleStateEnumValues Enumerates the set of values for SubnetLifecycleStateEnum
161func GetSubnetLifecycleStateEnumValues() []SubnetLifecycleStateEnum {
162	values := make([]SubnetLifecycleStateEnum, 0)
163	for _, v := range mappingSubnetLifecycleState {
164		values = append(values, v)
165	}
166	return values
167}
168