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

  • Service

Class Service

The Compute class represents the OpenStack Nova service.

It is constructed from a OpenStack object and requires a service name, region, and URL type to select the proper endpoint from the service catalog. However, constants can be used to define default values for these to make it easier to use:

Creating a compute object:

$rackspace = new OpenCloud\Rackspace(...);
$dallas = new Compute(
   $rackspace,              // connection
  'cloudServersOpenStack',  // the service's name
  'DFW',                    // region identifier
  'publicURL'               // URL type
 );

The easy way (with defaults); this assumes that the constants (RAXSDK_...) are defined elsewhere before the inclusion of the first SDK library file:

$rackspace = new OpenCloud\Rackspace(...);
$dallas = new OpenCloud\Compute($rackspace); // uses defaults
OpenCloud\Common\Base
Extended by OpenCloud\Common\Service\AbstractService implements OpenCloud\Common\Service\ServiceInterface
Extended by OpenCloud\Common\Service\CatalogService
Extended by OpenCloud\Common\Service\NovaService
Extended by OpenCloud\Compute\Service
Namespace: OpenCloud\Compute
Located at OpenCloud/Compute/Service.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
Client object
$type
Service type (e.g. 'compute')
$name
Service name (e.g. 'cloudServersOpenStack')
$region
Service region (e.g. 'DFW', 'ORD', 'IAD', 'LON', 'SYD' or 'HKG')
$urlType
Either 'publicURL' or 'internalURL'

Overrides

OpenCloud\Common\Service\CatalogService::__construct
public OpenCloud\Compute\Resource\Server
# server( string $id = null )

Returns a Server object associated with this Compute service

Returns a Server object associated with this Compute service

This is a factory method and should generally be used to create server objects (thus ensuring that they are correctly associated with the server) instead of calling the Server class explicitly.

Parameters

$id
  • if specified, the server with the ID is retrieved

Returns

OpenCloud\Compute\Resource\Server
object

Api

public OpenCloud\Common\Collection\PaginatedIterator
# serverList( boolean $details = true, array $filter = array() )

Returns a Collection of server objects, filtered by the specified parameters

Returns a Collection of server objects, filtered by the specified parameters

This is a factory method and should normally be called instead of creating a ServerList object directly.

Parameters

$details
  • if TRUE, full server details are returned; if FALSE, just the minimal set of info is listed. Defaults to TRUE; you might set this to FALSE to improve performance at the risk of not having all the information you need.
$filter
  • a set of key/value pairs that is passed to the servers list for filtering

Returns

OpenCloud\Common\Collection\PaginatedIterator

Api

public OpenCloud\Compute\Resource\Network
# network( string $id = null )

Returns a Network object

Returns a Network object

Parameters

$id
the network ID

Returns

OpenCloud\Compute\Resource\Network

Api

public OpenCloud\Common\Collection\PaginatedIterator
# networkList( array $filter = array() )

Returns a Collection of Network objects

Returns a Collection of Network objects

Parameters

$filter
array of filter key/value pairs

Returns

OpenCloud\Common\Collection\PaginatedIterator

Api

public OpenCloud\Compute\Resource\Image
# image( string $id = null )

Returns an image from the service

Returns an image from the service

This is a factory method and should normally be called instead of creating an Image object directly.

Parameters

$id
  • if supplied, returns the image with the specified ID.

Returns

OpenCloud\Compute\Resource\Image
object

Api

public OpenCloud\Common\Collection
# imageList( boolean $details = true, array $filter = array() )

Returns a Collection of images (class Image)

Returns a Collection of images (class Image)

This is a factory method and should normally be used instead of creating an ImageList object directly.

Parameters

$details
  • if TRUE (the default), returns complete image details. Set to FALSE to improve performance, but only return a minimal set of data
$filter
  • key/value pairs to pass to the images resource. The actual values available here are determined by the OpenStack code and any extensions installed by your cloud provider; see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/List_Images-d1e4435.html for current filters available.

Returns

OpenCloud\Common\Collection

Api

public
# keypair( $data = null )
public
# listKeypairs( )

Methods inherited from OpenCloud\Common\Service\NovaService

flavor(), flavorList()

Methods inherited from OpenCloud\Common\Service\CatalogService

getBaseUrl(), getExtensions(), getName(), getRegion(), getType(), getUrl(), getUrlType(), limits(), name(), region(), url()

Methods inherited from OpenCloud\Common\Service\AbstractService

collection(), getClient(), getEndpoint(), getNamespaces(), getResources(), namespaces(), resource(), resourceList(), setClient(), setEndpoint()

Methods inherited from OpenCloud\Common\Base

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

Constants summary

string DEFAULT_TYPE
# 'compute'
string DEFAULT_NAME
# 'cloudServersOpenStack'

Constants inherited from OpenCloud\Common\Service\CatalogService

DEFAULT_URL_TYPE, SUPPORTED_VERSION

Constants inherited from OpenCloud\Common\Base

PATCH_CONTENT_TYPE

API documentation generated by ApiGen