Overview
  • Namespace
  • Class

Namespaces

  • OpenCloud
    • Autoscale
      • 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
      • 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( )

Returns

OpenCloud\ObjectStore\CDNService
public OpenCloud\Common\Collection\PaginatedIterator
# listContainers( array $filter = array() )

List all available containers.

List all available containers.

Parameters

$filter

Returns

OpenCloud\Common\Collection\PaginatedIterator
public OpenCloud\ObjectStore\Resource\Container
# getContainer( $data = null )

Parameters

$data

Returns

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

Create a container for this service.

Create a container for this service.

Parameters

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

Returns

boolean|static
public boolean
# checkContainerName( $name )

Check the validity of a potential container name.

Check the validity of a potential container name.

Parameters

$name

Returns

boolean

Throws

OpenCloud\Common\Exceptions\InvalidArgumentError
public Guzzle\Http\Message\Response
# bulkExtract( $path, $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
path to the archive being extracted
$archive
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

Throws

OpenCloud\ObjectStore\Exception\BulkOperationException
OpenCloud\Common\Exceptions\InvalidArgumentError
public array
# 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
The array of responses from the API

Throws

OpenCloud\ObjectStore\Exception\BulkOperationException
public array
# 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

Returns

array
Of PUT responses

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(), getEndpoint(), getNamespaces(), getResources(), resource(), resourceList(), setClient(), setEndpoint()

Methods inherited from OpenCloud\Common\Base

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

Magic methods summary

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

API documentation generated by ApiGen