HPCloud-PHP
1.2.0
PHP bindings for HPCloud and OpenStack services.
|
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. |
Database As A Service.
This package provides access to HP Cloud's Database As A Service (DBaaS) service.
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().
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.
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.
__construct | ( | $token, | |
$endpoint, | |||
$projectId | |||
) |
Build a new DBaaS object.
string | $token | The auth token from identity services. |
string | $endpoint | The endpoint URL, typically from IdentityServices. |
string | $projectId | The 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().
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 |
projectId | ( | ) |
Get the project ID for this session.
string |
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().
url | ( | ) |
Get the endpoint URL to the DBaaS session.
string |
Definition at line 161 of file DBaaS.php.
References DBaaS\$url.
Referenced by Instance\__construct(), Flavor\__construct(), Snapshot\__construct(), DBaaS\__construct(), Instance\create(), Snapshot\create(), Instance\delete(), Snapshot\delete(), Instance\describe(), Snapshot\describe(), DBaaS\flavor(), DBaaS\instance(), Flavor\listFlavors(), Instance\listInstances(), Snapshot\listSnapshots(), Instance\resetPassword(), Instance\restart(), and DBaaS\snapshot().
|
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().
|
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().
|
protected |
The base URL to the DBaaS for a given account.
Definition at line 88 of file DBaaS.php.
Referenced by Instance\create(), Snapshot\create(), Instance\delete(), Snapshot\delete(), Instance\describe(), Snapshot\describe(), Flavor\listFlavors(), Instance\listInstances(), Snapshot\listSnapshots(), Instance\resetPassword(), Instance\restart(), FlavorDetails\url(), and DBaaS\url().