diff options
Diffstat (limited to 'server/Test/imageTests.php')
| -rwxr-xr-x | server/Test/imageTests.php | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/server/Test/imageTests.php b/server/Test/imageTests.php index 4adec08..a99fbd7 100755 --- a/server/Test/imageTests.php +++ b/server/Test/imageTests.php @@ -14,7 +14,7 @@ $opt['name'] = "Test"; $opt['tags'] = ['test', 'openstack']; //$opt['containerFormat'] = 'ami'; //$opt['diskFormat'] = 'iso'; -$opt['visibility'] = 'public'; +//$opt['visibility'] = 'public'; $opt['minDisk'] = 1; $opt['protected'] = false; $opt['minRam'] = 10; @@ -25,30 +25,39 @@ $retCreate = json_decode($App->show(), true)["Images"]; $idNew = $retCreate['id']; */ -/* -// Delete Image -$App->setPostParam('id', $idNew); -$image->action("deleteImage"); -*/ + + // Liste images $image->action("listImage"); $im = $App->show(); $images = json_decode($im, true)["Images"]; -echo "List images :</br>"; +$res; +echo "List images :</br></br>"; foreach($images as $i){ - echo $i['name']."</br>"; // Nom + $name = $i['name']; + if(strcmp($name,"Test") == 0) + { + $res = $i['id']; + } + echo $name."</br>"; // Nom echo $i['status']."</br>"; // Status $id = $i['id']; // Id echo $id."</br>"; - foreach ($i['tags'] as $tag) { // Tags + /*foreach ($i['tags'] as $tag) { // Tags echo $tag."</br>"; - } + }*/ echo "</br>"; } +// Delete Image + /* +$App->setPostParam('id', $res); +$image->action("deleteImage"); +*/ +/* // Details images echo "Détail image :</br>"; $App->setPostParam('id', $id); @@ -56,7 +65,7 @@ $image->action("detailsImage"); $retDetails = json_decode($App->show(), true)["Images"]; echo $retDetails['id']."</br>"; echo "</br>"; - +*/ /* // Download image @@ -66,18 +75,20 @@ $image->action("downloadImage"); // Desactivate Images +/* echo "Desactivate image : </br>"; echo $id."</br>"; $App->setPostParam('id', $id); $err = $image->action("desactivateImage"); echo "</br>"; +*/ +// Reactivate Images /* -// Resactivate Images echo $id."</br>"; -$App->setPostParam('id', $id); -$err = $image->action("resactivateImage"); +$App->setPostParam('id', $res); +$image->action("reactivateImage"); */ |
