The ZendService\Rackspace is a class that provides a simple API to manage the Rackspace services Cloud Files and Cloud Servers.


Load balancers service

The load balancers service of Rackspace is not implemented yet. We are planning to release it in the next future.

Registering with Rackspace

Before you can get started with ZendService\Rackspace, you must first register for an account. Please see the Cloud services page on the Rackspace website for more information.

After registering, you can get the Username and the API Key from the Rackspace management console under the menu “Your Account” > “API Access”. These informations are required to use the ZendService\Rackspace classes.

Cloud Files

The Cloud Files is a service to store any files in a cloud environment. A user can store an unlimited quantity of files and each file can be as large as 5 gigabytes. The files can be private or public. The private files can be accessed using the API of Rackspace. The public files are accessed using a CDN (Content Delivery Network). Rackspace exposes a REST API to manage the Cloud Files.

ZendService\Rackspace\Files provides the following functionality:

  • Upload files programmatically for tight integration with your application
  • Enable Cloud Files CDN integration on any container for public distribution
  • Create Containers programmatically
  • Retrieve lists of containers and files

Cloud Servers

Rackspace Cloud Servers is a compute service that provides server capacity in the cloud. Cloud Servers come in different flavors of memory, disk space, and CPU.

ZendService\Rackspace\Servers provides the following functionality:

  • Create/delete new servers
  • List and get information on each server
  • Manage the public/private IP addresses of a server
  • Resize the server capacity
  • Reboot a server
  • Create new images for a server
  • Manage the backup of a server
  • Create a group of server to share the IP addresses for High Availability architecture

Available Methods

Eeach service class (Files, Servers) of Rackspace extends the ZendService\Rackspace abstract class. This class contains a set of public methods shared with all the service. This public methods are reported as follow:



Authenticate the Rackspace API using the user and the key specified in the concrete class that extend ZendService\Rackspace. Return true in case of success and false in case of error.



Get the authentication URL of Rackspace. Returns a string.



Get the URL for the CDN. Returns a string.



Get the last HTTP error code. Returns a string.



Get the last error message. Returns a string.



Get the HTTP client used to call the API of the Rackspace. Returns a Zend\Http\Client instance.



Get the authentication key. Returns a string.



Get the URL for the management services. Returns a string.



Get the URL for the storage (files) service. Returns a string.



Get the token returned after a successful authentication. Returns a string.



Get the user authenticated with the Rackspace service. Returns a string.



Return true if the last service call was successful, false otherwise.


setAuthUrl(string $url)

Set the authentication URL to be used.

$url is the URL for the authentication


setKey(string $key)

Set the key for the API authentication.

$key is the key string for the authentication


setUser(string $user)

Set the user for the API authentication.

$user is the user string for the authentication

Edit this document

Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Login with your GitHub account.
  2. Go to Zend\Service\Rackspace on GitHub.
  3. Edit file contents using GitHub's text editor in your web browser
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on GitHub.