CloudLB

class CloudLB.CloudLB(env, region=None)[source]

Bases: Cloud.Cloud

service = 'LoadBalancers'
getLimits(absolute=False)[source]

Return the current rate limits for the account. Pass True to return absolute limits.

Arguments: absolute – Bool, set True for absolute limits. Defaults to False

Returns: JSON results as python dict

getAbsoluteLimits()[source]

Return the current absolute limits for the account.

Arguments: absolute – Bool, set True for absolute limits. Defaults to False

Returns: JSON results as python dict

getLBs()[source]

List all load balancers configured for the account (IDs, names and status only).

Arguments:

Returns: JSON results as python dict

getLB(lbId)[source]

Retrieve load balancer details.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

createLB(name, port, nodes, protocol, virtualIps, attrDict={})[source]

Create a new load balancer with the configuration defined by the request.

Arguments: name – Name of LB(str) port – nodes – A list containing a dictionary for each with all of the following key/values:

address – IP address of node (Required) port – Port number for the service you are load balancing on the node. (Required) condition – ENABLED / DISABLED (Required) id – Id of node (Optional) status – ONLINE / OFFLINE (Optional)

protocol – HTTP / HTTPS / DNS / IMAPS / LDAP / MYSQL / POP3 / SMTP / TCP / UDP / SFTP etc. virtualIps – A list containing a dictionary with any of the following key/values:

type – PUBLIC / PRIVATE (Required) address – IP address of virtual IP (Optional) id – Id of existing LB virtual ip. (Optional) ipVersion – IPV4 / IPV6 (Optional)
attrDict Options:
accessList – Network access controls to be applied to the load balancer’s virtual IP address. algorithm – Algorithm that defines how traffic should be directed between back-end nodes. connectionLogging – Current connection logging configuration. connectionThrottle – Limits on the number of connections per IP address healthMonitor – The type of health monitor check to perform. metadata – Information that can be associated with each load balancer for the client’s personal use. port – Port number for the service you are load balancing on the node. timeout – sessionPersistence – Specifies whether multiple requests from clients are directed to the same node.

Returns: status code

updateLB(lbId, attrDict={})[source]

Updates the attributes of the specified load balancer.

Arguments: lbId – Load Balancer id

attrDict Options:
name – Name of the load balancer to create protocol – Protocol of the service which is being load balanced. algorithm – Algorithm that defines how traffic should be directed between back-end nodes. port – Port number for the service you are load balancing. connectionLogging – true/false

Returns: status code

deleteLB(lbId)[source]

Removes the specified load balancer and its associated configuration from the account.

Arguments: lbId – Load Balancer id

Returns: status code

getErrorPage(lbId)[source]

List error page configured for the specified load balancer.

Arguments: lbId – Load Balancer id

Returns: JSON results as Python dict

setErrorPage(lbId, content)[source]

Set custom error page for the specified load balancer.

Arguments: lbId – Load Balancer id contents – HTML markup(string)

Returns: response code

deleteErrorPage(lbId)[source]

Delete custom error page for the specified load balancer.

Arguments: lbId – Load Balancer id

Returns: status code

getStats(lbId)[source]

Provides detailed stats output of specified LB.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

getNode(lbId, nId)[source]

List a specific node per a specified load balancer.

Arguments: lbId – Load Balancer id nId – Node id

Returns: JSON results as python dict

getNodes(lbId)[source]

List nodes per a specified load balancer.

Arguments: lbId – Load Balancer id nId – Node id

Returns: JSON results as python dict

createNode(lbId, attrList=[])[source]

Add a node to a specified load balancer.

Arguments: lbId – load balancer id

attrList – python list of dict options:
address – IP address or domain name for the node.(Required) condition – Condition for the node. ENABLED / DISABLED / DRAINING (Required) port – Port number for the service you are load balancing.(Required) type – Type of node to add: PRIMARY / SECONDARY (Optional) weight – Weight of node to add. Must be an integer from 1 to 100.(Optional)

Returns: status code

updateNode(lbId, nId, attrDict)[source]

Modify a node per a specified load balancer.

Arguments: lbId – Load Balancer id nId – Node id

attrDict Options:
condition – Condition for the node. ENABLED / DISABLED / DRAINING type – Type of node to add: PRIMARY / SECONDARY weight – Weight of node to add. Must be an integer from 1 to 100.

Returns: status code

deleteNode(lbId, nodeList=[])[source]

Remove node(s) per a specified load balancer.

Arguments: lbId – Load Balancer id nodeList – Python list containing nodes to delete.

Returns: status code

getVirtualIPs(lbId)[source]

List all virtual IPs associated with a load balancer.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

getVirtualIP(lbId, vpId)[source]

List a specific virtual IP associated with a load balancer.

Arguments: lbId – Load Balancer id vpId – Load Balancer id

Returns: JSON results as python dict

getAllowedDomains()[source]

List all allowed domains.

Arguments:

Returns: JSON results as python dict

createVirtualIP(lbId, typeIp, ipVersion='IPV6')[source]

Create a new virtual IP (v.6) with the configuration defined by the request.

Arguments: lbId – Load Balancer id typeIp – PUBLIC/SERVICENET ipVersion – IPV6

Returns: status code

deleteVirtualIP(lbId, vipList=[])[source]

Remove virtual ip(s) from the load balancer.

Arguments: lbId – Load Balancer id vipList – Python list containing virtual Ip’s to delete.

Returns: status code

getBillable(startTime, endTime, offset=None, limit=None)[source]

List paginated billable load balancers.

Arguments: startTime – start date; format is YYYY-MM-DD endTime – end date; format is YYYY-MM-DD offset – (Optional) limit – (Optional)

Returns: JSON results as python dict

