1# coding: utf-8 2# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. 3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. 4 5 6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 7from oci.decorators import init_model_state_from_kwargs 8 9 10@init_model_state_from_kwargs 11class UpdateHttpMonitorDetails(object): 12 """ 13 The request body used to update an HTTP monitor. 14 """ 15 16 #: A constant which can be used with the protocol property of a UpdateHttpMonitorDetails. 17 #: This constant has a value of "HTTP" 18 PROTOCOL_HTTP = "HTTP" 19 20 #: A constant which can be used with the protocol property of a UpdateHttpMonitorDetails. 21 #: This constant has a value of "HTTPS" 22 PROTOCOL_HTTPS = "HTTPS" 23 24 #: A constant which can be used with the method property of a UpdateHttpMonitorDetails. 25 #: This constant has a value of "GET" 26 METHOD_GET = "GET" 27 28 #: A constant which can be used with the method property of a UpdateHttpMonitorDetails. 29 #: This constant has a value of "HEAD" 30 METHOD_HEAD = "HEAD" 31 32 def __init__(self, **kwargs): 33 """ 34 Initializes a new UpdateHttpMonitorDetails object with values from keyword arguments. 35 The following keyword arguments are supported (corresponding to the getters/setters of this class): 36 37 :param targets: 38 The value to assign to the targets property of this UpdateHttpMonitorDetails. 39 :type targets: list[str] 40 41 :param vantage_point_names: 42 The value to assign to the vantage_point_names property of this UpdateHttpMonitorDetails. 43 :type vantage_point_names: list[str] 44 45 :param port: 46 The value to assign to the port property of this UpdateHttpMonitorDetails. 47 :type port: int 48 49 :param timeout_in_seconds: 50 The value to assign to the timeout_in_seconds property of this UpdateHttpMonitorDetails. 51 :type timeout_in_seconds: int 52 53 :param protocol: 54 The value to assign to the protocol property of this UpdateHttpMonitorDetails. 55 Allowed values for this property are: "HTTP", "HTTPS" 56 :type protocol: str 57 58 :param method: 59 The value to assign to the method property of this UpdateHttpMonitorDetails. 60 Allowed values for this property are: "GET", "HEAD" 61 :type method: str 62 63 :param path: 64 The value to assign to the path property of this UpdateHttpMonitorDetails. 65 :type path: str 66 67 :param headers: 68 The value to assign to the headers property of this UpdateHttpMonitorDetails. 69 :type headers: dict(str, str) 70 71 :param display_name: 72 The value to assign to the display_name property of this UpdateHttpMonitorDetails. 73 :type display_name: str 74 75 :param interval_in_seconds: 76 The value to assign to the interval_in_seconds property of this UpdateHttpMonitorDetails. 77 :type interval_in_seconds: int 78 79 :param is_enabled: 80 The value to assign to the is_enabled property of this UpdateHttpMonitorDetails. 81 :type is_enabled: bool 82 83 :param freeform_tags: 84 The value to assign to the freeform_tags property of this UpdateHttpMonitorDetails. 85 :type freeform_tags: dict(str, str) 86 87 :param defined_tags: 88 The value to assign to the defined_tags property of this UpdateHttpMonitorDetails. 89 :type defined_tags: dict(str, dict(str, object)) 90 91 """ 92 self.swagger_types = { 93 'targets': 'list[str]', 94 'vantage_point_names': 'list[str]', 95 'port': 'int', 96 'timeout_in_seconds': 'int', 97 'protocol': 'str', 98 'method': 'str', 99 'path': 'str', 100 'headers': 'dict(str, str)', 101 'display_name': 'str', 102 'interval_in_seconds': 'int', 103 'is_enabled': 'bool', 104 'freeform_tags': 'dict(str, str)', 105 'defined_tags': 'dict(str, dict(str, object))' 106 } 107 108 self.attribute_map = { 109 'targets': 'targets', 110 'vantage_point_names': 'vantagePointNames', 111 'port': 'port', 112 'timeout_in_seconds': 'timeoutInSeconds', 113 'protocol': 'protocol', 114 'method': 'method', 115 'path': 'path', 116 'headers': 'headers', 117 'display_name': 'displayName', 118 'interval_in_seconds': 'intervalInSeconds', 119 'is_enabled': 'isEnabled', 120 'freeform_tags': 'freeformTags', 121 'defined_tags': 'definedTags' 122 } 123 124 self._targets = None 125 self._vantage_point_names = None 126 self._port = None 127 self._timeout_in_seconds = None 128 self._protocol = None 129 self._method = None 130 self._path = None 131 self._headers = None 132 self._display_name = None 133 self._interval_in_seconds = None 134 self._is_enabled = None 135 self._freeform_tags = None 136 self._defined_tags = None 137 138 @property 139 def targets(self): 140 """ 141 Gets the targets of this UpdateHttpMonitorDetails. 142 A list of targets (hostnames or IP addresses) of the probe. 143 144 145 :return: The targets of this UpdateHttpMonitorDetails. 146 :rtype: list[str] 147 """ 148 return self._targets 149 150 @targets.setter 151 def targets(self, targets): 152 """ 153 Sets the targets of this UpdateHttpMonitorDetails. 154 A list of targets (hostnames or IP addresses) of the probe. 155 156 157 :param targets: The targets of this UpdateHttpMonitorDetails. 158 :type: list[str] 159 """ 160 self._targets = targets 161 162 @property 163 def vantage_point_names(self): 164 """ 165 Gets the vantage_point_names of this UpdateHttpMonitorDetails. 166 A list of names of vantage points from which to execute the probe. 167 168 169 :return: The vantage_point_names of this UpdateHttpMonitorDetails. 170 :rtype: list[str] 171 """ 172 return self._vantage_point_names 173 174 @vantage_point_names.setter 175 def vantage_point_names(self, vantage_point_names): 176 """ 177 Sets the vantage_point_names of this UpdateHttpMonitorDetails. 178 A list of names of vantage points from which to execute the probe. 179 180 181 :param vantage_point_names: The vantage_point_names of this UpdateHttpMonitorDetails. 182 :type: list[str] 183 """ 184 self._vantage_point_names = vantage_point_names 185 186 @property 187 def port(self): 188 """ 189 Gets the port of this UpdateHttpMonitorDetails. 190 The port on which to probe endpoints. If unspecified, probes will use the 191 default port of their protocol. 192 193 194 :return: The port of this UpdateHttpMonitorDetails. 195 :rtype: int 196 """ 197 return self._port 198 199 @port.setter 200 def port(self, port): 201 """ 202 Sets the port of this UpdateHttpMonitorDetails. 203 The port on which to probe endpoints. If unspecified, probes will use the 204 default port of their protocol. 205 206 207 :param port: The port of this UpdateHttpMonitorDetails. 208 :type: int 209 """ 210 self._port = port 211 212 @property 213 def timeout_in_seconds(self): 214 """ 215 Gets the timeout_in_seconds of this UpdateHttpMonitorDetails. 216 The probe timeout in seconds. Valid values: 10, 20, 30, and 60. 217 The probe timeout must be less than or equal to `intervalInSeconds` for monitors. 218 219 220 :return: The timeout_in_seconds of this UpdateHttpMonitorDetails. 221 :rtype: int 222 """ 223 return self._timeout_in_seconds 224 225 @timeout_in_seconds.setter 226 def timeout_in_seconds(self, timeout_in_seconds): 227 """ 228 Sets the timeout_in_seconds of this UpdateHttpMonitorDetails. 229 The probe timeout in seconds. Valid values: 10, 20, 30, and 60. 230 The probe timeout must be less than or equal to `intervalInSeconds` for monitors. 231 232 233 :param timeout_in_seconds: The timeout_in_seconds of this UpdateHttpMonitorDetails. 234 :type: int 235 """ 236 self._timeout_in_seconds = timeout_in_seconds 237 238 @property 239 def protocol(self): 240 """ 241 Gets the protocol of this UpdateHttpMonitorDetails. 242 Allowed values for this property are: "HTTP", "HTTPS" 243 244 245 :return: The protocol of this UpdateHttpMonitorDetails. 246 :rtype: str 247 """ 248 return self._protocol 249 250 @protocol.setter 251 def protocol(self, protocol): 252 """ 253 Sets the protocol of this UpdateHttpMonitorDetails. 254 255 :param protocol: The protocol of this UpdateHttpMonitorDetails. 256 :type: str 257 """ 258 allowed_values = ["HTTP", "HTTPS"] 259 if not value_allowed_none_or_none_sentinel(protocol, allowed_values): 260 raise ValueError( 261 "Invalid value for `protocol`, must be None or one of {0}" 262 .format(allowed_values) 263 ) 264 self._protocol = protocol 265 266 @property 267 def method(self): 268 """ 269 Gets the method of this UpdateHttpMonitorDetails. 270 Allowed values for this property are: "GET", "HEAD" 271 272 273 :return: The method of this UpdateHttpMonitorDetails. 274 :rtype: str 275 """ 276 return self._method 277 278 @method.setter 279 def method(self, method): 280 """ 281 Sets the method of this UpdateHttpMonitorDetails. 282 283 :param method: The method of this UpdateHttpMonitorDetails. 284 :type: str 285 """ 286 allowed_values = ["GET", "HEAD"] 287 if not value_allowed_none_or_none_sentinel(method, allowed_values): 288 raise ValueError( 289 "Invalid value for `method`, must be None or one of {0}" 290 .format(allowed_values) 291 ) 292 self._method = method 293 294 @property 295 def path(self): 296 """ 297 Gets the path of this UpdateHttpMonitorDetails. 298 The optional URL path to probe, including query parameters. 299 300 301 :return: The path of this UpdateHttpMonitorDetails. 302 :rtype: str 303 """ 304 return self._path 305 306 @path.setter 307 def path(self, path): 308 """ 309 Sets the path of this UpdateHttpMonitorDetails. 310 The optional URL path to probe, including query parameters. 311 312 313 :param path: The path of this UpdateHttpMonitorDetails. 314 :type: str 315 """ 316 self._path = path 317 318 @property 319 def headers(self): 320 """ 321 Gets the headers of this UpdateHttpMonitorDetails. 322 A dictionary of HTTP request headers. 323 324 *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. 325 326 327 :return: The headers of this UpdateHttpMonitorDetails. 328 :rtype: dict(str, str) 329 """ 330 return self._headers 331 332 @headers.setter 333 def headers(self, headers): 334 """ 335 Sets the headers of this UpdateHttpMonitorDetails. 336 A dictionary of HTTP request headers. 337 338 *Note:* Monitors and probes do not support the use of the `Authorization` HTTP header. 339 340 341 :param headers: The headers of this UpdateHttpMonitorDetails. 342 :type: dict(str, str) 343 """ 344 self._headers = headers 345 346 @property 347 def display_name(self): 348 """ 349 Gets the display_name of this UpdateHttpMonitorDetails. 350 A user-friendly and mutable name suitable for display in a user interface. 351 352 353 :return: The display_name of this UpdateHttpMonitorDetails. 354 :rtype: str 355 """ 356 return self._display_name 357 358 @display_name.setter 359 def display_name(self, display_name): 360 """ 361 Sets the display_name of this UpdateHttpMonitorDetails. 362 A user-friendly and mutable name suitable for display in a user interface. 363 364 365 :param display_name: The display_name of this UpdateHttpMonitorDetails. 366 :type: str 367 """ 368 self._display_name = display_name 369 370 @property 371 def interval_in_seconds(self): 372 """ 373 Gets the interval_in_seconds of this UpdateHttpMonitorDetails. 374 The monitor interval in seconds. Valid values: 10, 30, and 60. 375 376 377 :return: The interval_in_seconds of this UpdateHttpMonitorDetails. 378 :rtype: int 379 """ 380 return self._interval_in_seconds 381 382 @interval_in_seconds.setter 383 def interval_in_seconds(self, interval_in_seconds): 384 """ 385 Sets the interval_in_seconds of this UpdateHttpMonitorDetails. 386 The monitor interval in seconds. Valid values: 10, 30, and 60. 387 388 389 :param interval_in_seconds: The interval_in_seconds of this UpdateHttpMonitorDetails. 390 :type: int 391 """ 392 self._interval_in_seconds = interval_in_seconds 393 394 @property 395 def is_enabled(self): 396 """ 397 Gets the is_enabled of this UpdateHttpMonitorDetails. 398 Enables or disables the monitor. Set to 'true' to launch monitoring. 399 400 401 :return: The is_enabled of this UpdateHttpMonitorDetails. 402 :rtype: bool 403 """ 404 return self._is_enabled 405 406 @is_enabled.setter 407 def is_enabled(self, is_enabled): 408 """ 409 Sets the is_enabled of this UpdateHttpMonitorDetails. 410 Enables or disables the monitor. Set to 'true' to launch monitoring. 411 412 413 :param is_enabled: The is_enabled of this UpdateHttpMonitorDetails. 414 :type: bool 415 """ 416 self._is_enabled = is_enabled 417 418 @property 419 def freeform_tags(self): 420 """ 421 Gets the freeform_tags of this UpdateHttpMonitorDetails. 422 Free-form tags for this resource. Each tag is a simple key-value pair with no 423 predefined name, type, or namespace. For more information, 424 see `Resource Tags`__. 425 Example: `{\"Department\": \"Finance\"}` 426 427 __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm 428 429 430 :return: The freeform_tags of this UpdateHttpMonitorDetails. 431 :rtype: dict(str, str) 432 """ 433 return self._freeform_tags 434 435 @freeform_tags.setter 436 def freeform_tags(self, freeform_tags): 437 """ 438 Sets the freeform_tags of this UpdateHttpMonitorDetails. 439 Free-form tags for this resource. Each tag is a simple key-value pair with no 440 predefined name, type, or namespace. For more information, 441 see `Resource Tags`__. 442 Example: `{\"Department\": \"Finance\"}` 443 444 __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm 445 446 447 :param freeform_tags: The freeform_tags of this UpdateHttpMonitorDetails. 448 :type: dict(str, str) 449 """ 450 self._freeform_tags = freeform_tags 451 452 @property 453 def defined_tags(self): 454 """ 455 Gets the defined_tags of this UpdateHttpMonitorDetails. 456 Defined tags for this resource. Each key is predefined and scoped to a namespace. 457 For more information, see `Resource Tags`__. 458 Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` 459 460 __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm 461 462 463 :return: The defined_tags of this UpdateHttpMonitorDetails. 464 :rtype: dict(str, dict(str, object)) 465 """ 466 return self._defined_tags 467 468 @defined_tags.setter 469 def defined_tags(self, defined_tags): 470 """ 471 Sets the defined_tags of this UpdateHttpMonitorDetails. 472 Defined tags for this resource. Each key is predefined and scoped to a namespace. 473 For more information, see `Resource Tags`__. 474 Example: `{\"Operations\": {\"CostCenter\": \"42\"}}` 475 476 __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm 477 478 479 :param defined_tags: The defined_tags of this UpdateHttpMonitorDetails. 480 :type: dict(str, dict(str, object)) 481 """ 482 self._defined_tags = defined_tags 483 484 def __repr__(self): 485 return formatted_flat_dict(self) 486 487 def __eq__(self, other): 488 if other is None: 489 return False 490 491 return self.__dict__ == other.__dict__ 492 493 def __ne__(self, other): 494 return not self == other 495