Class: OCI::Jms::Models::JreUsage

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

Overview

Java Runtime usage during a specified time period. A Java Runtime is identified by its vendor and version.

Constant Summary collapse

SECURITY_STATUS_ENUM =
[
  SECURITY_STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  SECURITY_STATUS_UP_TO_DATE = 'UP_TO_DATE'.freeze,
  SECURITY_STATUS_UPDATE_REQUIRED = 'UPDATE_REQUIRED'.freeze,
  SECURITY_STATUS_UPGRADE_REQUIRED = 'UPGRADE_REQUIRED'.freeze,
  SECURITY_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 = {}) ⇒ JreUsage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/oci/jms/models/jre_usage.rb', line 175

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

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

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

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

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

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

  self.release_date = attributes[:'releaseDate'] if attributes[:'releaseDate']

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

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

  self.end_of_support_life_date = attributes[:'endOfSupportLifeDate'] if attributes[:'endOfSupportLifeDate']

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

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

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

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

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

  self.operating_systems = attributes[:'operatingSystems'] if attributes[:'operatingSystems']

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

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

  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_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_managed_instance_count = attributes[:'approximateManagedInstanceCount'] if attributes[:'approximateManagedInstanceCount']

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

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

  self.approximate_pending_work_request_count = attributes[:'approximatePendingWorkRequestCount'] if attributes[:'approximatePendingWorkRequestCount']

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

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

  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

#approximate_application_countInteger

The approximate count of the applications running on this Java Runtime.

Returns:

  • (Integer)


65
66
67
# File 'lib/oci/jms/models/jre_usage.rb', line 65

def approximate_application_count
  @approximate_application_count
end

#approximate_installation_countInteger

The approximate count of installations that are installations of this Java Runtime.

Returns:

  • (Integer)


61
62
63
# File 'lib/oci/jms/models/jre_usage.rb', line 61

def approximate_installation_count
  @approximate_installation_count
end

#approximate_managed_instance_countInteger

The approximate count of the managed instances that report this Java Runtime.

Returns:

  • (Integer)


69
70
71
# File 'lib/oci/jms/models/jre_usage.rb', line 69

def approximate_managed_instance_count
  @approximate_managed_instance_count
end

#approximate_pending_work_request_countInteger

The approximate count of work requests working on this Java Runtime.

Returns:

  • (Integer)


73
74
75
# File 'lib/oci/jms/models/jre_usage.rb', line 73

def approximate_pending_work_request_count
  @approximate_pending_work_request_count
end

#distributionString

**[Required]** The distribution of a Java Runtime is the name of the lineage of product to which it belongs, for example _Java(TM) SE Runtime Environment_.

Returns:

  • (String)


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

def distribution
  @distribution
end

#end_of_support_life_dateDateTime

The End of Support Life (EOSL) date of the Java Runtime (formatted according to [RFC3339](datatracker.ietf.org/doc/html/rfc3339)).

Returns:

  • (DateTime)


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

def end_of_support_life_date
  @end_of_support_life_date
end

#fleet_idString

The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related fleet. This property value is present only for /actions/listJreUsage.

Returns:

  • (String)


25
26
27
# File 'lib/oci/jms/models/jre_usage.rb', line 25

def fleet_id
  @fleet_id
end

#idString

The internal identifier of the Java Runtime.

Returns:

  • (String)


21
22
23
# File 'lib/oci/jms/models/jre_usage.rb', line 21

def id
  @id
end

#managed_instance_idString

The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related managed instance. This property value is present only for /actions/listJreUsage.

Returns:

  • (String)


29
30
31
# File 'lib/oci/jms/models/jre_usage.rb', line 29

def managed_instance_id
  @managed_instance_id
end

#operating_systemsArray<OCI::Jms::Models::OperatingSystem>

The operating systems that have this Java Runtime installed.



57
58
59
# File 'lib/oci/jms/models/jre_usage.rb', line 57

def operating_systems
  @operating_systems
end

