-
Notifications
You must be signed in to change notification settings - Fork 82
/
update_vtap_details.go
293 lines (242 loc) · 14.3 KB
/
update_vtap_details.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
// Core Services API
//
// Use the Core Services API to manage resources such as virtual cloud networks (VCNs),
// compute instances, and block storage volumes. For more information, see the console
// documentation for the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services.
// The required permissions are documented in the
// Details for the Core Services (https://docs.cloud.oracle.com/iaas/Content/Identity/Reference/corepolicyreference.htm) article.
//
package core
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// UpdateVtapDetails These details can be included in a request to update a virtual test access point (VTAP).
type UpdateVtapDetails struct {
// Defined tags for this resource. Each key is predefined and scoped to a
// namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// A user-friendly name. Does not have to be unique, and it's changeable.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
// 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 (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source point where packets are captured.
SourceId *string `mandatory:"false" json:"sourceId"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the destination resource where mirrored packets are sent.
TargetId *string `mandatory:"false" json:"targetId"`
// The IP address of the destination resource where mirrored packets are sent.
TargetIp *string `mandatory:"false" json:"targetIp"`
// The capture filter's Oracle ID (OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)).
CaptureFilterId *string `mandatory:"false" json:"captureFilterId"`
// Defines an encapsulation header type for the VTAP's mirrored traffic.
EncapsulationProtocol UpdateVtapDetailsEncapsulationProtocolEnum `mandatory:"false" json:"encapsulationProtocol,omitempty"`
// The virtual extensible LAN (VXLAN) network identifier (or VXLAN segment ID) that uniquely identifies the VXLAN.
VxlanNetworkIdentifier *int64 `mandatory:"false" json:"vxlanNetworkIdentifier"`
// Used to start or stop a `Vtap` resource.
// * `TRUE` directs the VTAP to start mirroring traffic.
// * `FALSE` (Default) directs the VTAP to stop mirroring traffic.
IsVtapEnabled *bool `mandatory:"false" json:"isVtapEnabled"`
// Used to control the priority of traffic. It is an optional field. If it not passed, the value is DEFAULT
TrafficMode UpdateVtapDetailsTrafficModeEnum `mandatory:"false" json:"trafficMode,omitempty"`
// The maximum size of the packets to be included in the filter.
MaxPacketSize *int `mandatory:"false" json:"maxPacketSize"`
// The IP Address of the source private endpoint.
SourcePrivateEndpointIp *string `mandatory:"false" json:"sourcePrivateEndpointIp"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet that source private endpoint belongs to.
SourcePrivateEndpointSubnetId *string `mandatory:"false" json:"sourcePrivateEndpointSubnetId"`
// The target type for the VTAP.
TargetType UpdateVtapDetailsTargetTypeEnum `mandatory:"false" json:"targetType,omitempty"`
// The source type for the VTAP.
SourceType UpdateVtapDetailsSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"`
}
func (m UpdateVtapDetails) String() string {
return common.PointerString(m)
}
// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m UpdateVtapDetails) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingUpdateVtapDetailsEncapsulationProtocolEnum(string(m.EncapsulationProtocol)); !ok && m.EncapsulationProtocol != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EncapsulationProtocol: %s. Supported values are: %s.", m.EncapsulationProtocol, strings.Join(GetUpdateVtapDetailsEncapsulationProtocolEnumStringValues(), ",")))
}
if _, ok := GetMappingUpdateVtapDetailsTrafficModeEnum(string(m.TrafficMode)); !ok && m.TrafficMode != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TrafficMode: %s. Supported values are: %s.", m.TrafficMode, strings.Join(GetUpdateVtapDetailsTrafficModeEnumStringValues(), ",")))
}
if _, ok := GetMappingUpdateVtapDetailsTargetTypeEnum(string(m.TargetType)); !ok && m.TargetType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TargetType: %s. Supported values are: %s.", m.TargetType, strings.Join(GetUpdateVtapDetailsTargetTypeEnumStringValues(), ",")))
}
if _, ok := GetMappingUpdateVtapDetailsSourceTypeEnum(string(m.SourceType)); !ok && m.SourceType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", m.SourceType, strings.Join(GetUpdateVtapDetailsSourceTypeEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// UpdateVtapDetailsEncapsulationProtocolEnum Enum with underlying type: string
type UpdateVtapDetailsEncapsulationProtocolEnum string
// Set of constants representing the allowable values for UpdateVtapDetailsEncapsulationProtocolEnum
const (
UpdateVtapDetailsEncapsulationProtocolVxlan UpdateVtapDetailsEncapsulationProtocolEnum = "VXLAN"
)
var mappingUpdateVtapDetailsEncapsulationProtocolEnum = map[string]UpdateVtapDetailsEncapsulationProtocolEnum{
"VXLAN": UpdateVtapDetailsEncapsulationProtocolVxlan,
}
var mappingUpdateVtapDetailsEncapsulationProtocolEnumLowerCase = map[string]UpdateVtapDetailsEncapsulationProtocolEnum{
"vxlan": UpdateVtapDetailsEncapsulationProtocolVxlan,
}
// GetUpdateVtapDetailsEncapsulationProtocolEnumValues Enumerates the set of values for UpdateVtapDetailsEncapsulationProtocolEnum
func GetUpdateVtapDetailsEncapsulationProtocolEnumValues() []UpdateVtapDetailsEncapsulationProtocolEnum {
values := make([]UpdateVtapDetailsEncapsulationProtocolEnum, 0)
for _, v := range mappingUpdateVtapDetailsEncapsulationProtocolEnum {
values = append(values, v)
}
return values
}
// GetUpdateVtapDetailsEncapsulationProtocolEnumStringValues Enumerates the set of values in String for UpdateVtapDetailsEncapsulationProtocolEnum
func GetUpdateVtapDetailsEncapsulationProtocolEnumStringValues() []string {
return []string{
"VXLAN",
}
}
// GetMappingUpdateVtapDetailsEncapsulationProtocolEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUpdateVtapDetailsEncapsulationProtocolEnum(val string) (UpdateVtapDetailsEncapsulationProtocolEnum, bool) {
enum, ok := mappingUpdateVtapDetailsEncapsulationProtocolEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UpdateVtapDetailsTrafficModeEnum Enum with underlying type: string
type UpdateVtapDetailsTrafficModeEnum string
// Set of constants representing the allowable values for UpdateVtapDetailsTrafficModeEnum
const (
UpdateVtapDetailsTrafficModeDefault UpdateVtapDetailsTrafficModeEnum = "DEFAULT"
UpdateVtapDetailsTrafficModePriority UpdateVtapDetailsTrafficModeEnum = "PRIORITY"
)
var mappingUpdateVtapDetailsTrafficModeEnum = map[string]UpdateVtapDetailsTrafficModeEnum{
"DEFAULT": UpdateVtapDetailsTrafficModeDefault,
"PRIORITY": UpdateVtapDetailsTrafficModePriority,
}
var mappingUpdateVtapDetailsTrafficModeEnumLowerCase = map[string]UpdateVtapDetailsTrafficModeEnum{
"default": UpdateVtapDetailsTrafficModeDefault,
"priority": UpdateVtapDetailsTrafficModePriority,
}
// GetUpdateVtapDetailsTrafficModeEnumValues Enumerates the set of values for UpdateVtapDetailsTrafficModeEnum
func GetUpdateVtapDetailsTrafficModeEnumValues() []UpdateVtapDetailsTrafficModeEnum {
values := make([]UpdateVtapDetailsTrafficModeEnum, 0)
for _, v := range mappingUpdateVtapDetailsTrafficModeEnum {
values = append(values, v)
}
return values
}
// GetUpdateVtapDetailsTrafficModeEnumStringValues Enumerates the set of values in String for UpdateVtapDetailsTrafficModeEnum
func GetUpdateVtapDetailsTrafficModeEnumStringValues() []string {
return []string{
"DEFAULT",
"PRIORITY",
}
}
// GetMappingUpdateVtapDetailsTrafficModeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUpdateVtapDetailsTrafficModeEnum(val string) (UpdateVtapDetailsTrafficModeEnum, bool) {
enum, ok := mappingUpdateVtapDetailsTrafficModeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UpdateVtapDetailsTargetTypeEnum Enum with underlying type: string
type UpdateVtapDetailsTargetTypeEnum string
// Set of constants representing the allowable values for UpdateVtapDetailsTargetTypeEnum
const (
UpdateVtapDetailsTargetTypeVnic UpdateVtapDetailsTargetTypeEnum = "VNIC"
UpdateVtapDetailsTargetTypeNetworkLoadBalancer UpdateVtapDetailsTargetTypeEnum = "NETWORK_LOAD_BALANCER"
UpdateVtapDetailsTargetTypeIpAddress UpdateVtapDetailsTargetTypeEnum = "IP_ADDRESS"
)
var mappingUpdateVtapDetailsTargetTypeEnum = map[string]UpdateVtapDetailsTargetTypeEnum{
"VNIC": UpdateVtapDetailsTargetTypeVnic,
"NETWORK_LOAD_BALANCER": UpdateVtapDetailsTargetTypeNetworkLoadBalancer,
"IP_ADDRESS": UpdateVtapDetailsTargetTypeIpAddress,
}
var mappingUpdateVtapDetailsTargetTypeEnumLowerCase = map[string]UpdateVtapDetailsTargetTypeEnum{
"vnic": UpdateVtapDetailsTargetTypeVnic,
"network_load_balancer": UpdateVtapDetailsTargetTypeNetworkLoadBalancer,
"ip_address": UpdateVtapDetailsTargetTypeIpAddress,
}
// GetUpdateVtapDetailsTargetTypeEnumValues Enumerates the set of values for UpdateVtapDetailsTargetTypeEnum
func GetUpdateVtapDetailsTargetTypeEnumValues() []UpdateVtapDetailsTargetTypeEnum {
values := make([]UpdateVtapDetailsTargetTypeEnum, 0)
for _, v := range mappingUpdateVtapDetailsTargetTypeEnum {
values = append(values, v)
}
return values
}
// GetUpdateVtapDetailsTargetTypeEnumStringValues Enumerates the set of values in String for UpdateVtapDetailsTargetTypeEnum
func GetUpdateVtapDetailsTargetTypeEnumStringValues() []string {
return []string{
"VNIC",
"NETWORK_LOAD_BALANCER",
"IP_ADDRESS",
}
}
// GetMappingUpdateVtapDetailsTargetTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUpdateVtapDetailsTargetTypeEnum(val string) (UpdateVtapDetailsTargetTypeEnum, bool) {
enum, ok := mappingUpdateVtapDetailsTargetTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// UpdateVtapDetailsSourceTypeEnum Enum with underlying type: string
type UpdateVtapDetailsSourceTypeEnum string
// Set of constants representing the allowable values for UpdateVtapDetailsSourceTypeEnum
const (
UpdateVtapDetailsSourceTypeVnic UpdateVtapDetailsSourceTypeEnum = "VNIC"
UpdateVtapDetailsSourceTypeSubnet UpdateVtapDetailsSourceTypeEnum = "SUBNET"
UpdateVtapDetailsSourceTypeLoadBalancer UpdateVtapDetailsSourceTypeEnum = "LOAD_BALANCER"
UpdateVtapDetailsSourceTypeDbSystem UpdateVtapDetailsSourceTypeEnum = "DB_SYSTEM"
UpdateVtapDetailsSourceTypeExadataVmCluster UpdateVtapDetailsSourceTypeEnum = "EXADATA_VM_CLUSTER"
UpdateVtapDetailsSourceTypeAutonomousDataWarehouse UpdateVtapDetailsSourceTypeEnum = "AUTONOMOUS_DATA_WAREHOUSE"
)
var mappingUpdateVtapDetailsSourceTypeEnum = map[string]UpdateVtapDetailsSourceTypeEnum{
"VNIC": UpdateVtapDetailsSourceTypeVnic,
"SUBNET": UpdateVtapDetailsSourceTypeSubnet,
"LOAD_BALANCER": UpdateVtapDetailsSourceTypeLoadBalancer,
"DB_SYSTEM": UpdateVtapDetailsSourceTypeDbSystem,
"EXADATA_VM_CLUSTER": UpdateVtapDetailsSourceTypeExadataVmCluster,
"AUTONOMOUS_DATA_WAREHOUSE": UpdateVtapDetailsSourceTypeAutonomousDataWarehouse,
}
var mappingUpdateVtapDetailsSourceTypeEnumLowerCase = map[string]UpdateVtapDetailsSourceTypeEnum{
"vnic": UpdateVtapDetailsSourceTypeVnic,
"subnet": UpdateVtapDetailsSourceTypeSubnet,
"load_balancer": UpdateVtapDetailsSourceTypeLoadBalancer,
"db_system": UpdateVtapDetailsSourceTypeDbSystem,
"exadata_vm_cluster": UpdateVtapDetailsSourceTypeExadataVmCluster,
"autonomous_data_warehouse": UpdateVtapDetailsSourceTypeAutonomousDataWarehouse,
}
// GetUpdateVtapDetailsSourceTypeEnumValues Enumerates the set of values for UpdateVtapDetailsSourceTypeEnum
func GetUpdateVtapDetailsSourceTypeEnumValues() []UpdateVtapDetailsSourceTypeEnum {
values := make([]UpdateVtapDetailsSourceTypeEnum, 0)
for _, v := range mappingUpdateVtapDetailsSourceTypeEnum {
values = append(values, v)
}
return values
}
// GetUpdateVtapDetailsSourceTypeEnumStringValues Enumerates the set of values in String for UpdateVtapDetailsSourceTypeEnum
func GetUpdateVtapDetailsSourceTypeEnumStringValues() []string {
return []string{
"VNIC",
"SUBNET",
"LOAD_BALANCER",
"DB_SYSTEM",
"EXADATA_VM_CLUSTER",
"AUTONOMOUS_DATA_WAREHOUSE",
}
}
// GetMappingUpdateVtapDetailsSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingUpdateVtapDetailsSourceTypeEnum(val string) (UpdateVtapDetailsSourceTypeEnum, bool) {
enum, ok := mappingUpdateVtapDetailsSourceTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}