Ask Your Question
0

Create container in OpenStack using PHPOpenCloud

asked 2014-05-02 11:19:31 -0500

mani619cash gravatar image

I want to create a container using PHPOpenCLoud. I have deployed https://github.com/rackspace/php-opencloud (OpenStack) using DevStack on single machine.

I have this code: -

require 'vendor/autoload.php';

use OpenCloud\OpenStack;

$client = new OpenStack('http://192.168.171.131:5000/v2.0', array(
    'username' => 'admin',
    'password' => 'devstack'
));

$service = $client->objectStoreService('swift', 'nova');

I am getting this error.

Fatal error: Uncaught exception 'OpenCloud\Common\Exceptions\EndpointError'
with message 'No endpoints for service type [object-store], name [swift], 
region [nova] ....

Can some one tell me how do make use of OpenStack services through https://github.com/rackspace/php-opencloud (PHPOpenCloud)

edit retag flag offensive close merge delete

Comments

Is your target environment actually running swift?

larsks gravatar imagelarsks ( 2014-05-02 12:10:44 -0500 )edit

Yes! I already have some containers and objects in them.

mani619cash gravatar imagemani619cash ( 2014-05-02 12:36:33 -0500 )edit

Make sure your devstack installation runs properly, check the logs of your openstack cloud, too

smaffulli gravatar imagesmaffulli ( 2014-05-02 15:04:09 -0500 )edit

That works properly as I told you I can upload objects to container via CLI. That means it works!

mani619cash gravatar imagemani619cash ( 2014-05-02 23:34:45 -0500 )edit

Were you ever able to solve this? I just tried to do the same thing and got the same error...

I asked on the rackspace forums and they provided an answer, so if you need it look here:

https://community.rackspace.com/developers/f/7/t/4067 (https://community.rackspace.com/devel...)

loatu gravatar imageloatu ( 2014-07-16 12:37:39 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-08-12 03:25:29 -0500

Hamzoz gravatar image
<?php                                                                                                 require 'vendor/autoload.php';                                                                        $openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region'  => '{region}',
'user'    => [
    'id'       => '{userId}',
    'password' => '{password}'
],
'scope'   => ['project' => ['id' => '{projectId}']]                                                   ]);                                                                                                     $service = $client->objectStoreService('{catalogName}', '{region}', '{urlType}'); ?>

try this !

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-05-02 11:19:31 -0500

Seen: 371 times

Last updated: Aug 12 '16