Class: OCI::ApmSynthetics::Models::UpdateMonitorDetails
- Inherits:
-
Object
- Object
- OCI::ApmSynthetics::Models::UpdateMonitorDetails
- Defined in:
- lib/oci/apm_synthetics/models/update_monitor_details.rb
Overview
Details of the request body used to update a monitor.
Constant Summary collapse
- STATUS_ENUM =
[ STATUS_ENABLED = 'ENABLED'.freeze, STATUS_DISABLED = 'DISABLED'.freeze, STATUS_INVALID = 'INVALID'.freeze ].freeze
Instance Attribute Summary collapse
- #configuration ⇒ OCI::ApmSynthetics::Models::MonitorConfiguration
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource.
-
#display_name ⇒ String
Unique name that can be edited.
-
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type or scope.
-
#is_run_once ⇒ BOOLEAN
If runOnce is enabled, then the monitor will run once.
-
#repeat_interval_in_seconds ⇒ Integer
Interval in seconds after the start time when the job should be repeated.
-
#script_id ⇒ String
The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the script.
-
#script_parameters ⇒ Array<OCI::ApmSynthetics::Models::MonitorScriptParameter>
List of script parameters in the monitor.
-
#status ⇒ String
Enables or disables the monitor.
-
#target ⇒ String
Specify the endpoint on which to run the monitor.
-
#timeout_in_seconds ⇒ Integer
Timeout in seconds.
-
#vantage_points ⇒ Array<String>
A list of public and dedicated vantage points from which to execute the monitor.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ UpdateMonitorDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ UpdateMonitorDetails
Initializes the object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 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 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 141 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.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.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.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.status = attributes[:'status'] if attributes[:'status'] self.status = "ENABLED" if status.nil? && !attributes.key?(:'status') # rubocop:disable Style/StringLiterals 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.script_parameters = attributes[:'scriptParameters'] if attributes[:'scriptParameters'] raise 'You cannot provide both :scriptParameters and :script_parameters' if attributes.key?(:'scriptParameters') && attributes.key?(:'script_parameters') self.script_parameters = attributes[:'script_parameters'] if attributes[:'script_parameters'] self.configuration = attributes[:'configuration'] if attributes[:'configuration'] self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] end |
Instance Attribute Details
#configuration ⇒ OCI::ApmSynthetics::Models::MonitorConfiguration
69 70 71 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 69 def configuration @configuration end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"bar-key": "value"}`
81 82 83 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 81 def @defined_tags end |
#display_name ⇒ String
Unique name that can be edited. The name should not contain any confidential information.
18 19 20 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 18 def display_name @display_name end |
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `"value"`
75 76 77 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 75 def @freeform_tags end |
#is_run_once ⇒ BOOLEAN
If runOnce is enabled, then the monitor will run once.
44 45 46 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 44 def is_run_once @is_run_once end |
#repeat_interval_in_seconds ⇒ Integer
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.
40 41 42 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 40 def repeat_interval_in_seconds @repeat_interval_in_seconds end |
#script_id ⇒ String
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.
30 31 32 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 30 def script_id @script_id end |
#script_parameters ⇒ Array<OCI::ApmSynthetics::Models::MonitorScriptParameter>
List of script parameters in the monitor. This is valid only for SCRIPTED_BROWSER and SCRIPTED_REST monitor types. For other monitor types, it should be set to null. Example: `["userid", "paramValue":"testuser"]`
66 67 68 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 66 def script_parameters @script_parameters end |
#status ⇒ String
Enables or disables the monitor.
34 35 36 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 34 def status @status end |
#target ⇒ String
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.
59 60 61 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 59 def target @target end |
#timeout_in_seconds ⇒ Integer
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.
51 52 53 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 51 def timeout_in_seconds @timeout_in_seconds end |
#vantage_points ⇒ Array<String>
A list of public and dedicated vantage points from which to execute the monitor. Use /publicVantagePoints to fetch public vantage points, and /dedicatedVantagePoints to fetch dedicated vantage points.
24 25 26 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 24 def vantage_points @vantage_points end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 84 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'display_name': :'displayName', 'vantage_points': :'vantagePoints', 'script_id': :'scriptId', 'status': :'status', 'repeat_interval_in_seconds': :'repeatIntervalInSeconds', 'is_run_once': :'isRunOnce', 'timeout_in_seconds': :'timeoutInSeconds', 'target': :'target', 'script_parameters': :'scriptParameters', 'configuration': :'configuration', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 104 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'display_name': :'String', 'vantage_points': :'Array<String>', 'script_id': :'String', 'status': :'String', 'repeat_interval_in_seconds': :'Integer', 'is_run_once': :'BOOLEAN', 'timeout_in_seconds': :'Integer', 'target': :'String', 'script_parameters': :'Array<OCI::ApmSynthetics::Models::MonitorScriptParameter>', 'configuration': :'OCI::ApmSynthetics::Models::MonitorConfiguration', '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.
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 226 def ==(other) return true if equal?(other) self.class == other.class && display_name == other.display_name && vantage_points == other.vantage_points && script_id == other.script_id && 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 && script_parameters == other.script_parameters && configuration == other.configuration && == other. && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 267 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
247 248 249 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 247 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
256 257 258 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 256 def hash [display_name, vantage_points, script_id, status, repeat_interval_in_seconds, is_run_once, timeout_in_seconds, target, script_parameters, configuration, , ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
300 301 302 303 304 305 306 307 308 309 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 300 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_s ⇒ String
Returns the string representation of the object
294 295 296 |
# File 'lib/oci/apm_synthetics/models/update_monitor_details.rb', line 294 def to_s to_hash.to_s end |