Class: OCI::VnMonitoring::Models::FlowLogCaptureFilterRuleDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb

Overview

The set of rules governing what traffic the flow log collects when creating a flow log capture filter.

Constant Summary collapse

FLOW_LOG_TYPE_ENUM =
[
  FLOW_LOG_TYPE_ALL = 'ALL'.freeze,
  FLOW_LOG_TYPE_REJECT = 'REJECT'.freeze,
  FLOW_LOG_TYPE_ACCEPT = 'ACCEPT'.freeze,
  FLOW_LOG_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RULE_ACTION_ENUM =
[
  RULE_ACTION_INCLUDE = 'INCLUDE'.freeze,
  RULE_ACTION_EXCLUDE = 'EXCLUDE'.freeze,
  RULE_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FlowLogCaptureFilterRuleDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 131

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

  raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?

  self.priority = attributes[:'priority'] if attributes[:'priority']

  self.sampling_rate = attributes[:'samplingRate'] if attributes[:'samplingRate']

  raise 'You cannot provide both :samplingRate and :sampling_rate' if attributes.key?(:'samplingRate') && attributes.key?(:'sampling_rate')

  self.sampling_rate = attributes[:'sampling_rate'] if attributes[:'sampling_rate']

  self.source_cidr = attributes[:'sourceCidr'] if attributes[:'sourceCidr']

  raise 'You cannot provide both :sourceCidr and :source_cidr' if attributes.key?(:'sourceCidr') && attributes.key?(:'source_cidr')

  self.source_cidr = attributes[:'source_cidr'] if attributes[:'source_cidr']

  self.destination_cidr = attributes[:'destinationCidr'] if attributes[:'destinationCidr']

  raise 'You cannot provide both :destinationCidr and :destination_cidr' if attributes.key?(:'destinationCidr') && attributes.key?(:'destination_cidr')

  self.destination_cidr = attributes[:'destination_cidr'] if attributes[:'destination_cidr']

  self.protocol = attributes[:'protocol'] if attributes[:'protocol']

  self.icmp_options = attributes[:'icmpOptions'] if attributes[:'icmpOptions']

  raise 'You cannot provide both :icmpOptions and :icmp_options' if attributes.key?(:'icmpOptions') && attributes.key?(:'icmp_options')

  self.icmp_options = attributes[:'icmp_options'] if attributes[:'icmp_options']

  self.tcp_options = attributes[:'tcpOptions'] if attributes[:'tcpOptions']

  raise 'You cannot provide both :tcpOptions and :tcp_options' if attributes.key?(:'tcpOptions') && attributes.key?(:'tcp_options')

  self.tcp_options = attributes[:'tcp_options'] if attributes[:'tcp_options']

  self.udp_options = attributes[:'udpOptions'] if attributes[:'udpOptions']

  raise 'You cannot provide both :udpOptions and :udp_options' if attributes.key?(:'udpOptions') && attributes.key?(:'udp_options')

  self.udp_options = attributes[:'udp_options'] if attributes[:'udp_options']

  self.flow_log_type = attributes[:'flowLogType'] if attributes[:'flowLogType']

  raise 'You cannot provide both :flowLogType and :flow_log_type' if attributes.key?(:'flowLogType') && attributes.key?(:'flow_log_type')

  self.flow_log_type = attributes[:'flow_log_type'] if attributes[:'flow_log_type']

  self.rule_action = attributes[:'ruleAction'] if attributes[:'ruleAction']

  raise 'You cannot provide both :ruleAction and :rule_action' if attributes.key?(:'ruleAction') && attributes.key?(:'rule_action')

  self.rule_action = attributes[:'rule_action'] if attributes[:'rule_action']
end

Instance Attribute Details

#destination_cidrString

Traffic to this CIDR will be captured in the flow log.

Returns:

  • (String)


49
50
51
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 49

def destination_cidr
  @destination_cidr
end

#flow_log_typeString

Type or types of flow logs to store. ALL includes records for both accepted traffic and rejected traffic.

Returns:

  • (String)


69
70
71
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 69

def flow_log_type
  @flow_log_type
end

#icmp_optionsOCI::VnMonitoring::Models::IcmpOptions



57
58
59
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 57

def icmp_options
  @icmp_options
end

#is_enabledBOOLEAN

Indicates whether a flow log capture filter rule is enabled.

Returns:

  • (BOOLEAN)


29
30
31
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 29

def is_enabled
  @is_enabled
end

#priorityInteger

A lower number indicates a higher priority, range 0-9. Each rule must have a distinct priority.

Returns:

  • (Integer)


34
35
36
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 34

def priority
  @priority
end

#protocolString

The transport protocol the filter uses.

Returns:

  • (String)


54
55
56
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 54

def protocol
  @protocol
end

#rule_actionString

Include or exclude a ruleAction object.

Returns:

  • (String)


74
75
76
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 74

def rule_action
  @rule_action
end

#sampling_rateInteger

Sampling interval as 1 of X, where X is an integer not greater than 100000.

Returns:

  • (Integer)


39
40
41
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 39

def sampling_rate
  @sampling_rate
end

#source_cidrString

Traffic from this CIDR will be captured in the flow log.

Returns:

  • (String)


44
45
46
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 44

def source_cidr
  @source_cidr
end

#tcp_optionsOCI::VnMonitoring::Models::TcpOptions



60
61
62
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 60

def tcp_options
  @tcp_options
end

#udp_optionsOCI::VnMonitoring::Models::UdpOptions



63
64
65
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 63

def udp_options
  @udp_options
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 77

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_enabled': :'isEnabled',
    'priority': :'priority',
    'sampling_rate': :'samplingRate',
    'source_cidr': :'sourceCidr',
    'destination_cidr': :'destinationCidr',
    'protocol': :'protocol',
    'icmp_options': :'icmpOptions',
    'tcp_options': :'tcpOptions',
    'udp_options': :'udpOptions',
    'flow_log_type': :'flowLogType',
    'rule_action': :'ruleAction'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 96

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_enabled': :'BOOLEAN',
    'priority': :'Integer',
    'sampling_rate': :'Integer',
    'source_cidr': :'String',
    'destination_cidr': :'String',
    'protocol': :'String',
    'icmp_options': :'OCI::VnMonitoring::Models::IcmpOptions',
    'tcp_options': :'OCI::VnMonitoring::Models::TcpOptions',
    'udp_options': :'OCI::VnMonitoring::Models::UdpOptions',
    'flow_log_type': :'String',
    'rule_action': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 229

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    is_enabled == other.is_enabled &&
    priority == other.priority &&
    sampling_rate == other.sampling_rate &&
    source_cidr == other.source_cidr &&
    destination_cidr == other.destination_cidr &&
    protocol == other.protocol &&
    icmp_options == other.icmp_options &&
    tcp_options == other.tcp_options &&
    udp_options == other.udp_options &&
    flow_log_type == other.flow_log_type &&
    rule_action == other.rule_action
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 269

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


249
250
251
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 249

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



258
259
260
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 258

def hash
  [is_enabled, priority, sampling_rate, source_cidr, destination_cidr, protocol, icmp_options, tcp_options, udp_options, flow_log_type, rule_action].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



302
303
304
305
306
307
308
309
310
311
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 302

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



296
297
298
# File 'lib/oci/vn_monitoring/models/flow_log_capture_filter_rule_details.rb', line 296

def to_s
  to_hash.to_s
end