diff options
| author | root <root@kabir-PC> | 2016-03-30 12:42:40 +0200 |
|---|---|---|
| committer | root <root@kabir-PC> | 2016-03-30 12:42:40 +0200 |
| commit | b6ffc16d78e3fd22f9d728d45cef1c78c182cc1f (patch) | |
| tree | fdd10bf95ca8d479fd6c3d62f17103dbd13b7f27 /server/Test | |
| parent | 750dcc61ceff516a9233cc10dc138a9c898a61f6 (diff) | |
| parent | 1fdc1a19ce180e4db111354cbedc436a15dd803c (diff) | |
Merge branch 'develop' of https://github.com/manzerbredes/istic-openstack into develop
Diffstat (limited to 'server/Test')
| -rw-r--r-- | 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 100644 --- 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"); */ |
