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
- 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
- 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_lb(identifier, mask=None)[source]¶
Returns a IBM Cloud LoadBalancer
- Returns
SoftLayer_Network_LBaaS_LoadBalancer
- 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)
- order_lbaas(datacenter, name, desc, protocols, subnet_id, public=False, verify=False)[source]¶
Allows to order a Load Balancer
- Parameters
datacenter – Shortname for the SoftLayer datacenter to order in.
name – Identifier for the new LB.
desc – Optional description for the lb.
protocols – https://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_LBaaS_Listener/
subnet_id – Id of the subnet for this new LB to live on.
public – Use Public side for the backend.
verify – Don’t actually order if True.
- 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