Overview

Namespaces

  • None
  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Exceptions
      • Log
      • Request
        • Response
    • Compute
    • Database
    • DNS
    • LoadBalancer
      • Resources
    • ObjectStore
      • Resource
    • Orchestration
    • Volume
  • PHP

Classes

  • Access
  • Algorithm
  • AllowedDomain
  • BillableLoadBalancer
  • ConnectionLogging
  • ConnectionThrottle
  • ContentCaching
  • ErrorPage
  • HealthMonitor
  • LoadBalancer
  • Metadata
  • Node
  • NodeEvent
  • Protocol
  • Readonly
  • SessionPersistence
  • SSLTermination
  • Stats
  • SubResource
  • Usage
  • VirtualIp
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class LoadBalancer

A load balancer is a logical device which belongs to a cloud account. It is used to distribute workloads between multiple back-end systems or services, based on the criteria defined as part of its configuration.

OpenCloud\Common\Base
Extended by OpenCloud\Common\PersistentObject
Extended by OpenCloud\LoadBalancer\Resources\LoadBalancer
Namespace: OpenCloud\LoadBalancer\Resources
Located at OpenCloud/LoadBalancer/Resources/LoadBalancer.php
Methods summary
public
# addNode( string $address, integer $port, boolean $condition = 'ENABLED', string $type = null, integer $weight = null )

adds a node to the load balancer

adds a node to the load balancer

This method creates a Node object and adds it to a list of Nodes to be added to the LoadBalancer. Very important: this method NEVER adds the nodes directly to the load balancer itself; it stores them on the object, and the nodes are added later, in one of two ways:

  • for a new LoadBalancer, the Nodes are added as part of the Create() method call.
  • for an existing LoadBalancer, you must call the AddNodes() method

Parameters

$address
string
$address the IP address of the node
$port
integer
$port the port # of the node
$condition
boolean
$condition the initial condition of the node
$type
string
$type either PRIMARY or SECONDARY
$weight
integer
$weight the node weight (for round-robin)

Throws

OpenCloud\DomainError
if value is not valid

Api

public HttpResponse
# addNodes( )

adds queued nodes to the load balancer

adds queued nodes to the load balancer

In many cases, Nodes will be added to the Load Balancer when it is created (via the Create() method), but this method is provided when a set of Nodes needs to be added after the fact.

Returns

HttpResponse

Api

public
# addVirtualIp( string $type = 'PUBLIC', integer $ipVersion = NULL )

adds a virtual IP to the load balancer

adds a virtual IP to the load balancer

You can use the strings 'PUBLIC' or 'SERVICENET' to indicate the public or internal networks, or you can pass the Id of an existing IP address.

Parameters

$type
string
$id either 'public' or 'servicenet' or an ID of an existing IP address
$ipVersion
integer
$ipVersion either null, 4, or 6 (both, IPv4, or IPv6)

Api

public
# node( mixed $id = null )

returns a Node object

returns a Node object

public
# nodeList( )

returns a Collection of Nodes

returns a Collection of Nodes

public
# nodeEvent( )

returns a NodeEvent object

returns a NodeEvent object

public
# nodeEventList( )

returns a Collection of NodeEvents

returns a Collection of NodeEvents

public
# virtualIp( mixed $data = null )

returns a single Virtual IP (not called publicly)

returns a single Virtual IP (not called publicly)

public
# virtualIpList( )

returns a Collection of Virtual Ips

returns a Collection of Virtual Ips

public
# sessionPersistence( )
public OpenCloud\LoadBalancer\Resources\ErrorPage
# errorPage( )

returns the load balancer's error page object

returns the load balancer's error page object

Returns

OpenCloud\LoadBalancer\Resources\ErrorPage

Api

public OpenCloud\LoadBalancer\Resources\HealthMonitor
# healthMonitor( )

returns the load balancer's health monitor object

returns the load balancer's health monitor object

