Class: OCI::StackMonitoring::Models::DiscoveryDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/stack_monitoring/models/discovery_details.rb

Overview

The request of DiscoveryJob Resource details.

Constant Summary collapse

RESOURCE_TYPE_ENUM =
[
  RESOURCE_TYPE_WEBLOGIC_DOMAIN = 'WEBLOGIC_DOMAIN'.freeze,
  RESOURCE_TYPE_EBS_INSTANCE = 'EBS_INSTANCE'.freeze,
  RESOURCE_TYPE_SQL_SERVER = 'SQL_SERVER'.freeze,
  RESOURCE_TYPE_APACHE_TOMCAT = 'APACHE_TOMCAT'.freeze,
  RESOURCE_TYPE_ORACLE_DATABASE = 'ORACLE_DATABASE'.freeze,
  RESOURCE_TYPE_OCI_ORACLE_DB = 'OCI_ORACLE_DB'.freeze,
  RESOURCE_TYPE_OCI_ORACLE_CDB = 'OCI_ORACLE_CDB'.freeze,
  RESOURCE_TYPE_OCI_ORACLE_PDB = 'OCI_ORACLE_PDB'.freeze,
  RESOURCE_TYPE_HOST = 'HOST'.freeze,
  RESOURCE_TYPE_ORACLE_PSFT = 'ORACLE_PSFT'.freeze,
  RESOURCE_TYPE_ORACLE_MFT = 'ORACLE_MFT'.freeze,
  RESOURCE_TYPE_APACHE_HTTP_SERVER = 'APACHE_HTTP_SERVER'.freeze,
  RESOURCE_TYPE_ORACLE_GOLDENGATE = 'ORACLE_GOLDENGATE'.freeze,
  RESOURCE_TYPE_CUSTOM_RESOURCE = 'CUSTOM_RESOURCE'.freeze,
  RESOURCE_TYPE_ORACLE_HTTP_SERVER = 'ORACLE_HTTP_SERVER'.freeze,
  RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LICENSE_ENUM =
[
  LICENSE_STANDARD_EDITION = 'STANDARD_EDITION'.freeze,
  LICENSE_ENTERPRISE_EDITION = 'ENTERPRISE_EDITION'.freeze,
  LICENSE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DiscoveryDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 106

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

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

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

  self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName']

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

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

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

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

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

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

Instance Attribute Details

#agent_idString

[Required] The OCID of Management Agent

Returns:

  • (String)


39
40
41
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 39

def agent_id
  @agent_id
end

#credentialsOCI::StackMonitoring::Models::CredentialCollection



58
59
60
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 58

def credentials
  @credentials
end

#licenseString

License edition of the monitored resource.

Returns:

  • (String)


51
52
53
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 51

def license
  @license
end

#propertiesOCI::StackMonitoring::Models::PropertyDetails

This attribute is required.



55
56
57
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 55

def properties
  @properties
end

#resource_nameString

[Required] The Name of resource type

Returns:

  • (String)


47
48
49
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 47

def resource_name
  @resource_name
end

#resource_typeString

[Required] Resource Type.

Returns:

  • (String)


43
44
45
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 43

def resource_type
  @resource_type
end

#tagsOCI::StackMonitoring::Models::PropertyDetails



61
62
63
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 61

def tags
  @tags
end

Class Method Details

.attribute_mapObject

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



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 64

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'agent_id': :'agentId',
    'resource_type': :'resourceType',
    'resource_name': :'resourceName',
    'license': :'license',
    'properties': :'properties',
    'credentials': :'credentials',
    'tags': :'tags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 79

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'agent_id': :'String',
    'resource_type': :'String',
    'resource_name': :'String',
    'license': :'String',
    'properties': :'OCI::StackMonitoring::Models::PropertyDetails',
    'credentials': :'OCI::StackMonitoring::Models::CredentialCollection',
    'tags': :'OCI::StackMonitoring::Models::PropertyDetails'
    # 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



172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 172

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

  self.class == other.class &&
    agent_id == other.agent_id &&
    resource_type == other.resource_type &&
    resource_name == other.resource_name &&
    license == other.license &&
    properties == other.properties &&
    credentials == other.credentials &&
    tags == other.tags
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



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 208

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


188
189
190
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 188

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



197
198
199
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 197

def hash
  [agent_id, resource_type, resource_name, license, properties, credentials, tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 241

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



235
236
237
# File 'lib/oci/stack_monitoring/models/discovery_details.rb', line 235

def to_s
  to_hash.to_s
end