Class: OCI::DatabaseManagement::Models::EntityDiscovered

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/entity_discovered.rb

Overview

The details of the base entity discovery. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

DISCOVER_STATUS_ENUM =
[
  DISCOVER_STATUS_PREV_DISCOVERED = 'PREV_DISCOVERED'.freeze,
  DISCOVER_STATUS_NEW_DISCOVERED = 'NEW_DISCOVERED'.freeze,
  DISCOVER_STATUS_NOT_FOUND = 'NOT_FOUND'.freeze,
  DISCOVER_STATUS_DISCOVERING = 'DISCOVERING'.freeze
].freeze
ENTITY_TYPE_ENUM =
[
  ENTITY_TYPE_STORAGE_SERVER_DISCOVER_SUMMARY = 'STORAGE_SERVER_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_STORAGE_GRID_DISCOVER_SUMMARY = 'STORAGE_GRID_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_DATABASE_SYSTEM_DISCOVER_SUMMARY = 'DATABASE_SYSTEM_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_INFRASTRUCTURE_DISCOVER_SUMMARY = 'INFRASTRUCTURE_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_INFRASTRUCTURE_DISCOVER = 'INFRASTRUCTURE_DISCOVER'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EntityDiscovered

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :agent_id (String)

    The value to assign to the #agent_id property

  • :connector_id (String)

    The value to assign to the #connector_id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :version (String)

    The value to assign to the #version property

  • :internal_id (String)

    The value to assign to the #internal_id property

  • :status (String)

    The value to assign to the #status property

  • :discover_status (String)

    The value to assign to the #discover_status property

  • :discover_error_code (String)

    The value to assign to the #discover_error_code property

  • :discover_error_msg (String)

    The value to assign to the #discover_error_msg property

  • :entity_type (String)

    The value to assign to the #entity_type property



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
# File 'lib/oci/database_management/models/entity_discovered.rb', line 145

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

  self.agent_id = attributes[:'agentId'] if attributes[:'agentId']

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

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

  self.connector_id = attributes[:'connectorId'] if attributes[:'connectorId']

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

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

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

  self.internal_id = attributes[:'internalId'] if attributes[:'internalId']

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

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

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

  self.discover_status = attributes[:'discoverStatus'] if attributes[:'discoverStatus']
  self.discover_status = "NEW_DISCOVERED" if discover_status.nil? && !attributes.key?(:'discoverStatus') # rubocop:disable Style/StringLiterals

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

  self.discover_status = attributes[:'discover_status'] if attributes[:'discover_status']
  self.discover_status = "NEW_DISCOVERED" if discover_status.nil? && !attributes.key?(:'discoverStatus') && !attributes.key?(:'discover_status') # rubocop:disable Style/StringLiterals

  self.discover_error_code = attributes[:'discoverErrorCode'] if attributes[:'discoverErrorCode']

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

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

  self.discover_error_msg = attributes[:'discoverErrorMsg'] if attributes[:'discoverErrorMsg']

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

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

  self.entity_type = attributes[:'entityType'] if attributes[:'entityType']

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

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

Instance Attribute Details

#agent_idString

The OCID of the agent used for monitoring.

Returns:

  • (String)


33
34
35
# File 'lib/oci/database_management/models/entity_discovered.rb', line 33

def agent_id
  @agent_id
end

#connector_idString

The OCID of the associated connector.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_management/models/entity_discovered.rb', line 37

def connector_id
  @connector_id
end

#discover_error_codeString

The error code of the discovery.

Returns:

  • (String)


61
62
63
# File 'lib/oci/database_management/models/entity_discovered.rb', line 61

def discover_error_code
  @discover_error_code
end

#discover_error_msgString

The error message of the discovery.

Returns:

  • (String)


65
66
67
# File 'lib/oci/database_management/models/entity_discovered.rb', line 65

def discover_error_msg
  @discover_error_msg
end

#discover_statusString

The status of the entity discovery.

Returns:

  • (String)


57
58
59
# File 'lib/oci/database_management/models/entity_discovered.rb', line 57

def discover_status
  @discover_status
end

#display_nameString

[Required] The name of the entity.

Returns:

  • (String)


41
42
43
# File 'lib/oci/database_management/models/entity_discovered.rb', line 41

def display_name
  @display_name
end

#entity_typeString

[Required] The type of discovered entities.

Returns:

  • (String)


69
70
71
# File 'lib/oci/database_management/models/entity_discovered.rb', line 69

def entity_type
  @entity_type
end

#idString

The OCID of the entity discovered.

Returns:

  • (String)


29
30
31
# File 'lib/oci/database_management/models/entity_discovered.rb', line 29

def id
  @id
end

#internal_idString

The internal identifier of the entity.

Returns:

  • (String)


49
50
51
# File 'lib/oci/database_management/models/entity_discovered.rb', line 49

def internal_id
  @internal_id
end

#statusString

The status of the entity.

Returns:

  • (String)


53
54
55
# File 'lib/oci/database_management/models/entity_discovered.rb', line 53

def status
  @status
end

#versionString

The version of the entity.

Returns:

  • (String)


45
46
47
# File 'lib/oci/database_management/models/entity_discovered.rb', line 45

def version
  @version
end

Class Method Details

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/database_management/models/entity_discovered.rb', line 72

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'agent_id': :'agentId',
    'connector_id': :'connectorId',
    'display_name': :'displayName',
    'version': :'version',
    'internal_id': :'internalId',
    'status': :'status',
    'discover_status': :'discoverStatus',
    'discover_error_code': :'discoverErrorCode',
    'discover_error_msg': :'discoverErrorMsg',
    'entity_type': :'entityType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/database_management/models/entity_discovered.rb', line 114

def self.get_subtype(object_hash)
  type = object_hash[:'entityType'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::DatabaseManagement::Models::ExternalStorageGridDiscoverySummary' if type == 'STORAGE_GRID_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::ExternalExadataInfrastructureDiscovery' if type == 'INFRASTRUCTURE_DISCOVER'
  return 'OCI::DatabaseManagement::Models::ExternalDatabaseSystemDiscoverySummary' if type == 'DATABASE_SYSTEM_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::ExternalExadataInfrastructureDiscoverySummary' if type == 'INFRASTRUCTURE_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::ExternalStorageServerDiscoverySummary' if type == 'STORAGE_SERVER_DISCOVER_SUMMARY'

  # TODO: Log a warning when the subtype is not found.
  'OCI::DatabaseManagement::Models::EntityDiscovered'
end

.swagger_typesObject

Attribute type mapping.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/database_management/models/entity_discovered.rb', line 91

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'agent_id': :'String',
    'connector_id': :'String',
    'display_name': :'String',
    'version': :'String',
    'internal_id': :'String',
    'status': :'String',
    'discover_status': :'String',
    'discover_error_code': :'String',
    'discover_error_msg': :'String',
    'entity_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



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/database_management/models/entity_discovered.rb', line 231

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

  self.class == other.class &&
    id == other.id &&
    agent_id == other.agent_id &&
    connector_id == other.connector_id &&
    display_name == other.display_name &&
    version == other.version &&
    internal_id == other.internal_id &&
    status == other.status &&
    discover_status == other.discover_status &&
    discover_error_code == other.discover_error_code &&
    discover_error_msg == other.discover_error_msg &&
    entity_type == other.entity_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



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

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


251
252
253
# File 'lib/oci/database_management/models/entity_discovered.rb', line 251

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



260
261
262
# File 'lib/oci/database_management/models/entity_discovered.rb', line 260

def hash
  [id, agent_id, connector_id, display_name, version, internal_id, status, discover_status, discover_error_code, discover_error_msg, entity_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



304
305
306
307
308
309
310
311
312
313
# File 'lib/oci/database_management/models/entity_discovered.rb', line 304

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



298
299
300
# File 'lib/oci/database_management/models/entity_discovered.rb', line 298

def to_s
  to_hash.to_s
end