getUsage(lbId=None, startTime=None, endTime=None, offset=None, limit=None)[source]

List types of usage statistics (transfer activity, average number of connections, virtual IP count) over a date range or last 24 hours (“current”).

Arguments: lbId – load balancer id (Optional) startTime – start date; format is YYYY-MM-DD (Optional, if not set then current=true with lbId) endTime – end date; format is YYYY-MM-DD (Optional, if not set then current=true with lbId) offset – (Optional) limit – (Optional)

Returns: JSON results as python dict

getAccessList(lbId)[source]

List all access list associated with a load balancer.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

createAccessList(lbId, ipList=[])[source]

Create a new access list with the configuration defined by the request.

Arguments: lbId – Load Balancer id ipList – python list of dictionary key/value args:

address – ip address for item to add alType – ALLOW / DENY

Returns: status code

updateAccessList(lbId, ipList=[])[source]

Update an access list with the configuration defined by the request.

Arguments: lbId – Load Balancer id ipList – python list of dictionaries with these required args:

address – ip address for item to add type – ALLOW / DENY

Returns: status code

deleteAccessList(lbId)[source]

Remove access list from the load balancer.

Arguments: lbId – Load Balancer id

Returns: status code

deleteAccessListNetworkItems(lbId, ipList=[])[source]

Remove network item(s) from a load balancer’s access list.

Arguments: lbId – Load Balancer id ipList – Python list containing network item id’s to delete.

Returns: status code

getMonitorHealth(lbId)[source]

Retrieve health monitor configuration (if one exists).

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

deleteMonitorHealth(lbId)[source]

Remove health monitor from the load balancer.

Arguments: lbId – Load Balancer id

Returns: status code

updateMonitorHealthConn(lbId, attempts, delay, timeout, type)[source]

Update Health Monitor connections with the configuration defined by the request.

Arguments: lbId – Load Balancer id attempts – attempts before deactivation delay – timeout – type –

Returns: status code

updateMonitorHealthHttp(lbId, attempts, bRegex, delay, path, sRegex, timeout, type, hostHeader=None)[source]

Update Health Monitor HTTP/HTTPS with the configuration defined by the request.

Arguments: lbId – Load Balancer id attempts – attempts before deactivation bRegex – bodyRegex delay – path – sRegex – statusRegex timeout – type – hostHeader –

Returns: status code

getSession(lbId)[source]

Retrieve session persistence configuration.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

updateSession(lbId, type)[source]

Update session persistence with the configuration defined by the request.

Arguments: lbId – Load Balancer id type – persistence type - HTTP_COOKIE / SOURCE_IP

Returns: status code

deleteSession(lbId)[source]

Disable session persistence from the load balancer.

Arguments: lbId – Load Balancer id

Returns: status code

getConnection(lbId)[source]

Retrieve connection logging configuration.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

setConnection(lbId, enabled)[source]

Enable/disable connection logging.

Arguments: lbId – Load Balancer id enabled – true / false

Returns: status code

getConnectionThrottle(lbId)[source]

Retrieve connection throttle configuration.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

updateConnectionThrottle(lbId, attrDict={})[source]

Update connection throttle configuration defined by the request.

Arguments: lbId – Load Balancer id attrDict – python dict options:

maxConnectionRate – (Optional) maxConnections – (Optional) minConnections – (Optional) rateInterval – (Optional)

Returns: status code

deleteConnectionThrottle(lbId)[source]

Remove connection throttle configuration from the load balancer.

Arguments: lbId – Load Balancer id (Required)

Returns: status code

getContentCaching(lbId)[source]

Retrieve content caching configuration.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

setContentCaching(lbId, enabled)[source]

Enable/disable content caching.

Arguments: lbId – Load Balancer id enabled – true / false

Returns: status code

getProtocols()[source]

List supported load balancing protocols.

Arguments:

Returns: JSON results as python dict

getAlgorithms()[source]

List supported load balancing algorithms.

Arguments:

Returns: JSON results as python dict

getSSLTermination(lbId)[source]

List load balancers SSL termination configuration.

Arguments: lbId – Load Balancer id

Returns: JSON results as python dict

setSSLTermination(lbId, attrDict)[source]

Update/configure SSL termination.

Arguments: lbId – Load Balancer id

attrDict – python dictionary options:
securePort – (Required) privatekey – (Required) certificate – (Required) intermediatecertificate – (Required for intermediate SSL Termination) enabled – true / false (Optional) secureTrafficOnly – true / false (Optional)

Returns: status code

deleteSSLTermination(lbId)[source]

Remote SSL Termination.

Arguments: lbId – Load Balancer id

Returns: status code

getMetadata(lbId, metaId=None, nodeId=None)[source]

Retrieve metadata associated with load balancer.

Arguments: lbId – Load Balancer id metaId – Meta id (Optional) nodeId – Node id (Optional)

Returns: JSON results as python dict

createMetadata(lbId, metaList=[], nodeId=None)[source]

Create metadata per a load balancer.

Arguments: lbId – Load Balancer id nodeId – (Optional) metaList – python list of meta key/value dictionaries:

key – value –

Returns: status code

updateMetadata(lbId, metaId, value, nodeId=None)[source]

Update metadata per a load balancer (and optionally with a node) defined by the request.

Arguments: lbId – Load Balancer id metaId – Meta id value – nodeId – Node id (Optional)

Returns: status code

deleteMetadata(lbId, metaIdList, nodeId=None)[source]

Remove metadata per a load balancer.

Arguments: lbId – Load Balancer id metaIdList – Python list containing metadata id’s to delete. nodeId – Node id (Optional)

Returns: status code

Previous topic

CloudFiles

Next topic

CloudMonitor