Overview
  • Namespace
  • Class

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CDN
      • Resource
    • CloudMonitoring
      • Collection
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Collection
      • Enum
      • Resource
    • Networking
      • Resource
    • ObjectStore
      • Constants
      • Enum
      • Exception
      • Resource
      • Upload
    • Orchestration
      • Resource
    • Queues
      • Collection
      • Exception
      • Resource
    • Volume
      • Resource

Classes

  • AbstractResource
  • Access
  • Algorithm
  • AllowedDomain
  • CertificateMapping
  • ConnectionLogging
  • ConnectionThrottle
  • ContentCaching
  • ErrorPage
  • HealthMonitor
  • LoadBalancer
  • Metadata
  • Node
  • NodeEvent
  • NonIdUriResource
  • Protocol
  • ReadOnlyResource
  • SessionPersistence
  • SSLTermination
  • Stats
  • UsageRecord
  • VirtualIp

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\Resource\BaseResource
Extended by OpenCloud\Common\Resource\PersistentResource
Extended by OpenCloud\LoadBalancer\Resource\LoadBalancer implements OpenCloud\DNS\Resource\HasPtrRecordsInterface
Namespace: OpenCloud\LoadBalancer\Resource
Located at OpenCloud/LoadBalancer/Resource/LoadBalancer.php

Methods summary

public
# addNode( string $address, integer $port, boolean $condition = OpenCloud\LoadBalancer\Resource\NodeCondition::ENABLED, string $type = null, integer $weight = null )

This method creates a Node object and adds it to a list of Nodes to be added to the LoadBalancer. This method will not add the nodes directly to the load balancer itself; it stores them in an array and the nodes are added later, in one of two ways:

This method creates a Node object and adds it to a list of Nodes to be added to the LoadBalancer. This method will not add the nodes directly to the load balancer itself; it stores them in an array and the nodes are added later, in one of two ways:

  • for a new load balancer, the nodes are added as part of the create() method call
  • for an existing load balancer, you must call the addNodes() method

Parameters

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

Throws

InvalidArgumentException
public array
# addNodes( )

Creates currently added nodes by sending them to the API

Creates currently added nodes by sending them to the API

Returns

array
of \Guzzle\Http\Message\Response objects

Throws

OpenCloud\Common\Exceptions\MissingValueError
public Guzzle\Http\Message\Response
# removeNode( integer $nodeId )

Remove a node from this load-balancer

Remove a node from this load-balancer

Parameters

$nodeId
$id id of the node

Returns

Guzzle\Http\Message\Response
public
# addVirtualIp( string $type = OpenCloud\LoadBalancer\Resource\IpType::PUBLIC_TYPE, integer $ipVersion = null )

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.

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

$id either 'public' or 'servicenet' or an ID of an existing IP address

$ipVersion
either null, 4, or 6 (both, IPv4, or IPv6)
public OpenCloud\LoadBalancer\Resource\Node
# node( $id = null )

Returns a Node

Returns a Node

Returns

OpenCloud\LoadBalancer\Resource\Node
public OpenCloud\Common\Collection\PaginatedIterator
# nodeList( )

returns a Collection of Nodes

returns a Collection of Nodes

Returns

OpenCloud\Common\Collection\PaginatedIterator
public OpenCloud\LoadBalancer\Resource\NodeEvent
# nodeEvent( )

Returns a NodeEvent object

Returns a NodeEvent object

Returns

OpenCloud\LoadBalancer\Resource\NodeEvent
public OpenCloud\Common\Collection\PaginatedIterator
# nodeEventList( )

Returns a Collection of NodeEvents

Returns a Collection of NodeEvents

Returns

OpenCloud\Common\Collection\PaginatedIterator
public OpenCloud\LoadBalancer\Resource\VirtualIp
# virtualIp( $data = null )

Returns a single Virtual IP (not called publicly)

Returns a single Virtual IP (not called publicly)

Returns

OpenCloud\LoadBalancer\Resource\VirtualIp
public OpenCloud\Common\Collection\PaginatedIterator
# virtualIpList( )

