Compute v2

Setup

Rackspace setup

The first step is to pass in your credentials and set up a client. For Rackspace users, you will need your username and API key:

use OpenCloud\Rackspace;

$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
  'username' => '{username}',
  'apiKey'   => '{apiKey}',
));

OpenStack setup

If you’re an OpenStack user, you will also need to prove a few other configuration parameters:

$client = new OpenCloud\OpenStack('{keystoneUrl}', array(
  'username' => '{username}',
  'password' => '{apiKey}',
  'tenantId' => '{tenantId}',
));

Compute service

Now to instantiate the Compute service:

$service = $client->computeService('{catalogName}', '{region}', '{urlType}');
  • {catalogName} is the name of the service as it appears in the service catalog. OpenStack users must set this value. For Rackspace users, a default will be provided if you pass in null.
  • {region} is the region the service will operate in. For Rackspace users, you can select one of the following from the supported regions page.
  • {urlType} is the type of URL to use, depending on which endpoints your catalog provides. If omitted, it will default to the public network.

Glossary

image
An image is a collection of files for a specific operating system that you use to create or rebuild a server. Rackspace provides prebuilt images. You can also create custom images from servers that you have launched.
flavor
A flavor is a named definition of certain server parameters such as the amount of RAM and disk space available. (There are other parameters set via the flavor, such as the amount of disk space and the number of virtual CPUs, but a discussion of those is too in-depth for a simple Getting Started Guide like this one.)
server
A server is a virtual machine instance in the Cloud Servers environment.