|
| 1 | +# coding: utf-8 |
| 2 | +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
| 3 | + |
| 4 | + |
| 5 | +from ...util import formatted_flat_dict |
| 6 | + |
| 7 | + |
| 8 | +class Backend(object): |
| 9 | + |
| 10 | + def __init__(self): |
| 11 | + |
| 12 | + self.swagger_types = { |
| 13 | + 'backup': 'bool', |
| 14 | + 'drain': 'bool', |
| 15 | + 'ip_address': 'str', |
| 16 | + 'name': 'str', |
| 17 | + 'offline': 'bool', |
| 18 | + 'port': 'int', |
| 19 | + 'weight': 'int' |
| 20 | + } |
| 21 | + |
| 22 | + self.attribute_map = { |
| 23 | + 'backup': 'backup', |
| 24 | + 'drain': 'drain', |
| 25 | + 'ip_address': 'ipAddress', |
| 26 | + 'name': 'name', |
| 27 | + 'offline': 'offline', |
| 28 | + 'port': 'port', |
| 29 | + 'weight': 'weight' |
| 30 | + } |
| 31 | + |
| 32 | + self._backup = None |
| 33 | + self._drain = None |
| 34 | + self._ip_address = None |
| 35 | + self._name = None |
| 36 | + self._offline = None |
| 37 | + self._port = None |
| 38 | + self._weight = None |
| 39 | + |
| 40 | + @property |
| 41 | + def backup(self): |
| 42 | + """ |
| 43 | + Gets the backup of this Backend. |
| 44 | + Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress |
| 45 | + traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. |
| 46 | +
|
| 47 | + Example: `true` |
| 48 | +
|
| 49 | +
|
| 50 | + :return: The backup of this Backend. |
| 51 | + :rtype: bool |
| 52 | + """ |
| 53 | + return self._backup |
| 54 | + |
| 55 | + @backup.setter |
| 56 | + def backup(self, backup): |
| 57 | + """ |
| 58 | + Sets the backup of this Backend. |
| 59 | + Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress |
| 60 | + traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. |
| 61 | +
|
| 62 | + Example: `true` |
| 63 | +
|
| 64 | +
|
| 65 | + :param backup: The backup of this Backend. |
| 66 | + :type: bool |
| 67 | + """ |
| 68 | + self._backup = backup |
| 69 | + |
| 70 | + @property |
| 71 | + def drain(self): |
| 72 | + """ |
| 73 | + Gets the drain of this Backend. |
| 74 | + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new |
| 75 | + incoming traffic. |
| 76 | +
|
| 77 | + Example: `true` |
| 78 | +
|
| 79 | +
|
| 80 | + :return: The drain of this Backend. |
| 81 | + :rtype: bool |
| 82 | + """ |
| 83 | + return self._drain |
| 84 | + |
| 85 | + @drain.setter |
| 86 | + def drain(self, drain): |
| 87 | + """ |
| 88 | + Sets the drain of this Backend. |
| 89 | + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new |
| 90 | + incoming traffic. |
| 91 | +
|
| 92 | + Example: `true` |
| 93 | +
|
| 94 | +
|
| 95 | + :param drain: The drain of this Backend. |
| 96 | + :type: bool |
| 97 | + """ |
| 98 | + self._drain = drain |
| 99 | + |
| 100 | + @property |
| 101 | + def ip_address(self): |
| 102 | + """ |
| 103 | + Gets the ip_address of this Backend. |
| 104 | + The IP address of the backend server. |
| 105 | +
|
| 106 | + Example: `10.10.10.4` |
| 107 | +
|
| 108 | +
|
| 109 | + :return: The ip_address of this Backend. |
| 110 | + :rtype: str |
| 111 | + """ |
| 112 | + return self._ip_address |
| 113 | + |
| 114 | + @ip_address.setter |
| 115 | + def ip_address(self, ip_address): |
| 116 | + """ |
| 117 | + Sets the ip_address of this Backend. |
| 118 | + The IP address of the backend server. |
| 119 | +
|
| 120 | + Example: `10.10.10.4` |
| 121 | +
|
| 122 | +
|
| 123 | + :param ip_address: The ip_address of this Backend. |
| 124 | + :type: str |
| 125 | + """ |
| 126 | + self._ip_address = ip_address |
| 127 | + |
| 128 | + @property |
| 129 | + def name(self): |
| 130 | + """ |
| 131 | + Gets the name of this Backend. |
| 132 | + A name to uniquely identify this backend server in the backend set. |
| 133 | +
|
| 134 | + Example: `My first backend server` |
| 135 | +
|
| 136 | +
|
| 137 | + :return: The name of this Backend. |
| 138 | + :rtype: str |
| 139 | + """ |
| 140 | + return self._name |
| 141 | + |
| 142 | + @name.setter |
| 143 | + def name(self, name): |
| 144 | + """ |
| 145 | + Sets the name of this Backend. |
| 146 | + A name to uniquely identify this backend server in the backend set. |
| 147 | +
|
| 148 | + Example: `My first backend server` |
| 149 | +
|
| 150 | +
|
| 151 | + :param name: The name of this Backend. |
| 152 | + :type: str |
| 153 | + """ |
| 154 | + self._name = name |
| 155 | + |
| 156 | + @property |
| 157 | + def offline(self): |
| 158 | + """ |
| 159 | + Gets the offline of this Backend. |
| 160 | + Whether the load balancer should treat this server as offline. Offline servers receive no incoming |
| 161 | + traffic. |
| 162 | +
|
| 163 | + Example: `true` |
| 164 | +
|
| 165 | +
|
| 166 | + :return: The offline of this Backend. |
| 167 | + :rtype: bool |
| 168 | + """ |
| 169 | + return self._offline |
| 170 | + |
| 171 | + @offline.setter |
| 172 | + def offline(self, offline): |
| 173 | + """ |
| 174 | + Sets the offline of this Backend. |
| 175 | + Whether the load balancer should treat this server as offline. Offline servers receive no incoming |
| 176 | + traffic. |
| 177 | +
|
| 178 | + Example: `true` |
| 179 | +
|
| 180 | +
|
| 181 | + :param offline: The offline of this Backend. |
| 182 | + :type: bool |
| 183 | + """ |
| 184 | + self._offline = offline |
| 185 | + |
| 186 | + @property |
| 187 | + def port(self): |
| 188 | + """ |
| 189 | + Gets the port of this Backend. |
| 190 | + The communication port for the backend server. |
| 191 | +
|
| 192 | + Example: `8080` |
| 193 | +
|
| 194 | +
|
| 195 | + :return: The port of this Backend. |
| 196 | + :rtype: int |
| 197 | + """ |
| 198 | + return self._port |
| 199 | + |
| 200 | + @port.setter |
| 201 | + def port(self, port): |
| 202 | + """ |
| 203 | + Sets the port of this Backend. |
| 204 | + The communication port for the backend server. |
| 205 | +
|
| 206 | + Example: `8080` |
| 207 | +
|
| 208 | +
|
| 209 | + :param port: The port of this Backend. |
| 210 | + :type: int |
| 211 | + """ |
| 212 | + self._port = port |
| 213 | + |
| 214 | + @property |
| 215 | + def weight(self): |
| 216 | + """ |
| 217 | + Gets the weight of this Backend. |
| 218 | + The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger |
| 219 | + proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections |
| 220 | + as a server weighted '1'. |
| 221 | + For more information on load balancing policies, see |
| 222 | + `How Load Balancing Policies Work`__. |
| 223 | +
|
| 224 | + Example: `3` |
| 225 | +
|
| 226 | + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm |
| 227 | +
|
| 228 | +
|
| 229 | + :return: The weight of this Backend. |
| 230 | + :rtype: int |
| 231 | + """ |
| 232 | + return self._weight |
| 233 | + |
| 234 | + @weight.setter |
| 235 | + def weight(self, weight): |
| 236 | + """ |
| 237 | + Sets the weight of this Backend. |
| 238 | + The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger |
| 239 | + proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections |
| 240 | + as a server weighted '1'. |
| 241 | + For more information on load balancing policies, see |
| 242 | + `How Load Balancing Policies Work`__. |
| 243 | +
|
| 244 | + Example: `3` |
| 245 | +
|
| 246 | + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm |
| 247 | +
|
| 248 | +
|
| 249 | + :param weight: The weight of this Backend. |
| 250 | + :type: int |
| 251 | + """ |
| 252 | + self._weight = weight |
| 253 | + |
| 254 | + def __repr__(self): |
| 255 | + return formatted_flat_dict(self) |
| 256 | + |
| 257 | + def __eq__(self, other): |
| 258 | + if other is None: |
| 259 | + return False |
| 260 | + |
| 261 | + return self.__dict__ == other.__dict__ |
| 262 | + |
| 263 | + def __ne__(self, other): |
| 264 | + return not self == other |
0 commit comments