diff options
| author | yogg@epsina.com <evan.pisani@etudiant.univ-rennes1.fr> | 2016-01-31 13:00:04 +0100 |
|---|---|---|
| committer | yogg@epsina.com <evan.pisani@etudiant.univ-rennes1.fr> | 2016-01-31 13:00:04 +0100 |
| commit | 10a6cd146db2bc509059d07ff8b7887445524cab (patch) | |
| tree | aa824a0abf59439ca1bd23fe4ace6c74640ccdfe /server/test.php | |
| parent | 325362a386687dd77c6c42dc5ab266d646bd9842 (diff) | |
Add create_image and delete_image
Diffstat (limited to 'server/test.php')
| -rw-r--r-- | server/test.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/server/test.php b/server/test.php index 6881923..ce262fa 100644 --- a/server/test.php +++ b/server/test.php @@ -36,6 +36,17 @@ $optImage = Array(); $optImage["region"] = "RegionOne"; $image = new Image($openstack, $optImage); +$opt = Array(); +$opt['name'] = "Test"; +//$opt['tags'] = 'test'; +$opt['containerFormat'] = 'ami'; +$opt['diskFormat'] = 'iso'; +$opt['visibility'] = 'public'; +$opt['minDisk'] = 1; +$opt['protected'] = true; +$opt['minRam'] = 10; + +//$new_image = $image->create_image($opt); //Liste des images $images = $image->list_images(); @@ -45,7 +56,7 @@ echo "</br>"; foreach($images as $i){ echo $i->name; - if($i->name == "TinyCore"){ + if($i->name == "Test"){ $id_image = $i->id; } echo "</br>"; @@ -54,6 +65,9 @@ echo "</br>"; // Détails Image -$details = $image->image_details($id_image); +//$details = $image->image_details($id_image); + +//$image->delete_image($id_image); + ?>
\ No newline at end of file |
