Class: OCI::ApmSynthetics::Models::MonitorSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_synthetics/models/monitor_summary.rb

Overview

Information about the monitor.

Constant Summary collapse

MONITOR_TYPE_ENUM =
[
  MONITOR_TYPE_SCRIPTED_BROWSER = 'SCRIPTED_BROWSER'.freeze,
  MONITOR_TYPE_BROWSER = 'BROWSER'.freeze,
  MONITOR_TYPE_SCRIPTED_REST = 'SCRIPTED_REST'.freeze,
  MONITOR_TYPE_REST = 'REST'.freeze,
  MONITOR_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_ENABLED = 'ENABLED'.freeze,
  STATUS_DISABLED = 'DISABLED'.freeze,
  STATUS_INVALID = 'INVALID'.freeze,
  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 = {}) ⇒ MonitorSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :monitor_type (String)

    The value to assign to the #monitor_type property

  • :vantage_points (Array<OCI::ApmSynthetics::Models::VantagePointInfo>)

    The value to assign to the #vantage_points property

  • :vantage_point_count (Integer)

    The value to assign to the #vantage_point_count property

  • :script_id (String)

    The value to assign to the #script_id property

  • :script_name (String)

    The value to assign to the #script_name property

  • :status (String)

    The value to assign to the #status property

  • :repeat_interval_in_seconds (Integer)

    The value to assign to the #repeat_interval_in_seconds property

  • :is_run_once (BOOLEAN)

    The value to assign to the #is_run_once property

  • :timeout_in_seconds (Integer)

    The value to assign to the #timeout_in_seconds property

  • :target (String)

    The value to assign to the #target property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property



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/apm_synthetics/models/monitor_summary.rb', line 181

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

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

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

  self.monitor_type = attributes[:'monitorType'] if attributes[:'monitorType']

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

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

  self.vantage_points = attributes[:'vantagePoints'] if attributes[:'vantagePoints']

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

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

  self.vantage_point_count = attributes[:'vantagePointCount'] if attributes[:'vantagePointCount']

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

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

  self.script_id = attributes[:'scriptId'] if attributes[:'scriptId']

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

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

  self.script_name = attributes[:'scriptName'] if attributes[:'scriptName']

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

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

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

  self.repeat_interval_in_seconds = attributes[:'repeatIntervalInSeconds'] if attributes[:'repeatIntervalInSeconds']

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

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

  self.is_run_once = attributes[:'isRunOnce'] unless attributes[:'isRunOnce'].nil?
  self.is_run_once = false if is_run_once.nil? && !attributes.key?(:'isRunOnce') # rubocop:disable Style/StringLiterals

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

  self.is_run_once = attributes[:'is_run_once'] unless attributes[:'is_run_once'].nil?
  self.is_run_once = false if is_run_once.nil? && !attributes.key?(:'isRunOnce') && !attributes.key?(:'is_run_once') # rubocop:disable Style/StringLiterals

  self.timeout_in_seconds = attributes[:'timeoutInSeconds'] if attributes[:'timeoutInSeconds']

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

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"bar-key": "value"}`

Returns:

  • (Hash<String, Hash<String, Object>>)


109
110
111
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 109

def defined_tags
  @defined_tags
end

#display_nameString

**[Required]** Unique name that can be edited. The name should not contain any confidential information.

Returns:

  • (String)


32
33
34
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 32

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `"value"`

Returns:

  • (Hash<String, String>)


103
104
105
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 103

def freeform_tags
  @freeform_tags
end

#idString

**[Required]** The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the monitor.

Returns:

  • (String)


28
29
30
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 28

def id
  @id
end

#is_run_onceBOOLEAN

**[Required]** If runOnce is enabled, then the monitor will run once.

Returns:

  • (BOOLEAN)


68
69
70
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 68

def is_run_once
  @is_run_once
end

#monitor_typeString

**[Required]** The type of monitor.

Returns:

  • (String)


36
37
38
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 36

def monitor_type
  @monitor_type
end

#repeat_interval_in_secondsInteger

**[Required]** Interval in seconds after the start time when the job should be repeated. Minimum repeatIntervalInSeconds should be 300 seconds for Scripted REST, Scripted Browser and Browser monitors, and 60 seconds for REST monitor.

Returns:

  • (Integer)


64
65
66
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 64

def repeat_interval_in_seconds
  @repeat_interval_in_seconds
end

#script_idString

**[Required]** The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the script. scriptId is mandatory for creation of SCRIPTED_BROWSER and SCRIPTED_REST monitor types. For other monitor types, it should be set to null.

Returns:

  • (String)


50
51
52
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 50

def script_id
  @script_id
end

#script_nameString

**[Required]** Name of the script.

Returns:

  • (String)


54
55
56
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 54

def script_name
  @script_name
end

#statusString

**[Required]** Enables or disables the monitor.

Returns:

  • (String)


58
59
60
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 58

def status
  @status
end

#targetString

Specify the endpoint on which to run the monitor. For BROWSER and REST monitor types, target is mandatory. If target is specified in the SCRIPTED_BROWSER monitor type, then the monitor will run the selected script (specified by scriptId in monitor) against the specified target endpoint. If target is not specified in the SCRIPTED_BROWSER monitor type, then the monitor will run the selected script as it is.

Returns:

  • (String)


83
84
85
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 83

def target
  @target
end

#time_createdDateTime

The time the resource was created, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-12T22:47:12.613Z`

