1: <?php
2: /**
3: * PHP OpenCloud library.
4: *
5: * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information.
6: * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
7: * @version 1.6.0
8: * @author Glen Campbell <glen.campbell@rackspace.com>
9: * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
10: */
11:
12: namespace OpenCloud\LoadBalancer\Resource;
13:
14: /**
15: * All load balancers utilize an algorithm that defines how traffic should be
16: * directed between back-end nodes. The default algorithm for newly created load
17: * balancers is RANDOM, which can be overridden at creation time or changed
18: * after the load balancer has been initially provisioned. The algorithm name is
19: * to be constant within a major revision of the load balancing API, though new
20: * algorithms may be created with a unique algorithm name within a given major
21: * revision of the service API.
22: *
23: * Accepted options are:
24: *
25: * * LEAST_CONNECTIONS: The node with the lowest number of connections will
26: * receive requests.
27: *
28: * * RANDOM: Back-end servers are selected at random.
29: *
30: * * ROUND_ROBIN: Connections are routed to each of the back-end servers in turn.
31: *
32: * * WEIGHTED_LEAST_CONNECTIONS: Each request will be assigned to a node based
33: * on the number of concurrent connections to the node and its weight.
34: *
35: * * WEIGHTED_ROUND_ROBIN: A round robin algorithm, but with different
36: * proportions of traffic being directed to the back-end nodes. Weights
37: * must be defined as part of the load balancer's node configuration.
38: */
39: class Algorithm extends Readonly
40: {
41:
42: public $name;
43: protected static $json_name = 'algorithm';
44: protected static $url_resource = 'loadbalancers/algorithms';
45:
46: }
47: