diff options
| author | Eole <josselin.35@live.fr> | 2016-01-21 13:02:45 +0100 |
|---|---|---|
| committer | Eole <josselin.35@live.fr> | 2016-01-21 13:02:45 +0100 |
| commit | 5f34f504b08b34aad35d232d3ea35f2b4b70b070 (patch) | |
| tree | df560b899d151334dc1cb9b2ccfc1dfa04b44307 /server/test.php | |
| parent | a44cc1d2e3c0f147e91a5c052ac7fd879e34e706 (diff) | |
Init file for php-opencloud api - Config file
Diffstat (limited to 'server/test.php')
| -rw-r--r-- | server/test.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/server/test.php b/server/test.php new file mode 100644 index 0000000..c5fcb59 --- /dev/null +++ b/server/test.php @@ -0,0 +1,36 @@ +<?php +ini_set('display_errors', 1); +date_default_timezone_set("Europe/Paris"); +require 'vendor/autoload.php'; + +$options = Array(); +$options["user"] = Array("name"=>"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]); +$options["scope"] = Array("project"=>Array("name"=>"admin", "domain"=>["id"=>"Default"])); +$options["authUrl"] = "http://148.60.11.31:5000/v3"; + +$openstack = new OpenStack\OpenStack($options); + +//$identity = $openstack->identityV3(); +//var_dump($identity); +// Since usernames will not be unique across an entire OpenStack installation, +// when authenticating with them you must also provide your domain ID. You do +// not have to do this if you authenticate with a user ID. + +/*$token = $identity->generateToken([ + 'user' => [ + 'name' => 'admin', + 'password' => 'ae5or6cn', + 'domain' => [ + 'id' => 'Default' + ] + ] + ]); + */ +$compute = $openstack->computeV2(["region" => "RegionOne"]); +//var_dump($compute->client); +//$servers = $compute->listServers(true); + +//foreach($servers as $server){ +// echo $server->id." !!! "; +// echo $server->name." !!! "; +//} |
