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,
  DISCOVER_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.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,
  ENTITY_TYPE_MANAGED_STORAGE_SERVER_DISCOVER_SUMMARY = 'MANAGED_STORAGE_SERVER_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_MANAGED_STORAGE_GRID_DISCOVER_SUMMARY = 'MANAGED_STORAGE_GRID_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_VM_CLUSTER_DISCOVER_SUMMARY = 'VM_CLUSTER_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_MANAGED_INFRASTRUCTURE_DISCOVER_SUMMARY = 'MANAGED_INFRASTRUCTURE_DISCOVER_SUMMARY'.freeze,
  ENTITY_TYPE_CLOUD_INFRASTRUCTURE_DISCOVER = 'CLOUD_INFRASTRUCTURE_DISCOVER'.freeze,
  ENTITY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.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



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
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/database_management/models/entity_discovered.rb', line 158

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)


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

def agent_id
  @agent_id
end

#connector_idString

The OCID of the associated connector.

Returns:

  • (String)


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

def connector_id
  @connector_id
end

#discover_error_codeString

The error code of the discovery.

Returns:

  • (String)


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

def discover_error_code
  @discover_error_code
end

#discover_error_msgString

The error message of the discovery.

Returns:

  • (String)


73
74
75
# File 'lib/oci/database_management/models/entity_discovered.rb', line 73

def discover_error_msg
  @discover_error_msg
end

#discover_statusString

The status of the entity discovery.

Returns:

  • (String)


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

def discover_status
  @discover_status
end

#display_nameString

[Required] The name of the entity.

Returns:

  • (String)


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

def display_name
  @display_name
end

#entity_typeString

[Required] The type of discovered entities.

Returns:

  • (String)


77
78
79
# File 'lib/oci/database_management/models/entity_discovered.rb', line 77

def entity_type
  @entity_type
end

#idString

The OCID of the entity discovered.

Returns:

  • (String)


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

def id
  @id
end

#internal_idString

The internal identifier of the entity.

Returns:

  • (String)


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

def internal_id
  @internal_id
end

#statusString

The status of the entity.

Returns:

  • (String)


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

def status
  @status
end

#versionString

The version of the entity.

Returns:

  • (String)


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

def version
  @version
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/oci/database_management/models/entity_discovered.rb', line 80

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.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/oci/database_management/models/entity_discovered.rb', line 122

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

  return 'OCI::DatabaseManagement::Models::ExadataInfrastructureDiscoverySummary' if type == 'MANAGED_INFRASTRUCTURE_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::StorageGridDiscoverySummary' if type == 'MANAGED_STORAGE_GRID_DISCOVER_SUMMARY'
  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::CloudExadataInfrastructureDiscovery' if type == 'CLOUD_INFRASTRUCTURE_DISCOVER'
  return 'OCI::DatabaseManagement::Models::ExternalExadataInfrastructureDiscoverySummary' if type == 'INFRASTRUCTURE_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::ExternalStorageServerDiscoverySummary' if type == 'STORAGE_SERVER_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::StorageServerDiscoverySummary' if type == 'MANAGED_STORAGE_SERVER_DISCOVER_SUMMARY'
  return 'OCI::DatabaseManagement::Models::VMClusterDiscoverySummary' if type == 'VM_CLUSTER_DISCOVER_SUMMARY'

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

.swagger_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/database_management/models/entity_discovered.rb', line 99

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



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/database_management/models/entity_discovered.rb', line 254

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



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/oci/database_management/models/entity_discovered.rb', line 294

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


274
275
276
# File 'lib/oci/database_management/models/entity_discovered.rb', line 274

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



283
284
285
# File 'lib/oci/database_management/models/entity_discovered.rb', line 283

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



327
328
329
330
331
332
333
334
335
336
# File 'lib/oci/database_management/models/entity_discovered.rb', line 327

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



321
322
323
# File 'lib/oci/database_management/models/entity_discovered.rb', line 321

def to_s
  to_hash.to_s
end