# Object Store v1

## 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}',
    ));

### Object Store service

Now to instantiate the Object Store service:

    $service = $client->objectStoreService('{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.

## Operations

- Account Details
  - Setup
  - View all details
  - Retrieve total container count
  - Retrieve total object count
  - Retrieve total bytes used
- Containers
  - Create container
  - List containers
    - Filtering large collections
  - Get container
    - Retrieve a container’s name
    - Retrieve a container’s object count
    - Retrieve a container’s total bytes used
  - Delete container
  - Deleting all objects inside a container
  - Create or update container metadata
  - Container quotas
  - Access log delivery
  - Syncing containers
- Objects
  - Setup
  - Create an object
    - Upload a single file (under 5GB)
    - Upload a single file (under 5GB) with metadata
    - Batch upload multiple files (each under 5GB)
    - Upload large files (over 5GB)
  - List objects in a container
  - Get object
    - Get object’s parent container
    - Get file name
    - Get file size
    - Get content of file
    - Get type of file
    - Get file checksum
    - Get last modified date of file
    - Conditional requests
  - Update an existing object
  - Copy object to new location
  - Get object metadata
  - Update object metadata
  - Extract archive
  - Delete object
  - Delete multiple objects
- CDN Containers
  - Setup
  - List CDN-enabled containers
  - CDN-enable a container
  - CDN-disable a container
  - Operations on CDN-enabled containers
    - Retrieve the SSL URL of a CDN container
    - Retrieve the streaming URL of a CDN container
    - Retrieve the iOS streaming URL of a CDN container
    - CDN logging
  - Purge CDN-enabled objects
- Migrating containers across regions
  - Requirements
  - Setup
  - Options
    - Options explained
- Temporary URLs
  - Set “temporary URL” metadata key
  - Create a temporary URL
- Hosting HTML sites on CDN

## Glossary

account
  The portion of the system designated for your use. An Object Store system is typically designed to be used by many different customers, and your user account is your portion of it.
container
  A storage compartment that provides a way for you to organize data. A container is similar to a folder in Windows or a directory in UNIX. The primary difference between a container and these other file system concepts is that containers cannot be nested.
cdn
  A system of distributed servers (network) that delivers web pages and other web content to a user based on the geographic locations of the user, the origin of the web page, and a content delivery server.
metadata
  Optional information that you can assign to Cloud Files accounts, containers, and objects through the use of a metadata header.
object
  An object (sometimes referred to as a file) is the unit of storage in an Object Store. An object is a combination of content (data) and metadata.

## Further links

- Getting Started Guide for the API
- API Developer Guide
- API release history