Loadbalancer Service Methods

API methods for managing Load Balancer services.

loadbalancer.service.add()

Define a new service on the given load balancer. The service must be given a name. This is used to refer to the service later.

Parameters:
  • load_balancer (String) – The name of the load balancer. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – The name of the load balancer service. Service names must only consist of letters, numbers, underscores and hyphens. Ensure this value has at most 64 characters.
  • protocol (String) – The protocol to be used by the load balacer. Acceptable values: ‘tcp’, ‘http’, ‘https’.
  • virtual_ip (String) – The virtual IP address. This is the address clients will connect to.
  • port (Integer) – The port number clients will connect to. Ensure this value is greater than or equal to 1. Ensure this value is less than or equal to 65535.
  • enabled (Boolean, Optional) – Whether the service is enabled or not. Defaults to True.
Returns:

A dictionary of the newly defined service as described in loadbalancer.service.info().

Raises :

Will raise:

loadbalancer.service.info()

Describe a load balancer service.

Parameters:
  • load_balancer (String) – The name of the load balancer. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – The name of the load balancer service. Service names must only consist of letters, numbers, underscores and hyphens. Ensure this value has at most 64 characters.
Returns:

A dictionary with the following keys:

name

String: Name of the service.

enabled:

Boolean: If the service is enabled or not.

virtual_ip:

String: The load-balanced IP (that which should be used in DNS records).

port:

Integer: The TCP port number.

protocol:

String: Service type (e.g. http)

servers:

A list of dictionaries as described in loadbalancer.server.info().

Raises :

Will raise ApiErrorDoesNotExist if the load balancer or named service does not exist.

loadbalancer.service.list()

List a load balancer’s services.

Parameters:load_balancer (String) – The name of the load balancer. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
Returns:A list of dictionaries as described in loadbalancer.service.info().
loadbalancer.service.remove()

Remove a service. The service must have no servers attached to it.

Parameters:
  • load_balancer (String) – The name of the load balancer. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – The name of the load balancer service. Service names must only consist of letters, numbers, underscores and hyphens. Ensure this value has at most 64 characters.
Returns:

The name of the removed service.

Raises :

Will raise:

loadbalancer.service.update()

Update a service’s settings. Settings that are not provided will not be updated.

Parameters:
  • load_balancer (String) – The name of the load balancer. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – The name of the load balancer service. Service names must only consist of letters, numbers, underscores and hyphens. Ensure this value has at most 64 characters.
  • protocol (String, Optional) – The protocol to be used by the load balacer. Acceptable values: ‘tcp’, ‘http’, ‘https’.
  • virtual_ip (String, Optional) – The virtual IP address. This is the address clients will connect to.
  • port (Integer, Optional) – The port number clients will connect to. Ensure this value is greater than or equal to 1. Ensure this value is less than or equal to 65535.
  • enabled (Boolean, Optional) – Whether the service is enabled or not.
Returns:

A dictionary of the updated load balancer service as described in loadbalancer.service.info().

Raises :

Will raise:

Previous topic

Loadbalancer Server Methods

Next topic

Memshell Methods

This Page