Cluster Real Service Methods

API methods for cluster real services.

cluster.real_service.disable()

Disable the Cluster Server in the Cluster Service.

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
Returns:

If the server is enabled, a dictionary as described in job.status().

Raises :

May raise ApiErrorDoesNotExist if the Cluster, Cluster Service or server does not exist.

cluster.real_service.disable_fallback()

Unset the Real Service as fallback.

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
Returns:

If in fallback, a dictionary as described in job.status().

Raises :

ApiErrorDoesNotExist if the Cluster, Cluster Service or Cluster Server does not exist (in the cluster/account).

When in fallback mode, the real service is used when all other real services are down. Only one Real Service can be in fallback mode.

cluster.real_service.enable()

Enable the Cluster Server in the Cluster Real Service.

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
Returns:

If the server is disabled, a dictionary as described in job.status().

Raises :

May raise ApiErrorDoesNotExist if the Cluster, Cluster Service or server does not exist.

cluster.real_service.enable_fallback()

Set the Real Service as fallback.

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
Returns:

If not in fallback, a dictionary as described in job.status().

Raises :

ApiErrorDoesNotExist if the Cluster, Cluster Service or Cluster Server does not exist (in the cluster/account).

Raises :

ApiErrorPreconditionFailed if a server in the Cluster Service is already set as fallback.

Raises :

ApiErrorPreconditionFailed if the Real Service is not enabled.

When in fallback mode, the real service is used when all other real services are down. Only one Real Service can be in fallback mode.

cluster.real_service.info()

Information about a Cluster Real Service

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
Returns:

a dictionary with the following keys:

ip_address

String: IP Address the service is listening on.

port

String: The port the service is on.

weight

Integer: The weight for this service.

fallback

Boolean: Whether this real service is set as a fallback.

enabled

Boolean: Whether this real service is enabled. When disabled, it is not part of the service.

Raises :

May raise ApiErrorDoesNotExist if the cluster, Cluster Service, Cluster Real Service or Cluster Server does exist.

cluster.real_service.list()

List the Cluster Real Services for a given Cluster Service.

FIXME: returns

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
cluster.real_service.set_weight()

Change the weight of a server in the service.

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
  • weight (Integer) – Weight is an integer specifying the capacity of a server (relative to the others in the pool). A weight of zero means that the server will not receive new jobs.
Returns:

If new weight is different to existing value, a dictionary as described in job.status().

Raises :

ApiErrorDoesNotExist if the Cluster, Cluster Service or Cluster Server does not exist (in the cluster/account).

cluster.real_service.statistics()

Statistical information about a Cluster Real Service.

Parameters:
  • cluster_name (String) – Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service_name (String) – Name of the cluster service.
  • server_name (String) – Name of the cluster server.
Returns:

a dictionary with the following keys:

active

Boolean: Whether this real service is active in the cluster service.

active_connections

Integer: Current number of active connections

bps_in

Integer: Current bits per second in

bps_out

Integer: Current bits per second out

connections_per_second

Integer: Current number of connections per second

inactive_connections

Integer: Current number of inactive connections

last_update

Date (with time): The time the status was last updated

persistent_connections

Integer persistent connections - Current number of persistent connections

pps_in

Integer: Current number of packets per second in

pps_out

Integer: Current number of packets per second out

Raises :

May raise ApiErrorDoesNotExist if the cluster, Cluster Service, Cluster Real Service or Cluster Server does exist.

N.B. The data is not live and is thus always at least a few minutes out-of-date. This method can be polled frequently without concern for performance.

Previous topic

Cluster Methods

Next topic

Cluster Server Methods

This Page