<?php
include('InitTest.php');
include_once("../core/Image.php");

$image = new Image($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"];
$recup;

echo "Images présentes :";
echo "</br>";
foreach($images as $i){
    $recup = $i;
    echo $recup['name'];
    echo "</br>";
    //echo $recup['id'];
 }
echo "</br>";
echo "Erreur capturée: ";
echo "</br>";
   
    /*
    //$App->setPostParam('id', $recup['id']);
    $App->setPostParam('id', 'sdfihlus154dfhj');
    $err = $image->action("detailsImage");
    $temp = $App->show();
    $ret = json_decode($temp, true)["Images"];
    echo $ret['id'];
    */
    //$App->getPostParam("id");




?>