Overview

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
  • PHP

Classes

  • AbstractService
  • CDNService
  • Service
  • Overview
  • Namespace
  • Class
  • Tree

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: * <code>limit</code>: number of results to limit the list to. Optional. * <code>marker</code>: name of container after which to start the list. Optional. * <code>end_marker</code>: 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 <code><a href="class-OpenCloud.ObjectStore.Constants.UrlType.html">OpenCloud\ObjectStore\Constants\UrlType</a></code>

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 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 <code>/{containerName}/{objectName}</code>. If you are deleting <code>object_1</code> and <code>object_2</code> from the <code>photos_container</code>, the array will be: array( '/photos_container/object<sub>1</sub>', '/photos_container/object<sub>2</sub>' )

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: * <code>read.batchLimit</code>: Number of files to read at a time from <code>$old</code> container. Optional; default = 1000. * <code>write.batchLimit</code>: Number of files to write at a time to <code>$new</code> container. Optional; default = 1000. * <code>read.pageLimit</code>: Number of filenames to read at a time from <code>$old</code> 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()
Methods inherited from OpenCloud\Common\Service\AbstractService
collection(), getClient(), getCurrentNamespace(), getEndpoint(), getNamespaces(), getResources(), resolveResourceClass(), resource(), resourceList(), setClient(), setEndpoint()
Methods inherited from OpenCloud\Common\Base
__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getPatchHeaders(), getProperty(), hasLogger(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), 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
Properties inherited from OpenCloud\Common\Service\CatalogService
$regionless
Properties inherited from OpenCloud\Common\Service\AbstractService
$client, $endpoint, $namespaces, $resources
Properties inherited from OpenCloud\Common\Base
$aliases
API documentation generated by ApiGen 2.8.0