Merge branch 'Evan' into Eole
This commit is contained in:
commit
10fb56b935
1 changed files with 67 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
date_default_timezone_set("Europe/Paris");
|
date_default_timezone_set("Europe/Paris");
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
include("core/Image.php");
|
||||||
|
|
||||||
$options = Array();
|
$options = Array();
|
||||||
$options["user"] = Array("name"=>"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]);
|
$options["user"] = Array("name"=>"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]);
|
||||||
|
@ -15,7 +16,6 @@ $openstack = new OpenStack\OpenStack($options);
|
||||||
// Since usernames will not be unique across an entire OpenStack installation,
|
// Since usernames will not be unique across an entire OpenStack installation,
|
||||||
// when authenticating with them you must also provide your domain ID. You do
|
// 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.
|
// not have to do this if you authenticate with a user ID.
|
||||||
|
|
||||||
/*$token = $identity->generateToken([
|
/*$token = $identity->generateToken([
|
||||||
'user' => [
|
'user' => [
|
||||||
'name' => 'admin',
|
'name' => 'admin',
|
||||||
|
@ -26,11 +26,72 @@ $openstack = new OpenStack\OpenStack($options);
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
*/
|
*/
|
||||||
$compute = $openstack->computeV2(["region" => "RegionOne"]);
|
//$compute = $openstack->computeV2(["region" => "RegionOne"]);
|
||||||
|
//$image= $openstack->imagesV2(["region" => "RegionOne"]);
|
||||||
//var_dump($compute->client);
|
//var_dump($compute->client);
|
||||||
//$servers = $compute->listServers(true);
|
//$servers = $compute->listServers(true);
|
||||||
|
|
||||||
//foreach($servers as $server){
|
// Initialisation Image()
|
||||||
// echo $server->id." !!! ";
|
$optImage = Array();
|
||||||
// echo $server->name." !!! ";
|
$optImage["region"] = "RegionOne";
|
||||||
//}
|
$image = new Image($openstack, $optImage);
|
||||||
|
|
||||||
|
$opt = Array();
|
||||||
|
$opt['name'] = "Test";
|
||||||
|
$opt['tags'] = ['test', 'openstack'];
|
||||||
|
//$opt['containerFormat'] = 'ami';
|
||||||
|
//$opt['diskFormat'] = 'iso';
|
||||||
|
$opt['visibility'] = 'public';
|
||||||
|
$opt['minDisk'] = 1;
|
||||||
|
$opt['protected'] = false;
|
||||||
|
$opt['minRam'] = 10;
|
||||||
|
|
||||||
|
//$new_image = $image->create_image($opt);
|
||||||
|
|
||||||
|
//Liste des images
|
||||||
|
$images = $image->list_images();
|
||||||
|
|
||||||
|
echo "Images présentes :";
|
||||||
|
echo "</br>";
|
||||||
|
|
||||||
|
foreach($images as $i){
|
||||||
|
echo $i->name;
|
||||||
|
if($i->name == "Test"){
|
||||||
|
$id_image = $i->id;
|
||||||
|
$list = $i->tags;
|
||||||
|
echo $i->status;
|
||||||
|
}
|
||||||
|
echo "</br>";
|
||||||
|
}
|
||||||
|
echo "</br>";
|
||||||
|
|
||||||
|
if(isset($list)){
|
||||||
|
foreach ($list as $l) {
|
||||||
|
echo $l;
|
||||||
|
echo "</br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Détails Image
|
||||||
|
//$details = $image->image_details($id_image);
|
||||||
|
|
||||||
|
//$image->delete_image('123456');
|
||||||
|
|
||||||
|
//$image->desactivate_image($id_image);
|
||||||
|
//$image->reactivate_image($id_image);
|
||||||
|
|
||||||
|
//$file_name = "/home/yogg/Downloads/TinyCore-6.4.1.iso";
|
||||||
|
//$image->upload_image($id_image, $file_name);
|
||||||
|
|
||||||
|
//$image->download_image($id_image);
|
||||||
|
|
||||||
|
/*
|
||||||
|
$opt_update = Array();
|
||||||
|
$opt_update['name'] = "Test";
|
||||||
|
$opt_update['tags'] = null;
|
||||||
|
|
||||||
|
$update = $image->update_image($id_image, $opt_update);
|
||||||
|
echo $update->name;
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
Loading…
Add table
Reference in a new issue