Class: OCI::StackMonitoring::Models::SearchMonitoredResourcesDetails

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

Overview

The property search criteria for listing monitored resources.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze
].freeze
LICENSE_ENUM =
[
  LICENSE_STANDARD_EDITION = 'STANDARD_EDITION'.freeze,
  LICENSE_ENTERPRISE_EDITION = 'ENTERPRISE_EDITION'.freeze
].freeze
SORT_ORDER_ENUM =
[
  SORT_ORDER_ASC = 'ASC'.freeze,
  SORT_ORDER_DESC = 'DESC'.freeze
].freeze
SORT_BY_ENUM =
[
  SORT_BY_TIME_CREATED = 'TIME_CREATED'.freeze,
  SORT_BY_RESOURCE_NAME = 'RESOURCE_NAME'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SearchMonitoredResourcesDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :name (String)

    The value to assign to the #name property

  • :name_contains (String)

    The value to assign to the #name_contains property

  • :type (String)

    The value to assign to the #type property

  • :host_name (String)

    The value to assign to the #host_name property

  • :external_id (String)

    The value to assign to the #external_id property

  • :host_name_contains (String)

    The value to assign to the #host_name_contains property

  • :management_agent_id (String)

    The value to assign to the #management_agent_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :license (String)

    The value to assign to the #license property

  • :time_created_greater_than_or_equal_to (DateTime)

    The value to assign to the #time_created_greater_than_or_equal_to property

  • :time_created_less_than (DateTime)

    The value to assign to the #time_created_less_than property

  • :time_updated_greater_than_or_equal_to (DateTime)

    The value to assign to the #time_updated_greater_than_or_equal_to property

  • :time_updated_less_than (DateTime)

    The value to assign to the #time_updated_less_than property

  • :resource_time_zone (String)

    The value to assign to the #resource_time_zone property

  • :sort_order (String)

    The value to assign to the #sort_order property

  • :sort_by (String)

    The value to assign to the #sort_by property

  • :property_equals (Hash<String, String>)

    The value to assign to the #property_equals property



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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 229

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

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

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

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

  self.name_contains = attributes[:'nameContains'] if attributes[:'nameContains']

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

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

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

  self.host_name = attributes[:'hostName'] if attributes[:'hostName']

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

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

  self.external_id = attributes[:'externalId'] if attributes[:'externalId']

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

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

  self.host_name_contains = attributes[:'hostNameContains'] if attributes[:'hostNameContains']

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

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

  self.management_agent_id = attributes[:'managementAgentId'] if attributes[:'managementAgentId']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

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

  self.time_created_greater_than_or_equal_to = attributes[:'timeCreatedGreaterThanOrEqualTo'] if attributes[:'timeCreatedGreaterThanOrEqualTo']

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

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

  self.time_created_less_than = attributes[:'timeCreatedLessThan'] if attributes[:'timeCreatedLessThan']

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

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

  self.time_updated_greater_than_or_equal_to = attributes[:'timeUpdatedGreaterThanOrEqualTo'] if attributes[:'timeUpdatedGreaterThanOrEqualTo']

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

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

  self.time_updated_less_than = attributes[:'timeUpdatedLessThan'] if attributes[:'timeUpdatedLessThan']

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

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

  self.resource_time_zone = attributes[:'resourceTimeZone'] if attributes[:'resourceTimeZone']
  self.resource_time_zone = "Etc/UTC" if resource_time_zone.nil? && !attributes.key?(:'resourceTimeZone') # rubocop:disable Style/StringLiterals

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

  self.resource_time_zone = attributes[:'resource_time_zone'] if attributes[:'resource_time_zone']
  self.resource_time_zone = "Etc/UTC" if resource_time_zone.nil? && !attributes.key?(:'resourceTimeZone') && !attributes.key?(:'resource_time_zone') # rubocop:disable Style/StringLiterals

  self.sort_order = attributes[:'sortOrder'] if attributes[:'sortOrder']

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

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

  self.sort_by = attributes[:'sortBy'] if attributes[:'sortBy']
  self.sort_by = "TIME_CREATED" if sort_by.nil? && !attributes.key?(:'sortBy') # rubocop:disable Style/StringLiterals

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

  self.sort_by = attributes[:'sort_by'] if attributes[:'sort_by']
  self.sort_by = "TIME_CREATED" if sort_by.nil? && !attributes.key?(:'sortBy') && !attributes.key?(:'sort_by') # rubocop:disable Style/StringLiterals

  self.property_equals = attributes[:'propertyEquals'] if attributes[:'propertyEquals']

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

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

Instance Attribute Details

#compartment_idString

[Required] Compartment Identifier OCID.

Returns:

  • (String)


38
39
40
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 38

def compartment_id
  @compartment_id
end

#external_idString

External resource is any OCI resource identifier OCID which is not a Stack Monitoring service resource. Currently supports only following resource types - Container database, non-container database, pluggable database and OCI compute instance.

Returns:

  • (String)


65
66
67
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 65

def external_id
  @external_id
end

#host_nameString

A filter to return resources with host name match.

Returns:

  • (String)


57
58
59
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 57

def host_name
  @host_name
end

#host_name_containsString

A filter to return resources with host name pattern.

Returns:

  • (String)


70
71
72
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 70

def host_name_contains
  @host_name_contains
end

#licenseString

License edition of the monitored resource.

Returns:

  • (String)


82
83
84
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 82

def license
  @license
end

#lifecycle_stateString

A filter to return resources with matching lifecycle state.

Returns:

  • (String)


78
79
80
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 78

def lifecycle_state
  @lifecycle_state
end

#management_agent_idString

A filter to return resources with matching management agent id.

Returns:

  • (String)


74
75
76
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 74

def management_agent_id
  @management_agent_id
end

#nameString

A filter to return resources that match exact resource name.

Returns:

  • (String)


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

def name
  @name
end

#name_containsString

A filter to return resources that match resource name pattern given. The match is not case sensitive.

Returns:

  • (String)


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

def name_contains
  @name_contains
end

#property_equalsHash<String, String>

Criteria based on resource property.

Returns:

  • (Hash<String, String>)


151
152
153
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 151

def property_equals
  @property_equals
end

#resource_time_zoneString

Time zone in the form of tz database canonical zone ID. Specifies the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example - America/Los_Angeles

Returns:

  • (String)


137
138
139
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 137

def resource_time_zone
  @resource_time_zone
end

#sort_byString

The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for resources is ascending.

Returns:

  • (String)


147
148
149
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 147

def sort_by
  @sort_by
end

#sort_orderString

The sort order to use, either 'ASC' or 'DESC'.

Returns:

  • (String)


141
142
143
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 141

def sort_order
  @sort_order
end

#time_created_greater_than_or_equal_toDateTime

Search for resources that were created within a specific date range, using this parameter to specify the earliest creation date for the returned list (inclusive). Specifying this parameter without the corresponding timeCreatedLessThan parameter will retrieve resources created from the given timeCreatedGreaterThanOrEqualTo to the current time, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

Example: 2016-12-19T16:39:57.600Z

Returns:

  • (DateTime)


94
95
96
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 94

def time_created_greater_than_or_equal_to
  @time_created_greater_than_or_equal_to
end

#time_created_less_thanDateTime

Search for resources that were created within a specific date range, using this parameter to specify the latest creation date for the returned list (exclusive). Specifying this parameter without the corresponding timeCreatedGreaterThanOrEqualTo parameter will retrieve all resources created before the specified end date, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

Example: 2016-12-19T16:39:57.600Z

Returns:

  • (DateTime)


106
107
108
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 106

def time_created_less_than
  @time_created_less_than
end

#time_updated_greater_than_or_equal_toDateTime

Search for resources that were updated within a specific date range, using this parameter to specify the earliest update date for the returned list (inclusive). Specifying this parameter without the corresponding timeUpdatedLessThan parameter will retrieve resources updated from the given timeUpdatedGreaterThanOrEqualTo to the current time, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

Example: 2016-12-19T16:39:57.600Z

Returns:

  • (DateTime)


118
119
120
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 118

def time_updated_greater_than_or_equal_to
  @time_updated_greater_than_or_equal_to
end

#time_updated_less_thanDateTime

Search for resources that were updated within a specific date range, using this parameter to specify the latest creation date for the returned list (exclusive). Specifying this parameter without the corresponding timeUpdatedGreaterThanOrEqualTo parameter will retrieve all resources updated before the specified end date, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

Example: 2016-12-19T16:39:57.600Z

Returns:

  • (DateTime)


130
131
132
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 130

def time_updated_less_than
  @time_updated_less_than
end

#typeString

A filter to return resources that match resource type.

Returns:

  • (String)


52
53
54
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 52

def type
  @type
end

Class Method Details

.attribute_mapObject

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



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 154

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'name': :'name',
    'name_contains': :'nameContains',
    'type': :'type',
    'host_name': :'hostName',
    'external_id': :'externalId',
    'host_name_contains': :'hostNameContains',
    'management_agent_id': :'managementAgentId',
    'lifecycle_state': :'lifecycleState',
    'license': :'license',
    'time_created_greater_than_or_equal_to': :'timeCreatedGreaterThanOrEqualTo',
    'time_created_less_than': :'timeCreatedLessThan',
    'time_updated_greater_than_or_equal_to': :'timeUpdatedGreaterThanOrEqualTo',
    'time_updated_less_than': :'timeUpdatedLessThan',
    'resource_time_zone': :'resourceTimeZone',
    'sort_order': :'sortOrder',
    'sort_by': :'sortBy',
    'property_equals': :'propertyEquals'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 180

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'name': :'String',
    'name_contains': :'String',
    'type': :'String',
    'host_name': :'String',
    'external_id': :'String',
    'host_name_contains': :'String',
    'management_agent_id': :'String',
    'lifecycle_state': :'String',
    'license': :'String',
    'time_created_greater_than_or_equal_to': :'DateTime',
    'time_created_less_than': :'DateTime',
    'time_updated_greater_than_or_equal_to': :'DateTime',
    'time_updated_less_than': :'DateTime',
    'resource_time_zone': :'String',
    'sort_order': :'String',
    'sort_by': :'String',
    'property_equals': :'Hash<String, 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



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 375

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    name == other.name &&
    name_contains == other.name_contains &&
    type == other.type &&
    host_name == other.host_name &&
    external_id == other.external_id &&
    host_name_contains == other.host_name_contains &&
    management_agent_id == other.management_agent_id &&
    lifecycle_state == other.lifecycle_state &&
    license == other.license &&
    time_created_greater_than_or_equal_to == other.time_created_greater_than_or_equal_to &&
    time_created_less_than == other.time_created_less_than &&
    time_updated_greater_than_or_equal_to == other.time_updated_greater_than_or_equal_to &&
    time_updated_less_than == other.time_updated_less_than &&
    resource_time_zone == other.resource_time_zone &&
    sort_order == other.sort_order &&
    sort_by == other.sort_by &&
    property_equals == other.property_equals
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



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 422

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


402
403
404
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 402

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



411
412
413
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 411

def hash
  [compartment_id, name, name_contains, type, host_name, external_id, host_name_contains, management_agent_id, lifecycle_state, license, time_created_greater_than_or_equal_to, time_created_less_than, time_updated_greater_than_or_equal_to, time_updated_less_than, resource_time_zone, sort_order, sort_by, property_equals].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



455
456
457
458
459
460
461
462
463
464
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 455

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



449
450
451
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 449

def to_s
  to_hash.to_s
end