2016-01-21 13:02:45 +01:00
|
|
|
<?php
|
|
|
|
ini_set('display_errors', 1);
|
|
|
|
date_default_timezone_set("Europe/Paris");
|
|
|
|
require 'vendor/autoload.php';
|
2016-01-31 10:56:52 +01:00
|
|
|
include("core/Image.php");
|
2016-01-25 22:40:54 +01:00
|
|
|
|
2016-01-21 13:02:45 +01:00
|
|
|
$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'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
*/
|
2016-01-31 10:56:52 +01:00
|
|
|
//$compute = $openstack->computeV2(["region" => "RegionOne"]);
|
|
|
|
|
|
|
|
//$image= $openstack->imagesV2(["region" => "RegionOne"]);
|
|
|
|
$optImage = Array();
|
|
|
|
$optImage["region"] = "RegionOne";
|
|
|
|
$image = new Image($openstack, $optImage);
|
|
|
|
|
|
|
|
|
|
|
|
$images = $image->list_images();
|
|
|
|
|
2016-01-21 13:02:45 +01:00
|
|
|
//var_dump($compute->client);
|
|
|
|
//$servers = $compute->listServers(true);
|
|
|
|
|
2016-01-31 10:56:52 +01:00
|
|
|
foreach($images as $i){
|
|
|
|
//echo $server->id." !!! ";
|
|
|
|
echo $i->name;
|
|
|
|
echo "</br>";
|
|
|
|
}
|