blob: d86c664cc7830ecca410fc48f78c8ddface845f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<?php
include('InitTest.php');
include_once("../core/Image.php");
include_once("../core/Compute.php");
$image = new Image($App);
$compute = new Compute($App);
$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;
//$App->setPostParam('id', 'sdfihlus154dfhj');
//$err = $image->action("createImage");
//Liste des images
$image->action("listImage");
$im = $App->show();
$images = json_decode($im, true)["Images"];
echo "Images présentes :";
echo "</br>";
foreach($images as $i){
$recup = $i;
echo $recup['name'];
echo "</br>";
//echo $recup['id'];
}
echo "</br>";
echo "Flavors: ";
echo "</br>";
$compute->action("listFlavors");
$flavors = json_decode($App->show(), true)["Flavors"];
foreach($flavors as $f){
echo "Id=".$f['id'].", ";
echo "name=".$f['name'].", ";
echo "ram=".$f['ram'].", ";
echo "disk=".$f['disk'].", ";
echo "vcpus=".$f['vcpus'];
echo "</br>";
}
/*
$App->setPostParam('id', 354);
$err = $image->action("deleteImage");
$temp = $App->show();
$ret = json_decode($temp, true)["Images"];
echo $ret['id'];
*/
?>
|