Overview
  • Namespace
  • Class

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CDN
      • Resource
    • CloudMonitoring
      • Collection
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Collection
      • Enum
      • Resource
    • Networking
      • Resource
    • ObjectStore
      • Constants
      • Enum
      • Exception
      • Resource
      • Upload
    • Orchestration
      • Resource
    • Queues
      • Collection
      • Exception
      • Resource
    • Volume
      • Resource

Classes

  • AbstractService
  • CDNService
  • Service

Class Service

The ObjectStore (Cloud Files) service.

OpenCloud\Common\Base
Extended by OpenCloud\Common\Service\AbstractService implements OpenCloud\Common\Service\ServiceInterface
Extended by OpenCloud\Common\Service\CatalogService
Extended by OpenCloud\ObjectStore\AbstractService
Extended by OpenCloud\ObjectStore\Service
Namespace: OpenCloud\ObjectStore
Located at OpenCloud/ObjectStore/Service.php

Methods summary

public
# __construct( OpenCloud\Common\Http\Client $client, string $type = null, string $name = null, string $region = null, string $urlType = null )

Creates a service object, based off the specified client.

Creates a service object, based off the specified client.

The service's URL is defined in the client's serviceCatalog; it uses the $type, $name, $region, and $urlType to find the proper endpoint and set it. If it cannot find a URL in the service catalog that matches the criteria, then an exception is thrown.

Parameters

$client
Client object
$type
Service type (e.g. 'compute')
$name
Service name (e.g. 'cloudServersOpenStack')
$region
Service region (e.g. 'DFW', 'ORD', 'IAD', 'LON', 'SYD' or 'HKG')
$urlType
Either 'publicURL' or 'internalURL'

Overrides

OpenCloud\Common\Service\CatalogService::__construct
public OpenCloud\ObjectStore\CDNService
# getCdnService( )

Return the CDN version of the ObjectStore service.

Return the CDN version of the ObjectStore service.

Returns

OpenCloud\ObjectStore\CDNService
CDN version of the ObjectStore service
public OpenCloud\Common\Collection\PaginatedIterator
# listContainers( array $filter = array() )

List all available containers.

List all available containers.

Parameters

$filter

Array of filter options such as:

  • limit: number of results to limit the list to. Optional.
  • marker: name of container after which to start the list. Optional.
  • end_marker: name of container before which to end the list. Optional.

Returns

OpenCloud\Common\Collection\PaginatedIterator
Iterator to list of containers
public OpenCloud\ObjectStore\Resource\Container
# getContainer( stdClass $data = null )

Return a new or existing (if name is specified) container.

Return a new or existing (if name is specified) container.

Parameters

$data
Data to initialize container. Optional.

Returns

OpenCloud\ObjectStore\Resource\Container
Container
public boolean|OpenCloud\ObjectStore\Resource\Container
# createContainer( string $name, array $metadata = array() )

Create a container for this service.

Create a container for this service.

Parameters

$name
The name of the container
$metadata
Additional (optional) metadata to associate with the container

Returns

boolean|OpenCloud\ObjectStore\Resource\Container
Newly-created Container upon success; false, otherwise
public boolean
# checkContainerName( string $name )

Check the validity of a potential container name.

Check the validity of a potential container name.

Parameters

$name
Name of container

Returns

boolean
True if container name is valid

Throws

OpenCloud\Common\Exceptions\InvalidArgumentError
if container name is invalid
public Guzzle\Http\Message\Response
# bulkExtract( string $path, string|stream $archive, string $archiveType = OpenCloud\ObjectStore\UrlType::TAR_GZ )

Perform a bulk extraction, expanding an archive file. If the $path is an empty string, containers will be auto-created accordingly, and files in the archive that do not map to any container (files in the base directory) will be ignored. You can create up to 1,000 new containers per extraction request. Also note that only regular files will be uploaded. Empty directories, symlinks, and so on, will not be uploaded.

