LoadBalancerManager

class SoftLayer.managers.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

__init__(client)[source]

Methods

__init__(client)

add_lb_l7_pool(identifier, pool, members, ...)

Creates a new l7 pool for a LBaaS instance

add_lb_listener(identifier, listener)

Adds or update a listener to a LBaaS instance

add_lb_member(identifier, service_info)

Adds a member to a LBaaS instance

add_protocols(uuid, protocols)

This sample shows how to add protocols to the LBaaS.

cancel_lbaas(uuid)

Cancels a LBaaS instance.

del_lb_l7_pool(identifier)

Deletes a l7 pool

delete_lb_member(identifier, member_id)

Removes a member from a LBaaS instance

delete_protocol(uuid_lb, uuid)

This sample shows how to delete protocols to the LBaaS.

get_adc(identifier[, mask])

Returns a netscaler object.

get_adcs([mask])

Returns a list of all netscalers.

get_all_l7policies()

Gets all Layer7 policies

get_l7policies(identifier)

Gets Layer7 policies from a listener

get_lb(identifier[, mask])

Returns a IBM Cloud LoadBalancer

get_lb_type(lb_type)

return the loadbalancer type.

get_lb_uuid(identifier)

this sample show the uuid from loadbalancer.

get_lbaas([mask])

Returns a list of IBM Cloud Loadbalancers

get_lbaas_by_name(name[, mask])

Gets a LBaaS by name.

get_lbaas_uuid_id(identifier)

Gets a LBaaS uuid, id.

lbaas_order_options()

Gets the options to order a LBaaS instance.

order_lbaas(datacenter, name, desc, ...[, ...])

Allows to order a Load Balancer

remove_lb_listener(identifier, listener)

Removes a listener to a LBaaS instance

resolve_ids(identifier)

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

update_lb_health_monitors(uuid, checks)

calls SoftLayer_Network_LBaaS_HealthMonitor::updateLoadBalancerHealthMonitors()

Attributes

TYPE

resolvers

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

add_protocols(uuid, protocols)[source]

This sample shows how to add protocols to the LBaaS.

https://softlayer.github.io/reference/services/SoftLayer_Network_LBaaS_Listener/updateLoadBalancerProtocols/ :param uuid string: UUID of the LBaaS instance to add a new protocol :param protocols SoftLayer_Network_LBaaS_LoadBalancerProtocolConfiguration[]: protocol configurations

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.

delete_protocol(uuid_lb, uuid)[source]

This sample shows how to delete protocols to the LBaaS.

https://softlayer.github.io/reference/services/SoftLayer_Network_LBaaS_Listener/updateLoadBalancerProtocols/ :param uuid string: UUID of the LBaaS instance to add a new protocol :param protocols SoftLayer_Network_LBaaS_LoadBalancerProtocolConfiguration[]: protocol configurations

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_all_l7policies()[source]

Gets all Layer7 policies

Returns:

Dictionary of (protocol_id: policies list).

get_l7policies(identifier)[source]

Gets Layer7 policies from a listener

Parameters:

identifier – id

get_lb(identifier, mask=None)[source]

Returns a IBM Cloud LoadBalancer

Returns:

SoftLayer_Network_LBaaS_LoadBalancer

get_lb_type(lb_type)[source]

return the loadbalancer type.

Parameters:

lb_type – load balancer type

get_lb_uuid(identifier)[source]

this sample show the uuid from loadbalancer.

Parameters:

int (identifier) – loadbalancer identifier.

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[]