Class: OCI::VnMonitoring::Models::UpdateVtapDetails

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

Overview

These details can be included in a request to update a virtual test access point (VTAP).

Constant Summary collapse

ENCAPSULATION_PROTOCOL_ENUM =
[
  ENCAPSULATION_PROTOCOL_VXLAN = 'VXLAN'.freeze
].freeze
TRAFFIC_MODE_ENUM =
[
  TRAFFIC_MODE_DEFAULT = 'DEFAULT'.freeze,
  TRAFFIC_MODE_PRIORITY = 'PRIORITY'.freeze
].freeze
TARGET_TYPE_ENUM =
[
  TARGET_TYPE_VNIC = 'VNIC'.freeze,
  TARGET_TYPE_NETWORK_LOAD_BALANCER = 'NETWORK_LOAD_BALANCER'.freeze,
  TARGET_TYPE_IP_ADDRESS = 'IP_ADDRESS'.freeze
].freeze
SOURCE_TYPE_ENUM =
[
  SOURCE_TYPE_VNIC = 'VNIC'.freeze,
  SOURCE_TYPE_SUBNET = 'SUBNET'.freeze,
  SOURCE_TYPE_LOAD_BALANCER = 'LOAD_BALANCER'.freeze,
  SOURCE_TYPE_DB_SYSTEM = 'DB_SYSTEM'.freeze,
  SOURCE_TYPE_EXADATA_VM_CLUSTER = 'EXADATA_VM_CLUSTER'.freeze,
  SOURCE_TYPE_AUTONOMOUS_DATA_WAREHOUSE = 'AUTONOMOUS_DATA_WAREHOUSE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateVtapDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property

  • :display_name (String)

    The value to assign to the #display_name property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :source_id (String)

    The value to assign to the #source_id property

  • :target_id (String)

    The value to assign to the #target_id property

  • :target_ip (String)

    The value to assign to the #target_ip property

  • :capture_filter_id (String)

    The value to assign to the #capture_filter_id property

  • :encapsulation_protocol (String)

    The value to assign to the #encapsulation_protocol property

  • :vxlan_network_identifier (Integer)

    The value to assign to the #vxlan_network_identifier property

  • :is_vtap_enabled (BOOLEAN)

    The value to assign to the #is_vtap_enabled property

  • :traffic_mode (String)

    The value to assign to the #traffic_mode property

  • :max_packet_size (Integer)

    The value to assign to the #max_packet_size property

  • :source_private_endpoint_ip (String)

    The value to assign to the #source_private_endpoint_ip property

  • :source_private_endpoint_subnet_id (String)

    The value to assign to the #source_private_endpoint_subnet_id property

  • :target_type (String)

    The value to assign to the #target_type property

  • :source_type (String)

    The value to assign to the #source_type property



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

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.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.source_id = attributes[:'sourceId'] if attributes[:'sourceId']

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

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

  self.target_id = attributes[:'targetId'] if attributes[:'targetId']

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

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

  self.target_ip = attributes[:'targetIp'] if attributes[:'targetIp']

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

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

  self.capture_filter_id = attributes[:'captureFilterId'] if attributes[:'captureFilterId']

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

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

  self.encapsulation_protocol = attributes[:'encapsulationProtocol'] if attributes[:'encapsulationProtocol']

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

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

  self.vxlan_network_identifier = attributes[:'vxlanNetworkIdentifier'] if attributes[:'vxlanNetworkIdentifier']

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

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

  self.is_vtap_enabled = attributes[:'isVtapEnabled'] unless attributes[:'isVtapEnabled'].nil?
  self.is_vtap_enabled = false if is_vtap_enabled.nil? && !attributes.key?(:'isVtapEnabled') # rubocop:disable Style/StringLiterals

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

  self.is_vtap_enabled = attributes[:'is_vtap_enabled'] unless attributes[:'is_vtap_enabled'].nil?
  self.is_vtap_enabled = false if is_vtap_enabled.nil? && !attributes.key?(:'isVtapEnabled') && !attributes.key?(:'is_vtap_enabled') # rubocop:disable Style/StringLiterals

  self.traffic_mode = attributes[:'trafficMode'] if attributes[:'trafficMode']
  self.traffic_mode = "DEFAULT" if traffic_mode.nil? && !attributes.key?(:'trafficMode') # rubocop:disable Style/StringLiterals

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

  self.traffic_mode = attributes[:'traffic_mode'] if attributes[:'traffic_mode']
  self.traffic_mode = "DEFAULT" if traffic_mode.nil? && !attributes.key?(:'trafficMode') && !attributes.key?(:'traffic_mode') # rubocop:disable Style/StringLiterals

  self.max_packet_size = attributes[:'maxPacketSize'] if attributes[:'maxPacketSize']

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

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

  self.source_private_endpoint_ip = attributes[:'sourcePrivateEndpointIp'] if attributes[:'sourcePrivateEndpointIp']

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

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

  self.source_private_endpoint_subnet_id = attributes[:'sourcePrivateEndpointSubnetId'] if attributes[:'sourcePrivateEndpointSubnetId']

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

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

  self.target_type = attributes[:'targetType'] if attributes[:'targetType']

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

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

  self.source_type = attributes[:'sourceType'] if attributes[:'sourceType']

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

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

Instance Attribute Details

#capture_filter_idString

The capture filter's Oracle ID (OCID).

Returns:

  • (String)


71
72
73
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 71

def capture_filter_id
  @capture_filter_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


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

def defined_tags
  @defined_tags
end

#display_nameString

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


45
46
47
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 45

def display_name
  @display_name
end

#encapsulation_protocolString

Defines an encapsulation header type for the VTAP's mirrored traffic.

Returns:

  • (String)


76
77
78
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 76

def encapsulation_protocol
  @encapsulation_protocol
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


51
52
53
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 51

def freeform_tags
  @freeform_tags
end

#is_vtap_enabledBOOLEAN

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.

Returns:

  • (BOOLEAN)


89
90
91
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 89

def is_vtap_enabled
  @is_vtap_enabled
end

#max_packet_sizeInteger

The maximum size of the packets to be included in the filter.

Returns:

  • (Integer)


97
98
99
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 97

def max_packet_size
  @max_packet_size
end

#source_idString

The OCID of the source point where packets are captured.

Returns:

  • (String)


56
57
58
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 56

def source_id
  @source_id
end

#source_private_endpoint_ipString

The IP Address of the source private endpoint.

Returns:

  • (String)


102
103
104
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 102

def source_private_endpoint_ip
  @source_private_endpoint_ip
end

#source_private_endpoint_subnet_idString

The OCID of the subnet that source private endpoint belongs to.

Returns:

  • (String)


107
108
109
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 107

def source_private_endpoint_subnet_id
  @source_private_endpoint_subnet_id
end

#source_typeString

The source type for the VTAP.

Returns:

  • (String)


117
118
119
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 117

def source_type
  @source_type
end

#target_idString

The OCID of the destination resource where mirrored packets are sent.

Returns:

  • (String)


61
62
63
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 61

def target_id
  @target_id
end

#target_ipString

The IP address of the destination resource where mirrored packets are sent.

Returns:

  • (String)


66
67
68
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 66

def target_ip
  @target_ip
end

#target_typeString

The target type for the VTAP.

Returns:

  • (String)


112
113
114
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 112

def target_type
  @target_type
end

#traffic_modeString

Used to control the priority of traffic. It is an optional field. If it not passed, the value is DEFAULT

Returns:

  • (String)


93
94
95
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 93

def traffic_mode
  @traffic_mode
end

#vxlan_network_identifierInteger

The virtual extensible LAN (VXLAN) network identifier (or VXLAN segment ID) that uniquely identifies the VXLAN.

Returns:

  • (Integer)


81
82
83
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 81

def vxlan_network_identifier
  @vxlan_network_identifier
end

Class Method Details

.attribute_mapObject

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



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 120

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'freeform_tags': :'freeformTags',
    'source_id': :'sourceId',
    'target_id': :'targetId',
    'target_ip': :'targetIp',
    'capture_filter_id': :'captureFilterId',
    'encapsulation_protocol': :'encapsulationProtocol',
    'vxlan_network_identifier': :'vxlanNetworkIdentifier',
    'is_vtap_enabled': :'isVtapEnabled',
    'traffic_mode': :'trafficMode',
    'max_packet_size': :'maxPacketSize',
    'source_private_endpoint_ip': :'sourcePrivateEndpointIp',
    'source_private_endpoint_subnet_id': :'sourcePrivateEndpointSubnetId',
    'target_type': :'targetType',
    'source_type': :'sourceType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 144

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'freeform_tags': :'Hash<String, String>',
    'source_id': :'String',
    'target_id': :'String',
    'target_ip': :'String',
    'capture_filter_id': :'String',
    'encapsulation_protocol': :'String',
    'vxlan_network_identifier': :'Integer',
    'is_vtap_enabled': :'BOOLEAN',
    'traffic_mode': :'String',
    'max_packet_size': :'Integer',
    'source_private_endpoint_ip': :'String',
    'source_private_endpoint_subnet_id': :'String',
    'target_type': :'String',
    'source_type': :'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



335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 335

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

  self.class == other.class &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    freeform_tags == other.freeform_tags &&
    source_id == other.source_id &&
    target_id == other.target_id &&
    target_ip == other.target_ip &&
    capture_filter_id == other.capture_filter_id &&
    encapsulation_protocol == other.encapsulation_protocol &&
    vxlan_network_identifier == other.vxlan_network_identifier &&
    is_vtap_enabled == other.is_vtap_enabled &&
    traffic_mode == other.traffic_mode &&
    max_packet_size == other.max_packet_size &&
    source_private_endpoint_ip == other.source_private_endpoint_ip &&
    source_private_endpoint_subnet_id == other.source_private_endpoint_subnet_id &&
    target_type == other.target_type &&
    source_type == other.source_type
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



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 380

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


360
361
362
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 360

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



369
370
371
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 369

def hash
  [defined_tags, display_name, freeform_tags, source_id, target_id, target_ip, capture_filter_id, encapsulation_protocol, vxlan_network_identifier, is_vtap_enabled, traffic_mode, max_packet_size, source_private_endpoint_ip, source_private_endpoint_subnet_id, target_type, source_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



413
414
415
416
417
418
419
420
421
422
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 413

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



407
408
409
# File 'lib/oci/vn_monitoring/models/update_vtap_details.rb', line 407

def to_s
  to_hash.to_s
end