Returns

OpenCloud\Common\Collection\PaginatedIterator
public OpenCloud\LoadBalancer\Resource\CertificateMapping
# certificateMapping( integer|array $id = null )

Returns a Certificate Mapping.

Returns a Certificate Mapping.

Parameters

$id

(Optional) Either a particular Certificate mapping ID, or an array of data about the mapping. An array can include these keys: hostName, privateKey, certificate, intermediateCertificate.

Returns

OpenCloud\LoadBalancer\Resource\CertificateMapping
public OpenCloud\Common\Collection\PaginatedIterator
# certificateMappingList( )

Returns a Collection of Certificate Mappings.

Returns a Collection of Certificate Mappings.

Returns

OpenCloud\Common\Collection\PaginatedIterator
public array
# addCertificateMapping( string $hostName, string $privateKey, string $certificate, string $intermediateCertificate = null )

Creates a certificate mapping.

Creates a certificate mapping.

Parameters

$hostName
The domain name for the certificate.
$privateKey
The private key for the certificate
$certificate
The certificate itself.
$intermediateCertificate
The intermediate certificate chain.

Returns

array
An array of \Guzzle\Http\Message\Response objects.

Throws

OpenCloud\Common\Exceptions\MissingValueError
public array
# updateCertificateMapping( integer $id, string $hostName = null, string $privateKey = null, string $certificate = null, string $intermediateCertificate = null )

Updates a certificate mapping.

Updates a certificate mapping.

Parameters

$id
ID of the certificate mapping.
$hostName
(Optional) The domain name of the certificate.
$privateKey
(Optional) The private key for the certificate.
$certificate
The certificate itself.
$intermediateCertificate
The intermediate certificate chain.

Returns

array
An array of \Guzzle\Http\Message\Response objects.
public Guzzle\Http\Message\Response
# removeCertificateMapping( integer $id )

Remove a certificate mapping.

Remove a certificate mapping.

Parameters

$id
ID of the certificate mapping.

Returns

Guzzle\Http\Message\Response
public OpenCloud\LoadBalancer\Resource\SessionPersistence
# sessionPersistence( )

Return the session persistence resource

Return the session persistence resource

Returns

OpenCloud\LoadBalancer\Resource\SessionPersistence
public OpenCloud\LoadBalancer\Resource\ErrorPage
# errorPage( )

Returns the load balancer's error page object

Returns the load balancer's error page object

Returns

OpenCloud\LoadBalancer\Resource\ErrorPage
public OpenCloud\LoadBalancer\Resource\HealthMonitor
# healthMonitor( )

Returns the load balancer's health monitor object

Returns the load balancer's health monitor object

Returns

OpenCloud\LoadBalancer\Resource\HealthMonitor
public OpenCloud\LoadBalancer\Resource\Stats
# stats( )

Returns statistics on the load balancer operation

Returns statistics on the load balancer operation

Returns

OpenCloud\LoadBalancer\Resource\Stats
public OpenCloud\Common\Collection\PaginatedIterator
# usage( )

Returns

OpenCloud\Common\Collection\PaginatedIterator
public OpenCloud\LoadBalancer\Resource\Access
# access( $data = null )

Return an access resource

Return an access resource

Returns

OpenCloud\LoadBalancer\Resource\Access
public Guzzle\Http\Message\Response
# createAccessList( array $list )

Creates an access list. You must provide an array of \stdClass objects, each of which contains type' andaddress' properties. Valid types for the former are: "DENY" or "ALLOW". The address must be a valid IP address, either v4 or v6.

Creates an access list. You must provide an array of \stdClass objects, each of which contains type' andaddress' properties. Valid types for the former are: "DENY" or "ALLOW". The address must be a valid IP address, either v4 or v6.

Parameters

$list

Returns

Guzzle\Http\Message\Response
public OpenCloud\Common\Collection\PaginatedIterator
# accessList( )

Returns

