# Class Service

The ObjectStore (Cloud Files) service.

  OpenCloud\Common\Base
  OpenCloud\Common\Service\AbstractService implements OpenCloud\Common\Service\ServiceInterface
  OpenCloud\Common\Service\CatalogService
  OpenCloud\ObjectStore\AbstractService
  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 ``OpenCloud\Common\Http\Client`` $client Client object $type `string` $type Service type (e.g. 'compute') $name `string` $name Service name (e.g. 'cloudServersOpenStack') $region `string` $region Service region (e.g. 'DFW', 'ORD', 'IAD', 'LON', 'SYD' or 'HKG') $urlType `string` $urlType Either 'publicURL' or 'privateURL' #### Overrides `OpenCloud\Common\Service\CatalogService::__construct()`
`public `OpenCloud\ObjectStore\CDNService`` | # `getCdnService( )` #### Returns ``OpenCloud\ObjectStore\CDNService``
`public `OpenCloud\ObjectStore\Resource\Container`` | # `getContainer( mixed $data = null )` #### Parameters $data `mixed` $data #### Returns ``OpenCloud\ObjectStore\Resource\Container``
`public boolean|static` | # `createContainer( mixed $name, array $metadata = array() )` Create a container for this service. Create a container for this service. #### Parameters $name `mixed` $name The name of the container $metadata `array` $metadata Additional (optional) metadata to associate with the container #### Returns `boolean|static`
`public boolean` | # `checkContainerName( mixed $name )` Check the validity of a potential container name. Check the validity of a potential container name. #### Parameters $name `mixed` $name #### Returns `boolean` #### Throws ``OpenCloud\Common\Exceptions\InvalidArgumentError``
`public Guzzle\Http\Message\Response` | # `bulkExtract( mixed $path = '', mixed $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 `mixed` $path The path to the archive being extracted $archive `mixed` $archive The contents of the archive (either string or stream) $archiveType `string` $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 Guzzle\Http\Message\Response` | # `bulkDelete( array $paths )` This method will delete multiple objects or containers from their account with a single request. This method will delete multiple objects or containers from their account with a single request. #### Parameters $paths `array` $paths A two-dimensional array of paths: array('container_a/file1', 'container_b/file78', 'container_c/file_40582') #### Returns `Guzzle\Http\Message\Response` #### 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 ``OpenCloud\ObjectStore\Resource\Container`` $old Where you're moving files from $new ``OpenCloud\ObjectStore\Resource\Container`` $new Where you're moving files to $options #### Returns `array` Of PUT responses

Methods inherited from OpenCloud\ObjectStore\AbstractService
`getAccount(), listContainers()`

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(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Constants summary
`string` | `DEFAULT_NAME` | `'cloudFiles'` | #
`string` | `DEFAULT_TYPE` | `'object-store'` | #

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`

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`