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
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):



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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 197

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.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.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](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)

Returns:

  • (String)


31
32
33
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 31

def compartment_id
  @compartment_id
end

#host_nameString

A filter to return resources with host name match

Returns:

  • (String)


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

def host_name
  @host_name
end

#host_name_containsString

A filter to return resources with host name pattern

Returns:

  • (String)


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

def host_name_contains
  @host_name_contains
end

#lifecycle_stateString

A filter to return resources with matching lifecycle state.

Returns:

  • (String)


59
60
61
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 59

def lifecycle_state
  @lifecycle_state
end

#management_agent_idString

A filter to return resources with matching management agent id.

Returns:

  • (String)


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

def management_agent_id
  @management_agent_id
end

#nameString

A filter to return resources that match exact resource name

Returns:

  • (String)


35
36
37
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 35

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)


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

def name_contains
  @name_contains
end

#property_equalsHash<String, String>

Criteria based on resource property.

Returns:

  • (Hash<String, String>)


125
126
127
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 125

def property_equals
  @property_equals
end

#resource_time_zoneString

Time zone in the form of tz database canonical zone ID.

Returns:

  • (String)


111
112
113
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 111

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)


121
122
123
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 121

def sort_by
  @sort_by
end

#sort_orderString

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

Returns:

  • (String)


115
116
117
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 115

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](tools.ietf.org/html/rfc3339).

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

Returns:

  • (DateTime)


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

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](tools.ietf.org/html/rfc3339).

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

Returns:

  • (DateTime)


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

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](tools.ietf.org/html/rfc3339).

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

Returns:

  • (DateTime)


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

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](tools.ietf.org/html/rfc3339).

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

Returns:

  • (DateTime)


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

def time_updated_less_than
  @time_updated_less_than
end

#typeString

A filter to return resources that match resource type

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.attribute_mapObject

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



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/stack_monitoring/models/search_monitored_resources_details.rb', line 128

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'name': :'name',
    'name_contains': :'nameContains',
    'type': :'type',
    'host_name': :'hostName',
    'host_name_contains': :'hostNameContains',
    'management_agent_id': :'managementAgentId',
    'lifecycle_state': :'lifecycleState',
    '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.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'name': :'String',
    'name_contains': :'String',
    'type': :'String',
    'host_name': :'String',
    'host_name_contains': :'String',
    'management_agent_id': :'String',
    'lifecycle_state': :'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



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 327

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 &&
    host_name_contains == other.host_name_contains &&
    management_agent_id == other.management_agent_id &&
    lifecycle_state == other.lifecycle_state &&
    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



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

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


352
353
354
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 352

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



361
362
363
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 361

def hash
  [compartment_id, name, name_contains, type, host_name, host_name_contains, management_agent_id, lifecycle_state, 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



405
406
407
408
409
410
411
412
413
414
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 405

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



399
400
401
# File 'lib/oci/stack_monitoring/models/search_monitored_resources_details.rb', line 399

def to_s
  to_hash.to_s
end