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 SubResource

SubResource is an abstract class that handles subresources of a LoadBalancer object; for example, the /loadbalancers/{id}/errorpage. Since most of the subresources are handled in a similar manner, this consolidates the functions.

There are really four pieces of data that define a subresource:

  • $url_resource - the actual name of the url component
  • $json_name - the name of the JSON object holding the data
  • $json_collection_name - if the collection is not simply $json_name . 's', this defines the collectio name.
  • $json_collection_element - if the object in a collection is not anonymous, this defines the name of the element holding the object.

Of these, only the $json_name and $url_resource are required.

OpenCloud\Common\Base
Extended by OpenCloud\Common\PersistentObject
Extended by OpenCloud\LoadBalancer\Resources\SubResource

Direct known subclasses

OpenCloud\LoadBalancer\Resources\Access, OpenCloud\LoadBalancer\Resources\ConnectionLogging, OpenCloud\LoadBalancer\Resources\VirtualIp, OpenCloud\LoadBalancer\Resources\ConnectionThrottle, OpenCloud\LoadBalancer\Resources\ContentCaching, OpenCloud\LoadBalancer\Resources\ErrorPage, OpenCloud\LoadBalancer\Resources\HealthMonitor, OpenCloud\LoadBalancer\Resources\Metadata, OpenCloud\LoadBalancer\Resources\Readonly, OpenCloud\LoadBalancer\Resources\SessionPersistence, OpenCloud\LoadBalancer\Resources\SSLTermination

Indirect known subclasses

OpenCloud\LoadBalancer\Resources\Algorithm, OpenCloud\LoadBalancer\Resources\NodeEvent, OpenCloud\LoadBalancer\Resources\Stats, OpenCloud\LoadBalancer\Resources\Usage
Abstract
Namespace: OpenCloud\LoadBalancer\Resources
Located at OpenCloud/LoadBalancer/Resources/SubResource.php
Methods summary
public
# initialRefresh( )

This method needs attention.

This method needs attention.

CodeCoverageIgnore

public string
# url( string $subresource = null, array $qstr = array() )

returns the URL of the SubResource

returns the URL of the SubResource

Parameters

$subresource
string
$subresource the subresource of the parent
$qstr
array
$qstr an array of key/value pairs to be converted to query string parameters for the subresource

Returns

string

Throws

UrlError
if URL is not defined

Api

Overrides

OpenCloud\Common\PersistentObject::url()
protected stdClass;
# CreateJson( )

returns the JSON document's object for creating the subresource

returns the JSON document's object for creating the subresource

The value $_create_keys should be an array of names of data items that can be used in the creation of the object.

Returns

stdClass;
protected stdClass
# updateJson( mixed $params = array() )

returns the JSON for the update (same as create)

returns the JSON for the update (same as create)

For these subresources, the update JSON is the same as the Create JSON

Returns

stdClass

Throws

UpdateError
if not overridden

Overrides

OpenCloud\Common\PersistentObject::updateJson()
public string
# name( )

returns a (default) name of the object

returns a (default) name of the object

The name is constructed by the object class and the object's ID.

Returns

string

Throws

NameError
if attribute 'name' is not defined

Api

Overrides

OpenCloud\Common\PersistentObject::name()
Methods inherited from OpenCloud\Common\PersistentObject
__construct(), __set(), action(), checkExtension(), create(), createJson(), createUrl(), customAction(), delete(), findLink(), getParent(), getService(), id(), jsonCollectionElement(), jsonCollectionName(), jsonName(), noCreate(), noDelete(), noUpdate(), parent(), primaryKeyField(), refresh(), region(), resourceName(), service(), setParent(), setService(), status(), update(), waitFor()
Methods inherited from OpenCloud\Common\Base
checkJsonError(), getHttpRequestObject(), getLogger(), makeQueryString(), populate(), setLogger(), setProperty()
Properties inherited from OpenCloud\Common\PersistentObject
$id
PHP OpenCloud API API documentation generated by ApiGen 2.8.0