octey / opencloud-bundle
Symfony2 Bundle for php-opencloud
Installs: 305
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Type:symfony-bundle
pkg:composer/octey/opencloud-bundle
This package has no released version yet, and little information is available.
README
A bundle to use php-opencloud inside your Symfony2 application.
Installation
The recommended way to install this bundle is through
Composer. Require the octey/opencloud-bundle
package into your composer.json file:
{
    "require": {
        "octey/opencloud-bundle": "@stable"
    }
}
Protip: you should browse the
octey/opencloud-bundle
page to choose a stable version to use, avoid the @stable meta constraint.
Update app/AppKernel.php:
public function registerBundles()
{
    $bundles = array(
        // ...
        new Octey\OpenCloudBundle\OcteyOpenCloudBundle(),
    );
    return $bundles;
}
Configuration reference
Rackspace :
octey_opencloud:
    provider: rackspace
    credentials:
        username: %rackspace_username%
        apiKey: %rackspace_username_apiKey%
OpenStack :
octey_opencloud:
    provider: openstack
    endpoint: %openstack_endpoint%
    credentials:
        username: %openstack_username%
        password: "%openstack_password%"
        # tenantName or tenantId
        tenantName: %openstack_tenantName%
        #tenantId: %openstack_tenantId%
Usage
public function indexAction()
{
    // get opencloud client
    $client = $this->get('opencloud');
    // Rackspace
    $compute = $client->computeService('cloudServersOpenStack', 'ORD');
    // OpenStack
    $compute = $client->computeService('nova', 'RegionOne');
}
Once this client object is available, you have full access to the php-opencloud SDK.
Inspiration
License
This bundle is released under the MIT License. See the bundled LICENSE file for details.