Architecture modification
This commit is contained in:
parent
b6d7d2c30e
commit
0298591cee
2 changed files with 79 additions and 81 deletions
|
@ -1,35 +1,6 @@
|
|||
<?php
|
||||
require '../vendor/autoload.php';
|
||||
include('/istic-openstack/server/init.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"]);
|
||||
//$image= $openstack->imagesV2(["region" => "RegionOne"]);
|
||||
//var_dump($compute->client);
|
||||
//$servers = $compute->listServers(true);
|
||||
echo 'toto';
|
||||
include('InitTest.php');
|
||||
include_once("../core/Image.php");
|
||||
|
||||
$image = new Image($App);
|
||||
|
||||
|
@ -43,52 +14,54 @@ $opt['minDisk'] = 1;
|
|||
$opt['protected'] = false;
|
||||
$opt['minRam'] = 10;
|
||||
|
||||
//$new_image = $image->create_image($opt);
|
||||
|
||||
//$new_image = $image->createImage($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;
|
||||
$image->action("listImage");
|
||||
//$images = $image->listImage();
|
||||
$im = $App->show();
|
||||
$images = json_decode($im, true)["Images"];
|
||||
if(isset($images)){
|
||||
echo "Images présentes :";
|
||||
echo "</br>";
|
||||
foreach($images as $i){
|
||||
echo $i['name'];
|
||||
echo "</br>";
|
||||
}
|
||||
echo "</br>";
|
||||
}
|
||||
echo "</br>";
|
||||
|
||||
if(isset($list)){
|
||||
foreach ($list as $l) {
|
||||
echo $l;
|
||||
echo "</br>";
|
||||
}
|
||||
if(isset($list)){
|
||||
foreach ($list as $l) {
|
||||
echo $l;
|
||||
echo "</br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo "Aucune image présente\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Détails Image
|
||||
//$details = $image->image_details($id_image);
|
||||
//$details = $image->imageDetails($id_image);
|
||||
|
||||
//$image->delete_image('123456');
|
||||
//$image->deleteImage('123456');
|
||||
|
||||
//$image->desactivate_image($id_image);
|
||||
//$image->reactivate_image($id_image);
|
||||
//$image->desactivateImage($id_image);
|
||||
//$image->reactivateImage($id_image);
|
||||
|
||||
//$file_name = "/home/yogg/Downloads/TinyCore-6.4.1.iso";
|
||||
//$image->upload_image($id_image, $file_name);
|
||||
//$image->uploadImage($id_image, $file_name);
|
||||
|
||||
//$image->download_image($id_image);
|
||||
//$image->downloadImage($id_image);
|
||||
|
||||
/*
|
||||
$opt_update = Array();
|
||||
$opt_update['name'] = "Test";
|
||||
$opt_update['tags'] = null;
|
||||
|
||||
$update = $image->update_image($id_image, $opt_update);
|
||||
$update = $image->updateImage($id_image, $opt_update);
|
||||
echo $update->name;
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue