/
flow_log_capture_filter_rule_details.go
162 lines (130 loc) · 7.74 KB
/
flow_log_capture_filter_rule_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
// 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.
// Network Monitoring API
//
// Use the Network Monitoring API to troubleshoot routing and security issues for resources such as virtual cloud networks (VCNs) and compute instances. For more information, see the console
// documentation for the Network Path Analyzer (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/path_analyzer.htm) tool.
//
package vnmonitoring
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// FlowLogCaptureFilterRuleDetails The set of rules governing what traffic the flow log collects when creating a flow log capture filter.
type FlowLogCaptureFilterRuleDetails struct {
// Indicates whether a flow log capture filter rule is enabled.
IsEnabled *bool `mandatory:"false" json:"isEnabled"`
// A lower number indicates a higher priority, range 0-9. Each rule must have a distinct priority.
Priority *int `mandatory:"false" json:"priority"`
// Sampling interval as 1 of X, where X is an integer not greater than 100000.
SamplingRate *int `mandatory:"false" json:"samplingRate"`
// Traffic from this CIDR will be captured in the flow log.
SourceCidr *string `mandatory:"false" json:"sourceCidr"`
// Traffic to this CIDR will be captured in the flow log.
DestinationCidr *string `mandatory:"false" json:"destinationCidr"`
// The transport protocol the filter uses.
Protocol *string `mandatory:"false" json:"protocol"`
IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"`
TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"`
UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"`
// Type or types of flow logs to store. `ALL` includes records for both accepted traffic and
// rejected traffic.
FlowLogType FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum `mandatory:"false" json:"flowLogType,omitempty"`
// Include or exclude a ruleAction object.
RuleAction FlowLogCaptureFilterRuleDetailsRuleActionEnum `mandatory:"false" json:"ruleAction,omitempty"`
}
func (m FlowLogCaptureFilterRuleDetails) 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 FlowLogCaptureFilterRuleDetails) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnum(string(m.FlowLogType)); !ok && m.FlowLogType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FlowLogType: %s. Supported values are: %s.", m.FlowLogType, strings.Join(GetFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumStringValues(), ",")))
}
if _, ok := GetMappingFlowLogCaptureFilterRuleDetailsRuleActionEnum(string(m.RuleAction)); !ok && m.RuleAction != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RuleAction: %s. Supported values are: %s.", m.RuleAction, strings.Join(GetFlowLogCaptureFilterRuleDetailsRuleActionEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum Enum with underlying type: string
type FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum string
// Set of constants representing the allowable values for FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum
const (
FlowLogCaptureFilterRuleDetailsFlowLogTypeAll FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum = "ALL"
FlowLogCaptureFilterRuleDetailsFlowLogTypeReject FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum = "REJECT"
FlowLogCaptureFilterRuleDetailsFlowLogTypeAccept FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum = "ACCEPT"
)
var mappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnum = map[string]FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum{
"ALL": FlowLogCaptureFilterRuleDetailsFlowLogTypeAll,
"REJECT": FlowLogCaptureFilterRuleDetailsFlowLogTypeReject,
"ACCEPT": FlowLogCaptureFilterRuleDetailsFlowLogTypeAccept,
}
var mappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumLowerCase = map[string]FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum{
"all": FlowLogCaptureFilterRuleDetailsFlowLogTypeAll,
"reject": FlowLogCaptureFilterRuleDetailsFlowLogTypeReject,
"accept": FlowLogCaptureFilterRuleDetailsFlowLogTypeAccept,
}
// GetFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumValues Enumerates the set of values for FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum
func GetFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumValues() []FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum {
values := make([]FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum, 0)
for _, v := range mappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnum {
values = append(values, v)
}
return values
}
// GetFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumStringValues Enumerates the set of values in String for FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum
func GetFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumStringValues() []string {
return []string{
"ALL",
"REJECT",
"ACCEPT",
}
}
// GetMappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnum(val string) (FlowLogCaptureFilterRuleDetailsFlowLogTypeEnum, bool) {
enum, ok := mappingFlowLogCaptureFilterRuleDetailsFlowLogTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// FlowLogCaptureFilterRuleDetailsRuleActionEnum Enum with underlying type: string
type FlowLogCaptureFilterRuleDetailsRuleActionEnum string
// Set of constants representing the allowable values for FlowLogCaptureFilterRuleDetailsRuleActionEnum
const (
FlowLogCaptureFilterRuleDetailsRuleActionInclude FlowLogCaptureFilterRuleDetailsRuleActionEnum = "INCLUDE"
FlowLogCaptureFilterRuleDetailsRuleActionExclude FlowLogCaptureFilterRuleDetailsRuleActionEnum = "EXCLUDE"
)
var mappingFlowLogCaptureFilterRuleDetailsRuleActionEnum = map[string]FlowLogCaptureFilterRuleDetailsRuleActionEnum{
"INCLUDE": FlowLogCaptureFilterRuleDetailsRuleActionInclude,
"EXCLUDE": FlowLogCaptureFilterRuleDetailsRuleActionExclude,
}
var mappingFlowLogCaptureFilterRuleDetailsRuleActionEnumLowerCase = map[string]FlowLogCaptureFilterRuleDetailsRuleActionEnum{
"include": FlowLogCaptureFilterRuleDetailsRuleActionInclude,
"exclude": FlowLogCaptureFilterRuleDetailsRuleActionExclude,
}
// GetFlowLogCaptureFilterRuleDetailsRuleActionEnumValues Enumerates the set of values for FlowLogCaptureFilterRuleDetailsRuleActionEnum
func GetFlowLogCaptureFilterRuleDetailsRuleActionEnumValues() []FlowLogCaptureFilterRuleDetailsRuleActionEnum {
values := make([]FlowLogCaptureFilterRuleDetailsRuleActionEnum, 0)
for _, v := range mappingFlowLogCaptureFilterRuleDetailsRuleActionEnum {
values = append(values, v)
}
return values
}
// GetFlowLogCaptureFilterRuleDetailsRuleActionEnumStringValues Enumerates the set of values in String for FlowLogCaptureFilterRuleDetailsRuleActionEnum
func GetFlowLogCaptureFilterRuleDetailsRuleActionEnumStringValues() []string {
return []string{
"INCLUDE",
"EXCLUDE",
}
}
// GetMappingFlowLogCaptureFilterRuleDetailsRuleActionEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingFlowLogCaptureFilterRuleDetailsRuleActionEnum(val string) (FlowLogCaptureFilterRuleDetailsRuleActionEnum, bool) {
enum, ok := mappingFlowLogCaptureFilterRuleDetailsRuleActionEnumLowerCase[strings.ToLower(val)]
return enum, ok
}