Perform a bulk extraction, expanding an archive file. If the $path is an empty string, containers will be auto-created accordingly, and files in the archive that do not map to any container (files in the base directory) will be ignored. You can create up to 1,000 new containers per extraction request. Also note that only regular files will be uploaded. Empty directories, symlinks, and so on, will not be uploaded.

Parameters

$path
The path to the archive being extracted
$archive
The contents of the archive (either string or stream)
$archiveType
The type of archive you're using OpenCloud\ObjectStore\Constants\UrlType

Returns

Guzzle\Http\Message\Response
HTTP response from API

Throws

OpenCloud\Common\Exceptions\InvalidArgumentError
if specifed $archiveType is invalid
OpenCloud\ObjectStore\Exception\BulkOperationException
if there are errors with the bulk extract
public
# bulkDelete( array $paths )

Deprecated

Please use OpenCloud\ObjectStore\Service::batchDelete() instead.
public array[Guzzle\Http\Message\Response]
# batchDelete( array $paths )

Batch delete will delete an array of object paths. By default, the API will only accept a maximum of 10,000 object deletions per request - so for arrays that exceed this size, it is chunked and sent as individual requests.

Batch delete will delete an array of object paths. By default, the API will only accept a maximum of 10,000 object deletions per request - so for arrays that exceed this size, it is chunked and sent as individual requests.

Parameters

$paths

The objects you want to delete. Each path needs be formatted as /{containerName}/{objectName}. If you are deleting object_1 and object_2 from the photos_container, the array will be:

                array(
                   '/photos_container/object_1',
                   '/photos_container/object_2'
                )

Returns

array[Guzzle\Http\Message\Response]
HTTP responses from the API

Throws

OpenCloud\ObjectStore\Exception\BulkOperationException
if the bulk delete operation fails
public array[Guzzle\Http\Message\Response]
# migrateContainer( OpenCloud\ObjectStore\Resource\Container $old, OpenCloud\ObjectStore\Resource\Container $new, array $options = array() )

Allows files to be transferred from one container to another.

Allows files to be transferred from one container to another.

Parameters

$old
Where you're moving files from
$new
Where you're moving files to
$options

Options to configure the migration. Optional. Available options are:

  • read.batchLimit: Number of files to read at a time from $old container. Optional; default = 1000.
  • write.batchLimit: Number of files to write at a time to $new container. Optional; default = 1000.
  • read.pageLimit: Number of filenames to read at a time from $old container. Optional; default = 10000.

Returns

array[Guzzle\Http\Message\Response]
HTTP responses from the API

Methods inherited from OpenCloud\ObjectStore\AbstractService

getAccount()

Methods inherited from OpenCloud\Common\Service\CatalogService

getBaseUrl(), getExtensions(), getName(), getRegion(), getType(), getUrl(), getUrlType(), limits(), name(), region(), url()

Methods inherited from OpenCloud\Common\Service\AbstractService

collection(), getClient(), getEndpoint(), getNamespaces(), getResources(), namespaces(), resource(), resourceList(), setClient(), setEndpoint()

Methods inherited from OpenCloud\Common\Base

__call(), checkJsonError(), generateUuid(), getInstance(), getLogger(), hasLogger(), makeResourceIteratorOptions(), populate(), setLogger(), stripNamespace(), toCamel(), toUnderscores()

Constants summary

string DEFAULT_NAME
# 'cloudFiles'
string DEFAULT_TYPE
# 'object-store'
integer BATCH_DELETE_MAX
# 10000

Constants inherited from OpenCloud\ObjectStore\AbstractService

MAX_CONTAINER_NAME_LENGTH, MAX_OBJECT_NAME_LEN, MAX_OBJECT_SIZE

Constants inherited from OpenCloud\Common\Service\CatalogService

DEFAULT_URL_TYPE, SUPPORTED_VERSION

Constants inherited from OpenCloud\Common\Base

PATCH_CONTENT_TYPE

API documentation generated by ApiGen