summaryrefslogtreecommitdiff
path: root/server/test.php
diff options
context:
space:
mode:
authorYoggzo <yogg@epsina.com>2016-02-11 17:01:37 +0100
committerYoggzo <yogg@epsina.com>2016-02-11 17:01:37 +0100
commitc31c3bb28155c401d295a4bea6c43b72bbe30206 (patch)
tree5925d82a0e693be9ec2ed4646811695bdedf1980 /server/test.php
parent8c6b1cecd310acebd63c73628688aa0fcf8cb126 (diff)
move image tests file
Diffstat (limited to 'server/test.php')
-rw-r--r--server/test.php97
1 files changed, 0 insertions, 97 deletions
diff --git a/server/test.php b/server/test.php
deleted file mode 100644
index f0e68c4..0000000
--- a/server/test.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-ini_set('display_errors', 1);
-date_default_timezone_set("Europe/Paris");
-require 'vendor/autoload.php';
-include("core/Image.php");
-
-$options = Array();
-$options["user"] = Array("name"=>"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]);
-$options["scope"] = Array("project"=>Array("name"=>"admin", "domain"=>["id"=>"Default"]));
-$options["authUrl"] = "http://148.60.11.31:5000/v3";
-
-$openstack = new OpenStack\OpenStack($options);
-
-//$identity = $openstack->identityV3();
-//var_dump($identity);
-// Since usernames will not be unique across an entire OpenStack installation,
-// when authenticating with them you must also provide your domain ID. You do
-// not have to do this if you authenticate with a user ID.
-/*$token = $identity->generateToken([
- 'user' => [
- 'name' => 'admin',
- 'password' => 'ae5or6cn',
- 'domain' => [
- 'id' => 'Default'
- ]
- ]
- ]);
- */
-//$compute = $openstack->computeV2(["region" => "RegionOne"]);
-//$image= $openstack->imagesV2(["region" => "RegionOne"]);
-//var_dump($compute->client);
-//$servers = $compute->listServers(true);
-
-// Initialisation Image()
-$optImage = Array();
-$optImage["region"] = "RegionOne";
-$image = new Image($openstack, $optImage);
-
-$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;
-
-//$new_image = $image->create_image($opt);
-
-//Liste des images
-$images = $image->list_images();
-
-echo "Images présentes :";
-echo "</br>";
-
-foreach($images as $i){
- echo $i->name;
- if($i->name == "Test"){
- $id_image = $i->id;
- $list = $i->tags;
- echo $i->status;
- }
- echo "</br>";
-}
-echo "</br>";
-
-if(isset($list)){
- foreach ($list as $l) {
- echo $l;
- echo "</br>";
- }
-}
-
-// Détails Image
-//$details = $image->image_details($id_image);
-
-//$image->delete_image('123456');
-
-//$image->desactivate_image($id_image);
-//$image->reactivate_image($id_image);
-
-//$file_name = "/home/yogg/Downloads/TinyCore-6.4.1.iso";
-//$image->upload_image($id_image, $file_name);
-
-//$image->download_image($id_image);
-
-/*
-$opt_update = Array();
-$opt_update['name'] = "Test";
-$opt_update['tags'] = null;
-
-$update = $image->update_image($id_image, $opt_update);
-echo $update->name;
-*/
-
-?> \ No newline at end of file