istic-openstack/server/Test/imageTests.php

52 lines
1 KiB
PHP
Raw Normal View History

<?php
2016-03-02 16:00:46 +01:00
include('InitTest.php');
include_once("../core/Image.php");
2016-01-31 11:36:58 +01:00
2016-02-11 20:38:15 +01:00
$image = new Image($App);
2016-01-31 13:00:04 +01:00
$opt = Array();
$opt['name'] = "Test";
$opt['tags'] = ['test', 'openstack'];
//$opt['containerFormat'] = 'ami';
//$opt['diskFormat'] = 'iso';
2016-01-31 13:00:04 +01:00
$opt['visibility'] = 'public';
$opt['minDisk'] = 1;
$opt['protected'] = false;
2016-01-31 13:00:04 +01:00
$opt['minRam'] = 10;
//$App->setPostParam('id', 'sdfihlus154dfhj');
$err = $image->action("createImage");
2016-02-11 20:06:50 +01:00
2016-01-31 11:36:58 +01:00
//Liste des images
2016-03-02 16:00:46 +01:00
$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");
2016-01-31 11:36:58 +01:00
2016-01-31 18:28:09 +01:00
2016-01-31 11:36:58 +01:00
?>