class Builder

A Builder for easily creating OpenStack services.

Methods

__construct (array $globalOptions = array(), string $rootNamespace = 'OpenStack')

No description

createService (string $namespace, array $serviceOptions = array()) : ServiceInterface

This method will return an OpenStack service ready fully built and ready for use. There is some initial setup that may prohibit users from directly instantiating the service class directly - this setup includes the configuration of the HTTP client's base URL, and the attachment of an authentication handler.

Details

__construct(array $globalOptions = array(), string $rootNamespace = 'OpenStack')

Parameters

$globalOptions array Options that will be applied to every service created by this builder. Eventually they will be merged (and if necessary overridden) by the service-specific options passed in.
$rootNamespace string API classes' root namespace

Example code

$builder->__construct($globalOptions, $rootNamespace);

createService(string $namespace, array $serviceOptions = array())

This method will return an OpenStack service ready fully built and ready for use. There is some initial setup that may prohibit users from directly instantiating the service class directly - this setup includes the configuration of the HTTP client's base URL, and the attachment of an authentication handler.

Parameters

$namespace string The namespace of the service
$serviceOptions array The service-specific options to use

Return value

ServiceInterface

Exceptions

Exception

Example code

$serviceInterface = $builder->createService($namespace, $serviceOptions);