diff --git a/docs/api/index.rst b/docs/api/index.rst index c5c63a9550..0996fb3a69 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -146,8 +146,6 @@ Load Balancer .. autoclass:: Signer -.. autoclass:: ObjectUploadSigner - =========== Utilities =========== diff --git a/oraclebmc/loadbalancer/__init__.py b/oraclebmc/loadbalancer/__init__.py new file mode 100644 index 0000000000..998e26060a --- /dev/null +++ b/oraclebmc/loadbalancer/__init__.py @@ -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"] diff --git a/oraclebmc/loadbalancer/load_balancer_client.py b/oraclebmc/loadbalancer/load_balancer_client.py new file mode 100644 index 0000000000..9575bd2133 --- /dev/null +++ b/oraclebmc/loadbalancer/load_balancer_client.py @@ -0,0 +1,1714 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + +from __future__ import absolute_import + +import six + +from ..base_client import BaseClient +from ..config import get_config_value_or_default, validate_config +from ..signer import Signer +from ..util import Sentinel +from .models import loadbalancer_type_mapping +missing = Sentinel("Missing") + + +class LoadBalancerClient(object): + + def __init__(self, config): + validate_config(config) + signer = Signer( + tenancy=config["tenancy"], + user=config["user"], + fingerprint=config["fingerprint"], + private_key_file_location=config["key_file"], + pass_phrase=get_config_value_or_default(config, "pass_phrase") + ) + self.base_client = BaseClient("load_balancer", config, signer, loadbalancer_type_mapping) + + def create_backend(self, create_backend_details, load_balancer_id, backend_set_name, **kwargs): + """ + CreateBackend + Adds a backend server to a backend set. + + + :param CreateBackendDetails create_backend_details: (required) + The details to add a backend server to a backend set. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set and servers. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set to add the backend server to. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_backend got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=create_backend_details) + + def create_backend_set(self, create_backend_set_details, load_balancer_id, **kwargs): + """ + CreateBackendSet + Adds a backend set to a load balancer. + + + :param CreateBackendSetDetails create_backend_set_details: (required) + The details for adding a backend set. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer on which to add a backend set. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_backend_set got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=create_backend_set_details) + + def create_certificate(self, create_certificate_details, load_balancer_id, **kwargs): + """ + CreateCertificate + Creates an asynchronous request to add an SSL certificate. + + + :param CreateCertificateDetails create_certificate_details: (required) + The details of the certificate to add. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer on which to add the certificate. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/certificates" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_certificate got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=create_certificate_details) + + def create_listener(self, create_listener_details, load_balancer_id, **kwargs): + """ + CreateListener + Adds a listener to a load balancer. + + + :param CreateListenerDetails create_listener_details: (required) + Details to add a listener. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer on which to add a listener. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/listeners" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_listener got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=create_listener_details) + + def create_load_balancer(self, create_load_balancer_details, **kwargs): + """ + CreateLoadBalancer + Creates a new load balancer in the specified compartment. For general information about load balancers, + see `Overview of the Load Balancing Service`__. + + For the purposes of access control, you must provide the OCID of the compartment where you want + the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN + or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN. + For information about access control and compartments, see + `Overview of the IAM Service`__. + + You must specify a display name for the load balancer. It does not have to be unique, and you can change it. + + For information about Availability Domains, see + `Regions and Availability Domains`__. + To get a list of Availability Domains, use the `ListAvailabilityDomains` operation + in the Identity and Access Management Service API. + + All Oracle Bare Metal Cloud Services resources, including load balancers, get an Oracle-assigned, + unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID + in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, + or by viewing the resource in the Console. Fore more information, see + `Resource Identifiers`__. + + After you send your request, the new object's state will temporarily be PROVISIONING. Before using the + object, first make sure its state has changed to RUNNING. + + When you create a load balancer, the system assigns an IP address. + To get the IP address, use the :func:`get_load_balancer` operation. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Concepts/balanceoverview.htm + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param CreateLoadBalancerDetails create_load_balancer_details: (required) + The configuration details for creating a load balancer. + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers" + method = "POST" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "create_load_balancer got unknown kwargs: {!r}".format(extra_kwargs)) + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_load_balancer_details) + + def delete_backend(self, load_balancer_id, backend_set_name, backend_name, **kwargs): + """ + DeleteBackend + Removes a backend server from a given load balancer and backend set. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set and server. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set associated with the backend server. + + Example: `My backend set` + + :param str backend_name: (required) + The name of the backend server to remove. + + Example: `My backend server` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_backend got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name, + "backendName": backend_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def delete_backend_set(self, load_balancer_id, backend_set_name, **kwargs): + """ + DeleteBackendSet + Deletes the specified backend set. Note that deleting a backend set removes its backend servers from the load balancer. + + Before you can delete a backend set, you must remove it from any active listeners. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set to delete. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_backend_set got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def delete_certificate(self, load_balancer_id, certificate_name, **kwargs): + """ + DeleteCertificate + Deletes an SSL certificate from a load balancer. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the certificate to be deleted. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str certificate_name: (required) + The name of the certificate to delete. + + Example: `My certificate` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/certificates/{certificateName}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_certificate got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "certificateName": certificate_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def delete_listener(self, load_balancer_id, listener_name, **kwargs): + """ + DeleteListener + Deletes a listener from a load balancer. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the listener to delete. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str listener_name: (required) + The name of the listener to delete. + + Example: `My listener` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/listeners/{listenerName}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_listener got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "listenerName": listener_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def delete_load_balancer(self, load_balancer_id, **kwargs): + """ + DeleteLoadBalancer + Stops a load balancer and removes it from service. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer to delete. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}" + method = "DELETE" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "delete_load_balancer got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params) + + def get_backend(self, load_balancer_id, backend_set_name, backend_name, **kwargs): + """ + GetBackend + Gets the specified backend server's configuration information. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set and server. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set that includes the backend server. + + Example: `My backend set` + + :param str backend_name: (required) + The name of the backend server to retrieve. + + Example: `My backend server` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type Backend + :rtype: Backend + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_backend got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name, + "backendName": backend_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="Backend") + + def get_backend_set(self, load_balancer_id, backend_set_name, **kwargs): + """ + GetBackendSet + Gets the specified backend set's configuration information. + + + :param str load_balancer_id: (required) + The `OCID`__ of the specified load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set to retrieve. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type BackendSet + :rtype: BackendSet + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_backend_set got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="BackendSet") + + def get_health_checker(self, load_balancer_id, backend_set_name, **kwargs): + """ + GetHealthChecker + Gets the health check policy information for a given load balancer and backend set. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the health check policy to be retrieved. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend associated with the health check policy to be retrieved. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type HealthChecker + :rtype: HealthChecker + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_health_checker got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="HealthChecker") + + def get_load_balancer(self, load_balancer_id, **kwargs): + """ + GetLoadBalancer + Gets the specified load balancer's configuration information. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer to retrieve. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type LoadBalancer + :rtype: LoadBalancer + """ + resource_path = "/loadBalancers/{loadBalancerId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_load_balancer got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="LoadBalancer") + + def get_work_request(self, work_request_id, **kwargs): + """ + GetWorkRequest + Gets the details of a work request. + + + :param str work_request_id: (required) + The `OCID`__ of the work request to retrieve. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type WorkRequest + :rtype: WorkRequest + """ + resource_path = "/loadBalancerWorkRequests/{workRequestId}" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "get_work_request got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "workRequestId": work_request_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="WorkRequest") + + def list_backend_sets(self, load_balancer_id, **kwargs): + """ + ListBackendSets + Lists all backend sets associated with a given load balancer. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend sets to retrieve. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type list[BackendSet] + :rtype: list[BackendSet] + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_backend_sets got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="list[BackendSet]") + + def list_backends(self, load_balancer_id, backend_set_name, **kwargs): + """ + ListBackends + Lists the backend servers for a given load balancer and backend set. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set and servers. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set associated with the backend servers. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type list[Backend] + :rtype: list[Backend] + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_backends got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="list[Backend]") + + def list_certificates(self, load_balancer_id, **kwargs): + """ + ListCertificates + Lists all SSL certificates associated with a given load balancer. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the certificates to be listed. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :return: A Response object with data of type list[Certificate] + :rtype: list[Certificate] + """ + resource_path = "/loadBalancers/{loadBalancerId}/certificates" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_certificates got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="list[Certificate]") + + def list_load_balancers(self, compartment_id, **kwargs): + """ + ListLoadBalancers + Lists all load balancers in the specified compartment. + + + :param str compartment_id: (required) + The `OCID`__ of the compartment containing the load balancers to list. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + Example: `500` + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + Example: `3` + + :param str detail: (optional) + The level of detail to return for each result. Can be `full` or `simple`. + + Example: `full` + + :return: A Response object with data of type list[LoadBalancer] + :rtype: list[LoadBalancer] + """ + resource_path = "/loadBalancers" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "limit", + "page", + "detail" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_load_balancers got unknown kwargs: {!r}".format(extra_kwargs)) + + query_params = { + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "compartmentId": compartment_id, + "detail": kwargs.get("detail", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[LoadBalancer]") + + def list_policies(self, compartment_id, **kwargs): + """ + ListPolicies + Lists the available load balancer policies. + + + :param str compartment_id: (required) + The `OCID`__ of the compartment containing the load balancer policies to list. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + Example: `500` + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + Example: `3` + + :return: A Response object with data of type list[LoadBalancerPolicy] + :rtype: list[LoadBalancerPolicy] + """ + resource_path = "/loadBalancerPolicies" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "limit", + "page" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_policies got unknown kwargs: {!r}".format(extra_kwargs)) + + query_params = { + "compartmentId": compartment_id, + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[LoadBalancerPolicy]") + + def list_protocols(self, compartment_id, **kwargs): + """ + ListProtocols + Lists all supported traffic protocols. + + + :param str compartment_id: (required) + The `OCID`__ of the compartment containing the load balancer protocols to list. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + Example: `500` + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + Example: `3` + + :return: A Response object with data of type list[LoadBalancerProtocol] + :rtype: list[LoadBalancerProtocol] + """ + resource_path = "/loadBalancerProtocols" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "limit", + "page" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_protocols got unknown kwargs: {!r}".format(extra_kwargs)) + + query_params = { + "compartmentId": compartment_id, + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[LoadBalancerProtocol]") + + def list_shapes(self, compartment_id, **kwargs): + """ + ListShapes + Lists the valid load balancer shapes. + + + :param str compartment_id: (required) + The `OCID`__ of the compartment containing the load balancer shapes to list. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + Example: `500` + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + Example: `3` + + :return: A Response object with data of type list[LoadBalancerShape] + :rtype: list[LoadBalancerShape] + """ + resource_path = "/loadBalancerShapes" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "limit", + "page" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_shapes got unknown kwargs: {!r}".format(extra_kwargs)) + + query_params = { + "compartmentId": compartment_id, + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="list[LoadBalancerShape]") + + def list_work_requests(self, load_balancer_id, **kwargs): + """ + ListWorkRequests + Lists the work requests for a given load balancer. + + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the work requests to retrieve. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param int limit: (optional) + The maximum number of items to return in a paginated \"List\" call. + + Example: `500` + + :param str page: (optional) + The value of the `opc-next-page` response header from the previous \"List\" call. + + Example: `3` + + :return: A Response object with data of type list[WorkRequest] + :rtype: list[WorkRequest] + """ + resource_path = "/loadBalancers/{loadBalancerId}/workRequests" + method = "GET" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "limit", + "page" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "list_work_requests got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + query_params = { + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="list[WorkRequest]") + + def update_backend(self, update_backend_details, load_balancer_id, backend_set_name, backend_name, **kwargs): + """ + UpdateBackend + Updates the configuration of a backend server within the specified backend set. + + + :param UpdateBackendDetails update_backend_details: (required) + Details for updating a backend server. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set and server. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set associated with the backend server. + + Example: `My backend set` + + :param str backend_name: (required) + The name of the backend server to update. + + Example: `My backend server` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/backends/{backendName}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_backend got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name, + "backendName": backend_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_backend_details) + + def update_backend_set(self, update_backend_set_details, load_balancer_id, backend_set_name, **kwargs): + """ + UpdateBackendSet + Updates a backend set. + + + :param UpdateBackendSetDetails update_backend_set_details: (required) + The details to update a backend set. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the backend set. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set to update. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_backend_set got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_backend_set_details) + + def update_health_checker(self, health_checker, load_balancer_id, backend_set_name, **kwargs): + """ + UpdateHealthChecker + Updates the health check policy for a given load balancer and backend set. + + + :param UpdateHealthCheckerDetails health_checker: (required) + The health check policy configuration details. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the health check policy to be updated. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str backend_set_name: (required) + The name of the backend set associated with the health check policy to be retrieved. + + Example: `My backend set` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/backendSets/{backendSetName}/healthChecker" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_health_checker got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "backendSetName": backend_set_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=health_checker) + + def update_listener(self, update_listener_details, load_balancer_id, listener_name, **kwargs): + """ + UpdateListener + Updates a listener for a given load balancer. + + + :param UpdateListenerDetails update_listener_details: (required) + Details to update a listener. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer associated with the listener to update. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str listener_name: (required) + The name of the listener to update. + + Example: `My listener` + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}/listeners/{listenerName}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_listener got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id, + "listenerName": listener_name + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_listener_details) + + def update_load_balancer(self, update_load_balancer_details, load_balancer_id, **kwargs): + """ + UpdateLoadBalancer + Updates a load balancer's configuration. + + + :param UpdateLoadBalancerDetails update_load_balancer_details: (required) + The details for updating a load balancer's configuration. + + :param str load_balancer_id: (required) + The `OCID`__ of the load balancer to update. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + A token that uniquely identifies a request so it can be retried in case of a timeout or + server error without risk of executing that same action again. Retry tokens expire after 24 + hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + has been deleted and purged from the system, then a retry of the original creation request + may be rejected). + + :return: A Response object with data of type None + :rtype: None + """ + resource_path = "/loadBalancers/{loadBalancerId}" + method = "PUT" + + # Don't accept unknown kwargs + expected_kwargs = [ + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + "update_load_balancer got unknown kwargs: {!r}".format(extra_kwargs)) + + path_params = { + "loadBalancerId": load_balancer_id + } + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing} + + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_load_balancer_details) diff --git a/oraclebmc/loadbalancer/models/__init__.py b/oraclebmc/loadbalancer/models/__init__.py new file mode 100644 index 0000000000..f7f6fa3d29 --- /dev/null +++ b/oraclebmc/loadbalancer/models/__init__.py @@ -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 +} diff --git a/oraclebmc/loadbalancer/models/backend.py b/oraclebmc/loadbalancer/models/backend.py new file mode 100644 index 0000000000..cb214b9f76 --- /dev/null +++ b/oraclebmc/loadbalancer/models/backend.py @@ -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 diff --git a/oraclebmc/loadbalancer/models/backend_details.py b/oraclebmc/loadbalancer/models/backend_details.py new file mode 100644 index 0000000000..22949b55e1 --- /dev/null +++ b/oraclebmc/loadbalancer/models/backend_details.py @@ -0,0 +1,233 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class BackendDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backup': 'bool', + 'drain': 'bool', + 'ip_address': 'str', + 'offline': 'bool', + 'port': 'int', + 'weight': 'int' + } + + self.attribute_map = { + 'backup': 'backup', + 'drain': 'drain', + 'ip_address': 'ipAddress', + 'offline': 'offline', + 'port': 'port', + 'weight': 'weight' + } + + self._backup = None + self._drain = None + self._ip_address = None + self._offline = None + self._port = None + self._weight = None + + @property + def backup(self): + """ + Gets the backup of this BackendDetails. + 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 BackendDetails. + :rtype: bool + """ + return self._backup + + @backup.setter + def backup(self, backup): + """ + Sets the backup of this BackendDetails. + 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 BackendDetails. + :type: bool + """ + self._backup = backup + + @property + def drain(self): + """ + Gets the drain of this BackendDetails. + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + incoming traffic. + + Example: `true` + + + :return: The drain of this BackendDetails. + :rtype: bool + """ + return self._drain + + @drain.setter + def drain(self, drain): + """ + Sets the drain of this BackendDetails. + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + incoming traffic. + + Example: `true` + + + :param drain: The drain of this BackendDetails. + :type: bool + """ + self._drain = drain + + @property + def ip_address(self): + """ + Gets the ip_address of this BackendDetails. + The IP address of the backend server. + + Example: `10.10.10.4` + + + :return: The ip_address of this BackendDetails. + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """ + Sets the ip_address of this BackendDetails. + The IP address of the backend server. + + Example: `10.10.10.4` + + + :param ip_address: The ip_address of this BackendDetails. + :type: str + """ + self._ip_address = ip_address + + @property + def offline(self): + """ + Gets the offline of this BackendDetails. + Whether the load balancer should treat this server as offline. Offline servers receive no incoming + traffic. + + Example: `true` + + + :return: The offline of this BackendDetails. + :rtype: bool + """ + return self._offline + + @offline.setter + def offline(self, offline): + """ + Sets the offline of this BackendDetails. + Whether the load balancer should treat this server as offline. Offline servers receive no incoming + traffic. + + Example: `true` + + + :param offline: The offline of this BackendDetails. + :type: bool + """ + self._offline = offline + + @property + def port(self): + """ + Gets the port of this BackendDetails. + The communication port for the backend server. + + Example: `8080` + + + :return: The port of this BackendDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this BackendDetails. + The communication port for the backend server. + + Example: `8080` + + + :param port: The port of this BackendDetails. + :type: int + """ + self._port = port + + @property + def weight(self): + """ + Gets the weight of this BackendDetails. + 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 BackendDetails. + :rtype: int + """ + return self._weight + + @weight.setter + def weight(self, weight): + """ + Sets the weight of this BackendDetails. + 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 BackendDetails. + :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 diff --git a/oraclebmc/loadbalancer/models/backend_health.py b/oraclebmc/loadbalancer/models/backend_health.py new file mode 100644 index 0000000000..5ec609bd3d --- /dev/null +++ b/oraclebmc/loadbalancer/models/backend_health.py @@ -0,0 +1,178 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class BackendHealth(object): + + def __init__(self): + + self.swagger_types = { + 'instance_id': 'str', + 'is_healthy': 'bool', + 'last_health_check_result': 'str', + 'subnet_id': 'str', + 'time_updated': 'datetime' + } + + self.attribute_map = { + 'instance_id': 'instanceId', + 'is_healthy': 'isHealthy', + 'last_health_check_result': 'lastHealthCheckResult', + 'subnet_id': 'subnetId', + 'time_updated': 'timeUpdated' + } + + self._instance_id = None + self._is_healthy = None + self._last_health_check_result = None + self._subnet_id = None + self._time_updated = None + + @property + def instance_id(self): + """ + Gets the instance_id of this BackendHealth. + A unique identifier to be used primarily for determining same-subnet instances apart. + + + :return: The instance_id of this BackendHealth. + :rtype: str + """ + return self._instance_id + + @instance_id.setter + def instance_id(self, instance_id): + """ + Sets the instance_id of this BackendHealth. + A unique identifier to be used primarily for determining same-subnet instances apart. + + + :param instance_id: The instance_id of this BackendHealth. + :type: str + """ + self._instance_id = instance_id + + @property + def is_healthy(self): + """ + Gets the is_healthy of this BackendHealth. + Interprets the healthCheckResult value to true or false. + + Example: `true` + + + :return: The is_healthy of this BackendHealth. + :rtype: bool + """ + return self._is_healthy + + @is_healthy.setter + def is_healthy(self, is_healthy): + """ + Sets the is_healthy of this BackendHealth. + Interprets the healthCheckResult value to true or false. + + Example: `true` + + + :param is_healthy: The is_healthy of this BackendHealth. + :type: bool + """ + self._is_healthy = is_healthy + + @property + def last_health_check_result(self): + """ + Gets the last_health_check_result of this BackendHealth. + The result of the last fetched health check. + + Allowed values for this property are: "OK", "INVALID_STATUS_CODE", "TIMED_OUT", "REGEX_MISMATCH", "CONNECT_FAILURE", "IO_ERROR", "OFFLINE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The last_health_check_result of this BackendHealth. + :rtype: str + """ + return self._last_health_check_result + + @last_health_check_result.setter + def last_health_check_result(self, last_health_check_result): + """ + Sets the last_health_check_result of this BackendHealth. + The result of the last fetched health check. + + + :param last_health_check_result: The last_health_check_result of this BackendHealth. + :type: str + """ + allowed_values = ["OK", "INVALID_STATUS_CODE", "TIMED_OUT", "REGEX_MISMATCH", "CONNECT_FAILURE", "IO_ERROR", "OFFLINE"] + if last_health_check_result not in allowed_values: + last_health_check_result = 'UNKNOWN_ENUM_VALUE' + self._last_health_check_result = last_health_check_result + + @property + def subnet_id(self): + """ + Gets the subnet_id of this BackendHealth. + The ocid of the specific subnet that this health status comes from. + + + :return: The subnet_id of this BackendHealth. + :rtype: str + """ + return self._subnet_id + + @subnet_id.setter + def subnet_id(self, subnet_id): + """ + Sets the subnet_id of this BackendHealth. + The ocid of the specific subnet that this health status comes from. + + + :param subnet_id: The subnet_id of this BackendHealth. + :type: str + """ + self._subnet_id = subnet_id + + @property + def time_updated(self): + """ + Gets the time_updated of this BackendHealth. + A timestamp of the last time this data was fetched. + + Example: `2016-07-11T14:58:10` + + + :return: The time_updated of this BackendHealth. + :rtype: datetime + """ + return self._time_updated + + @time_updated.setter + def time_updated(self, time_updated): + """ + Sets the time_updated of this BackendHealth. + A timestamp of the last time this data was fetched. + + Example: `2016-07-11T14:58:10` + + + :param time_updated: The time_updated of this BackendHealth. + :type: datetime + """ + self._time_updated = time_updated + + 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 diff --git a/oraclebmc/loadbalancer/models/backend_set.py b/oraclebmc/loadbalancer/models/backend_set.py new file mode 100644 index 0000000000..4657354fa5 --- /dev/null +++ b/oraclebmc/loadbalancer/models/backend_set.py @@ -0,0 +1,187 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class BackendSet(object): + + def __init__(self): + + self.swagger_types = { + 'backends': 'list[Backend]', + 'health_checker': 'HealthChecker', + 'name': 'str', + 'policy': 'str', + 'session_persistence_configuration': 'SessionPersistenceConfigurationDetails', + 'ssl_configuration': 'SSLConfiguration' + } + + self.attribute_map = { + 'backends': 'backends', + 'health_checker': 'healthChecker', + 'name': 'name', + 'policy': 'policy', + 'session_persistence_configuration': 'sessionPersistenceConfiguration', + 'ssl_configuration': 'sslConfiguration' + } + + self._backends = None + self._health_checker = None + self._name = None + self._policy = None + self._session_persistence_configuration = None + self._ssl_configuration = None + + @property + def backends(self): + """ + Gets the backends of this BackendSet. + + :return: The backends of this BackendSet. + :rtype: list[Backend] + """ + return self._backends + + @backends.setter + def backends(self, backends): + """ + Sets the backends of this BackendSet. + + :param backends: The backends of this BackendSet. + :type: list[Backend] + """ + self._backends = backends + + @property + def health_checker(self): + """ + Gets the health_checker of this BackendSet. + + :return: The health_checker of this BackendSet. + :rtype: HealthChecker + """ + return self._health_checker + + @health_checker.setter + def health_checker(self, health_checker): + """ + Sets the health_checker of this BackendSet. + + :param health_checker: The health_checker of this BackendSet. + :type: HealthChecker + """ + self._health_checker = health_checker + + @property + def name(self): + """ + Gets the name of this BackendSet. + A friendly name for the backend set. It must be unique and it cannot be changed. + + Example: `My backend set` + + + :return: The name of this BackendSet. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this BackendSet. + A friendly name for the backend set. It must be unique and it cannot be changed. + + Example: `My backend set` + + + :param name: The name of this BackendSet. + :type: str + """ + self._name = name + + @property + def policy(self): + """ + Gets the policy of this BackendSet. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` + operation. + + Example: `LEAST_CONNECTIONS` + + + :return: The policy of this BackendSet. + :rtype: str + """ + return self._policy + + @policy.setter + def policy(self, policy): + """ + Sets the policy of this BackendSet. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` + operation. + + Example: `LEAST_CONNECTIONS` + + + :param policy: The policy of this BackendSet. + :type: str + """ + self._policy = policy + + @property + def session_persistence_configuration(self): + """ + Gets the session_persistence_configuration of this BackendSet. + + :return: The session_persistence_configuration of this BackendSet. + :rtype: SessionPersistenceConfigurationDetails + """ + return self._session_persistence_configuration + + @session_persistence_configuration.setter + def session_persistence_configuration(self, session_persistence_configuration): + """ + Sets the session_persistence_configuration of this BackendSet. + + :param session_persistence_configuration: The session_persistence_configuration of this BackendSet. + :type: SessionPersistenceConfigurationDetails + """ + self._session_persistence_configuration = session_persistence_configuration + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this BackendSet. + + :return: The ssl_configuration of this BackendSet. + :rtype: SSLConfiguration + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this BackendSet. + + :param ssl_configuration: The ssl_configuration of this BackendSet. + :type: SSLConfiguration + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/backend_set_details.py b/oraclebmc/loadbalancer/models/backend_set_details.py new file mode 100644 index 0000000000..8697003b73 --- /dev/null +++ b/oraclebmc/loadbalancer/models/backend_set_details.py @@ -0,0 +1,156 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class BackendSetDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backends': 'list[BackendDetails]', + 'health_checker': 'HealthCheckerDetails', + 'policy': 'str', + 'session_persistence_configuration': 'SessionPersistenceConfigurationDetails', + 'ssl_configuration': 'SSLConfigurationDetails' + } + + self.attribute_map = { + 'backends': 'backends', + 'health_checker': 'healthChecker', + 'policy': 'policy', + 'session_persistence_configuration': 'sessionPersistenceConfiguration', + 'ssl_configuration': 'sslConfiguration' + } + + self._backends = None + self._health_checker = None + self._policy = None + self._session_persistence_configuration = None + self._ssl_configuration = None + + @property + def backends(self): + """ + Gets the backends of this BackendSetDetails. + + :return: The backends of this BackendSetDetails. + :rtype: list[BackendDetails] + """ + return self._backends + + @backends.setter + def backends(self, backends): + """ + Sets the backends of this BackendSetDetails. + + :param backends: The backends of this BackendSetDetails. + :type: list[BackendDetails] + """ + self._backends = backends + + @property + def health_checker(self): + """ + Gets the health_checker of this BackendSetDetails. + + :return: The health_checker of this BackendSetDetails. + :rtype: HealthCheckerDetails + """ + return self._health_checker + + @health_checker.setter + def health_checker(self, health_checker): + """ + Sets the health_checker of this BackendSetDetails. + + :param health_checker: The health_checker of this BackendSetDetails. + :type: HealthCheckerDetails + """ + self._health_checker = health_checker + + @property + def policy(self): + """ + Gets the policy of this BackendSetDetails. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` + operation. + + Example: `LEAST_CONNECTIONS` + + + :return: The policy of this BackendSetDetails. + :rtype: str + """ + return self._policy + + @policy.setter + def policy(self, policy): + """ + Sets the policy of this BackendSetDetails. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` + operation. + + Example: `LEAST_CONNECTIONS` + + + :param policy: The policy of this BackendSetDetails. + :type: str + """ + self._policy = policy + + @property + def session_persistence_configuration(self): + """ + Gets the session_persistence_configuration of this BackendSetDetails. + + :return: The session_persistence_configuration of this BackendSetDetails. + :rtype: SessionPersistenceConfigurationDetails + """ + return self._session_persistence_configuration + + @session_persistence_configuration.setter + def session_persistence_configuration(self, session_persistence_configuration): + """ + Sets the session_persistence_configuration of this BackendSetDetails. + + :param session_persistence_configuration: The session_persistence_configuration of this BackendSetDetails. + :type: SessionPersistenceConfigurationDetails + """ + self._session_persistence_configuration = session_persistence_configuration + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this BackendSetDetails. + + :return: The ssl_configuration of this BackendSetDetails. + :rtype: SSLConfigurationDetails + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this BackendSetDetails. + + :param ssl_configuration: The ssl_configuration of this BackendSetDetails. + :type: SSLConfigurationDetails + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/backend_set_health.py b/oraclebmc/loadbalancer/models/backend_set_health.py new file mode 100644 index 0000000000..797db3b782 --- /dev/null +++ b/oraclebmc/loadbalancer/models/backend_set_health.py @@ -0,0 +1,83 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class BackendSetHealth(object): + + def __init__(self): + + self.swagger_types = { + 'is_healthy': 'bool', + 'unhealthy_backends': 'list[str]' + } + + self.attribute_map = { + 'is_healthy': 'isHealthy', + 'unhealthy_backends': 'unhealthyBackends' + } + + self._is_healthy = None + self._unhealthy_backends = None + + @property + def is_healthy(self): + """ + Gets the is_healthy of this BackendSetHealth. + A healthy/unhealthy boolean to quickly describe backend set health. + + + :return: The is_healthy of this BackendSetHealth. + :rtype: bool + """ + return self._is_healthy + + @is_healthy.setter + def is_healthy(self, is_healthy): + """ + Sets the is_healthy of this BackendSetHealth. + A healthy/unhealthy boolean to quickly describe backend set health. + + + :param is_healthy: The is_healthy of this BackendSetHealth. + :type: bool + """ + self._is_healthy = is_healthy + + @property + def unhealthy_backends(self): + """ + Gets the unhealthy_backends of this BackendSetHealth. + A list of unhealthy backend identifiers. + + + :return: The unhealthy_backends of this BackendSetHealth. + :rtype: list[str] + """ + return self._unhealthy_backends + + @unhealthy_backends.setter + def unhealthy_backends(self, unhealthy_backends): + """ + Sets the unhealthy_backends of this BackendSetHealth. + A list of unhealthy backend identifiers. + + + :param unhealthy_backends: The unhealthy_backends of this BackendSetHealth. + :type: list[str] + """ + self._unhealthy_backends = unhealthy_backends + + 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 diff --git a/oraclebmc/loadbalancer/models/certificate.py b/oraclebmc/loadbalancer/models/certificate.py new file mode 100644 index 0000000000..cf19148c9c --- /dev/null +++ b/oraclebmc/loadbalancer/models/certificate.py @@ -0,0 +1,154 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class Certificate(object): + + def __init__(self): + + self.swagger_types = { + 'ca_certificate': 'str', + 'certificate_name': 'str', + 'public_certificate': 'str' + } + + self.attribute_map = { + 'ca_certificate': 'caCertificate', + 'certificate_name': 'certificateName', + 'public_certificate': 'publicCertificate' + } + + self._ca_certificate = None + self._certificate_name = None + self._public_certificate = None + + @property + def ca_certificate(self): + """ + Gets the ca_certificate of this Certificate. + The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + ... + -----END CERTIFICATE----- + + + :return: The ca_certificate of this Certificate. + :rtype: str + """ + return self._ca_certificate + + @ca_certificate.setter + def ca_certificate(self, ca_certificate): + """ + Sets the ca_certificate of this Certificate. + The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + ... + -----END CERTIFICATE----- + + + :param ca_certificate: The ca_certificate of this Certificate. + :type: str + """ + self._ca_certificate = ca_certificate + + @property + def certificate_name(self): + """ + Gets the certificate_name of this Certificate. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :return: The certificate_name of this Certificate. + :rtype: str + """ + return self._certificate_name + + @certificate_name.setter + def certificate_name(self, certificate_name): + """ + Sets the certificate_name of this Certificate. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :param certificate_name: The certificate_name of this Certificate. + :type: str + """ + self._certificate_name = certificate_name + + @property + def public_certificate(self): + """ + Gets the public_certificate of this Certificate. + The public certificate, in PEM format, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + ... + -----END CERTIFICATE----- + + + :return: The public_certificate of this Certificate. + :rtype: str + """ + return self._public_certificate + + @public_certificate.setter + def public_certificate(self, public_certificate): + """ + Sets the public_certificate of this Certificate. + The public certificate, in PEM format, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + ... + -----END CERTIFICATE----- + + + :param public_certificate: The public_certificate of this Certificate. + :type: str + """ + self._public_certificate = public_certificate + + 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 diff --git a/oraclebmc/loadbalancer/models/certificate_details.py b/oraclebmc/loadbalancer/models/certificate_details.py new file mode 100644 index 0000000000..73bd029041 --- /dev/null +++ b/oraclebmc/loadbalancer/models/certificate_details.py @@ -0,0 +1,232 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class CertificateDetails(object): + + def __init__(self): + + self.swagger_types = { + 'ca_certificate': 'str', + 'certificate_name': 'str', + 'passphrase': 'str', + 'private_key': 'str', + 'public_certificate': 'str' + } + + self.attribute_map = { + 'ca_certificate': 'caCertificate', + 'certificate_name': 'certificateName', + 'passphrase': 'passphrase', + 'private_key': 'privateKey', + 'public_certificate': 'publicCertificate' + } + + self._ca_certificate = None + self._certificate_name = None + self._passphrase = None + self._private_key = None + self._public_certificate = None + + @property + def ca_certificate(self): + """ + Gets the ca_certificate of this CertificateDetails. + The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + ... + -----END CERTIFICATE----- + + + :return: The ca_certificate of this CertificateDetails. + :rtype: str + """ + return self._ca_certificate + + @ca_certificate.setter + def ca_certificate(self, ca_certificate): + """ + Sets the ca_certificate of this CertificateDetails. + The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + ... + -----END CERTIFICATE----- + + + :param ca_certificate: The ca_certificate of this CertificateDetails. + :type: str + """ + self._ca_certificate = ca_certificate + + @property + def certificate_name(self): + """ + Gets the certificate_name of this CertificateDetails. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :return: The certificate_name of this CertificateDetails. + :rtype: str + """ + return self._certificate_name + + @certificate_name.setter + def certificate_name(self, certificate_name): + """ + Sets the certificate_name of this CertificateDetails. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :param certificate_name: The certificate_name of this CertificateDetails. + :type: str + """ + self._certificate_name = certificate_name + + @property + def passphrase(self): + """ + Gets the passphrase of this CertificateDetails. + A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. + + Example: `Mysecretunlockingcode42!1!` + + + :return: The passphrase of this CertificateDetails. + :rtype: str + """ + return self._passphrase + + @passphrase.setter + def passphrase(self, passphrase): + """ + Sets the passphrase of this CertificateDetails. + A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. + + Example: `Mysecretunlockingcode42!1!` + + + :param passphrase: The passphrase of this CertificateDetails. + :type: str + """ + self._passphrase = passphrase + + @property + def private_key(self): + """ + Gets the private_key of this CertificateDetails. + The SSL private key for your certificate, in PEM format. + + Example: + + -----BEGIN RSA PRIVATE KEY----- + jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK + tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb + +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16 + /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ + ... + -----END RSA PRIVATE KEY----- + + + :return: The private_key of this CertificateDetails. + :rtype: str + """ + return self._private_key + + @private_key.setter + def private_key(self, private_key): + """ + Sets the private_key of this CertificateDetails. + The SSL private key for your certificate, in PEM format. + + Example: + + -----BEGIN RSA PRIVATE KEY----- + jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK + tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb + +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16 + /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ + ... + -----END RSA PRIVATE KEY----- + + + :param private_key: The private_key of this CertificateDetails. + :type: str + """ + self._private_key = private_key + + @property + def public_certificate(self): + """ + Gets the public_certificate of this CertificateDetails. + The public certificate, in PEM format, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + ... + -----END CERTIFICATE----- + + + :return: The public_certificate of this CertificateDetails. + :rtype: str + """ + return self._public_certificate + + @public_certificate.setter + def public_certificate(self, public_certificate): + """ + Sets the public_certificate of this CertificateDetails. + The public certificate, in PEM format, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + ... + -----END CERTIFICATE----- + + + :param public_certificate: The public_certificate of this CertificateDetails. + :type: str + """ + self._public_certificate = public_certificate + + 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 diff --git a/oraclebmc/loadbalancer/models/create_backend_details.py b/oraclebmc/loadbalancer/models/create_backend_details.py new file mode 100644 index 0000000000..40916f1cb6 --- /dev/null +++ b/oraclebmc/loadbalancer/models/create_backend_details.py @@ -0,0 +1,233 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class CreateBackendDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backup': 'bool', + 'drain': 'bool', + 'ip_address': 'str', + 'offline': 'bool', + 'port': 'int', + 'weight': 'int' + } + + self.attribute_map = { + 'backup': 'backup', + 'drain': 'drain', + 'ip_address': 'ipAddress', + 'offline': 'offline', + 'port': 'port', + 'weight': 'weight' + } + + self._backup = None + self._drain = None + self._ip_address = None + self._offline = None + self._port = None + self._weight = None + + @property + def backup(self): + """ + Gets the backup of this CreateBackendDetails. + 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 CreateBackendDetails. + :rtype: bool + """ + return self._backup + + @backup.setter + def backup(self, backup): + """ + Sets the backup of this CreateBackendDetails. + 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 CreateBackendDetails. + :type: bool + """ + self._backup = backup + + @property + def drain(self): + """ + Gets the drain of this CreateBackendDetails. + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + incoming traffic. + + Example: `true` + + + :return: The drain of this CreateBackendDetails. + :rtype: bool + """ + return self._drain + + @drain.setter + def drain(self, drain): + """ + Sets the drain of this CreateBackendDetails. + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + incoming traffic. + + Example: `true` + + + :param drain: The drain of this CreateBackendDetails. + :type: bool + """ + self._drain = drain + + @property + def ip_address(self): + """ + Gets the ip_address of this CreateBackendDetails. + The IP address of the backend server. + + Example: `10.10.10.4` + + + :return: The ip_address of this CreateBackendDetails. + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """ + Sets the ip_address of this CreateBackendDetails. + The IP address of the backend server. + + Example: `10.10.10.4` + + + :param ip_address: The ip_address of this CreateBackendDetails. + :type: str + """ + self._ip_address = ip_address + + @property + def offline(self): + """ + Gets the offline of this CreateBackendDetails. + Whether the load balancer should treat this server as offline. Offline servers receive no incoming + traffic. + + Example: `true` + + + :return: The offline of this CreateBackendDetails. + :rtype: bool + """ + return self._offline + + @offline.setter + def offline(self, offline): + """ + Sets the offline of this CreateBackendDetails. + Whether the load balancer should treat this server as offline. Offline servers receive no incoming + traffic. + + Example: `true` + + + :param offline: The offline of this CreateBackendDetails. + :type: bool + """ + self._offline = offline + + @property + def port(self): + """ + Gets the port of this CreateBackendDetails. + The communication port for the backend server. + + Example: `8080` + + + :return: The port of this CreateBackendDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this CreateBackendDetails. + The communication port for the backend server. + + Example: `8080` + + + :param port: The port of this CreateBackendDetails. + :type: int + """ + self._port = port + + @property + def weight(self): + """ + Gets the weight of this CreateBackendDetails. + 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 CreateBackendDetails. + :rtype: int + """ + return self._weight + + @weight.setter + def weight(self, weight): + """ + Sets the weight of this CreateBackendDetails. + 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 CreateBackendDetails. + :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 diff --git a/oraclebmc/loadbalancer/models/create_backend_set_details.py b/oraclebmc/loadbalancer/models/create_backend_set_details.py new file mode 100644 index 0000000000..d534be0def --- /dev/null +++ b/oraclebmc/loadbalancer/models/create_backend_set_details.py @@ -0,0 +1,185 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class CreateBackendSetDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backends': 'list[BackendDetails]', + 'health_checker': 'HealthCheckerDetails', + 'name': 'str', + 'policy': 'str', + 'session_persistence_configuration': 'SessionPersistenceConfigurationDetails', + 'ssl_configuration': 'SSLConfigurationDetails' + } + + self.attribute_map = { + 'backends': 'backends', + 'health_checker': 'healthChecker', + 'name': 'name', + 'policy': 'policy', + 'session_persistence_configuration': 'sessionPersistenceConfiguration', + 'ssl_configuration': 'sslConfiguration' + } + + self._backends = None + self._health_checker = None + self._name = None + self._policy = None + self._session_persistence_configuration = None + self._ssl_configuration = None + + @property + def backends(self): + """ + Gets the backends of this CreateBackendSetDetails. + + :return: The backends of this CreateBackendSetDetails. + :rtype: list[BackendDetails] + """ + return self._backends + + @backends.setter + def backends(self, backends): + """ + Sets the backends of this CreateBackendSetDetails. + + :param backends: The backends of this CreateBackendSetDetails. + :type: list[BackendDetails] + """ + self._backends = backends + + @property + def health_checker(self): + """ + Gets the health_checker of this CreateBackendSetDetails. + + :return: The health_checker of this CreateBackendSetDetails. + :rtype: HealthCheckerDetails + """ + return self._health_checker + + @health_checker.setter + def health_checker(self, health_checker): + """ + Sets the health_checker of this CreateBackendSetDetails. + + :param health_checker: The health_checker of this CreateBackendSetDetails. + :type: HealthCheckerDetails + """ + self._health_checker = health_checker + + @property + def name(self): + """ + Gets the name of this CreateBackendSetDetails. + A friendly name for the backend set. It must be unique and it cannot be changed. + + Example: `My backend set` + + + :return: The name of this CreateBackendSetDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this CreateBackendSetDetails. + A friendly name for the backend set. It must be unique and it cannot be changed. + + Example: `My backend set` + + + :param name: The name of this CreateBackendSetDetails. + :type: str + """ + self._name = name + + @property + def policy(self): + """ + Gets the policy of this CreateBackendSetDetails. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` operation. + + Example: `LEAST_CONNECTIONS` + + + :return: The policy of this CreateBackendSetDetails. + :rtype: str + """ + return self._policy + + @policy.setter + def policy(self, policy): + """ + Sets the policy of this CreateBackendSetDetails. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` operation. + + Example: `LEAST_CONNECTIONS` + + + :param policy: The policy of this CreateBackendSetDetails. + :type: str + """ + self._policy = policy + + @property + def session_persistence_configuration(self): + """ + Gets the session_persistence_configuration of this CreateBackendSetDetails. + + :return: The session_persistence_configuration of this CreateBackendSetDetails. + :rtype: SessionPersistenceConfigurationDetails + """ + return self._session_persistence_configuration + + @session_persistence_configuration.setter + def session_persistence_configuration(self, session_persistence_configuration): + """ + Sets the session_persistence_configuration of this CreateBackendSetDetails. + + :param session_persistence_configuration: The session_persistence_configuration of this CreateBackendSetDetails. + :type: SessionPersistenceConfigurationDetails + """ + self._session_persistence_configuration = session_persistence_configuration + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this CreateBackendSetDetails. + + :return: The ssl_configuration of this CreateBackendSetDetails. + :rtype: SSLConfigurationDetails + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this CreateBackendSetDetails. + + :param ssl_configuration: The ssl_configuration of this CreateBackendSetDetails. + :type: SSLConfigurationDetails + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/create_certificate_details.py b/oraclebmc/loadbalancer/models/create_certificate_details.py new file mode 100644 index 0000000000..0f5ee9b77d --- /dev/null +++ b/oraclebmc/loadbalancer/models/create_certificate_details.py @@ -0,0 +1,232 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class CreateCertificateDetails(object): + + def __init__(self): + + self.swagger_types = { + 'ca_certificate': 'str', + 'certificate_name': 'str', + 'passphrase': 'str', + 'private_key': 'str', + 'public_certificate': 'str' + } + + self.attribute_map = { + 'ca_certificate': 'caCertificate', + 'certificate_name': 'certificateName', + 'passphrase': 'passphrase', + 'private_key': 'privateKey', + 'public_certificate': 'publicCertificate' + } + + self._ca_certificate = None + self._certificate_name = None + self._passphrase = None + self._private_key = None + self._public_certificate = None + + @property + def ca_certificate(self): + """ + Gets the ca_certificate of this CreateCertificateDetails. + The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + ... + -----END CERTIFICATE----- + + + :return: The ca_certificate of this CreateCertificateDetails. + :rtype: str + """ + return self._ca_certificate + + @ca_certificate.setter + def ca_certificate(self, ca_certificate): + """ + Sets the ca_certificate of this CreateCertificateDetails. + The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix + EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD + VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y + aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy + ... + -----END CERTIFICATE----- + + + :param ca_certificate: The ca_certificate of this CreateCertificateDetails. + :type: str + """ + self._ca_certificate = ca_certificate + + @property + def certificate_name(self): + """ + Gets the certificate_name of this CreateCertificateDetails. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :return: The certificate_name of this CreateCertificateDetails. + :rtype: str + """ + return self._certificate_name + + @certificate_name.setter + def certificate_name(self, certificate_name): + """ + Sets the certificate_name of this CreateCertificateDetails. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :param certificate_name: The certificate_name of this CreateCertificateDetails. + :type: str + """ + self._certificate_name = certificate_name + + @property + def passphrase(self): + """ + Gets the passphrase of this CreateCertificateDetails. + A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. + + Example: `Mysecretunlockingcode42!1!` + + + :return: The passphrase of this CreateCertificateDetails. + :rtype: str + """ + return self._passphrase + + @passphrase.setter + def passphrase(self, passphrase): + """ + Sets the passphrase of this CreateCertificateDetails. + A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. + + Example: `Mysecretunlockingcode42!1!` + + + :param passphrase: The passphrase of this CreateCertificateDetails. + :type: str + """ + self._passphrase = passphrase + + @property + def private_key(self): + """ + Gets the private_key of this CreateCertificateDetails. + The SSL private key for your certificate, in PEM format. + + Example: + + -----BEGIN RSA PRIVATE KEY----- + jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK + tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb + +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16 + /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ + ... + -----END RSA PRIVATE KEY----- + + + :return: The private_key of this CreateCertificateDetails. + :rtype: str + """ + return self._private_key + + @private_key.setter + def private_key(self, private_key): + """ + Sets the private_key of this CreateCertificateDetails. + The SSL private key for your certificate, in PEM format. + + Example: + + -----BEGIN RSA PRIVATE KEY----- + jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK + tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb + +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16 + /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ + ... + -----END RSA PRIVATE KEY----- + + + :param private_key: The private_key of this CreateCertificateDetails. + :type: str + """ + self._private_key = private_key + + @property + def public_certificate(self): + """ + Gets the public_certificate of this CreateCertificateDetails. + The public certificate, in PEM format, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + ... + -----END CERTIFICATE----- + + + :return: The public_certificate of this CreateCertificateDetails. + :rtype: str + """ + return self._public_certificate + + @public_certificate.setter + def public_certificate(self, public_certificate): + """ + Sets the public_certificate of this CreateCertificateDetails. + The public certificate, in PEM format, that you received from your SSL certificate provider. + + Example: + + -----BEGIN CERTIFICATE----- + MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG + A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE + MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl + YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + ... + -----END CERTIFICATE----- + + + :param public_certificate: The public_certificate of this CreateCertificateDetails. + :type: str + """ + self._public_certificate = public_certificate + + 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 diff --git a/oraclebmc/loadbalancer/models/create_listener_details.py b/oraclebmc/loadbalancer/models/create_listener_details.py new file mode 100644 index 0000000000..8e1fa05f67 --- /dev/null +++ b/oraclebmc/loadbalancer/models/create_listener_details.py @@ -0,0 +1,176 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class CreateListenerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'default_backend_set_name': 'str', + 'name': 'str', + 'port': 'int', + 'protocol': 'str', + 'ssl_configuration': 'SSLConfigurationDetails' + } + + self.attribute_map = { + 'default_backend_set_name': 'defaultBackendSetName', + 'name': 'name', + 'port': 'port', + 'protocol': 'protocol', + 'ssl_configuration': 'sslConfiguration' + } + + self._default_backend_set_name = None + self._name = None + self._port = None + self._protocol = None + self._ssl_configuration = None + + @property + def default_backend_set_name(self): + """ + Gets the default_backend_set_name of this CreateListenerDetails. + The name of the associated backend set. + + + :return: The default_backend_set_name of this CreateListenerDetails. + :rtype: str + """ + return self._default_backend_set_name + + @default_backend_set_name.setter + def default_backend_set_name(self, default_backend_set_name): + """ + Sets the default_backend_set_name of this CreateListenerDetails. + The name of the associated backend set. + + + :param default_backend_set_name: The default_backend_set_name of this CreateListenerDetails. + :type: str + """ + self._default_backend_set_name = default_backend_set_name + + @property + def name(self): + """ + Gets the name of this CreateListenerDetails. + A friendly name for the listener. It must be unique and it cannot be changed. + + Example: `My listener` + + + :return: The name of this CreateListenerDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this CreateListenerDetails. + A friendly name for the listener. It must be unique and it cannot be changed. + + Example: `My listener` + + + :param name: The name of this CreateListenerDetails. + :type: str + """ + self._name = name + + @property + def port(self): + """ + Gets the port of this CreateListenerDetails. + The communication port for the listener. + + Example: `80` + + + :return: The port of this CreateListenerDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this CreateListenerDetails. + The communication port for the listener. + + Example: `80` + + + :param port: The port of this CreateListenerDetails. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this CreateListenerDetails. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :return: The protocol of this CreateListenerDetails. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this CreateListenerDetails. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :param protocol: The protocol of this CreateListenerDetails. + :type: str + """ + self._protocol = protocol + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this CreateListenerDetails. + + :return: The ssl_configuration of this CreateListenerDetails. + :rtype: SSLConfigurationDetails + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this CreateListenerDetails. + + :param ssl_configuration: The ssl_configuration of this CreateListenerDetails. + :type: SSLConfigurationDetails + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/create_load_balancer_details.py b/oraclebmc/loadbalancer/models/create_load_balancer_details.py new file mode 100644 index 0000000000..e43c961283 --- /dev/null +++ b/oraclebmc/loadbalancer/models/create_load_balancer_details.py @@ -0,0 +1,285 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class CreateLoadBalancerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backend_sets': 'dict(str, BackendSetDetails)', + 'certificates': 'dict(str, CertificateDetails)', + 'compartment_id': 'str', + 'display_name': 'str', + 'is_private': 'bool', + 'listeners': 'dict(str, ListenerDetails)', + 'shape_name': 'str', + 'subnet_ids': 'list[str]' + } + + self.attribute_map = { + 'backend_sets': 'backendSets', + 'certificates': 'certificates', + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'is_private': 'isPrivate', + 'listeners': 'listeners', + 'shape_name': 'shapeName', + 'subnet_ids': 'subnetIds' + } + + self._backend_sets = None + self._certificates = None + self._compartment_id = None + self._display_name = None + self._is_private = None + self._listeners = None + self._shape_name = None + self._subnet_ids = None + + @property + def backend_sets(self): + """ + Gets the backend_sets of this CreateLoadBalancerDetails. + + :return: The backend_sets of this CreateLoadBalancerDetails. + :rtype: dict(str, BackendSetDetails) + """ + return self._backend_sets + + @backend_sets.setter + def backend_sets(self, backend_sets): + """ + Sets the backend_sets of this CreateLoadBalancerDetails. + + :param backend_sets: The backend_sets of this CreateLoadBalancerDetails. + :type: dict(str, BackendSetDetails) + """ + self._backend_sets = backend_sets + + @property + def certificates(self): + """ + Gets the certificates of this CreateLoadBalancerDetails. + + :return: The certificates of this CreateLoadBalancerDetails. + :rtype: dict(str, CertificateDetails) + """ + return self._certificates + + @certificates.setter + def certificates(self, certificates): + """ + Sets the certificates of this CreateLoadBalancerDetails. + + :param certificates: The certificates of this CreateLoadBalancerDetails. + :type: dict(str, CertificateDetails) + """ + self._certificates = certificates + + @property + def compartment_id(self): + """ + Gets the compartment_id of this CreateLoadBalancerDetails. + The `OCID`__ of the compartment in which to create the load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this CreateLoadBalancerDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateLoadBalancerDetails. + The `OCID`__ of the compartment in which to create the load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this CreateLoadBalancerDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + Gets the display_name of this CreateLoadBalancerDetails. + A user-friendly name. It does not have to be unique, and it is changeable. + + Example: `My load balancer` + + + :return: The display_name of this CreateLoadBalancerDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this CreateLoadBalancerDetails. + A user-friendly name. It does not have to be unique, and it is changeable. + + Example: `My load balancer` + + + :param display_name: The display_name of this CreateLoadBalancerDetails. + :type: str + """ + self._display_name = display_name + + @property + def is_private(self): + """ + Gets the is_private of this CreateLoadBalancerDetails. + Whether the load balancer has a VCN-local (private) IP address. + + If \"true\", the service assigns a private IP address to the load balancer. The load balancer requires only one subnet + to host both the primary and secondary load balancers. The private IP address is local to the subnet. The load balancer + is accessible only from within the VCN that contains the associated subnet, or as further restricted by your security + list rules. The load balancer can route traffic to any backend server that is reachable from the VCN. + + For a private load balancer, both the primary and secondary load balancer hosts are within the same Availability Domain. + + If \"false\", the service assigns a public IP address to the load balancer. A load balancer with a public IP address + requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other + hosts the secondary (stand-by) load balancer. A public load balancer is accessible from the internet, depending on your + VCN's `security list rules`__. + + Example: `false` + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm + + + :return: The is_private of this CreateLoadBalancerDetails. + :rtype: bool + """ + return self._is_private + + @is_private.setter + def is_private(self, is_private): + """ + Sets the is_private of this CreateLoadBalancerDetails. + Whether the load balancer has a VCN-local (private) IP address. + + If \"true\", the service assigns a private IP address to the load balancer. The load balancer requires only one subnet + to host both the primary and secondary load balancers. The private IP address is local to the subnet. The load balancer + is accessible only from within the VCN that contains the associated subnet, or as further restricted by your security + list rules. The load balancer can route traffic to any backend server that is reachable from the VCN. + + For a private load balancer, both the primary and secondary load balancer hosts are within the same Availability Domain. + + If \"false\", the service assigns a public IP address to the load balancer. A load balancer with a public IP address + requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other + hosts the secondary (stand-by) load balancer. A public load balancer is accessible from the internet, depending on your + VCN's `security list rules`__. + + Example: `false` + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm + + + :param is_private: The is_private of this CreateLoadBalancerDetails. + :type: bool + """ + self._is_private = is_private + + @property + def listeners(self): + """ + Gets the listeners of this CreateLoadBalancerDetails. + + :return: The listeners of this CreateLoadBalancerDetails. + :rtype: dict(str, ListenerDetails) + """ + return self._listeners + + @listeners.setter + def listeners(self, listeners): + """ + Sets the listeners of this CreateLoadBalancerDetails. + + :param listeners: The listeners of this CreateLoadBalancerDetails. + :type: dict(str, ListenerDetails) + """ + self._listeners = listeners + + @property + def shape_name(self): + """ + Gets the shape_name of this CreateLoadBalancerDetails. + A template that determines the total pre-provisioned bandwidth (ingress plus egress). + To get a list of available shapes, use the :func:`list_shapes` + operation. + + Example: `100Mbps` + + + :return: The shape_name of this CreateLoadBalancerDetails. + :rtype: str + """ + return self._shape_name + + @shape_name.setter + def shape_name(self, shape_name): + """ + Sets the shape_name of this CreateLoadBalancerDetails. + A template that determines the total pre-provisioned bandwidth (ingress plus egress). + To get a list of available shapes, use the :func:`list_shapes` + operation. + + Example: `100Mbps` + + + :param shape_name: The shape_name of this CreateLoadBalancerDetails. + :type: str + """ + self._shape_name = shape_name + + @property + def subnet_ids(self): + """ + Gets the subnet_ids of this CreateLoadBalancerDetails. + An array of subnet `OCIDs`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The subnet_ids of this CreateLoadBalancerDetails. + :rtype: list[str] + """ + return self._subnet_ids + + @subnet_ids.setter + def subnet_ids(self, subnet_ids): + """ + Sets the subnet_ids of this CreateLoadBalancerDetails. + An array of subnet `OCIDs`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param subnet_ids: The subnet_ids of this CreateLoadBalancerDetails. + :type: list[str] + """ + self._subnet_ids = subnet_ids + + 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 diff --git a/oraclebmc/loadbalancer/models/health_checker.py b/oraclebmc/loadbalancer/models/health_checker.py new file mode 100644 index 0000000000..5108eb10a2 --- /dev/null +++ b/oraclebmc/loadbalancer/models/health_checker.py @@ -0,0 +1,281 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class HealthChecker(object): + + def __init__(self): + + self.swagger_types = { + 'interval_in_millis': 'int', + 'port': 'int', + 'protocol': 'str', + 'response_body_regex': 'str', + 'retries': 'int', + 'return_code': 'int', + 'timeout_in_millis': 'int', + 'url_path': 'str' + } + + self.attribute_map = { + 'interval_in_millis': 'intervalInMillis', + 'port': 'port', + 'protocol': 'protocol', + 'response_body_regex': 'responseBodyRegex', + 'retries': 'retries', + 'return_code': 'returnCode', + 'timeout_in_millis': 'timeoutInMillis', + 'url_path': 'urlPath' + } + + self._interval_in_millis = None + self._port = None + self._protocol = None + self._response_body_regex = None + self._retries = None + self._return_code = None + self._timeout_in_millis = None + self._url_path = None + + @property + def interval_in_millis(self): + """ + Gets the interval_in_millis of this HealthChecker. + The interval between health checks, in milliseconds. The default is 10000 (10 seconds). + + Example: `30000` + + + :return: The interval_in_millis of this HealthChecker. + :rtype: int + """ + return self._interval_in_millis + + @interval_in_millis.setter + def interval_in_millis(self, interval_in_millis): + """ + Sets the interval_in_millis of this HealthChecker. + The interval between health checks, in milliseconds. The default is 10000 (10 seconds). + + Example: `30000` + + + :param interval_in_millis: The interval_in_millis of this HealthChecker. + :type: int + """ + self._interval_in_millis = interval_in_millis + + @property + def port(self): + """ + Gets the port of this HealthChecker. + The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + port information from the `Backend` object. + + Example: `8080` + + + :return: The port of this HealthChecker. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this HealthChecker. + The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + port information from the `Backend` object. + + Example: `8080` + + + :param port: The port of this HealthChecker. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this HealthChecker. + The protocol the health check must use; either HTTP or TCP. + + Example: `HTTP` + + + :return: The protocol of this HealthChecker. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this HealthChecker. + The protocol the health check must use; either HTTP or TCP. + + Example: `HTTP` + + + :param protocol: The protocol of this HealthChecker. + :type: str + """ + self._protocol = protocol + + @property + def response_body_regex(self): + """ + Gets the response_body_regex of this HealthChecker. + A regular expression for parsing the response body from the backend server. + + Example: `^(500|40[1348])$` + + + :return: The response_body_regex of this HealthChecker. + :rtype: str + """ + return self._response_body_regex + + @response_body_regex.setter + def response_body_regex(self, response_body_regex): + """ + Sets the response_body_regex of this HealthChecker. + A regular expression for parsing the response body from the backend server. + + Example: `^(500|40[1348])$` + + + :param response_body_regex: The response_body_regex of this HealthChecker. + :type: str + """ + self._response_body_regex = response_body_regex + + @property + def retries(self): + """ + Gets the retries of this HealthChecker. + The number of retries to attempt before a backend server is considered \"unhealthy\". Defaults to 3. + + Example: `3` + + + :return: The retries of this HealthChecker. + :rtype: int + """ + return self._retries + + @retries.setter + def retries(self, retries): + """ + Sets the retries of this HealthChecker. + The number of retries to attempt before a backend server is considered \"unhealthy\". Defaults to 3. + + Example: `3` + + + :param retries: The retries of this HealthChecker. + :type: int + """ + self._retries = retries + + @property + def return_code(self): + """ + Gets the return_code of this HealthChecker. + The status code a healthy backend server should return. If you configure the health check policy to use the HTTP protocol, + you can use common HTTP status codes such as \"200\". + + Example: `200` + + + :return: The return_code of this HealthChecker. + :rtype: int + """ + return self._return_code + + @return_code.setter + def return_code(self, return_code): + """ + Sets the return_code of this HealthChecker. + The status code a healthy backend server should return. If you configure the health check policy to use the HTTP protocol, + you can use common HTTP status codes such as \"200\". + + Example: `200` + + + :param return_code: The return_code of this HealthChecker. + :type: int + """ + self._return_code = return_code + + @property + def timeout_in_millis(self): + """ + Gets the timeout_in_millis of this HealthChecker. + The maximum timeout before a retry, in milliseconds. Defaults to 3000 (3 seconds). + + Example: `6000` + + + :return: The timeout_in_millis of this HealthChecker. + :rtype: int + """ + return self._timeout_in_millis + + @timeout_in_millis.setter + def timeout_in_millis(self, timeout_in_millis): + """ + Sets the timeout_in_millis of this HealthChecker. + The maximum timeout before a retry, in milliseconds. Defaults to 3000 (3 seconds). + + Example: `6000` + + + :param timeout_in_millis: The timeout_in_millis of this HealthChecker. + :type: int + """ + self._timeout_in_millis = timeout_in_millis + + @property + def url_path(self): + """ + Gets the url_path of this HealthChecker. + The path against which to run the health check. + + Example: `/healthcheck` + + + :return: The url_path of this HealthChecker. + :rtype: str + """ + return self._url_path + + @url_path.setter + def url_path(self, url_path): + """ + Sets the url_path of this HealthChecker. + The path against which to run the health check. + + Example: `/healthcheck` + + + :param url_path: The url_path of this HealthChecker. + :type: str + """ + self._url_path = url_path + + 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 diff --git a/oraclebmc/loadbalancer/models/health_checker_details.py b/oraclebmc/loadbalancer/models/health_checker_details.py new file mode 100644 index 0000000000..6a5a466c6a --- /dev/null +++ b/oraclebmc/loadbalancer/models/health_checker_details.py @@ -0,0 +1,279 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class HealthCheckerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'interval_in_millis': 'int', + 'port': 'int', + 'protocol': 'str', + 'response_body_regex': 'str', + 'retries': 'int', + 'return_code': 'int', + 'timeout_in_millis': 'int', + 'url_path': 'str' + } + + self.attribute_map = { + 'interval_in_millis': 'intervalInMillis', + 'port': 'port', + 'protocol': 'protocol', + 'response_body_regex': 'responseBodyRegex', + 'retries': 'retries', + 'return_code': 'returnCode', + 'timeout_in_millis': 'timeoutInMillis', + 'url_path': 'urlPath' + } + + self._interval_in_millis = None + self._port = None + self._protocol = None + self._response_body_regex = None + self._retries = None + self._return_code = None + self._timeout_in_millis = None + self._url_path = None + + @property + def interval_in_millis(self): + """ + Gets the interval_in_millis of this HealthCheckerDetails. + The interval between health checks, in milliseconds. + + Example: `30000` + + + :return: The interval_in_millis of this HealthCheckerDetails. + :rtype: int + """ + return self._interval_in_millis + + @interval_in_millis.setter + def interval_in_millis(self, interval_in_millis): + """ + Sets the interval_in_millis of this HealthCheckerDetails. + The interval between health checks, in milliseconds. + + Example: `30000` + + + :param interval_in_millis: The interval_in_millis of this HealthCheckerDetails. + :type: int + """ + self._interval_in_millis = interval_in_millis + + @property + def port(self): + """ + Gets the port of this HealthCheckerDetails. + The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + port information from the `Backend` object. + + Example: `8080` + + + :return: The port of this HealthCheckerDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this HealthCheckerDetails. + The backend server port against which to run the health check. If the port is not specified, the load balancer uses the + port information from the `Backend` object. + + Example: `8080` + + + :param port: The port of this HealthCheckerDetails. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this HealthCheckerDetails. + The protocol the health check must use; either HTTP or TCP. + + Example: `HTTP` + + + :return: The protocol of this HealthCheckerDetails. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this HealthCheckerDetails. + The protocol the health check must use; either HTTP or TCP. + + Example: `HTTP` + + + :param protocol: The protocol of this HealthCheckerDetails. + :type: str + """ + self._protocol = protocol + + @property + def response_body_regex(self): + """ + Gets the response_body_regex of this HealthCheckerDetails. + A regular expression for parsing the response body from the backend server. + + Example: `^(500|40[1348])$` + + + :return: The response_body_regex of this HealthCheckerDetails. + :rtype: str + """ + return self._response_body_regex + + @response_body_regex.setter + def response_body_regex(self, response_body_regex): + """ + Sets the response_body_regex of this HealthCheckerDetails. + A regular expression for parsing the response body from the backend server. + + Example: `^(500|40[1348])$` + + + :param response_body_regex: The response_body_regex of this HealthCheckerDetails. + :type: str + """ + self._response_body_regex = response_body_regex + + @property + def retries(self): + """ + Gets the retries of this HealthCheckerDetails. + The number of retries to attempt before a backend server is considered \"unhealthy\". + + Example: `3` + + + :return: The retries of this HealthCheckerDetails. + :rtype: int + """ + return self._retries + + @retries.setter + def retries(self, retries): + """ + Sets the retries of this HealthCheckerDetails. + The number of retries to attempt before a backend server is considered \"unhealthy\". + + Example: `3` + + + :param retries: The retries of this HealthCheckerDetails. + :type: int + """ + self._retries = retries + + @property + def return_code(self): + """ + Gets the return_code of this HealthCheckerDetails. + The status code a healthy backend server should return. + + Example: `200` + + + :return: The return_code of this HealthCheckerDetails. + :rtype: int + """ + return self._return_code + + @return_code.setter + def return_code(self, return_code): + """ + Sets the return_code of this HealthCheckerDetails. + The status code a healthy backend server should return. + + Example: `200` + + + :param return_code: The return_code of this HealthCheckerDetails. + :type: int + """ + self._return_code = return_code + + @property + def timeout_in_millis(self): + """ + Gets the timeout_in_millis of this HealthCheckerDetails. + The maximum timeout in milliseconds before a retry. + + Example: `6000` + + + :return: The timeout_in_millis of this HealthCheckerDetails. + :rtype: int + """ + return self._timeout_in_millis + + @timeout_in_millis.setter + def timeout_in_millis(self, timeout_in_millis): + """ + Sets the timeout_in_millis of this HealthCheckerDetails. + The maximum timeout in milliseconds before a retry. + + Example: `6000` + + + :param timeout_in_millis: The timeout_in_millis of this HealthCheckerDetails. + :type: int + """ + self._timeout_in_millis = timeout_in_millis + + @property + def url_path(self): + """ + Gets the url_path of this HealthCheckerDetails. + The path against which to run the health check. + + Example: `/healthcheck` + + + :return: The url_path of this HealthCheckerDetails. + :rtype: str + """ + return self._url_path + + @url_path.setter + def url_path(self, url_path): + """ + Sets the url_path of this HealthCheckerDetails. + The path against which to run the health check. + + Example: `/healthcheck` + + + :param url_path: The url_path of this HealthCheckerDetails. + :type: str + """ + self._url_path = url_path + + 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 diff --git a/oraclebmc/loadbalancer/models/ip_address.py b/oraclebmc/loadbalancer/models/ip_address.py new file mode 100644 index 0000000000..5044ce974e --- /dev/null +++ b/oraclebmc/loadbalancer/models/ip_address.py @@ -0,0 +1,95 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class IpAddress(object): + + def __init__(self): + + self.swagger_types = { + 'ip_address': 'str', + 'is_public': 'bool' + } + + self.attribute_map = { + 'ip_address': 'ipAddress', + 'is_public': 'isPublic' + } + + self._ip_address = None + self._is_public = None + + @property + def ip_address(self): + """ + Gets the ip_address of this IpAddress. + An IP address. + + Example: `128.148.10.20` + + + :return: The ip_address of this IpAddress. + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """ + Sets the ip_address of this IpAddress. + An IP address. + + Example: `128.148.10.20` + + + :param ip_address: The ip_address of this IpAddress. + :type: str + """ + self._ip_address = ip_address + + @property + def is_public(self): + """ + Gets the is_public of this IpAddress. + Whether the IP address is public or private. + + If \"true\", the IP address is public and accessible from the internet. + + If \"false\", the IP address is private and accessible only from within the associated VCN. + + + :return: The is_public of this IpAddress. + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """ + Sets the is_public of this IpAddress. + Whether the IP address is public or private. + + If \"true\", the IP address is public and accessible from the internet. + + If \"false\", the IP address is private and accessible only from within the associated VCN. + + + :param is_public: The is_public of this IpAddress. + :type: bool + """ + self._is_public = is_public + + 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 diff --git a/oraclebmc/loadbalancer/models/listener.py b/oraclebmc/loadbalancer/models/listener.py new file mode 100644 index 0000000000..b5966c2a94 --- /dev/null +++ b/oraclebmc/loadbalancer/models/listener.py @@ -0,0 +1,176 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class Listener(object): + + def __init__(self): + + self.swagger_types = { + 'default_backend_set_name': 'str', + 'name': 'str', + 'port': 'int', + 'protocol': 'str', + 'ssl_configuration': 'SSLConfiguration' + } + + self.attribute_map = { + 'default_backend_set_name': 'defaultBackendSetName', + 'name': 'name', + 'port': 'port', + 'protocol': 'protocol', + 'ssl_configuration': 'sslConfiguration' + } + + self._default_backend_set_name = None + self._name = None + self._port = None + self._protocol = None + self._ssl_configuration = None + + @property + def default_backend_set_name(self): + """ + Gets the default_backend_set_name of this Listener. + The name of the associated backend set. + + + :return: The default_backend_set_name of this Listener. + :rtype: str + """ + return self._default_backend_set_name + + @default_backend_set_name.setter + def default_backend_set_name(self, default_backend_set_name): + """ + Sets the default_backend_set_name of this Listener. + The name of the associated backend set. + + + :param default_backend_set_name: The default_backend_set_name of this Listener. + :type: str + """ + self._default_backend_set_name = default_backend_set_name + + @property + def name(self): + """ + Gets the name of this Listener. + A friendly name for the listener. It must be unique and it cannot be changed. + + Example: `My listener` + + + :return: The name of this Listener. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Listener. + A friendly name for the listener. It must be unique and it cannot be changed. + + Example: `My listener` + + + :param name: The name of this Listener. + :type: str + """ + self._name = name + + @property + def port(self): + """ + Gets the port of this Listener. + The communication port for the listener. + + Example: `80` + + + :return: The port of this Listener. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this Listener. + The communication port for the listener. + + Example: `80` + + + :param port: The port of this Listener. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this Listener. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :return: The protocol of this Listener. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this Listener. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :param protocol: The protocol of this Listener. + :type: str + """ + self._protocol = protocol + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this Listener. + + :return: The ssl_configuration of this Listener. + :rtype: SSLConfiguration + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this Listener. + + :param ssl_configuration: The ssl_configuration of this Listener. + :type: SSLConfiguration + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/listener_details.py b/oraclebmc/loadbalancer/models/listener_details.py new file mode 100644 index 0000000000..f3de18cdeb --- /dev/null +++ b/oraclebmc/loadbalancer/models/listener_details.py @@ -0,0 +1,145 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class ListenerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'default_backend_set_name': 'str', + 'port': 'int', + 'protocol': 'str', + 'ssl_configuration': 'SSLConfigurationDetails' + } + + self.attribute_map = { + 'default_backend_set_name': 'defaultBackendSetName', + 'port': 'port', + 'protocol': 'protocol', + 'ssl_configuration': 'sslConfiguration' + } + + self._default_backend_set_name = None + self._port = None + self._protocol = None + self._ssl_configuration = None + + @property + def default_backend_set_name(self): + """ + Gets the default_backend_set_name of this ListenerDetails. + The name of the associated backend set. + + + :return: The default_backend_set_name of this ListenerDetails. + :rtype: str + """ + return self._default_backend_set_name + + @default_backend_set_name.setter + def default_backend_set_name(self, default_backend_set_name): + """ + Sets the default_backend_set_name of this ListenerDetails. + The name of the associated backend set. + + + :param default_backend_set_name: The default_backend_set_name of this ListenerDetails. + :type: str + """ + self._default_backend_set_name = default_backend_set_name + + @property + def port(self): + """ + Gets the port of this ListenerDetails. + The communication port for the listener. + + Example: `80` + + + :return: The port of this ListenerDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this ListenerDetails. + The communication port for the listener. + + Example: `80` + + + :param port: The port of this ListenerDetails. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this ListenerDetails. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :return: The protocol of this ListenerDetails. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this ListenerDetails. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :param protocol: The protocol of this ListenerDetails. + :type: str + """ + self._protocol = protocol + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this ListenerDetails. + + :return: The ssl_configuration of this ListenerDetails. + :rtype: SSLConfigurationDetails + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this ListenerDetails. + + :param ssl_configuration: The ssl_configuration of this ListenerDetails. + :type: SSLConfigurationDetails + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/load_balancer.py b/oraclebmc/loadbalancer/models/load_balancer.py new file mode 100644 index 0000000000..a2ea65833a --- /dev/null +++ b/oraclebmc/loadbalancer/models/load_balancer.py @@ -0,0 +1,399 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class LoadBalancer(object): + + def __init__(self): + + self.swagger_types = { + 'backend_sets': 'dict(str, BackendSet)', + 'certificates': 'dict(str, Certificate)', + 'compartment_id': 'str', + 'display_name': 'str', + 'id': 'str', + 'ip_addresses': 'list[IpAddress]', + 'is_private': 'bool', + 'lifecycle_state': 'str', + 'listeners': 'dict(str, Listener)', + 'shape_name': 'str', + 'subnet_ids': 'list[str]', + 'time_created': 'datetime' + } + + self.attribute_map = { + 'backend_sets': 'backendSets', + 'certificates': 'certificates', + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'id': 'id', + 'ip_addresses': 'ipAddresses', + 'is_private': 'isPrivate', + 'lifecycle_state': 'lifecycleState', + 'listeners': 'listeners', + 'shape_name': 'shapeName', + 'subnet_ids': 'subnetIds', + 'time_created': 'timeCreated' + } + + self._backend_sets = None + self._certificates = None + self._compartment_id = None + self._display_name = None + self._id = None + self._ip_addresses = None + self._is_private = None + self._lifecycle_state = None + self._listeners = None + self._shape_name = None + self._subnet_ids = None + self._time_created = None + + @property + def backend_sets(self): + """ + Gets the backend_sets of this LoadBalancer. + + :return: The backend_sets of this LoadBalancer. + :rtype: dict(str, BackendSet) + """ + return self._backend_sets + + @backend_sets.setter + def backend_sets(self, backend_sets): + """ + Sets the backend_sets of this LoadBalancer. + + :param backend_sets: The backend_sets of this LoadBalancer. + :type: dict(str, BackendSet) + """ + self._backend_sets = backend_sets + + @property + def certificates(self): + """ + Gets the certificates of this LoadBalancer. + + :return: The certificates of this LoadBalancer. + :rtype: dict(str, Certificate) + """ + return self._certificates + + @certificates.setter + def certificates(self, certificates): + """ + Sets the certificates of this LoadBalancer. + + :param certificates: The certificates of this LoadBalancer. + :type: dict(str, Certificate) + """ + self._certificates = certificates + + @property + def compartment_id(self): + """ + Gets the compartment_id of this LoadBalancer. + The `OCID`__ of the compartment containing the load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this LoadBalancer. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this LoadBalancer. + The `OCID`__ of the compartment containing the load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this LoadBalancer. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + Gets the display_name of this LoadBalancer. + A user-friendly name. It does not have to be unique, and it is changeable. + + Example: `My load balancer` + + + :return: The display_name of this LoadBalancer. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this LoadBalancer. + A user-friendly name. It does not have to be unique, and it is changeable. + + Example: `My load balancer` + + + :param display_name: The display_name of this LoadBalancer. + :type: str + """ + self._display_name = display_name + + @property + def id(self): + """ + Gets the id of this LoadBalancer. + The `OCID`__ of the load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The id of this LoadBalancer. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this LoadBalancer. + The `OCID`__ of the load balancer. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param id: The id of this LoadBalancer. + :type: str + """ + self._id = id + + @property + def ip_addresses(self): + """ + Gets the ip_addresses of this LoadBalancer. + An array of IP addresses. + + + :return: The ip_addresses of this LoadBalancer. + :rtype: list[IpAddress] + """ + return self._ip_addresses + + @ip_addresses.setter + def ip_addresses(self, ip_addresses): + """ + Sets the ip_addresses of this LoadBalancer. + An array of IP addresses. + + + :param ip_addresses: The ip_addresses of this LoadBalancer. + :type: list[IpAddress] + """ + self._ip_addresses = ip_addresses + + @property + def is_private(self): + """ + Gets the is_private of this LoadBalancer. + Whether the load balancer has a VCN-local (private) IP address. + + If \"true\", the service assigns a private IP address to the load balancer. The load balancer requires only one subnet + to host both the primary and secondary load balancers. The private IP address is local to the subnet. The load balancer + is accessible only from within the VCN that contains the associated subnet, or as further restricted by your security + list rules. The load balancer can route traffic to any backend server that is reachable from the VCN. + + For a private load balancer, both the primary and secondary load balancer hosts are within the same Availability Domain. + + If \"false\", the service assigns a public IP address to the load balancer. A load balancer with a public IP address + requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other + hosts the secondary (stand-by) load balancer. A public load balancer is accessible from the internet, depending on your + VCN's `security list rules`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm + + + :return: The is_private of this LoadBalancer. + :rtype: bool + """ + return self._is_private + + @is_private.setter + def is_private(self, is_private): + """ + Sets the is_private of this LoadBalancer. + Whether the load balancer has a VCN-local (private) IP address. + + If \"true\", the service assigns a private IP address to the load balancer. The load balancer requires only one subnet + to host both the primary and secondary load balancers. The private IP address is local to the subnet. The load balancer + is accessible only from within the VCN that contains the associated subnet, or as further restricted by your security + list rules. The load balancer can route traffic to any backend server that is reachable from the VCN. + + For a private load balancer, both the primary and secondary load balancer hosts are within the same Availability Domain. + + If \"false\", the service assigns a public IP address to the load balancer. A load balancer with a public IP address + requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other + hosts the secondary (stand-by) load balancer. A public load balancer is accessible from the internet, depending on your + VCN's `security list rules`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm + + + :param is_private: The is_private of this LoadBalancer. + :type: bool + """ + self._is_private = is_private + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this LoadBalancer. + Allowed values for this property are: "CREATING", "FAILED", "ACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this LoadBalancer. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this LoadBalancer. + + :param lifecycle_state: The lifecycle_state of this LoadBalancer. + :type: str + """ + allowed_values = ["CREATING", "FAILED", "ACTIVE", "DELETING", "DELETED"] + if lifecycle_state not in allowed_values: + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def listeners(self): + """ + Gets the listeners of this LoadBalancer. + + :return: The listeners of this LoadBalancer. + :rtype: dict(str, Listener) + """ + return self._listeners + + @listeners.setter + def listeners(self, listeners): + """ + Sets the listeners of this LoadBalancer. + + :param listeners: The listeners of this LoadBalancer. + :type: dict(str, Listener) + """ + self._listeners = listeners + + @property + def shape_name(self): + """ + Gets the shape_name of this LoadBalancer. + A template that determines the total pre-provisioned bandwidth (ingress plus egress). + To get a list of available shapes, use the :func:`list_shapes` + operation. + + Example: `100Mbps` + + + :return: The shape_name of this LoadBalancer. + :rtype: str + """ + return self._shape_name + + @shape_name.setter + def shape_name(self, shape_name): + """ + Sets the shape_name of this LoadBalancer. + A template that determines the total pre-provisioned bandwidth (ingress plus egress). + To get a list of available shapes, use the :func:`list_shapes` + operation. + + Example: `100Mbps` + + + :param shape_name: The shape_name of this LoadBalancer. + :type: str + """ + self._shape_name = shape_name + + @property + def subnet_ids(self): + """ + Gets the subnet_ids of this LoadBalancer. + An array of subnet `OCIDs`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The subnet_ids of this LoadBalancer. + :rtype: list[str] + """ + return self._subnet_ids + + @subnet_ids.setter + def subnet_ids(self, subnet_ids): + """ + Sets the subnet_ids of this LoadBalancer. + An array of subnet `OCIDs`__. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param subnet_ids: The subnet_ids of this LoadBalancer. + :type: list[str] + """ + self._subnet_ids = subnet_ids + + @property + def time_created(self): + """ + Gets the time_created of this LoadBalancer. + The date and time the load balancer was created, in the format defined by RFC3339. + + Example: `2016-08-25T21:10:29.600Z` + + + :return: The time_created of this LoadBalancer. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this LoadBalancer. + The date and time the load balancer was created, in the format defined by RFC3339. + + Example: `2016-08-25T21:10:29.600Z` + + + :param time_created: The time_created of this LoadBalancer. + :type: datetime + """ + self._time_created = time_created + + 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 diff --git a/oraclebmc/loadbalancer/models/load_balancer_policy.py b/oraclebmc/loadbalancer/models/load_balancer_policy.py new file mode 100644 index 0000000000..eee3ad9ff1 --- /dev/null +++ b/oraclebmc/loadbalancer/models/load_balancer_policy.py @@ -0,0 +1,56 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class LoadBalancerPolicy(object): + + def __init__(self): + + self.swagger_types = { + 'name': 'str' + } + + self.attribute_map = { + 'name': 'name' + } + + self._name = None + + @property + def name(self): + """ + Gets the name of this LoadBalancerPolicy. + The name of the load balancing policy. + + + :return: The name of this LoadBalancerPolicy. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this LoadBalancerPolicy. + The name of the load balancing policy. + + + :param name: The name of this LoadBalancerPolicy. + :type: str + """ + self._name = name + + 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 diff --git a/oraclebmc/loadbalancer/models/load_balancer_protocol.py b/oraclebmc/loadbalancer/models/load_balancer_protocol.py new file mode 100644 index 0000000000..b9592380f4 --- /dev/null +++ b/oraclebmc/loadbalancer/models/load_balancer_protocol.py @@ -0,0 +1,56 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class LoadBalancerProtocol(object): + + def __init__(self): + + self.swagger_types = { + 'name': 'str' + } + + self.attribute_map = { + 'name': 'name' + } + + self._name = None + + @property + def name(self): + """ + Gets the name of this LoadBalancerProtocol. + The name of the protocol. + + + :return: The name of this LoadBalancerProtocol. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this LoadBalancerProtocol. + The name of the protocol. + + + :param name: The name of this LoadBalancerProtocol. + :type: str + """ + self._name = name + + 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 diff --git a/oraclebmc/loadbalancer/models/load_balancer_shape.py b/oraclebmc/loadbalancer/models/load_balancer_shape.py new file mode 100644 index 0000000000..edf3bb881c --- /dev/null +++ b/oraclebmc/loadbalancer/models/load_balancer_shape.py @@ -0,0 +1,56 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class LoadBalancerShape(object): + + def __init__(self): + + self.swagger_types = { + 'name': 'str' + } + + self.attribute_map = { + 'name': 'name' + } + + self._name = None + + @property + def name(self): + """ + Gets the name of this LoadBalancerShape. + The name of the shape. + + + :return: The name of this LoadBalancerShape. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this LoadBalancerShape. + The name of the shape. + + + :param name: The name of this LoadBalancerShape. + :type: str + """ + self._name = name + + 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 diff --git a/oraclebmc/loadbalancer/models/session_persistence_configuration_details.py b/oraclebmc/loadbalancer/models/session_persistence_configuration_details.py new file mode 100644 index 0000000000..496f0b08ff --- /dev/null +++ b/oraclebmc/loadbalancer/models/session_persistence_configuration_details.py @@ -0,0 +1,95 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class SessionPersistenceConfigurationDetails(object): + + def __init__(self): + + self.swagger_types = { + 'cookie_name': 'str', + 'disable_fallback': 'bool' + } + + self.attribute_map = { + 'cookie_name': 'cookieName', + 'disable_fallback': 'disableFallback' + } + + self._cookie_name = None + self._disable_fallback = None + + @property + def cookie_name(self): + """ + Gets the cookie_name of this SessionPersistenceConfigurationDetails. + The name of the cookie used to detect a session initiated by the backend server. Use '*' to specify + that any cookie set by the backend causes the session to persist. + + Example: `myCookieName` + + + :return: The cookie_name of this SessionPersistenceConfigurationDetails. + :rtype: str + """ + return self._cookie_name + + @cookie_name.setter + def cookie_name(self, cookie_name): + """ + Sets the cookie_name of this SessionPersistenceConfigurationDetails. + The name of the cookie used to detect a session initiated by the backend server. Use '*' to specify + that any cookie set by the backend causes the session to persist. + + Example: `myCookieName` + + + :param cookie_name: The cookie_name of this SessionPersistenceConfigurationDetails. + :type: str + """ + self._cookie_name = cookie_name + + @property + def disable_fallback(self): + """ + Gets the disable_fallback of this SessionPersistenceConfigurationDetails. + Whether the load balancer is prevented from directing traffic from a persistent session client to + a different backend server if the original server is unavailable. Defaults to false. + + Example: `true` + + + :return: The disable_fallback of this SessionPersistenceConfigurationDetails. + :rtype: bool + """ + return self._disable_fallback + + @disable_fallback.setter + def disable_fallback(self, disable_fallback): + """ + Sets the disable_fallback of this SessionPersistenceConfigurationDetails. + Whether the load balancer is prevented from directing traffic from a persistent session client to + a different backend server if the original server is unavailable. Defaults to false. + + Example: `true` + + + :param disable_fallback: The disable_fallback of this SessionPersistenceConfigurationDetails. + :type: bool + """ + self._disable_fallback = disable_fallback + + 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 diff --git a/oraclebmc/loadbalancer/models/ssl_configuration.py b/oraclebmc/loadbalancer/models/ssl_configuration.py new file mode 100644 index 0000000000..e2428a4391 --- /dev/null +++ b/oraclebmc/loadbalancer/models/ssl_configuration.py @@ -0,0 +1,122 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class SSLConfiguration(object): + + def __init__(self): + + self.swagger_types = { + 'certificate_name': 'str', + 'verify_depth': 'int', + 'verify_peer_certificate': 'bool' + } + + self.attribute_map = { + 'certificate_name': 'certificateName', + 'verify_depth': 'verifyDepth', + 'verify_peer_certificate': 'verifyPeerCertificate' + } + + self._certificate_name = None + self._verify_depth = None + self._verify_peer_certificate = None + + @property + def certificate_name(self): + """ + Gets the certificate_name of this SSLConfiguration. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :return: The certificate_name of this SSLConfiguration. + :rtype: str + """ + return self._certificate_name + + @certificate_name.setter + def certificate_name(self, certificate_name): + """ + Sets the certificate_name of this SSLConfiguration. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :param certificate_name: The certificate_name of this SSLConfiguration. + :type: str + """ + self._certificate_name = certificate_name + + @property + def verify_depth(self): + """ + Gets the verify_depth of this SSLConfiguration. + The maximum depth for peer certificate chain verification. + + Example: `3` + + + :return: The verify_depth of this SSLConfiguration. + :rtype: int + """ + return self._verify_depth + + @verify_depth.setter + def verify_depth(self, verify_depth): + """ + Sets the verify_depth of this SSLConfiguration. + The maximum depth for peer certificate chain verification. + + Example: `3` + + + :param verify_depth: The verify_depth of this SSLConfiguration. + :type: int + """ + self._verify_depth = verify_depth + + @property + def verify_peer_certificate(self): + """ + Gets the verify_peer_certificate of this SSLConfiguration. + Whether the load balancer listener should verify peer certificates. + + Example: `true` + + + :return: The verify_peer_certificate of this SSLConfiguration. + :rtype: bool + """ + return self._verify_peer_certificate + + @verify_peer_certificate.setter + def verify_peer_certificate(self, verify_peer_certificate): + """ + Sets the verify_peer_certificate of this SSLConfiguration. + Whether the load balancer listener should verify peer certificates. + + Example: `true` + + + :param verify_peer_certificate: The verify_peer_certificate of this SSLConfiguration. + :type: bool + """ + self._verify_peer_certificate = verify_peer_certificate + + 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 diff --git a/oraclebmc/loadbalancer/models/ssl_configuration_details.py b/oraclebmc/loadbalancer/models/ssl_configuration_details.py new file mode 100644 index 0000000000..a7f348cdec --- /dev/null +++ b/oraclebmc/loadbalancer/models/ssl_configuration_details.py @@ -0,0 +1,122 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class SSLConfigurationDetails(object): + + def __init__(self): + + self.swagger_types = { + 'certificate_name': 'str', + 'verify_depth': 'int', + 'verify_peer_certificate': 'bool' + } + + self.attribute_map = { + 'certificate_name': 'certificateName', + 'verify_depth': 'verifyDepth', + 'verify_peer_certificate': 'verifyPeerCertificate' + } + + self._certificate_name = None + self._verify_depth = None + self._verify_peer_certificate = None + + @property + def certificate_name(self): + """ + Gets the certificate_name of this SSLConfigurationDetails. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :return: The certificate_name of this SSLConfigurationDetails. + :rtype: str + """ + return self._certificate_name + + @certificate_name.setter + def certificate_name(self, certificate_name): + """ + Sets the certificate_name of this SSLConfigurationDetails. + A friendly name for the certificate bundle. It must be unique and it cannot be changed. + + Example: `My certificate bundle` + + + :param certificate_name: The certificate_name of this SSLConfigurationDetails. + :type: str + """ + self._certificate_name = certificate_name + + @property + def verify_depth(self): + """ + Gets the verify_depth of this SSLConfigurationDetails. + The maximum depth for peer certificate chain verification. + + Example: `3` + + + :return: The verify_depth of this SSLConfigurationDetails. + :rtype: int + """ + return self._verify_depth + + @verify_depth.setter + def verify_depth(self, verify_depth): + """ + Sets the verify_depth of this SSLConfigurationDetails. + The maximum depth for peer certificate chain verification. + + Example: `3` + + + :param verify_depth: The verify_depth of this SSLConfigurationDetails. + :type: int + """ + self._verify_depth = verify_depth + + @property + def verify_peer_certificate(self): + """ + Gets the verify_peer_certificate of this SSLConfigurationDetails. + Whether the load balancer listener should verify peer certificates. + + Example: `true` + + + :return: The verify_peer_certificate of this SSLConfigurationDetails. + :rtype: bool + """ + return self._verify_peer_certificate + + @verify_peer_certificate.setter + def verify_peer_certificate(self, verify_peer_certificate): + """ + Sets the verify_peer_certificate of this SSLConfigurationDetails. + Whether the load balancer listener should verify peer certificates. + + Example: `true` + + + :param verify_peer_certificate: The verify_peer_certificate of this SSLConfigurationDetails. + :type: bool + """ + self._verify_peer_certificate = verify_peer_certificate + + 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 diff --git a/oraclebmc/loadbalancer/models/update_backend_details.py b/oraclebmc/loadbalancer/models/update_backend_details.py new file mode 100644 index 0000000000..1bce4e94f3 --- /dev/null +++ b/oraclebmc/loadbalancer/models/update_backend_details.py @@ -0,0 +1,171 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class UpdateBackendDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backup': 'bool', + 'drain': 'bool', + 'offline': 'bool', + 'weight': 'int' + } + + self.attribute_map = { + 'backup': 'backup', + 'drain': 'drain', + 'offline': 'offline', + 'weight': 'weight' + } + + self._backup = None + self._drain = None + self._offline = None + self._weight = None + + @property + def backup(self): + """ + Gets the backup of this UpdateBackendDetails. + 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 UpdateBackendDetails. + :rtype: bool + """ + return self._backup + + @backup.setter + def backup(self, backup): + """ + Sets the backup of this UpdateBackendDetails. + 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 UpdateBackendDetails. + :type: bool + """ + self._backup = backup + + @property + def drain(self): + """ + Gets the drain of this UpdateBackendDetails. + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + incoming traffic. + + Example: `true` + + + :return: The drain of this UpdateBackendDetails. + :rtype: bool + """ + return self._drain + + @drain.setter + def drain(self, drain): + """ + Sets the drain of this UpdateBackendDetails. + Whether the load balancer should drain this server. Servers marked \"drain\" receive no new + incoming traffic. + + Example: `true` + + + :param drain: The drain of this UpdateBackendDetails. + :type: bool + """ + self._drain = drain + + @property + def offline(self): + """ + Gets the offline of this UpdateBackendDetails. + Whether the load balancer should treat this server as offline. Offline servers receive no incoming + traffic. + + Example: `true` + + + :return: The offline of this UpdateBackendDetails. + :rtype: bool + """ + return self._offline + + @offline.setter + def offline(self, offline): + """ + Sets the offline of this UpdateBackendDetails. + Whether the load balancer should treat this server as offline. Offline servers receive no incoming + traffic. + + Example: `true` + + + :param offline: The offline of this UpdateBackendDetails. + :type: bool + """ + self._offline = offline + + @property + def weight(self): + """ + Gets the weight of this UpdateBackendDetails. + 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 UpdateBackendDetails. + :rtype: int + """ + return self._weight + + @weight.setter + def weight(self, weight): + """ + Sets the weight of this UpdateBackendDetails. + 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 UpdateBackendDetails. + :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 diff --git a/oraclebmc/loadbalancer/models/update_backend_set_details.py b/oraclebmc/loadbalancer/models/update_backend_set_details.py new file mode 100644 index 0000000000..1834231cf8 --- /dev/null +++ b/oraclebmc/loadbalancer/models/update_backend_set_details.py @@ -0,0 +1,156 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class UpdateBackendSetDetails(object): + + def __init__(self): + + self.swagger_types = { + 'backends': 'list[BackendDetails]', + 'health_checker': 'HealthCheckerDetails', + 'policy': 'str', + 'session_persistence_configuration': 'SessionPersistenceConfigurationDetails', + 'ssl_configuration': 'SSLConfigurationDetails' + } + + self.attribute_map = { + 'backends': 'backends', + 'health_checker': 'healthChecker', + 'policy': 'policy', + 'session_persistence_configuration': 'sessionPersistenceConfiguration', + 'ssl_configuration': 'sslConfiguration' + } + + self._backends = None + self._health_checker = None + self._policy = None + self._session_persistence_configuration = None + self._ssl_configuration = None + + @property + def backends(self): + """ + Gets the backends of this UpdateBackendSetDetails. + + :return: The backends of this UpdateBackendSetDetails. + :rtype: list[BackendDetails] + """ + return self._backends + + @backends.setter + def backends(self, backends): + """ + Sets the backends of this UpdateBackendSetDetails. + + :param backends: The backends of this UpdateBackendSetDetails. + :type: list[BackendDetails] + """ + self._backends = backends + + @property + def health_checker(self): + """ + Gets the health_checker of this UpdateBackendSetDetails. + + :return: The health_checker of this UpdateBackendSetDetails. + :rtype: HealthCheckerDetails + """ + return self._health_checker + + @health_checker.setter + def health_checker(self, health_checker): + """ + Sets the health_checker of this UpdateBackendSetDetails. + + :param health_checker: The health_checker of this UpdateBackendSetDetails. + :type: HealthCheckerDetails + """ + self._health_checker = health_checker + + @property + def policy(self): + """ + Gets the policy of this UpdateBackendSetDetails. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` + operation. + + Example: `LEAST_CONNECTIONS` + + + :return: The policy of this UpdateBackendSetDetails. + :rtype: str + """ + return self._policy + + @policy.setter + def policy(self, policy): + """ + Sets the policy of this UpdateBackendSetDetails. + The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN' + To get a list of available policies, use the :func:`list_policies` + operation. + + Example: `LEAST_CONNECTIONS` + + + :param policy: The policy of this UpdateBackendSetDetails. + :type: str + """ + self._policy = policy + + @property + def session_persistence_configuration(self): + """ + Gets the session_persistence_configuration of this UpdateBackendSetDetails. + + :return: The session_persistence_configuration of this UpdateBackendSetDetails. + :rtype: SessionPersistenceConfigurationDetails + """ + return self._session_persistence_configuration + + @session_persistence_configuration.setter + def session_persistence_configuration(self, session_persistence_configuration): + """ + Sets the session_persistence_configuration of this UpdateBackendSetDetails. + + :param session_persistence_configuration: The session_persistence_configuration of this UpdateBackendSetDetails. + :type: SessionPersistenceConfigurationDetails + """ + self._session_persistence_configuration = session_persistence_configuration + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this UpdateBackendSetDetails. + + :return: The ssl_configuration of this UpdateBackendSetDetails. + :rtype: SSLConfigurationDetails + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this UpdateBackendSetDetails. + + :param ssl_configuration: The ssl_configuration of this UpdateBackendSetDetails. + :type: SSLConfigurationDetails + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/update_health_checker_details.py b/oraclebmc/loadbalancer/models/update_health_checker_details.py new file mode 100644 index 0000000000..cdeb597f1d --- /dev/null +++ b/oraclebmc/loadbalancer/models/update_health_checker_details.py @@ -0,0 +1,277 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class UpdateHealthCheckerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'interval_in_millis': 'int', + 'port': 'int', + 'protocol': 'str', + 'response_body_regex': 'str', + 'retries': 'int', + 'return_code': 'int', + 'timeout_in_millis': 'int', + 'url_path': 'str' + } + + self.attribute_map = { + 'interval_in_millis': 'intervalInMillis', + 'port': 'port', + 'protocol': 'protocol', + 'response_body_regex': 'responseBodyRegex', + 'retries': 'retries', + 'return_code': 'returnCode', + 'timeout_in_millis': 'timeoutInMillis', + 'url_path': 'urlPath' + } + + self._interval_in_millis = None + self._port = None + self._protocol = None + self._response_body_regex = None + self._retries = None + self._return_code = None + self._timeout_in_millis = None + self._url_path = None + + @property + def interval_in_millis(self): + """ + Gets the interval_in_millis of this UpdateHealthCheckerDetails. + The interval between health checks, in milliseconds. + + Example: `30000` + + + :return: The interval_in_millis of this UpdateHealthCheckerDetails. + :rtype: int + """ + return self._interval_in_millis + + @interval_in_millis.setter + def interval_in_millis(self, interval_in_millis): + """ + Sets the interval_in_millis of this UpdateHealthCheckerDetails. + The interval between health checks, in milliseconds. + + Example: `30000` + + + :param interval_in_millis: The interval_in_millis of this UpdateHealthCheckerDetails. + :type: int + """ + self._interval_in_millis = interval_in_millis + + @property + def port(self): + """ + Gets the port of this UpdateHealthCheckerDetails. + The backend server port against which to run the health check. + + Example: `8080` + + + :return: The port of this UpdateHealthCheckerDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this UpdateHealthCheckerDetails. + The backend server port against which to run the health check. + + Example: `8080` + + + :param port: The port of this UpdateHealthCheckerDetails. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this UpdateHealthCheckerDetails. + The protocol the health check must use; either HTTP or TCP. + + Example: `HTTP` + + + :return: The protocol of this UpdateHealthCheckerDetails. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this UpdateHealthCheckerDetails. + The protocol the health check must use; either HTTP or TCP. + + Example: `HTTP` + + + :param protocol: The protocol of this UpdateHealthCheckerDetails. + :type: str + """ + self._protocol = protocol + + @property + def response_body_regex(self): + """ + Gets the response_body_regex of this UpdateHealthCheckerDetails. + A regular expression for parsing the response body from the backend server. + + Example: `^(500|40[1348])$` + + + :return: The response_body_regex of this UpdateHealthCheckerDetails. + :rtype: str + """ + return self._response_body_regex + + @response_body_regex.setter + def response_body_regex(self, response_body_regex): + """ + Sets the response_body_regex of this UpdateHealthCheckerDetails. + A regular expression for parsing the response body from the backend server. + + Example: `^(500|40[1348])$` + + + :param response_body_regex: The response_body_regex of this UpdateHealthCheckerDetails. + :type: str + """ + self._response_body_regex = response_body_regex + + @property + def retries(self): + """ + Gets the retries of this UpdateHealthCheckerDetails. + The number of retries to attempt before a backend server is considered \"unhealthy\". + + Example: `3` + + + :return: The retries of this UpdateHealthCheckerDetails. + :rtype: int + """ + return self._retries + + @retries.setter + def retries(self, retries): + """ + Sets the retries of this UpdateHealthCheckerDetails. + The number of retries to attempt before a backend server is considered \"unhealthy\". + + Example: `3` + + + :param retries: The retries of this UpdateHealthCheckerDetails. + :type: int + """ + self._retries = retries + + @property + def return_code(self): + """ + Gets the return_code of this UpdateHealthCheckerDetails. + The status code a healthy backend server should return. + + Example: `200` + + + :return: The return_code of this UpdateHealthCheckerDetails. + :rtype: int + """ + return self._return_code + + @return_code.setter + def return_code(self, return_code): + """ + Sets the return_code of this UpdateHealthCheckerDetails. + The status code a healthy backend server should return. + + Example: `200` + + + :param return_code: The return_code of this UpdateHealthCheckerDetails. + :type: int + """ + self._return_code = return_code + + @property + def timeout_in_millis(self): + """ + Gets the timeout_in_millis of this UpdateHealthCheckerDetails. + The maximum timeout in milliseconds before a retry. + + Example: `6000` + + + :return: The timeout_in_millis of this UpdateHealthCheckerDetails. + :rtype: int + """ + return self._timeout_in_millis + + @timeout_in_millis.setter + def timeout_in_millis(self, timeout_in_millis): + """ + Sets the timeout_in_millis of this UpdateHealthCheckerDetails. + The maximum timeout in milliseconds before a retry. + + Example: `6000` + + + :param timeout_in_millis: The timeout_in_millis of this UpdateHealthCheckerDetails. + :type: int + """ + self._timeout_in_millis = timeout_in_millis + + @property + def url_path(self): + """ + Gets the url_path of this UpdateHealthCheckerDetails. + The path against which to run the health check. + + Example: `/healthcheck` + + + :return: The url_path of this UpdateHealthCheckerDetails. + :rtype: str + """ + return self._url_path + + @url_path.setter + def url_path(self, url_path): + """ + Sets the url_path of this UpdateHealthCheckerDetails. + The path against which to run the health check. + + Example: `/healthcheck` + + + :param url_path: The url_path of this UpdateHealthCheckerDetails. + :type: str + """ + self._url_path = url_path + + 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 diff --git a/oraclebmc/loadbalancer/models/update_listener_details.py b/oraclebmc/loadbalancer/models/update_listener_details.py new file mode 100644 index 0000000000..7befa6ba89 --- /dev/null +++ b/oraclebmc/loadbalancer/models/update_listener_details.py @@ -0,0 +1,145 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class UpdateListenerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'default_backend_set_name': 'str', + 'port': 'int', + 'protocol': 'str', + 'ssl_configuration': 'SSLConfigurationDetails' + } + + self.attribute_map = { + 'default_backend_set_name': 'defaultBackendSetName', + 'port': 'port', + 'protocol': 'protocol', + 'ssl_configuration': 'sslConfiguration' + } + + self._default_backend_set_name = None + self._port = None + self._protocol = None + self._ssl_configuration = None + + @property + def default_backend_set_name(self): + """ + Gets the default_backend_set_name of this UpdateListenerDetails. + The name of the associated backend set. + + + :return: The default_backend_set_name of this UpdateListenerDetails. + :rtype: str + """ + return self._default_backend_set_name + + @default_backend_set_name.setter + def default_backend_set_name(self, default_backend_set_name): + """ + Sets the default_backend_set_name of this UpdateListenerDetails. + The name of the associated backend set. + + + :param default_backend_set_name: The default_backend_set_name of this UpdateListenerDetails. + :type: str + """ + self._default_backend_set_name = default_backend_set_name + + @property + def port(self): + """ + Gets the port of this UpdateListenerDetails. + The communication port for the listener. + + Example: `80` + + + :return: The port of this UpdateListenerDetails. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """ + Sets the port of this UpdateListenerDetails. + The communication port for the listener. + + Example: `80` + + + :param port: The port of this UpdateListenerDetails. + :type: int + """ + self._port = port + + @property + def protocol(self): + """ + Gets the protocol of this UpdateListenerDetails. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :return: The protocol of this UpdateListenerDetails. + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """ + Sets the protocol of this UpdateListenerDetails. + The protocol on which the listener accepts connection requests. + To get a list of valid protocols, use the :func:`list_protocols` + operation. + + Example: `HTTP` + + + :param protocol: The protocol of this UpdateListenerDetails. + :type: str + """ + self._protocol = protocol + + @property + def ssl_configuration(self): + """ + Gets the ssl_configuration of this UpdateListenerDetails. + + :return: The ssl_configuration of this UpdateListenerDetails. + :rtype: SSLConfigurationDetails + """ + return self._ssl_configuration + + @ssl_configuration.setter + def ssl_configuration(self, ssl_configuration): + """ + Sets the ssl_configuration of this UpdateListenerDetails. + + :param ssl_configuration: The ssl_configuration of this UpdateListenerDetails. + :type: SSLConfigurationDetails + """ + self._ssl_configuration = ssl_configuration + + 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 diff --git a/oraclebmc/loadbalancer/models/update_load_balancer_details.py b/oraclebmc/loadbalancer/models/update_load_balancer_details.py new file mode 100644 index 0000000000..66ab1b77d7 --- /dev/null +++ b/oraclebmc/loadbalancer/models/update_load_balancer_details.py @@ -0,0 +1,60 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class UpdateLoadBalancerDetails(object): + + def __init__(self): + + self.swagger_types = { + 'display_name': 'str' + } + + self.attribute_map = { + 'display_name': 'displayName' + } + + self._display_name = None + + @property + def display_name(self): + """ + Gets the display_name of this UpdateLoadBalancerDetails. + The user-friendly display name for the load balancer. It does not have to be unique, and it is changeable. + + Example: `My load balancer` + + + :return: The display_name of this UpdateLoadBalancerDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this UpdateLoadBalancerDetails. + The user-friendly display name for the load balancer. It does not have to be unique, and it is changeable. + + Example: `My load balancer` + + + :param display_name: The display_name of this UpdateLoadBalancerDetails. + :type: str + """ + self._display_name = display_name + + 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 diff --git a/oraclebmc/loadbalancer/models/work_request.py b/oraclebmc/loadbalancer/models/work_request.py new file mode 100644 index 0000000000..7ba74f0b2c --- /dev/null +++ b/oraclebmc/loadbalancer/models/work_request.py @@ -0,0 +1,275 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class WorkRequest(object): + + def __init__(self): + + self.swagger_types = { + 'error_details': 'list[WorkRequestError]', + 'id': 'str', + 'lifecycle_state': 'str', + 'load_balancer_id': 'str', + 'message': 'str', + 'time_accepted': 'datetime', + 'time_finished': 'datetime', + 'type': 'str' + } + + self.attribute_map = { + 'error_details': 'errorDetails', + 'id': 'id', + 'lifecycle_state': 'lifecycleState', + 'load_balancer_id': 'loadBalancerId', + 'message': 'message', + 'time_accepted': 'timeAccepted', + 'time_finished': 'timeFinished', + 'type': 'type' + } + + self._error_details = None + self._id = None + self._lifecycle_state = None + self._load_balancer_id = None + self._message = None + self._time_accepted = None + self._time_finished = None + self._type = None + + @property + def error_details(self): + """ + Gets the error_details of this WorkRequest. + + :return: The error_details of this WorkRequest. + :rtype: list[WorkRequestError] + """ + return self._error_details + + @error_details.setter + def error_details(self, error_details): + """ + Sets the error_details of this WorkRequest. + + :param error_details: The error_details of this WorkRequest. + :type: list[WorkRequestError] + """ + self._error_details = error_details + + @property + def id(self): + """ + Gets the id of this WorkRequest. + The `OCID`__ of the work request. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The id of this WorkRequest. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this WorkRequest. + The `OCID`__ of the work request. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param id: The id of this WorkRequest. + :type: str + """ + self._id = id + + @property + def lifecycle_state(self): + """ + Gets the lifecycle_state of this WorkRequest. + Allowed values for this property are: "ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this WorkRequest. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this WorkRequest. + + :param lifecycle_state: The lifecycle_state of this WorkRequest. + :type: str + """ + allowed_values = ["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED"] + if lifecycle_state not in allowed_values: + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def load_balancer_id(self): + """ + Gets the load_balancer_id of this WorkRequest. + The `OCID`__ of the load balancer with which the work request + is associated. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :return: The load_balancer_id of this WorkRequest. + :rtype: str + """ + return self._load_balancer_id + + @load_balancer_id.setter + def load_balancer_id(self, load_balancer_id): + """ + Sets the load_balancer_id of this WorkRequest. + The `OCID`__ of the load balancer with which the work request + is associated. + + __ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm + + + :param load_balancer_id: The load_balancer_id of this WorkRequest. + :type: str + """ + self._load_balancer_id = load_balancer_id + + @property + def message(self): + """ + Gets the message of this WorkRequest. + A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure. + Possible data elements include: + + - workflow name + - event ID + - work request ID + - load balancer ID + - workflow completion message + + + :return: The message of this WorkRequest. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequest. + A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure. + Possible data elements include: + + - workflow name + - event ID + - work request ID + - load balancer ID + - workflow completion message + + + :param message: The message of this WorkRequest. + :type: str + """ + self._message = message + + @property + def time_accepted(self): + """ + Gets the time_accepted of this WorkRequest. + The date and time the work request was created, in the format defined by RFC3339. + + Example: `2016-08-25T21:10:29.600Z` + + + :return: The time_accepted of this WorkRequest. + :rtype: datetime + """ + return self._time_accepted + + @time_accepted.setter + def time_accepted(self, time_accepted): + """ + Sets the time_accepted of this WorkRequest. + The date and time the work request was created, in the format defined by RFC3339. + + Example: `2016-08-25T21:10:29.600Z` + + + :param time_accepted: The time_accepted of this WorkRequest. + :type: datetime + """ + self._time_accepted = time_accepted + + @property + def time_finished(self): + """ + Gets the time_finished of this WorkRequest. + The date and time the work request was completed, in the format defined by RFC3339. + + Example: `2016-08-25T21:10:29.600Z` + + + :return: The time_finished of this WorkRequest. + :rtype: datetime + """ + return self._time_finished + + @time_finished.setter + def time_finished(self, time_finished): + """ + Sets the time_finished of this WorkRequest. + The date and time the work request was completed, in the format defined by RFC3339. + + Example: `2016-08-25T21:10:29.600Z` + + + :param time_finished: The time_finished of this WorkRequest. + :type: datetime + """ + self._time_finished = time_finished + + @property + def type(self): + """ + Gets the type of this WorkRequest. + The type of action the work request represents. + + + :return: The type of this WorkRequest. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this WorkRequest. + The type of action the work request represents. + + + :param type: The type of this WorkRequest. + :type: str + """ + self._type = type + + 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 diff --git a/oraclebmc/loadbalancer/models/work_request_error.py b/oraclebmc/loadbalancer/models/work_request_error.py new file mode 100644 index 0000000000..e9b7841ee0 --- /dev/null +++ b/oraclebmc/loadbalancer/models/work_request_error.py @@ -0,0 +1,85 @@ +# coding: utf-8 +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + + +from ...util import formatted_flat_dict + + +class WorkRequestError(object): + + def __init__(self): + + self.swagger_types = { + 'error_code': 'str', + 'message': 'str' + } + + self.attribute_map = { + 'error_code': 'errorCode', + 'message': 'message' + } + + self._error_code = None + self._message = None + + @property + def error_code(self): + """ + Gets the error_code of this WorkRequestError. + Allowed values for this property are: "BAD_INPUT", "INTERNAL_ERROR", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The error_code of this WorkRequestError. + :rtype: str + """ + return self._error_code + + @error_code.setter + def error_code(self, error_code): + """ + Sets the error_code of this WorkRequestError. + + :param error_code: The error_code of this WorkRequestError. + :type: str + """ + allowed_values = ["BAD_INPUT", "INTERNAL_ERROR"] + if error_code not in allowed_values: + error_code = 'UNKNOWN_ENUM_VALUE' + self._error_code = error_code + + @property + def message(self): + """ + Gets the message of this WorkRequestError. + A human-readable error string. + + + :return: The message of this WorkRequestError. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this WorkRequestError. + A human-readable error string. + + + :param message: The message of this WorkRequestError. + :type: str + """ + self._message = message + + 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