class Service extends AbstractService

Traits

Methods

Retrieves an Account object.

listContainers (array $options = array(), callable $mapFn = null) : Generator

Retrieves a collection of container resources in a generator format.

getContainer (string $name = null) : Container

Retrieves a Container object and populates its name according to the value provided. Please note that the remote API is not contacted.

createContainer (array $data) : Container

Creates a new container according to the values provided.

containerExists (string $name) : bool

Checks the existence of a container.

Details

getAccount()

Retrieves an Account object.

Return value

Account

Example code

$account = $service->getAccount();

listContainers(array $options = array(), callable $mapFn = null)

Retrieves a collection of container resources in a generator format.

Parameters

$options array {see \OpenStack\ObjectStore\v1\Api::getAccount}
$mapFn callable Allows a function to be mapped over each element in the collection.

Return value

Generator

Example code

$generator = $service->listContainers($options, $mapFn);

getContainer(string $name = null)

Retrieves a Container object and populates its name according to the value provided. Please note that the remote API is not contacted.

Parameters

$name string The unique name of the container

Return value

Container

Example code

$container = $service->getContainer($name);

createContainer(array $data)

Creates a new container according to the values provided.

Parameters

$data array {see \OpenStack\ObjectStore\v1\Api::putContainer}

Return value

Container

Example code

$container = $service->createContainer($data);

containerExists(string $name)

Checks the existence of a container.

Parameters

$name string The name of the container

Return value

bool TRUE if exists, FALSE if it doesn't

Exceptions

BadResponseError Thrown for any non 404 status error

Example code

$bool = $service->containerExists($name);