Returns:

  • (DateTime)


90
91
92
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 90

def time_created
  @time_created
end

#time_updatedDateTime

The time the resource was updated, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-13T22:47:12.613Z`

Returns:

  • (DateTime)


97
98
99
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 97

def time_updated
  @time_updated
end

#timeout_in_secondsInteger

**[Required]** Timeout in seconds. Timeout cannot be more than 30% of repeatIntervalInSeconds time for monitors. Also, timeoutInSeconds should be a multiple of 60 for Scripted REST, Scripted Browser and Browser monitors. Monitor will be allowed to run only for timeoutInSeconds time. It would be terminated after that.

Returns:

  • (Integer)


75
76
77
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 75

def timeout_in_seconds
  @timeout_in_seconds
end

#vantage_point_countInteger

**[Required]** Number of vantage points where monitor is running.

Returns:

  • (Integer)


44
45
46
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 44

def vantage_point_count
  @vantage_point_count
end

#vantage_pointsArray<OCI::ApmSynthetics::Models::VantagePointInfo>

**[Required]** List of public and dedicated vantage points where the monitor is running.



40
41
42
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 40

def vantage_points
  @vantage_points
end

Class Method Details

.attribute_mapObject

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



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 112

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'monitor_type': :'monitorType',
    'vantage_points': :'vantagePoints',
    'vantage_point_count': :'vantagePointCount',
    'script_id': :'scriptId',
    'script_name': :'scriptName',
    'status': :'status',
    'repeat_interval_in_seconds': :'repeatIntervalInSeconds',
    'is_run_once': :'isRunOnce',
    'timeout_in_seconds': :'timeoutInSeconds',
    'target': :'target',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 136

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'monitor_type': :'String',
    'vantage_points': :'Array<OCI::ApmSynthetics::Models::VantagePointInfo>',
    'vantage_point_count': :'Integer',
    'script_id': :'String',
    'script_name': :'String',
    'status': :'String',
    'repeat_interval_in_seconds': :'Integer',
    'is_run_once': :'BOOLEAN',
    'timeout_in_seconds': :'Integer',
    'target': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 307

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    monitor_type == other.monitor_type &&
    vantage_points == other.vantage_points &&
    vantage_point_count == other.vantage_point_count &&
    script_id == other.script_id &&
    script_name == other.script_name &&
    status == other.status &&
    repeat_interval_in_seconds == other.repeat_interval_in_seconds &&
    is_run_once == other.is_run_once &&
    timeout_in_seconds == other.timeout_in_seconds &&
    target == other.target &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_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



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 352

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


332
333
334
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 332

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



341
342
343
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 341

def hash
  [id, display_name, monitor_type, vantage_points, vantage_point_count, script_id, script_name, status, repeat_interval_in_seconds, is_run_once, timeout_in_seconds, target, time_created, time_updated, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



385
386
387
388
389
390
391
392
393
394
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 385

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



379
380
381
# File 'lib/oci/apm_synthetics/models/monitor_summary.rb', line 379

def to_s
  to_hash.to_s
end