Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Service_Rackspace Component Proposal

Proposed Component Name Zend_Service_Rackspace
Developer Notes
Proposers Enrico Zimuel
Zend Liaison TBD
Revision 1.0 - 2 May 2011: Initial Draft.
1.1 - 11 May 2011: Completed the prototype of the Rackspace Files service
Checkout the source code here (wiki revision: 19)

Table of Contents

1. Overview

Zend\Service\Rackspace is a class to manage the cloud service of Rackspace: Files, Servers, Load Balancers.

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.
Using the API features of Cloud Files you can:

  • 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

The Zend\Service\Rackspace\Files component will implement all these features.

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.
Using the Rackspace Server API you can:

  • Create new servers
  • List and get information on each server
  • Delete a 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

The Zend\Service\Rackspace\Servers component will implement all these features.

Load Balancers

A load balancer is a logical device which belongs to a cloud account. It is used to distribute workloads between multiple back-end systems or services, based on the criteria defined as part of its configuration. The Rackspace Cloud Load Balancers API is implemented using a ReSTful web service interface. Like other products in the Rackspace Cloud suite, the load balancing service shares a common token-based authentication system that allows seamless access between products and services.
Using the Rackspace Load Balancers API you can:

  • Manage the load balancer
  • Create virtual IPs
  • Manage access list
  • Check the usage report
  • Monitor the system
  • Manage Session Persistance

The Zend\Service\Rackspace\LoadBalancers component will implement all these features.

API version

The current version of the Rackspace Cloud API is 1.0.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will require a valid Rackspace account.
  • This component will implement full Rackspace Cloud REST API.
  • This component will use the JSON format to exchange data with the Rackspace API
  • This component will throw an Exception in case of a response error.

4. Dependencies on Other Framework Components

  • Zend\Http\Client
  • Zend\Validator\Ip

5. Theory of Operation

We propose to write an abstract class (Zend\Service\Rackspace\Rackspace) to share methods and properties common to all the Rackspace services: Files, Servers and Load Balancers.
The authentication request of the Rackspace API is shared between all the cloud services and can be implemented in the abstract class. Each subclass of Zend\Service\Rackspace will implement a specific service.

6. Milestones / Tasks

  • Milestone 1: Complete the proposal for Files [DONE]
  • Milestone 2: Prototype of the Zend\Service\Rackspace\Files [DONE]
  • Milestone 3: Provide examples and unit tests
  • Milestone 4: Write the documentation
  • Milestone 5: Propose an adapter for the Zend\Cloud\StorageService
  • Milestone 6: Complete the proposal for Servers
  • Milestone 7: Prototype of the Zend\Service\Rackspace\Servers
  • Milestone 8: Provide examples and unit tests
  • Milestone 9: Write the documentation
  • Milestone 10: Propose an adapter for the Zend\Cloud\Infrastructure
  • Milestone 11: Complete the proposal for Load Balancers
  • Milestone 12: Prototype of the Zend\Service\Rackspace\LoadBalancers
  • Milestone 13: Provide examples and unit tests
  • Milestone 14: Write the documentation

7. Class Index

  • Zend\Service\Rackspace\Rackspace
  • Zend\Service\Rackspace\Exception
  • Zend\Service\Rackspace\Files
  • Zend\Service\Rackspace\Files\Object
  • Zend\Service\Rackspace\Files\ObjectList
  • Zend\Service\Rackspace\Files\Container
  • Zend\Service\Rackspace\Files\ContainerList
  • Zend\Service\Rackspace\Servers
  • Zend\Service\Rackspace\Servers\Server
  • Zend\Service\Rackspace\Servers\ServerList
  • Zend\Service\Rackspace\Servers\Image
  • Zend\Service\Rackspace\Servers\ImageList
  • Zend\Service\Rackspace\Servers\SharedIpGroup
  • Zend\Service\Rackspace\Servers\SharedIpGroupList

8. Use Cases



Get all the containers and the files for each container.


Add an object (file) in a container. The metadata array is optional.


Create a container, store an object, and delete it. The metadata array is optional.


Check if a container is CDN enabled. If not, try to enable it.


Copy an object (file) from a container to another. During the copy you can change the name of the object (file) and add metadata to it (optional).



Create a new server instance. Metadata ($metadata) and files ($files) are optional parameters.


Get a server, using the ID of the server.


Get all the servers. The parameter of listServers() is a boolean flag to get a list of server with detailed information (true) or not (false).


Change the name of a server. The parameter of listServers() is a boolean flag to get a list of server with detailed information (true) or not (false).


Change the admin password of a server. For security reason the admin password is returned only when you create a server.

9. Class Skeletons



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 11, 2011

    <p>I'd like to see storeObject() accept PHP streams as well as full content. This would reduce memory requirements, particularly with large files.</p>

    1. May 17, 2011

      <p>We can support the PHP streams using the Chunked Transfer Encoding of the Rackspace API (page 27 of the Cloud Files Developer Guide). With this API we can upload data without needing to know in advance the amount of data to be uploaded. I started to implement this feature.</p>