Skip to content

Commit 53c6a10

Browse files
authored
Adding files for load balancer support (#19)
1 parent d43cf4b commit 53c6a10

36 files changed

+7442
-2
lines changed

docs/api/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ Load Balancer
146146

147147
.. autoclass:: Signer
148148

149-
.. autoclass:: ObjectUploadSigner
150-
151149
===========
152150
Utilities
153151
===========

oraclebmc/loadbalancer/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3+
4+
from __future__ import absolute_import
5+
6+
7+
from .load_balancer_client import LoadBalancerClient
8+
from . import models
9+
10+
__all__ = ["LoadBalancerClient", "models"]

oraclebmc/loadbalancer/load_balancer_client.py

Lines changed: 1714 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3+
4+
from __future__ import absolute_import
5+
6+
from .backend import Backend
7+
from .backend_details import BackendDetails
8+
from .backend_set import BackendSet
9+
from .backend_set_details import BackendSetDetails
10+
from .certificate import Certificate
11+
from .certificate_details import CertificateDetails
12+
from .create_backend_details import CreateBackendDetails
13+
from .create_backend_set_details import CreateBackendSetDetails
14+
from .create_certificate_details import CreateCertificateDetails
15+
from .create_listener_details import CreateListenerDetails
16+
from .create_load_balancer_details import CreateLoadBalancerDetails
17+
from .health_checker import HealthChecker
18+
from .health_checker_details import HealthCheckerDetails
19+
from .ip_address import IpAddress
20+
from .listener import Listener
21+
from .listener_details import ListenerDetails
22+
from .load_balancer import LoadBalancer
23+
from .load_balancer_policy import LoadBalancerPolicy
24+
from .load_balancer_protocol import LoadBalancerProtocol
25+
from .load_balancer_shape import LoadBalancerShape
26+
from .ssl_configuration import SSLConfiguration
27+
from .ssl_configuration_details import SSLConfigurationDetails
28+
from .session_persistence_configuration_details import SessionPersistenceConfigurationDetails
29+
from .update_backend_details import UpdateBackendDetails
30+
from .update_backend_set_details import UpdateBackendSetDetails
31+
from .update_health_checker_details import UpdateHealthCheckerDetails
32+
from .update_listener_details import UpdateListenerDetails
33+
from .update_load_balancer_details import UpdateLoadBalancerDetails
34+
from .work_request import WorkRequest
35+
from .work_request_error import WorkRequestError
36+
37+
# Maps type names to classes for loadbalancer services.
38+
loadbalancer_type_mapping = {
39+
"Backend": Backend,
40+
"BackendDetails": BackendDetails,
41+
"BackendSet": BackendSet,
42+
"BackendSetDetails": BackendSetDetails,
43+
"Certificate": Certificate,
44+
"CertificateDetails": CertificateDetails,
45+
"CreateBackendDetails": CreateBackendDetails,
46+
"CreateBackendSetDetails": CreateBackendSetDetails,
47+
"CreateCertificateDetails": CreateCertificateDetails,
48+
"CreateListenerDetails": CreateListenerDetails,
49+
"CreateLoadBalancerDetails": CreateLoadBalancerDetails,
50+
"HealthChecker": HealthChecker,
51+
"HealthCheckerDetails": HealthCheckerDetails,
52+
"IpAddress": IpAddress,
53+
"Listener": Listener,
54+
"ListenerDetails": ListenerDetails,
55+
"LoadBalancer": LoadBalancer,
56+
"LoadBalancerPolicy": LoadBalancerPolicy,
57+
"LoadBalancerProtocol": LoadBalancerProtocol,
58+
"LoadBalancerShape": LoadBalancerShape,
59+
"SSLConfiguration": SSLConfiguration,
60+
"SSLConfigurationDetails": SSLConfigurationDetails,
61+
"SessionPersistenceConfigurationDetails": SessionPersistenceConfigurationDetails,
62+
"UpdateBackendDetails": UpdateBackendDetails,
63+
"UpdateBackendSetDetails": UpdateBackendSetDetails,
64+
"UpdateHealthCheckerDetails": UpdateHealthCheckerDetails,
65+
"UpdateListenerDetails": UpdateListenerDetails,
66+
"UpdateLoadBalancerDetails": UpdateLoadBalancerDetails,
67+
"WorkRequest": WorkRequest,
68+
"WorkRequestError": WorkRequestError
69+
}
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
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

Comments
 (0)