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

Database As A Service. More...

Public Member Functions

 __construct ($token, $endpoint, $projectId)
 Build a new DBaaS object.
 instance ()
 snapshot ()
 flavor ()
 projectId ()
 Get the project ID for this session.
 url ()
 Get the endpoint URL to the DBaaS session.

Static Public Member Functions

static newFromIdentity ($identity, $region=DBaaS::DEFAULT_REGION)

Public Attributes

const SERVICE_TYPE = 'hpext:dbaas'
const API_VERSION = '1'
const DEFAULT_REGION = 'region-a.geo-1'

Protected Attributes

 $token
 The auth token for the current session.
 $url
 The base URL to the DBaaS for a given account.
 $projectId
 The tenant name.

Detailed Description

Database As A Service.

This package provides access to HP Cloud's Database As A Service (DBaaS) service.

About DBaaS

DBaaS is a service for creating and managing database instances and snapshots (backups) of that service. It is not a data access layer. That is, SQL is not proxied through this service. Rather, once a database instance is set up, apps may connect directly to that service using built-in drivers. See, for example, HPCloud::Services::DBaaS::Instance::dsn(), which returns the PDO DSN for connecting to a MySQL database.

To create and manage new database servers, you will work with HPCloud::Services::DBaaS::instance().

To take snapshots of an existing database server (which is recommended at regular intervals), you will work with HPCloud::Services::DBaaS::snapshot().

Authentication to the Service

To authenticate to the service, you will use IdentityServices. Note, however, that DBaaS requires a Tenant Name (not Tenant ID). After authentication, this will attempt to retrieve the name from IdentityServices.

Authentication to an Instance

Upon creating a new database instance, this library will return login credentials (username and password) from HPCloud::Services::DBaaS::Instance::create(). This is the only time that credentials are returned. Make note of them.

Those credentials can then be used to connect to the database instance, and create new databases, users, and tables.

Definition at line 73 of file DBaaS.php.

Constructor & Destructor Documentation

__construct (   $token,
  $endpoint,
  $projectId 
)

Build a new DBaaS object.

Parameters
string$tokenThe auth token from identity services.
string$endpointThe endpoint URL, typically from IdentityServices.
string$projectIdThe project ID. Typically, this is the tenant name.

Definition at line 124 of file DBaaS.php.

References $endpoint, DBaaS\$projectId, DBaaS\$token, DBaaS\projectId(), and DBaaS\url().

Member Function Documentation

flavor ( )

Definition at line 139 of file DBaaS.php.

References DBaaS\projectId(), and DBaaS\url().

instance ( )

Definition at line 131 of file DBaaS.php.

References DBaaS\projectId(), and DBaaS\url().

Referenced by Instance\__construct(), Flavor\__construct(), and Snapshot\__construct().

static newFromIdentity (   $identity,
  $region = DBaaS::DEFAULT_REGION 
)
static

Definition at line 96 of file DBaaS.php.

References $catalog, and $endpoint.

projectId ( )

Get the project ID for this session.

Return values
string
Returns
string The project ID.

Definition at line 150 of file DBaaS.php.

References DBaaS\$projectId.

Referenced by Instance\__construct(), Flavor\__construct(), Snapshot\__construct(), DBaaS\__construct(), Instance\create(), DBaaS\flavor(), Operations\headers(), DBaaS\instance(), and DBaaS\snapshot().

snapshot ( )

Definition at line 135 of file DBaaS.php.

References DBaaS\projectId(), and DBaaS\url().

Member Data Documentation

$projectId
protected

The tenant name.

Typically, this is an email address.

Definition at line 94 of file DBaaS.php.

Referenced by Instance\__construct(), Flavor\__construct(), Snapshot\__construct(), DBaaS\__construct(), and DBaaS\projectId().

$token
protected

The auth token for the current session.

Definition at line 84 of file DBaaS.php.

Referenced by Instance\__construct(), Flavor\__construct(), Snapshot\__construct(), and DBaaS\__construct().

const API_VERSION = '1'

Definition at line 77 of file DBaaS.php.

const DEFAULT_REGION = 'region-a.geo-1'

Definition at line 79 of file DBaaS.php.

const SERVICE_TYPE = 'hpext:dbaas'

Definition at line 75 of file DBaaS.php.


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