Class: OCI::Core::Models::CrossConnectStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/cross_connect_status.rb

Overview

The status of the cross-connect.

Constant Summary collapse

INTERFACE_STATE_ENUM =
[
  INTERFACE_STATE_UP = 'UP'.freeze,
  INTERFACE_STATE_DOWN = 'DOWN'.freeze,
  INTERFACE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIGHT_LEVEL_INDICATOR_ENUM =
[
  LIGHT_LEVEL_INDICATOR_NO_LIGHT = 'NO_LIGHT'.freeze,
  LIGHT_LEVEL_INDICATOR_LOW_WARN = 'LOW_WARN'.freeze,
  LIGHT_LEVEL_INDICATOR_HIGH_WARN = 'HIGH_WARN'.freeze,
  LIGHT_LEVEL_INDICATOR_BAD = 'BAD'.freeze,
  LIGHT_LEVEL_INDICATOR_GOOD = 'GOOD'.freeze,
  LIGHT_LEVEL_INDICATOR_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ENCRYPTION_STATUS_ENUM =
[
  ENCRYPTION_STATUS_UP = 'UP'.freeze,
  ENCRYPTION_STATUS_DOWN = 'DOWN'.freeze,
  ENCRYPTION_STATUS_CIPHER_MISMATCH = 'CIPHER_MISMATCH'.freeze,
  ENCRYPTION_STATUS_CKN_MISMATCH = 'CKN_MISMATCH'.freeze,
  ENCRYPTION_STATUS_CAK_MISMATCH = 'CAK_MISMATCH'.freeze,
  ENCRYPTION_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CrossConnectStatus

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/core/models/cross_connect_status.rb', line 121

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

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

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

  self.interface_state = attributes[:'interfaceState'] if attributes[:'interfaceState']

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

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

  self.light_level_ind_bm = attributes[:'lightLevelIndBm'] if attributes[:'lightLevelIndBm']

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

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

  self.light_level_indicator = attributes[:'lightLevelIndicator'] if attributes[:'lightLevelIndicator']

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

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

  self.encryption_status = attributes[:'encryptionStatus'] if attributes[:'encryptionStatus']

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

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

  self.light_levels_in_d_bm = attributes[:'lightLevelsInDBm'] if attributes[:'lightLevelsInDBm']

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

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

Instance Attribute Details

#cross_connect_idString

[Required] The OCID of the cross-connect.

Returns:

  • (String)


38
39
40
# File 'lib/oci/core/models/cross_connect_status.rb', line 38

def cross_connect_id
  @cross_connect_id
end

#encryption_statusString

Encryption status of this cross connect.

Possible values: * UP: Traffic is encrypted over this cross-connect * DOWN: Traffic is not encrypted over this cross-connect * CIPHER_MISMATCH: The MACsec encryption cipher doesn't match the cipher on the CPE * CKN_MISMATCH: The MACsec Connectivity association Key Name (CKN) doesn't match the CKN on the CPE * CAK_MISMATCH: The MACsec Connectivity Association Key (CAK) doesn't match the CAK on the CPE

Returns:

  • (String)


72
73
74
# File 'lib/oci/core/models/cross_connect_status.rb', line 72

def encryption_status
  @encryption_status
end

#interface_stateString

Indicates whether Oracle's side of the interface is up or down.

Returns:

  • (String)


42
43
44
# File 'lib/oci/core/models/cross_connect_status.rb', line 42

def interface_state
  @interface_state
end

#light_level_ind_bmFloat

The light level of the cross-connect (in dBm).

Example: 14.0

Returns:

  • (Float)


49
50
51
# File 'lib/oci/core/models/cross_connect_status.rb', line 49

def light_level_ind_bm
  @light_level_ind_bm
end

#light_level_indicatorString

Status indicator corresponding to the light level.

  • NO_LIGHT: No measurable light

  • LOW_WARN: There's measurable light but it's too low

  • HIGH_WARN: Light level is too high

  • BAD: There's measurable light but the signal-to-noise ratio is bad

  • GOOD: Good light level

Returns:

  • (String)


60
61
62
# File 'lib/oci/core/models/cross_connect_status.rb', line 60

def light_level_indicator
  @light_level_indicator
end

#light_levels_in_d_bmArray<Float>

The light levels of the cross-connect (in dBm).

Example: [14.0, -14.0, 2.1, -10.1]

Returns:

  • (Array<Float>)


79
80
81
# File 'lib/oci/core/models/cross_connect_status.rb', line 79

def light_levels_in_d_bm
  @light_levels_in_d_bm
end

Class Method Details

.attribute_mapObject

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



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/core/models/cross_connect_status.rb', line 82

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'cross_connect_id': :'crossConnectId',
    'interface_state': :'interfaceState',
    'light_level_ind_bm': :'lightLevelIndBm',
    'light_level_indicator': :'lightLevelIndicator',
    'encryption_status': :'encryptionStatus',
    'light_levels_in_d_bm': :'lightLevelsInDBm'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/core/models/cross_connect_status.rb', line 96

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'cross_connect_id': :'String',
    'interface_state': :'String',
    'light_level_ind_bm': :'Float',
    'light_level_indicator': :'String',
    'encryption_status': :'String',
    'light_levels_in_d_bm': :'Array<Float>'
    # 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



210
211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/core/models/cross_connect_status.rb', line 210

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

  self.class == other.class &&
    cross_connect_id == other.cross_connect_id &&
    interface_state == other.interface_state &&
    light_level_ind_bm == other.light_level_ind_bm &&
    light_level_indicator == other.light_level_indicator &&
    encryption_status == other.encryption_status &&
    light_levels_in_d_bm == other.light_levels_in_d_bm
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



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/core/models/cross_connect_status.rb', line 245

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


225
226
227
# File 'lib/oci/core/models/cross_connect_status.rb', line 225

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



234
235
236
# File 'lib/oci/core/models/cross_connect_status.rb', line 234

def hash
  [cross_connect_id, interface_state, light_level_ind_bm, light_level_indicator, encryption_status, light_levels_in_d_bm].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



278
279
280
281
282
283
284
285
286
287
# File 'lib/oci/core/models/cross_connect_status.rb', line 278

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



272
273
274
# File 'lib/oci/core/models/cross_connect_status.rb', line 272

def to_s
  to_hash.to_s
end