Class: OCI::Jms::Models::ManagedInstanceUsage

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/managed_instance_usage.rb

Overview

Managed instance usage during a specified time period. An entity that emits usage events to Java Management Service (JMS) is represented as a managed instance. A managed instance has a unique identity which is used by JMS to distinguish it from other managed instances. Currently, JMS supports only one kind of managed instance, a Management Agent.

Constant Summary collapse

MANAGED_INSTANCE_TYPE_ENUM =
[
  MANAGED_INSTANCE_TYPE_ORACLE_MANAGEMENT_AGENT = 'ORACLE_MANAGEMENT_AGENT'.freeze,
  MANAGED_INSTANCE_TYPE_ORACLE_CLOUD_AGENT = 'ORACLE_CLOUD_AGENT'.freeze,
  MANAGED_INSTANCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DRS_FILE_STATUS_ENUM =
[
  DRS_FILE_STATUS_PRESENT = 'PRESENT'.freeze,
  DRS_FILE_STATUS_ABSENT = 'ABSENT'.freeze,
  DRS_FILE_STATUS_MISMATCH = 'MISMATCH'.freeze,
  DRS_FILE_STATUS_NOT_CONFIGURED = 'NOT_CONFIGURED'.freeze,
  DRS_FILE_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 = {}) ⇒ ManagedInstanceUsage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 165

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

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

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

  self.managed_instance_type = attributes[:'managedInstanceType'] if attributes[:'managedInstanceType']

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

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

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

  self.host_id = attributes[:'hostId'] if attributes[:'hostId']

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

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

  self.operating_system = attributes[:'operatingSystem'] if attributes[:'operatingSystem']

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

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

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

  self.approximate_application_count = attributes[:'approximateApplicationCount'] if attributes[:'approximateApplicationCount']

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

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

  self.approximate_installation_count = attributes[:'approximateInstallationCount'] if attributes[:'approximateInstallationCount']

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

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

  self.approximate_jre_count = attributes[:'approximateJreCount'] if attributes[:'approximateJreCount']

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

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

  self.drs_file_status = attributes[:'drsFileStatus'] if attributes[:'drsFileStatus']

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

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

  self.application_invoked_by = attributes[:'applicationInvokedBy'] if attributes[:'applicationInvokedBy']

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

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

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

  self.time_first_seen = attributes[:'timeFirstSeen'] if attributes[:'timeFirstSeen']

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

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

  self.time_last_seen = attributes[:'timeLastSeen'] if attributes[:'timeLastSeen']

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

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

Instance Attribute Details

#agentOCI::Jms::Models::Agent



52
53
54
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 52

def agent
  @agent
end

#application_invoked_byString

Comma separated list of user names that invoked applications within this managed instance.

Returns:

  • (String)


72
73
74
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 72

def application_invoked_by
  @application_invoked_by
end

#approximate_application_countInteger

The approximate count of applications reported by this managed instance.

Returns:

  • (Integer)


56
57
58
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 56

def approximate_application_count
  @approximate_application_count
end

#approximate_installation_countInteger

The approximate count of installations reported by this managed instance.

Returns:

  • (Integer)


60
61
62
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 60

def approximate_installation_count
  @approximate_installation_count
end

#approximate_jre_countInteger

The approximate count of Java Runtimes reported by this managed instance.

Returns:

  • (Integer)


64
65
66
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 64

def approximate_jre_count
  @approximate_jre_count
end

#drs_file_statusString

DRS file status

Returns:

  • (String)


68
69
70
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 68

def drs_file_status
  @drs_file_status
end

#host_idString

The host OCID of the related managed instance.

Returns:

  • (String)


46
47
48
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 46

def host_id
  @host_id
end

#hostnameString

The hostname of the managed instance (if applicable).

Returns:

  • (String)


41
42
43
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 41

def hostname
  @hostname
end

#managed_instance_idString

[Required] The OCID of the related managed instance.

Returns:

  • (String)


33
34
35
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 33

def managed_instance_id
  @managed_instance_id
end

#managed_instance_typeString

[Required] The type of the source of events.

Returns:

  • (String)


37
38
39
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 37

def managed_instance_type
  @managed_instance_type
end

#operating_systemOCI::Jms::Models::OperatingSystem



49
50
51
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 49

def operating_system
  @operating_system
end

#time_endDateTime

Upper bound of the specified time period filter. JMS provides a view of the data that is per day. The query uses only the date element of the parameter.

Returns:

  • (DateTime)


80
81
82
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 80

def time_end
  @time_end
end

#time_first_seenDateTime

The date and time the resource was first reported to JMS. This is potentially before the specified time period provided by the filters. For example, a resource can be first reported to JMS before the start of a specified time period, if it is also reported during the time period.

Returns:

  • (DateTime)


88
89
90
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 88

def time_first_seen
  @time_first_seen
end

#time_last_seenDateTime

The date and time the resource was last reported to JMS. This is potentially after the specified time period provided by the filters. For example, a resource can be last reported to JMS before the start of a specified time period, if it is also reported during the time period.

Returns:

  • (DateTime)


96
97
98
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 96

def time_last_seen
  @time_last_seen
end

#time_startDateTime

Lower bound of the specified time period filter. JMS provides a view of the data that is per day. The query uses only the date element of the parameter.

Returns:

  • (DateTime)


76
77
78
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 76

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 99

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'managed_instance_id': :'managedInstanceId',
    'managed_instance_type': :'managedInstanceType',
    'hostname': :'hostname',
    'host_id': :'hostId',
    'operating_system': :'operatingSystem',
    'agent': :'agent',
    'approximate_application_count': :'approximateApplicationCount',
    'approximate_installation_count': :'approximateInstallationCount',
    'approximate_jre_count': :'approximateJreCount',
    'drs_file_status': :'drsFileStatus',
    'application_invoked_by': :'applicationInvokedBy',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'time_first_seen': :'timeFirstSeen',
    'time_last_seen': :'timeLastSeen'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'managed_instance_id': :'String',
    'managed_instance_type': :'String',
    'hostname': :'String',
    'host_id': :'String',
    'operating_system': :'OCI::Jms::Models::OperatingSystem',
    'agent': :'OCI::Jms::Models::Agent',
    'approximate_application_count': :'Integer',
    'approximate_installation_count': :'Integer',
    'approximate_jre_count': :'Integer',
    'drs_file_status': :'String',
    'application_invoked_by': :'String',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'time_first_seen': :'DateTime',
    'time_last_seen': :'DateTime'
    # 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



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 287

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

  self.class == other.class &&
    managed_instance_id == other.managed_instance_id &&
    managed_instance_type == other.managed_instance_type &&
    hostname == other.hostname &&
    host_id == other.host_id &&
    operating_system == other.operating_system &&
    agent == other.agent &&
    approximate_application_count == other.approximate_application_count &&
    approximate_installation_count == other.approximate_installation_count &&
    approximate_jre_count == other.approximate_jre_count &&
    drs_file_status == other.drs_file_status &&
    application_invoked_by == other.application_invoked_by &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    time_first_seen == other.time_first_seen &&
    time_last_seen == other.time_last_seen
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



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 331

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


311
312
313
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 311

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



320
321
322
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 320

def hash
  [managed_instance_id, managed_instance_type, hostname, host_id, operating_system, agent, approximate_application_count, approximate_installation_count, approximate_jre_count, drs_file_status, application_invoked_by, time_start, time_end, time_first_seen, time_last_seen].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



364
365
366
367
368
369
370
371
372
373
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 364

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



358
359
360
# File 'lib/oci/jms/models/managed_instance_usage.rb', line 358

def to_s
  to_hash.to_s
end