From 5f34f504b08b34aad35d232d3ea35f2b4b70b070 Mon Sep 17 00:00:00 2001 From: Eole Date: Thu, 21 Jan 2016 13:02:45 +0100 Subject: [PATCH] Init file for php-opencloud api - Config file --- server/config.inc.php | 7 +++++++ server/index.php | 6 ++++++ server/init.php | 35 +++++++++++++++++++++++++++++++++++ server/test.php | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 server/config.inc.php create mode 100644 server/index.php create mode 100644 server/init.php create mode 100644 server/test.php diff --git a/server/config.inc.php b/server/config.inc.php new file mode 100644 index 0000000..df92996 --- /dev/null +++ b/server/config.inc.php @@ -0,0 +1,7 @@ + + + diff --git a/server/index.php b/server/index.php new file mode 100644 index 0000000..7c3bd5b --- /dev/null +++ b/server/index.php @@ -0,0 +1,6 @@ + Array( + "name" => $user, + "password" => $password, + "domain" => Array( + "name" => "Default") + ), + "scope" => Array( + "project" => Array( + "name" => $project, + "domain" => Array( + "name" => "Default") + ) + ), + "authUrl" => $urlAuth + ); + } + + $openstack_api = new OpenStack\OpenStack($Args); + +?> 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 @@ +"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." !!! "; +//}