Returns

OpenCloud\LoadBalancer\Resources\HealthMonitor

Api

public OpenCloud\LoadBalancer\Resources\Stats
# stats( )

returns statistics on the load balancer operation

returns statistics on the load balancer operation

cannot be created, updated, or deleted

Returns

OpenCloud\LoadBalancer\Resources\Stats

Api

public
# usage( )
public
# access( mixed $data = null )
public
# accessList( )
public
# connectionThrottle( )
public
# connectionLogging( )
public
# contentCaching( )
public
# SSLTermination( )
public
# metadata( mixed $data = null )
public
# metadataList( )
protected stdClass
# createJson( )

returns the JSON object for Create()

returns the JSON object for Create()

Returns

stdClass

Throws

CreateError
if not overridden

Overrides

OpenCloud\Common\PersistentObject::createJson()
Methods inherited from OpenCloud\Common\PersistentObject
__construct(), __set(), action(), checkExtension(), create(), createUrl(), customAction(), delete(), findLink(), getParent(), getService(), id(), jsonCollectionElement(), jsonCollectionName(), jsonName(), name(), noCreate(), noDelete(), noUpdate(), parent(), primaryKeyField(), refresh(), region(), resourceName(), service(), setParent(), setService(), status(), update(), updateJson(), url(), waitFor()
Methods inherited from OpenCloud\Common\Base
checkJsonError(), getHttpRequestObject(), getLogger(), makeQueryString(), populate(), setLogger(), setProperty()
Properties summary
public mixed $id
#
public string $name
#

Name of the load balancer to create. The name must be 128 characters or less in length, and all UTF-8 characters are valid.

Name of the load balancer to create. The name must be 128 characters or less in length, and all UTF-8 characters are valid.

public integer $port
#

Port number for the service you are load balancing.

Port number for the service you are load balancing.

public string $protocol
#

Protocol of the service which is being load balanced.

Protocol of the service which is being load balanced.

public array $virtualIps array()
#

Type of virtual IP to add along with the creation of a load balancer.

Type of virtual IP to add along with the creation of a load balancer.

public array $nodes array()
#

Nodes to be added to the load balancer.

Nodes to be added to the load balancer.

public Collection $accessList
#

The access list management feature allows fine-grained network access controls to be applied to the load balancer's virtual IP address.

The access list management feature allows fine-grained network access controls to be applied to the load balancer's virtual IP address.

public string $algorithm
#

Algorithm that defines how traffic should be directed between back-end nodes.

Algorithm that defines how traffic should be directed between back-end nodes.

public string $connectionLogging
#

Current connection logging configuration.

Current connection logging configuration.

public string $connectionThrottle
#

Specifies limits on the number of connections per IP address to help mitigate malicious or abusive traffic to your applications.

Specifies limits on the number of connections per IP address to help mitigate malicious or abusive traffic to your applications.

public string $healthMonitor
#

The type of health monitor check to perform to ensure that the service is performing properly.

The type of health monitor check to perform to ensure that the service is performing properly.

public mixed $sessionPersistence
#
public array|OpenCloud\LoadBalancer\Resources\Metadata $metadata array()
#

Information (metadata) that can be associated with each load balancer for the client's personal use.

Information (metadata) that can be associated with each load balancer for the client's personal use.

public integer $timeout
#

The timeout value for the load balancer and communications with its nodes. Defaults to 30 seconds with a maximum of 120 seconds.

The timeout value for the load balancer and communications with its nodes. Defaults to 30 seconds with a maximum of 120 seconds.

public mixed $created
#
public mixed $updated
#
public mixed $status
#
public mixed $nodeCount
#
public mixed $sourceAddresses
#
public mixed $cluster
#
protected static string $json_name 'loadBalancer'
#
protected static string $url_resource 'loadbalancers'
#
PHP OpenCloud API API documentation generated by ApiGen 2.8.0