HPCloud-PHP  1.2.0
PHP bindings for HPCloud and OpenStack services.
 All Classes Namespaces Files Functions Variables Pages
Snapshot Class Reference

Manage snapshots. More...

Inheritance diagram for Snapshot:
Operations

Public Member Functions

 __construct ($token, $projectId, $endpoint)
 listSnapshots ($instanceId=NULL)
 Get a list of snapshot details.
 create ($instanceId, $name)
 Create a new snapshot of a given instance.
 delete ($snapshotId)
 Given a snapshot ID, delete the snapshot.
 describe ($snapshotId)
 Get the details for a particular snapshot.

Protected Attributes

 $token
 $projectId
 $url
 $client
- Protected Attributes inherited from Operations
 $token
 $projectId

Additional Inherited Members

- Protected Member Functions inherited from Operations
 headers ($merge=array())
 Generate the base headers needed by DBaaS requests.

Detailed Description

Manage snapshots.

A snapshot is an image (a backup) of a particular database taken at a particular point in time. They can be used by HP Cloud Services to restore a database instance to a particular point in time.

Snapshotscan be created and deleted. Information about the snapshots can be retrieved either as lists of snapshots or as individual snapshot details.

Generally, Snapshot objects should be created through the HPCloud::Services::DBaaS::snapshot() factory, and not created directly.

Any operation that goes to the remote server may throw one of the HPCloud::Exception exceptions.

Definition at line 48 of file Snapshot.php.

Constructor & Destructor Documentation

__construct (   $token,
  $projectId,
  $endpoint 
)

Member Function Documentation

create (   $instanceId,
  $name 
)

Create a new snapshot of a given instance.

Given the ID of a database instance and a mnemonic name for the snapshot, take a snapshot of the given database.

Note that subsequent references to this snapshot must be made by snapshot ID, not by $name.

Parameters
string$instanceIdThe instance ID for the database to snapshot.
string$nameA human-readable name for the snapshot. Internally, a snapshot ID will be used to reference this snapshot.
Return values
HPCloud::Services::DBaaS::SnapshotDetails
Returns
A snapshot details object containing information about the snapshot.

Definition at line 111 of file Snapshot.php.

References $name, DBaaS\$url, Operations\headers(), and DBaaS\url().

delete (   $snapshotId)

Given a snapshot ID, delete the snapshot.

Parameters
string$snapshotIdThe snapshot ID for the snapshot that should be deleted.
Return values
boolean
Returns
boolean Returns boolean TRUE on success. Throws one of the HPCloud::Exception instances on failure.
Exceptions
HPCloud::ExceptionOne of the Transport class of exceptions.

Definition at line 141 of file Snapshot.php.

References DBaaS\$url, Operations\headers(), and DBaaS\url().

describe (   $snapshotId)

Get the details for a particular snapshot.

Parameters
string$snapshotIdThe snapshot ID.
Return values
HPCloud::Services::DBaaS::SnapshotDetails
Returns
The details object.

Definition at line 158 of file Snapshot.php.

References DBaaS\$url, Operations\headers(), and DBaaS\url().

listSnapshots (   $instanceId = NULL)

Get a list of snapshot details.

Parameters
string$instanceIdAn optional database instance ID. If set, only snapshots for the given instance will be returned.
Return values
array
Returns
array An array of HPCloud::Services::DBaaS::SnapshotDetails instances.

Definition at line 73 of file Snapshot.php.

References DBaaS\$url, Operations\headers(), and DBaaS\url().

Member Data Documentation

$client
protected

Definition at line 53 of file Snapshot.php.

$projectId
protected

Definition at line 51 of file Snapshot.php.

$token
protected

Definition at line 50 of file Snapshot.php.

$url
protected

Definition at line 52 of file Snapshot.php.


The documentation for this class was generated from the following file: