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 BdsInstance(object): 12 """ 13 Description of the cluster. 14 """ 15 16 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 17 #: This constant has a value of "CREATING" 18 LIFECYCLE_STATE_CREATING = "CREATING" 19 20 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 21 #: This constant has a value of "ACTIVE" 22 LIFECYCLE_STATE_ACTIVE = "ACTIVE" 23 24 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 25 #: This constant has a value of "UPDATING" 26 LIFECYCLE_STATE_UPDATING = "UPDATING" 27 28 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 29 #: This constant has a value of "SUSPENDING" 30 LIFECYCLE_STATE_SUSPENDING = "SUSPENDING" 31 32 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 33 #: This constant has a value of "SUSPENDED" 34 LIFECYCLE_STATE_SUSPENDED = "SUSPENDED" 35 36 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 37 #: This constant has a value of "RESUMING" 38 LIFECYCLE_STATE_RESUMING = "RESUMING" 39 40 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 41 #: This constant has a value of "DELETING" 42 LIFECYCLE_STATE_DELETING = "DELETING" 43 44 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 45 #: This constant has a value of "DELETED" 46 LIFECYCLE_STATE_DELETED = "DELETED" 47 48 #: A constant which can be used with the lifecycle_state property of a BdsInstance. 49 #: This constant has a value of "FAILED" 50 LIFECYCLE_STATE_FAILED = "FAILED" 51 52 #: A constant which can be used with the cluster_version property of a BdsInstance. 53 #: This constant has a value of "CDH5" 54 CLUSTER_VERSION_CDH5 = "CDH5" 55 56 #: A constant which can be used with the cluster_version property of a BdsInstance. 57 #: This constant has a value of "CDH6" 58 CLUSTER_VERSION_CDH6 = "CDH6" 59 60 #: A constant which can be used with the cluster_version property of a BdsInstance. 61 #: This constant has a value of "ODH1" 62 CLUSTER_VERSION_ODH1 = "ODH1" 63 64 def __init__(self, **kwargs): 65 """ 66 Initializes a new BdsInstance object with values from keyword arguments. 67 The following keyword arguments are supported (corresponding to the getters/setters of this class): 68 69 :param id: 70 The value to assign to the id property of this BdsInstance. 71 :type id: str 72 73 :param compartment_id: 74 The value to assign to the compartment_id property of this BdsInstance. 75 :type compartment_id: str 76 77 :param display_name: 78 The value to assign to the display_name property of this BdsInstance. 79 :type display_name: str 80 81 :param lifecycle_state: 82 The value to assign to the lifecycle_state property of this BdsInstance. 83 Allowed values for this property are: "CREATING", "ACTIVE", "UPDATING", "SUSPENDING", "SUSPENDED", "RESUMING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. 84 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 85 :type lifecycle_state: str 86 87 :param cluster_version: 88 The value to assign to the cluster_version property of this BdsInstance. 89 Allowed values for this property are: "CDH5", "CDH6", "ODH1", 'UNKNOWN_ENUM_VALUE'. 90 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 91 :type cluster_version: str 92 93 :param is_high_availability: 94 The value to assign to the is_high_availability property of this BdsInstance. 95 :type is_high_availability: bool 96 97 :param is_secure: 98 The value to assign to the is_secure property of this BdsInstance. 99 :type is_secure: bool 100 101 :param is_cloud_sql_configured: 102 The value to assign to the is_cloud_sql_configured property of this BdsInstance. 103 :type is_cloud_sql_configured: bool 104 105 :param network_config: 106 The value to assign to the network_config property of this BdsInstance. 107 :type network_config: oci.bds.models.NetworkConfig 108 109 :param cluster_details: 110 The value to assign to the cluster_details property of this BdsInstance. 111 :type cluster_details: oci.bds.models.ClusterDetails 112 113 :param nodes: 114 The value to assign to the nodes property of this BdsInstance. 115 :type nodes: list[oci.bds.models.Node] 116 117 :param cloud_sql_details: 118 The value to assign to the cloud_sql_details property of this BdsInstance. 119 :type cloud_sql_details: oci.bds.models.CloudSqlDetails 120 121 :param created_by: 122 The value to assign to the created_by property of this BdsInstance. 123 :type created_by: str 124 125 :param time_created: 126 The value to assign to the time_created property of this BdsInstance. 127 :type time_created: datetime 128 129 :param time_updated: 130 The value to assign to the time_updated property of this BdsInstance. 131 :type time_updated: datetime 132 133 :param number_of_nodes: 134 The value to assign to the number_of_nodes property of this BdsInstance. 135 :type number_of_nodes: int 136 137 :param freeform_tags: 138 The value to assign to the freeform_tags property of this BdsInstance. 139 :type freeform_tags: dict(str, str) 140 141 :param defined_tags: 142 The value to assign to the defined_tags property of this BdsInstance. 143 :type defined_tags: dict(str, dict(str, object)) 144 145 """ 146 self.swagger_types = { 147 'id': 'str', 148 'compartment_id': 'str', 149 'display_name': 'str', 150 'lifecycle_state': 'str', 151 'cluster_version': 'str', 152 'is_high_availability': 'bool', 153 'is_secure': 'bool', 154 'is_cloud_sql_configured': 'bool', 155 'network_config': 'NetworkConfig', 156 'cluster_details': 'ClusterDetails', 157 'nodes': 'list[Node]', 158 'cloud_sql_details': 'CloudSqlDetails', 159 'created_by': 'str', 160 'time_created': 'datetime', 161 'time_updated': 'datetime', 162 'number_of_nodes': 'int', 163 'freeform_tags': 'dict(str, str)', 164 'defined_tags': 'dict(str, dict(str, object))' 165 } 166 167 self.attribute_map = { 168 'id': 'id', 169 'compartment_id': 'compartmentId', 170 'display_name': 'displayName', 171 'lifecycle_state': 'lifecycleState', 172 'cluster_version': 'clusterVersion', 173 'is_high_availability': 'isHighAvailability', 174 'is_secure': 'isSecure', 175 'is_cloud_sql_configured': 'isCloudSqlConfigured', 176 'network_config': 'networkConfig', 177 'cluster_details': 'clusterDetails', 178 'nodes': 'nodes', 179 'cloud_sql_details': 'cloudSqlDetails', 180 'created_by': 'createdBy', 181 'time_created': 'timeCreated', 182 'time_updated': 'timeUpdated', 183 'number_of_nodes': 'numberOfNodes', 184 'freeform_tags': 'freeformTags', 185 'defined_tags': 'definedTags' 186 } 187 188 self._id = None 189 self._compartment_id = None 190 self._display_name = None 191 self._lifecycle_state = None 192 self._cluster_version = None 193 self._is_high_availability = None 194 self._is_secure = None 195 self._is_cloud_sql_configured = None 196 self._network_config = None 197 self._cluster_details = None 198 self._nodes = None 199 self._cloud_sql_details = None 200 self._created_by = None 201 self._time_created = None 202 self._time_updated = None 203 self._number_of_nodes = None 204 self._freeform_tags = None 205 self._defined_tags = None 206 207 @property 208 def id(self): 209 """ 210 **[Required]** Gets the id of this BdsInstance. 211 The OCID of the Big Data Service resource. 212 213 214 :return: The id of this BdsInstance. 215 :rtype: str 216 """ 217 return self._id 218 219 @id.setter 220 def id(self, id): 221 """ 222 Sets the id of this BdsInstance. 223 The OCID of the Big Data Service resource. 224 225 226 :param id: The id of this BdsInstance. 227 :type: str 228 """ 229 self._id = id 230 231 @property 232 def compartment_id(self): 233 """ 234 **[Required]** Gets the compartment_id of this BdsInstance. 235 The OCID of the compartment. 236 237 238 :return: The compartment_id of this BdsInstance. 239 :rtype: str 240 """ 241 return self._compartment_id 242 243 @compartment_id.setter 244 def compartment_id(self, compartment_id): 245 """ 246 Sets the compartment_id of this BdsInstance. 247 The OCID of the compartment. 248 249 250 :param compartment_id: The compartment_id of this BdsInstance. 251 :type: str 252 """ 253 self._compartment_id = compartment_id 254 255 @property 256 def display_name(self): 257 """ 258 **[Required]** Gets the display_name of this BdsInstance. 259 The name of the cluster. 260 261 262 :return: The display_name of this BdsInstance. 263 :rtype: str 264 """ 265 return self._display_name 266 267 @display_name.setter 268 def display_name(self, display_name): 269 """ 270 Sets the display_name of this BdsInstance. 271 The name of the cluster. 272 273 274 :param display_name: The display_name of this BdsInstance. 275 :type: str 276 """ 277 self._display_name = display_name 278 279 @property 280 def lifecycle_state(self): 281 """ 282 **[Required]** Gets the lifecycle_state of this BdsInstance. 283 The state of the cluster. 284 285 Allowed values for this property are: "CREATING", "ACTIVE", "UPDATING", "SUSPENDING", "SUSPENDED", "RESUMING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. 286 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 287 288 289 :return: The lifecycle_state of this BdsInstance. 290 :rtype: str 291 """ 292 return self._lifecycle_state 293 294 @lifecycle_state.setter 295 def lifecycle_state(self, lifecycle_state): 296 """ 297 Sets the lifecycle_state of this BdsInstance. 298 The state of the cluster. 299 300 301 :param lifecycle_state: The lifecycle_state of this BdsInstance. 302 :type: str 303 """ 304 allowed_values = ["CREATING", "ACTIVE", "UPDATING", "SUSPENDING", "SUSPENDED", "RESUMING", "DELETING", "DELETED", "FAILED"] 305 if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): 306 lifecycle_state = 'UNKNOWN_ENUM_VALUE' 307 self._lifecycle_state = lifecycle_state 308 309 @property 310 def cluster_version(self): 311 """ 312 Gets the cluster_version of this BdsInstance. 313 Version of the Hadoop distribution. 314 315 Allowed values for this property are: "CDH5", "CDH6", "ODH1", 'UNKNOWN_ENUM_VALUE'. 316 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 317 318 319 :return: The cluster_version of this BdsInstance. 320 :rtype: str 321 """ 322 return self._cluster_version 323 324 @cluster_version.setter 325 def cluster_version(self, cluster_version): 326 """ 327 Sets the cluster_version of this BdsInstance. 328 Version of the Hadoop distribution. 329 330 331 :param cluster_version: The cluster_version of this BdsInstance. 332 :type: str 333 """ 334 allowed_values = ["CDH5", "CDH6", "ODH1"] 335 if not value_allowed_none_or_none_sentinel(cluster_version, allowed_values): 336 cluster_version = 'UNKNOWN_ENUM_VALUE' 337 self._cluster_version = cluster_version 338 339 @property 340 def is_high_availability(self): 341 """ 342 **[Required]** Gets the is_high_availability of this BdsInstance. 343 Boolean flag specifying whether or not the cluster is highly available (HA) 344 345 346 :return: The is_high_availability of this BdsInstance. 347 :rtype: bool 348 """ 349 return self._is_high_availability 350 351 @is_high_availability.setter 352 def is_high_availability(self, is_high_availability): 353 """ 354 Sets the is_high_availability of this BdsInstance. 355 Boolean flag specifying whether or not the cluster is highly available (HA) 356 357 358 :param is_high_availability: The is_high_availability of this BdsInstance. 359 :type: bool 360 """ 361 self._is_high_availability = is_high_availability 362 363 @property 364 def is_secure(self): 365 """ 366 **[Required]** Gets the is_secure of this BdsInstance. 367 Boolean flag specifying whether or not the cluster should be set up as secure. 368 369 370 :return: The is_secure of this BdsInstance. 371 :rtype: bool 372 """ 373 return self._is_secure 374 375 @is_secure.setter 376 def is_secure(self, is_secure): 377 """ 378 Sets the is_secure of this BdsInstance. 379 Boolean flag specifying whether or not the cluster should be set up as secure. 380 381 382 :param is_secure: The is_secure of this BdsInstance. 383 :type: bool 384 """ 385 self._is_secure = is_secure 386 387 @property 388 def is_cloud_sql_configured(self): 389 """ 390 **[Required]** Gets the is_cloud_sql_configured of this BdsInstance. 391 Boolean flag specifying whether or not Cloud SQL should be configured. 392 393 394 :return: The is_cloud_sql_configured of this BdsInstance. 395 :rtype: bool 396 """ 397 return self._is_cloud_sql_configured 398 399 @is_cloud_sql_configured.setter 400 def is_cloud_sql_configured(self, is_cloud_sql_configured): 401 """ 402 Sets the is_cloud_sql_configured of this BdsInstance. 403 Boolean flag specifying whether or not Cloud SQL should be configured. 404 405 406 :param is_cloud_sql_configured: The is_cloud_sql_configured of this BdsInstance. 407 :type: bool 408 """ 409 self._is_cloud_sql_configured = is_cloud_sql_configured 410 411 @property 412 def network_config(self): 413 """ 414 Gets the network_config of this BdsInstance. 415 416 :return: The network_config of this BdsInstance. 417 :rtype: oci.bds.models.NetworkConfig 418 """ 419 return self._network_config 420 421 @network_config.setter 422 def network_config(self, network_config): 423 """ 424 Sets the network_config of this BdsInstance. 425 426 :param network_config: The network_config of this BdsInstance. 427 :type: oci.bds.models.NetworkConfig 428 """ 429 self._network_config = network_config 430 431 @property 432 def cluster_details(self): 433 """ 434 Gets the cluster_details of this BdsInstance. 435 436 :return: The cluster_details of this BdsInstance. 437 :rtype: oci.bds.models.ClusterDetails 438 """ 439 return self._cluster_details 440 441 @cluster_details.setter 442 def cluster_details(self, cluster_details): 443 """ 444 Sets the cluster_details of this BdsInstance. 445 446 :param cluster_details: The cluster_details of this BdsInstance. 447 :type: oci.bds.models.ClusterDetails 448 """ 449 self._cluster_details = cluster_details 450 451 @property 452 def nodes(self): 453 """ 454 **[Required]** Gets the nodes of this BdsInstance. 455 The list of nodes in the cluster. 456 457 458 :return: The nodes of this BdsInstance. 459 :rtype: list[oci.bds.models.Node] 460 """ 461 return self._nodes 462 463 @nodes.setter 464 def nodes(self, nodes): 465 """ 466 Sets the nodes of this BdsInstance. 467 The list of nodes in the cluster. 468 469 470 :param nodes: The nodes of this BdsInstance. 471 :type: list[oci.bds.models.Node] 472 """ 473 self._nodes = nodes 474 475 @property 476 def cloud_sql_details(self): 477 """ 478 Gets the cloud_sql_details of this BdsInstance. 479 480 :return: The cloud_sql_details of this BdsInstance. 481 :rtype: oci.bds.models.CloudSqlDetails 482 """ 483 return self._cloud_sql_details 484 485 @cloud_sql_details.setter 486 def cloud_sql_details(self, cloud_sql_details): 487 """ 488 Sets the cloud_sql_details of this BdsInstance. 489 490 :param cloud_sql_details: The cloud_sql_details of this BdsInstance. 491 :type: oci.bds.models.CloudSqlDetails 492 """ 493 self._cloud_sql_details = cloud_sql_details 494 495 @property 496 def created_by(self): 497 """ 498 Gets the created_by of this BdsInstance. 499 The user who created the cluster. 500 501 502 :return: The created_by of this BdsInstance. 503 :rtype: str 504 """ 505 return self._created_by 506 507 @created_by.setter 508 def created_by(self, created_by): 509 """ 510 Sets the created_by of this BdsInstance. 511 The user who created the cluster. 512 513 514 :param created_by: The created_by of this BdsInstance. 515 :type: str 516 """ 517 self._created_by = created_by 518 519 @property 520 def time_created(self): 521 """ 522 Gets the time_created of this BdsInstance. 523 The time the cluster was created, shown as an RFC 3339 formatted datetime string. 524 525 526 :return: The time_created of this BdsInstance. 527 :rtype: datetime 528 """ 529 return self._time_created 530 531 @time_created.setter 532 def time_created(self, time_created): 533 """ 534 Sets the time_created of this BdsInstance. 535 The time the cluster was created, shown as an RFC 3339 formatted datetime string. 536 537 538 :param time_created: The time_created of this BdsInstance. 539 :type: datetime 540 """ 541 self._time_created = time_created 542 543 @property 544 def time_updated(self): 545 """ 546 Gets the time_updated of this BdsInstance. 547 The time the cluster was updated, shown as an RFC 3339 formatted datetime string. 548 549 550 :return: The time_updated of this BdsInstance. 551 :rtype: datetime 552 """ 553 return self._time_updated 554 555 @time_updated.setter 556 def time_updated(self, time_updated): 557 """ 558 Sets the time_updated of this BdsInstance. 559 The time the cluster was updated, shown as an RFC 3339 formatted datetime string. 560 561 562 :param time_updated: The time_updated of this BdsInstance. 563 :type: datetime 564 """ 565 self._time_updated = time_updated 566 567 @property 568 def number_of_nodes(self): 569 """ 570 **[Required]** Gets the number_of_nodes of this BdsInstance. 571 Number of nodes that forming the cluster 572 573 574 :return: The number_of_nodes of this BdsInstance. 575 :rtype: int 576 """ 577 return self._number_of_nodes 578 579 @number_of_nodes.setter 580 def number_of_nodes(self, number_of_nodes): 581 """ 582 Sets the number_of_nodes of this BdsInstance. 583 Number of nodes that forming the cluster 584 585 586 :param number_of_nodes: The number_of_nodes of this BdsInstance. 587 :type: int 588 """ 589 self._number_of_nodes = number_of_nodes 590 591 @property 592 def freeform_tags(self): 593 """ 594 Gets the freeform_tags of this BdsInstance. 595 Simple key-value pair that is applied without any predefined name, type, or scope. 596 Exists for cross-compatibility only. For example, `{\"bar-key\": \"value\"}` 597 598 599 :return: The freeform_tags of this BdsInstance. 600 :rtype: dict(str, str) 601 """ 602 return self._freeform_tags 603 604 @freeform_tags.setter 605 def freeform_tags(self, freeform_tags): 606 """ 607 Sets the freeform_tags of this BdsInstance. 608 Simple key-value pair that is applied without any predefined name, type, or scope. 609 Exists for cross-compatibility only. For example, `{\"bar-key\": \"value\"}` 610 611 612 :param freeform_tags: The freeform_tags of this BdsInstance. 613 :type: dict(str, str) 614 """ 615 self._freeform_tags = freeform_tags 616 617 @property 618 def defined_tags(self): 619 """ 620 Gets the defined_tags of this BdsInstance. 621 Defined tags for this resource. Each key is predefined and scoped to a namespace. 622 For example, `{\"foo-namespace\": {\"bar-key\": \"value\"}}` 623 624 625 :return: The defined_tags of this BdsInstance. 626 :rtype: dict(str, dict(str, object)) 627 """ 628 return self._defined_tags 629 630 @defined_tags.setter 631 def defined_tags(self, defined_tags): 632 """ 633 Sets the defined_tags of this BdsInstance. 634 Defined tags for this resource. Each key is predefined and scoped to a namespace. 635 For example, `{\"foo-namespace\": {\"bar-key\": \"value\"}}` 636 637 638 :param defined_tags: The defined_tags of this BdsInstance. 639 :type: dict(str, dict(str, object)) 640 """ 641 self._defined_tags = defined_tags 642 643 def __repr__(self): 644 return formatted_flat_dict(self) 645 646 def __eq__(self, other): 647 if other is None: 648 return False 649 650 return self.__dict__ == other.__dict__ 651 652 def __ne__(self, other): 653 return not self == other 654