#release_dateDateTime

The release date of the Java Runtime (formatted according to [RFC3339](datatracker.ietf.org/doc/html/rfc3339)).

Returns:

  • (DateTime)


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

def release_date
  @release_date
end

#security_statusString

The security status of the Java Runtime.

Returns:

  • (String)


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

def security_status
  @security_status
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)


81
82
83
# File 'lib/oci/jms/models/jre_usage.rb', line 81

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)


89
90
91
# File 'lib/oci/jms/models/jre_usage.rb', line 89

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)


97
98
99
# File 'lib/oci/jms/models/jre_usage.rb', line 97

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)


77
78
79
# File 'lib/oci/jms/models/jre_usage.rb', line 77

def time_start
  @time_start
end

#vendorString

**[Required]** The vendor of the Java Runtime.

Returns:

  • (String)


45
46
47
# File 'lib/oci/jms/models/jre_usage.rb', line 45

def vendor
  @vendor
end

#versionString

**[Required]** The version of the Java Runtime.

Returns:

  • (String)


53
54
55
# File 'lib/oci/jms/models/jre_usage.rb', line 53

def version
  @version
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'fleet_id': :'fleetId',
    'managed_instance_id': :'managedInstanceId',
    'security_status': :'securityStatus',
    'release_date': :'releaseDate',
    'end_of_support_life_date': :'endOfSupportLifeDate',
    'vendor': :'vendor',
    'distribution': :'distribution',
    'version': :'version',
    'operating_systems': :'operatingSystems',
    'approximate_installation_count': :'approximateInstallationCount',
    'approximate_application_count': :'approximateApplicationCount',
    'approximate_managed_instance_count': :'approximateManagedInstanceCount',
    'approximate_pending_work_request_count': :'approximatePendingWorkRequestCount',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'time_first_seen': :'timeFirstSeen',
    'time_last_seen': :'timeLastSeen'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/oci/jms/models/jre_usage.rb', line 126

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'fleet_id': :'String',
    'managed_instance_id': :'String',
    'security_status': :'String',
    'release_date': :'DateTime',
    'end_of_support_life_date': :'DateTime',
    'vendor': :'String',
    'distribution': :'String',
    'version': :'String',
    'operating_systems': :'Array<OCI::Jms::Models::OperatingSystem>',
    'approximate_installation_count': :'Integer',
    'approximate_application_count': :'Integer',
    'approximate_managed_instance_count': :'Integer',
    'approximate_pending_work_request_count': :'Integer',
    '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



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/jms/models/jre_usage.rb', line 294

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

  self.class == other.class &&
    id == other.id &&
    fleet_id == other.fleet_id &&
    managed_instance_id == other.managed_instance_id &&
    security_status == other.security_status &&
    release_date == other.release_date &&
    end_of_support_life_date == other.end_of_support_life_date &&
    vendor == other.vendor &&
    distribution == other.distribution &&
    version == other.version &&
    operating_systems == other.operating_systems &&
    approximate_installation_count == other.approximate_installation_count &&
    approximate_application_count == other.approximate_application_count &&
    approximate_managed_instance_count == other.approximate_managed_instance_count &&
    approximate_pending_work_request_count == other.approximate_pending_work_request_count &&
    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



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/oci/jms/models/jre_usage.rb', line 341

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


321
322
323
# File 'lib/oci/jms/models/jre_usage.rb', line 321

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



330
331
332
# File 'lib/oci/jms/models/jre_usage.rb', line 330

def hash
  [id, fleet_id, managed_instance_id, security_status, release_date, end_of_support_life_date, vendor, distribution, version, operating_systems, approximate_installation_count, approximate_application_count, approximate_managed_instance_count, approximate_pending_work_request_count, 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



374
375
376
377
378
379
380
381
382
383
# File 'lib/oci/jms/models/jre_usage.rb', line 374

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



368
369
370
# File 'lib/oci/jms/models/jre_usage.rb', line 368

def to_s
  to_hash.to_s
end