OpenCloud\Common\Collection\PaginatedIterator
public OpenCloud\LoadBalancer\Resource\ConnectionThrottle
# connectionThrottle( )

Return a connection throttle resource

Return a connection throttle resource

Returns

OpenCloud\LoadBalancer\Resource\ConnectionThrottle
public boolean
# hasConnectionLogging( )

Find out whether connection logging is enabled for this load balancer

Find out whether connection logging is enabled for this load balancer

Returns

boolean
Returns TRUE if enabled, FALSE if not
public Guzzle\Http\Message\Response
# enableConnectionLogging( $bool )

Set the connection logging setting for this load balancer

Set the connection logging setting for this load balancer

Parameters

$bool
to TRUE to enable, FALSE to disable

Returns

Guzzle\Http\Message\Response
public
# connectionLogging( )

Deprecated

public boolean
# hasContentCaching( )

Find out whether content caching is enabled for this load balancer

Find out whether content caching is enabled for this load balancer

Returns

boolean
Returns TRUE if enabled, FALSE if not
public Guzzle\Http\Message\Response
# enableContentCaching( $bool )

Set the content caching setting for this load balancer

Set the content caching setting for this load balancer

Parameters

$bool
to TRUE to enable, FALSE to disable

Returns

Guzzle\Http\Message\Response
public
# contentCaching( )

Deprecated

public OpenCloud\LoadBalancer\Resource\SSLTermination
# SSLTermination( )

Return a SSL Termination resource

Return a SSL Termination resource

Returns

OpenCloud\LoadBalancer\Resource\SSLTermination
public OpenCloud\LoadBalancer\Resource\Metadata
# metadata( $data = null )

Return a metadata item

Return a metadata item

Returns

OpenCloud\LoadBalancer\Resource\Metadata
public OpenCloud\Common\Collection\PaginatedIterator
# metadataList( )

Return a collection of metadata items

Return a collection of metadata items

Returns

OpenCloud\Common\Collection\PaginatedIterator

Methods inherited from OpenCloud\Common\Resource\PersistentResource

checkExtension(), create(), createUrl(), delete(), id(), name(), refresh(), refreshFromLocationUrl(), region(), status(), update(), waitFor()

Methods inherited from OpenCloud\Common\Resource\BaseResource

__construct(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), resourceName(), setMetadata(), setParent(), setService(), url()

Methods inherited from OpenCloud\Common\Base

__call(), checkJsonError(), generateUuid(), getInstance(), getLogger(), hasLogger(), makeResourceIteratorOptions(), populate(), setLogger(), stripNamespace(), toCamel(), toUnderscores()

Constants summary

Constants inherited from OpenCloud\Common\Base

PATCH_CONTENT_TYPE

Properties summary

public $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 string $port

Port of the service which is being load balanced.

Port of the service which is being load balanced.

#
public string $protocol

Protocol of the service which is being load balanced.

Protocol of the service which is being load balanced.

#
public array|Collection $virtualIps

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.

# array()
public array|Collection $nodes

Nodes to be added to the load balancer.

Nodes to be added to the load balancer.

# array()
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 OpenCloud\LoadBalancer\Resource\Algorithm $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 boolean $httpsRedirect

Enables or disables HTTP to HTTPS redirection for the load balancer.

Enables or disables HTTP to HTTPS redirection for the load balancer.

#
public OpenCloud\LoadBalancer\Resource\ConnectionLogging $connectionLogging

Current connection logging configuration.

Current connection logging configuration.

#
public OpenCloud\LoadBalancer\Resource\ConnectionThrottle $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 OpenCloud\LoadBalancer\Resource\HealthMonitor $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 SessionPersistance $sessionPersistence

Forces multiple requests, of the same protocol, from clients to be directed to the same node.

Forces multiple requests, of the same protocol, from clients to be directed to the same node.

#
public array|OpenCloud\LoadBalancer\Resource\Metadata $metadata

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.

# array()
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 $created
#
public $updated
#
public $status
#
public $nodeCount
#
public $sourceAddresses
#
public $cluster
#
API documentation generated by ApiGen