Overview

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Identity
      • Log
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Resource
    • LoadBalancer
      • Resource
    • ObjectStore
      • Constants
      • Exception
      • Resource
      • Upload
    • Orchestration
    • Queues
      • Exception
      • Resource
    • Volume
      • Resource
  • PHP

Classes

  • AbstractService
  • Catalog
  • CatalogItem
  • Endpoint
  • NovaService
  • ServiceBuilder
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class AbstractService

This class defines a cloud service; a relationship between a specific OpenStack and a provided service, represented by a URL in the service catalog.

Because Service is an abstract class, it cannot be called directly. Provider services such as Rackspace Cloud Servers or OpenStack Swift are each subclassed from Service.

OpenCloud\Common\Base
Extended by OpenCloud\Common\Service\AbstractService

Direct known subclasses

OpenCloud\Autoscale\Service, OpenCloud\CloudMonitoring\Service, OpenCloud\Common\Service\NovaService, OpenCloud\DNS\Service, OpenCloud\ObjectStore\AbstractService, OpenCloud\Orchestration\Service, OpenCloud\Queues\Service

Indirect known subclasses

OpenCloud\Compute\Service, OpenCloud\Database\Service, OpenCloud\LoadBalancer\Service, OpenCloud\ObjectStore\CDNService, OpenCloud\ObjectStore\Service, OpenCloud\Volume\Service
Abstract
Namespace: OpenCloud\Common\Service
Located at OpenCloud/Common/Service/AbstractService.php
Methods summary
public
# __construct( OpenCloud\Common\Http\Client $client, string $type = null, string $name = null, string $region = null, string $urlType = null )

Creates a service object, based off the specified client.

Creates a service object, based off the specified client.

The service's URL is defined in the client's serviceCatalog; it uses the $type, $name, $region, and $urlType to find the proper endpoint and set it. If it cannot find a URL in the service catalog that matches the criteria, then an exception is thrown.

Parameters

$client
OpenCloud\Common\Http\Client
$client Client object
$type
string
$type Service type (e.g. 'compute')
$name
string
$name Service name (e.g. 'cloudServersOpenStack')
$region
string
$region Service region (e.g. 'DFW', 'ORD', 'IAD', 'LON', 'SYD')
$urlType
string
$urlType Either 'publicURL' or 'privateURL'
public
# setClient( OpenCloud\Common\Http\Client $client )

Parameters

$client
OpenCloud\Common\Http\Client
$client
public OpenCloud\Common\Http\Client
# getClient( )

Returns

OpenCloud\Common\Http\Client
public string
# getType( )

Returns

string
public string
# getRegion( )

Returns

string
public string
# getName( )

Returns

string
public string
# getUrlType( )

Returns

string
public OpenCloud\Common\Service\Endpoint|OpenCloud\Common\Service\Endpoint
# getEndpoint( )

Returns

OpenCloud\Common\Service\Endpoint|OpenCloud\Common\Service\Endpoint
public Guzzle\Http\Url
# getUrl( string $path = null, array $query = array() )

Returns the URL for the Service

Returns the URL for the Service

Parameters

$path
string
$path URL path segment
$query
array
$query Array of query pairs

Returns

Guzzle\Http\Url

Throws

UrlError

Overrides

OpenCloud\Common\Base::getUrl()
public array
# getExtensions( )

Returns the /extensions for the service

Returns the /extensions for the service

Returns

array
of objects

Api

public array
# limits( )

Returns the limits for the service

Returns the limits for the service

Returns

array
of limits
public array
# namespaces( )

Returns a list of supported namespaces

Returns a list of supported namespaces

Returns

array
public
# getResources( )

Get all associated resources for this service.

Get all associated resources for this service.

protected type
# getCurrentNamespace( )

Internal method for accessing child namespace from parent scope.

Internal method for accessing child namespace from parent scope.

Returns

type
protected string
# resolveResourceClass( mixed $resourceName )

Resolves FQCN for local resource.

Resolves FQCN for local resource.

Parameters

$resourceName
mixed
$resourceName

Returns

string

Throws

OpenCloud\Common\Exceptions\UnrecognizedServiceError
public object
# resource( string $resourceName, mixed $info = null, mixed $parent = null )

Factory method for instantiating resource objects.

Factory method for instantiating resource objects.

Parameters

$resourceName
string
$resourceName
$info
mixed
$info (default: null)
$parent
mixed
$parent The parent object

Returns

object
public OpenCloud\Common\Collection
# resourceList( string $resourceName, string|null $url = null, string|null $parent = null )

Factory method for instantiating a resource collection.

Factory method for instantiating a resource collection.

Parameters

$resourceName
string
$resourceName
$url
string|null
$url
$parent
string|null
$service

Returns

OpenCloud\Common\Collection
public Guzzle\Http\Url
# getBaseUrl( )

Get the base URL for this service, based on the set URL type.

Get the base URL for this service, based on the set URL type.

Returns

Guzzle\Http\Url

Throws

OpenCloud\Common\Exceptions\ServiceException
public
# collection( mixed $class, mixed $url = null, mixed $parent = null, mixed $data = null )

CodeCoverageIgnore

Methods inherited from OpenCloud\Common\Base
__call(), checkJsonError(), generateUuid(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()
Constants summary
string DEFAULT_REGION 'DFW'
#
string DEFAULT_URL_TYPE 'publicURL'
#
Properties summary
protected OpenCloud\Common\Http\Client $client
#

The client which interacts with the API.

The client which interacts with the API.

protected array $namespaces array()
#

Namespaces for this service.

Namespaces for this service.

protected array $resources array()
#

A collection of resource models that this service has control over.

A collection of resource models that this service has control over.

PHP OpenCloud API API documentation generated by ApiGen 2.8.0