SoftLayer.load_balancer

Load Balancer Manager/helpers

license:MIT, see LICENSE for more details.
class SoftLayer.managers.load_balancer.LoadBalancerManager(client)[source]

Manages SoftLayer load balancers.

See product information here: https://www.ibm.com/cloud/load-balancer

Parameters:client (SoftLayer.API.BaseClient) – the client instance
add_lb_l7_pool(identifier, pool, members, health, session)[source]

Creates a new l7 pool for a LBaaS instance

Parameters:
  • identifier – UUID of the LBaaS instance
  • SoftLayer_Network_LBaaS_L7Pool (pool) – Description of the pool
  • SoftLayer_Network_LBaaS_L7Member[] (members) – Array of servers with their address, port, weight
  • SoftLayer_Network_LBaaS_L7HealthMonitor (monitor) – A health monitor
  • SoftLayer_Network_LBaaS_L7SessionAffinity (session) – Weather to use affinity
add_lb_listener(identifier, listener)[source]

Adds or update a listener to a LBaaS instance

When using this to update a listener, just include the ‘listenerUuid’ in the listener object See the following for listener configuration options https://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_LBaaS_LoadBalancerProtocolConfiguration/

Parameters:
  • identifier – UUID of the LBaaS instance
  • listener – Object with all listener configurations
add_lb_member(identifier, service_info)[source]

Adds a member to a LBaaS instance

https://sldn.softlayer.com/reference/services/SoftLayer_Network_LBaaS_Member/deleteLoadBalancerMembers/ :param identifier: UUID of the LBaaS instance :param service_info: datatypes/SoftLayer_Network_LBaaS_LoadBalancerServerInstanceInfo

cancel_lbaas(uuid)[source]

Cancels a LBaaS instance.

https://sldn.softlayer.com/reference/services/SoftLayer_Network_LBaaS_LoadBalancer/cancelLoadBalancer/ :param uuid string: UUID of the LBaaS instance to cancel

del_lb_l7_pool(identifier)[source]

Deletes a l7 pool

Parameters:identifier – Id of the L7Pool
delete_lb_member(identifier, member_id)[source]

Removes a member from a LBaaS instance

https://sldn.softlayer.com/reference/services/SoftLayer_Network_LBaaS_Member/deleteLoadBalancerMembers/ :param identifier: UUID of the LBaaS instance :param member_id: Member UUID to remove.

get_adc(identifier, mask=None)[source]

Returns a netscaler object.

Returns:SoftLayer_Network_Application_Delivery_Controller.
get_adcs(mask=None)[source]

Returns a list of all netscalers.

Returns:SoftLayer_Network_Application_Delivery_Controller[].
get_lb(identifier, mask=None)[source]

Returns a IBM Cloud LoadBalancer

Returns:SoftLayer_Network_LBaaS_LoadBalancer
get_lbaas(mask=None)[source]

Returns a list of IBM Cloud Loadbalancers

Returns:SoftLayer_Network_LBaaS_LoadBalancer[]
get_lbaas_by_name(name, mask=None)[source]

Gets a LBaaS by name.

Parameters:
  • name – Name of the LBaaS instance
  • mask
Returns:

SoftLayer_Network_LBaaS_LoadBalancer.

get_lbaas_uuid_id(identifier)[source]

Gets a LBaaS uuid, id. Since sometimes you need one or the other.

Parameters:identifier – either the LB Id, UUID or Name, this function will return UUI and LB Id.
Return (uuid, id):
 
lbaas_order_options()[source]

Gets the options to order a LBaaS instance.

order_lbaas(datacenter, name, desc, protocols, subnet_id, public=False, verify=False)[source]

Allows to order a Load Balancer

Parameters:
remove_lb_listener(identifier, listener)[source]

Removes a listener to a LBaaS instance

Parameters:
  • identifier – UUID of the LBaaS instance
  • listener – UUID of the Listner to be removed.
resolve_ids(identifier)

Takes a string and tries to resolve to a list of matching ids.

What exactly ‘identifier’ can be depends on the resolvers

Parameters:identifier (string) – identifying string
Returns list:
update_lb_health_monitors(uuid, checks)[source]

calls SoftLayer_Network_LBaaS_HealthMonitor::updateLoadBalancerHealthMonitors()

Parameters:
  • uuid – loadBalancerUuid
  • list (checks) – SoftLayer_Network_LBaaS_LoadBalancerHealthMonitorConfiguration[]