Skip to content

Commit

Permalink
Adding files for load balancer support (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
mross22 authored Jun 16, 2017
1 parent d43cf4b commit 53c6a10
Show file tree
Hide file tree
Showing 36 changed files with 7,442 additions and 2 deletions.
2 changes: 0 additions & 2 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ Load Balancer

.. autoclass:: Signer

.. autoclass:: ObjectUploadSigner

===========
Utilities
===========
Expand Down
10 changes: 10 additions & 0 deletions oraclebmc/loadbalancer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import


from .load_balancer_client import LoadBalancerClient
from . import models

__all__ = ["LoadBalancerClient", "models"]
1,714 changes: 1,714 additions & 0 deletions oraclebmc/loadbalancer/load_balancer_client.py

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions oraclebmc/loadbalancer/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import

from .backend import Backend
from .backend_details import BackendDetails
from .backend_set import BackendSet
from .backend_set_details import BackendSetDetails
from .certificate import Certificate
from .certificate_details import CertificateDetails
from .create_backend_details import CreateBackendDetails
from .create_backend_set_details import CreateBackendSetDetails
from .create_certificate_details import CreateCertificateDetails
from .create_listener_details import CreateListenerDetails
from .create_load_balancer_details import CreateLoadBalancerDetails
from .health_checker import HealthChecker
from .health_checker_details import HealthCheckerDetails
from .ip_address import IpAddress
from .listener import Listener
from .listener_details import ListenerDetails
from .load_balancer import LoadBalancer
from .load_balancer_policy import LoadBalancerPolicy
from .load_balancer_protocol import LoadBalancerProtocol
from .load_balancer_shape import LoadBalancerShape
from .ssl_configuration import SSLConfiguration
from .ssl_configuration_details import SSLConfigurationDetails
from .session_persistence_configuration_details import SessionPersistenceConfigurationDetails
from .update_backend_details import UpdateBackendDetails
from .update_backend_set_details import UpdateBackendSetDetails
from .update_health_checker_details import UpdateHealthCheckerDetails
from .update_listener_details import UpdateListenerDetails
from .update_load_balancer_details import UpdateLoadBalancerDetails
from .work_request import WorkRequest
from .work_request_error import WorkRequestError

# Maps type names to classes for loadbalancer services.
loadbalancer_type_mapping = {
"Backend": Backend,
"BackendDetails": BackendDetails,
"BackendSet": BackendSet,
"BackendSetDetails": BackendSetDetails,
"Certificate": Certificate,
"CertificateDetails": CertificateDetails,
"CreateBackendDetails": CreateBackendDetails,
"CreateBackendSetDetails": CreateBackendSetDetails,
"CreateCertificateDetails": CreateCertificateDetails,
"CreateListenerDetails": CreateListenerDetails,
"CreateLoadBalancerDetails": CreateLoadBalancerDetails,
"HealthChecker": HealthChecker,
"HealthCheckerDetails": HealthCheckerDetails,
"IpAddress": IpAddress,
"Listener": Listener,
"ListenerDetails": ListenerDetails,
"LoadBalancer": LoadBalancer,
"LoadBalancerPolicy": LoadBalancerPolicy,
"LoadBalancerProtocol": LoadBalancerProtocol,
"LoadBalancerShape": LoadBalancerShape,
"SSLConfiguration": SSLConfiguration,
"SSLConfigurationDetails": SSLConfigurationDetails,
"SessionPersistenceConfigurationDetails": SessionPersistenceConfigurationDetails,
"UpdateBackendDetails": UpdateBackendDetails,
"UpdateBackendSetDetails": UpdateBackendSetDetails,
"UpdateHealthCheckerDetails": UpdateHealthCheckerDetails,
"UpdateListenerDetails": UpdateListenerDetails,
"UpdateLoadBalancerDetails": UpdateLoadBalancerDetails,
"WorkRequest": WorkRequest,
"WorkRequestError": WorkRequestError
}
264 changes: 264 additions & 0 deletions oraclebmc/loadbalancer/models/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.


from ...util import formatted_flat_dict


class Backend(object):

def __init__(self):

self.swagger_types = {
'backup': 'bool',
'drain': 'bool',
'ip_address': 'str',
'name': 'str',
'offline': 'bool',
'port': 'int',
'weight': 'int'
}

self.attribute_map = {
'backup': 'backup',
'drain': 'drain',
'ip_address': 'ipAddress',
'name': 'name',
'offline': 'offline',
'port': 'port',
'weight': 'weight'
}

self._backup = None
self._drain = None
self._ip_address = None
self._name = None
self._offline = None
self._port = None
self._weight = None

@property
def backup(self):
"""
Gets the backup of this Backend.
Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress
traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy.
Example: `true`
:return: The backup of this Backend.
:rtype: bool
"""
return self._backup

@backup.setter
def backup(self, backup):
"""
Sets the backup of this Backend.
Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress
traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy.
Example: `true`
:param backup: The backup of this Backend.
:type: bool
"""
self._backup = backup

@property
def drain(self):
"""
Gets the drain of this Backend.
Whether the load balancer should drain this server. Servers marked \"drain\" receive no new
incoming traffic.
Example: `true`
:return: The drain of this Backend.
:rtype: bool
"""
return self._drain

@drain.setter
def drain(self, drain):
"""
Sets the drain of this Backend.
Whether the load balancer should drain this server. Servers marked \"drain\" receive no new
incoming traffic.
Example: `true`
:param drain: The drain of this Backend.
:type: bool
"""
self._drain = drain

@property
def ip_address(self):
"""
Gets the ip_address of this Backend.
The IP address of the backend server.
Example: `10.10.10.4`
:return: The ip_address of this Backend.
:rtype: str
"""
return self._ip_address

@ip_address.setter
def ip_address(self, ip_address):
"""
Sets the ip_address of this Backend.
The IP address of the backend server.
Example: `10.10.10.4`
:param ip_address: The ip_address of this Backend.
:type: str
"""
self._ip_address = ip_address

@property
def name(self):
"""
Gets the name of this Backend.
A name to uniquely identify this backend server in the backend set.
Example: `My first backend server`
:return: The name of this Backend.
:rtype: str
"""
return self._name

@name.setter
def name(self, name):
"""
Sets the name of this Backend.
A name to uniquely identify this backend server in the backend set.
Example: `My first backend server`
:param name: The name of this Backend.
:type: str
"""
self._name = name

@property
def offline(self):
"""
Gets the offline of this Backend.
Whether the load balancer should treat this server as offline. Offline servers receive no incoming
traffic.
Example: `true`
:return: The offline of this Backend.
:rtype: bool
"""
return self._offline

@offline.setter
def offline(self, offline):
"""
Sets the offline of this Backend.
Whether the load balancer should treat this server as offline. Offline servers receive no incoming
traffic.
Example: `true`
:param offline: The offline of this Backend.
:type: bool
"""
self._offline = offline

@property
def port(self):
"""
Gets the port of this Backend.
The communication port for the backend server.
Example: `8080`
:return: The port of this Backend.
:rtype: int
"""
return self._port

@port.setter
def port(self, port):
"""
Sets the port of this Backend.
The communication port for the backend server.
Example: `8080`
:param port: The port of this Backend.
:type: int
"""
self._port = port

@property
def weight(self):
"""
Gets the weight of this Backend.
The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger
proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections
as a server weighted '1'.
For more information on load balancing policies, see
`How Load Balancing Policies Work`__.
Example: `3`
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm
:return: The weight of this Backend.
:rtype: int
"""
return self._weight

@weight.setter
def weight(self, weight):
"""
Sets the weight of this Backend.
The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger
proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections
as a server weighted '1'.
For more information on load balancing policies, see
`How Load Balancing Policies Work`__.
Example: `3`
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm
:param weight: The weight of this Backend.
:type: int
"""
self._weight = weight

def __repr__(self):
return formatted_flat_dict(self)

def __eq__(self, other):
if other is None:
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
return not self == other
Loading

0 comments on commit 53c6a10

Please sign in to comment.