OpenCloud/Compute/Service.php

Properties

Description

The OpenStack Compute (Nova) service

Classes

Service

Properties

 
 
No 
No 

Description

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

Methods

Image, ImageList, Network, NetworkList, Server, ServerList, Url, __construct,

Image( string   $id = null, ) : \OpenCloud\Compute\Compute\Image

Description

Returns an image from the service
This is a factory method and should normally be called instead of creating an Image object directly.

Arguments

Name Type Description Default
$id string
  • if supplied, returns the image with the specified ID.
null

Return value

Type Description
\OpenCloud\Compute\Compute\Image object

Tags

Name Description
api

ImageList( boolean   $details = true, array   $filter = array(), ) : \OpenCloud\Compute\Collection

Description

Returns a Collection of images (class Image)
This is a factory method and should normally be used instead of creating an ImageList object directly.

Arguments

Name Type Description Default
$details boolean
  • if TRUE (the default), returns complete image details. Set to FALSE to improve performance, but only return a minimal set of data
true
$filter array
  • 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.
array()

Return value

Type Description
\OpenCloud\Compute\Collection

Tags

Name Description
api

Network( string   $id = null, ) : \OpenCloud\Compute\Compute\Network

Description

Returns a Network object

Arguments

Name Type Description Default
$id string

the network ID

null

Return value

Type Description
\OpenCloud\Compute\Compute\Network

Tags

Name Description
api

NetworkList(   $filter = array(), ) : \OpenCloud\Compute\Collection

Description

Returns a Collection of Network objects

Arguments

Name Type Description Default
$filter n/a array()

Return value

Type Description
\OpenCloud\Compute\Collection

Tags

Name Description
api

Server( string   $id = NULL, ) : n/a

Description

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.

Arguments

Name Type Description Default
$id string
  • if specified, the server with the ID is retrieved
NULL

Return value

Type Description
n/a n/a

Tags

Name Description
api
returns Compute\Server object

ServerList( boolean   $details = TRUE, array   $filter = array(), ) : n/a

Description

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.

Arguments

Name Type Description Default
$details boolean
  • 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.
TRUE
$filter array
  • a set of key/value pairs that is passed to the servers list for filtering
array()

Return value

Type Description
n/a n/a

Tags

Name Description
api
returns Collection

Url( string   $resource = 'servers', array   $args = array(), ) : n/a

Description

Returns the selected endpoint URL of this compute Service

Arguments

Name Type Description Default
$resource string
  • an optional child resource. For example, passing 'details' would return .../servers/details. Should not be prefixed with a slash (/).
'servers'
$args array

(optional) an array of key-value pairs for query strings to append to the URL

array()

Return value

Type Description
n/a n/a

Tags

Name Description
returns string - the requested URL

__construct( \OpenCloud\Identity   $conn, string   $serviceName, string   $serviceRegion, string   $urltype, ) : n/a

Description

Called when creating a new Compute service object
_NOTE_ that the order of parameters for this is *different* from the parent Service class. This is because the earlier parameters are the ones that most typically change, whereas the later ones are not modified as often.

Arguments

Name Type Description Default
$conn \OpenCloud\Identity
  • a connection object
$serviceName string
  • identifies the name of the service in the catalog
$serviceRegion string
  • identifies the region of this Compute service
$urltype string
  • identifies the URL type ("publicURL", "privateURL")

Return value

Type Description
n/a n/a
Documentation was generated by phpDocumentor 2.0.0b6 .

Namespaces

Packages