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 UpdateBackendDetails(object): 12 """ 13 The configuration details for updating a backend server. 14 """ 15 16 def __init__(self, **kwargs): 17 """ 18 Initializes a new UpdateBackendDetails object with values from keyword arguments. 19 The following keyword arguments are supported (corresponding to the getters/setters of this class): 20 21 :param weight: 22 The value to assign to the weight property of this UpdateBackendDetails. 23 :type weight: int 24 25 :param backup: 26 The value to assign to the backup property of this UpdateBackendDetails. 27 :type backup: bool 28 29 :param drain: 30 The value to assign to the drain property of this UpdateBackendDetails. 31 :type drain: bool 32 33 :param offline: 34 The value to assign to the offline property of this UpdateBackendDetails. 35 :type offline: bool 36 37 """ 38 self.swagger_types = { 39 'weight': 'int', 40 'backup': 'bool', 41 'drain': 'bool', 42 'offline': 'bool' 43 } 44 45 self.attribute_map = { 46 'weight': 'weight', 47 'backup': 'backup', 48 'drain': 'drain', 49 'offline': 'offline' 50 } 51 52 self._weight = None 53 self._backup = None 54 self._drain = None 55 self._offline = None 56 57 @property 58 def weight(self): 59 """ 60 **[Required]** Gets the weight of this UpdateBackendDetails. 61 The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger 62 proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections 63 as a server weighted '1'. 64 For more information on load balancing policies, see 65 `How Load Balancing Policies Work`__. 66 67 Example: `3` 68 69 __ https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm 70 71 72 :return: The weight of this UpdateBackendDetails. 73 :rtype: int 74 """ 75 return self._weight 76 77 @weight.setter 78 def weight(self, weight): 79 """ 80 Sets the weight of this UpdateBackendDetails. 81 The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger 82 proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections 83 as a server weighted '1'. 84 For more information on load balancing policies, see 85 `How Load Balancing Policies Work`__. 86 87 Example: `3` 88 89 __ https://docs.cloud.oracle.com/Content/Balance/Reference/lbpolicies.htm 90 91 92 :param weight: The weight of this UpdateBackendDetails. 93 :type: int 94 """ 95 self._weight = weight 96 97 @property 98 def backup(self): 99 """ 100 **[Required]** Gets the backup of this UpdateBackendDetails. 101 Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress 102 traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. 103 104 **Note:** You cannot add a backend server marked as `backup` to a backend set that uses the IP Hash policy. 105 106 Example: `false` 107 108 109 :return: The backup of this UpdateBackendDetails. 110 :rtype: bool 111 """ 112 return self._backup 113 114 @backup.setter 115 def backup(self, backup): 116 """ 117 Sets the backup of this UpdateBackendDetails. 118 Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress 119 traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. 120 121 **Note:** You cannot add a backend server marked as `backup` to a backend set that uses the IP Hash policy. 122 123 Example: `false` 124 125 126 :param backup: The backup of this UpdateBackendDetails. 127 :type: bool 128 """ 129 self._backup = backup 130 131 @property 132 def drain(self): 133 """ 134 **[Required]** Gets the drain of this UpdateBackendDetails. 135 Whether the load balancer should drain this server. Servers marked \"drain\" receive no new 136 incoming traffic. 137 138 Example: `false` 139 140 141 :return: The drain of this UpdateBackendDetails. 142 :rtype: bool 143 """ 144 return self._drain 145 146 @drain.setter 147 def drain(self, drain): 148 """ 149 Sets the drain of this UpdateBackendDetails. 150 Whether the load balancer should drain this server. Servers marked \"drain\" receive no new 151 incoming traffic. 152 153 Example: `false` 154 155 156 :param drain: The drain of this UpdateBackendDetails. 157 :type: bool 158 """ 159 self._drain = drain 160 161 @property 162 def offline(self): 163 """ 164 **[Required]** Gets the offline of this UpdateBackendDetails. 165 Whether the load balancer should treat this server as offline. Offline servers receive no incoming 166 traffic. 167 168 Example: `false` 169 170 171 :return: The offline of this UpdateBackendDetails. 172 :rtype: bool 173 """ 174 return self._offline 175 176 @offline.setter 177 def offline(self, offline): 178 """ 179 Sets the offline of this UpdateBackendDetails. 180 Whether the load balancer should treat this server as offline. Offline servers receive no incoming 181 traffic. 182 183 Example: `false` 184 185 186 :param offline: The offline of this UpdateBackendDetails. 187 :type: bool 188 """ 189 self._offline = offline 190 191 def __repr__(self): 192 return formatted_flat_dict(self) 193 194 def __eq__(self, other): 195 if other is None: 196 return False 197 198 return self.__dict__ == other.__dict__ 199 200 def __ne__(self, other): 201 return not self == other 202