OpenCloud/Compute/VolumeAttachment.php

Properties

Description

Defines a volume attachment object

Classes

VolumeAttachment

Properties

 
 
 
No 
No 

Description

The VolumeAttachment class represents a volume that is attached to a server.
This class abstracts much of the common functionality between Nova servers, Swift containers and objects, DBAAS instances, Cinder volumes, and various other objects that (a) have a URL, (b) can be created, updated, deleted, or retrieved, and (c) use a standard JSON format with a top-level element followed by a child object with attributes. In general, you can create a persistent object class by subclassing this class and defining some protected, static variables: - $url_resource - the sub-resource value in the URL of the parent. For example, if the parent URL is `http://something/parent`, then setting this value to `'another'` would result in a URL for the persistent object of `http://something/parent/another`. - $json_name - the top-level JSON object name. For example, if the persistent object is represented by `{"foo": {"attr":value, ...}}`, then set `json_name = 'foo'`. - $json_collection_name - optional; this value is the name of a collection of the persistent objects. If not provided, it defaults to `json_name` with an appended `'s'` (e.g., if `json_name` is `"foo"`, then `json_collection_name` would be `"foos"` by default). Set this value if the collection name doesn't follow this pattern. - $json_collection_element - the common pattern for a collection is: `{"collection": [{"attr":"value",...}, {"attr":"value",...}, ...]}` That is, each element of the array is an anonymous object containing the object's attributes. In (very) rare instances, the objects in the array are named, and `json_collection_element` contains the name of the collection objects. For example, in this: `{"allowedDomain":[{"allowedDomain":{"name":"foo"}}]}`, then `json_collection_element` would be set to `'allowedDomain'`. The PersistentObject class supports the standard `Create()`, `Update()`, and `Delete()` methods; if these are not needed (i.e., not supported by the service, the subclass should redefine these to call the `NoCreate`, `NoUpdate`, or `NoDelete` methods, which will trigger an appropriate exception. For example, if an object cannot be created: function Create($parm=array()) { $this->NoCreate(); } This will cause any call to the `Create()` method to fail with an exception.

Methods

CreateJson, Name, Parent, Update, __construct,

CreateJson( ) : \OpenCloud\Compute\stdClass

Description

returns the JSON object for Create()

Return value

Type Description
\OpenCloud\Compute\stdClass

Name( ) : string

Description

returns a readable name for the attachment
Since there is no 'name' attribute, we'll hardcode something

Return value

Type Description
string

Tags

Name Description
api

Parent( ) : \OpenCloud\Compute\Server

Description

returns the Parent (server) of the volume attachment
This is a subresource of the server, not of the service.

Return value

Type Description
\OpenCloud\Compute\Server

Update(   $params = array(), ) : n/a

Description

updates are not permitted

Arguments

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

Return value

Type Description
n/a n/a

Tags

Name Description
throws always

__construct(   $server,   $id = null, ) : n/a

Description

creates the object
This overrides the default constructor so that we can save off the server to which this attachment is associated.

Arguments

Name Type Description Default
$server n/a
$id n/a null

Return value

Type Description
n/a n/a

Properties

$_create_keys, $_server, $device, $id, $json_name, $serverId, $url_resource, $volumeId,

  private  $_create_keys = array('volumeId', 'device')




  private  $_server =




  public  $device =




  public  $id =




  public  static $json_name = 'volumeAttachment'




  public  $serverId =




  public  static $url_resource = 'os-volume_attachments'




  public  $volumeId =




Documentation was generated by phpDocumentor 2.0.0b6 .

Namespaces

Packages