65 lines
No EOL
1.2 KiB
PHP
65 lines
No EOL
1.2 KiB
PHP
<?php
|
|
include('InitTest.php');
|
|
include_once("../core/Image.php");
|
|
include_once("../core/Compute.php");
|
|
|
|
$image = new Image($App);
|
|
$compute = new Compute($App);
|
|
|
|
$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;
|
|
|
|
//$App->setPostParam('id', 'sdfihlus154dfhj');
|
|
//$err = $image->action("createImage");
|
|
|
|
|
|
//Liste des images
|
|
$image->action("listImage");
|
|
$im = $App->show();
|
|
$images = json_decode($im, true)["Images"];
|
|
|
|
echo "Images présentes :";
|
|
echo "</br>";
|
|
foreach($images as $i){
|
|
$recup = $i;
|
|
echo $recup['name'];
|
|
echo "</br>";
|
|
//echo $recup['id'];
|
|
}
|
|
echo "</br>";
|
|
|
|
echo "Flavors: ";
|
|
echo "</br>";
|
|
|
|
$compute->action("listFlavors");
|
|
$flavors = json_decode($App->show(), true)["Flavors"];
|
|
|
|
foreach($flavors as $f){
|
|
echo "Id=".$f['id'].", ";
|
|
echo "name=".$f['name'].", ";
|
|
echo "ram=".$f['ram'].", ";
|
|
echo "disk=".$f['disk'].", ";
|
|
echo "vcpus=".$f['vcpus'];
|
|
echo "</br>";
|
|
}
|
|
|
|
/*
|
|
$App->setPostParam('id', 354);
|
|
$err = $image->action("deleteImage");
|
|
$temp = $App->show();
|
|
$ret = json_decode($temp, true)["Images"];
|
|
echo $ret['id'];
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
?>
|