structure of Automating
This commit is contained in:
parent
7e5b9f3a72
commit
0fc14b5761
2 changed files with 56 additions and 71 deletions
server/Test
|
@ -1,48 +1,20 @@
|
|||
<?php
|
||||
include('InitTest.php');
|
||||
include_once("../core/Image.php");
|
||||
include_once("../core/Compute.php");
|
||||
include_once("../core/Network.php");
|
||||
//include_once("../core/Automating.php");
|
||||
include_once("../core/NetworkLayer3.php");
|
||||
include_once("../core/Automating.php");
|
||||
|
||||
$image = new Image($App);
|
||||
$compute = new Compute($App);
|
||||
$networkLayer3 = new NetworkLayer3($App);
|
||||
//$automating = new Automating($App);
|
||||
$automating = new Automating($App);
|
||||
|
||||
// Liste des serveurs
|
||||
echo "Liste des serveurs : </br>";
|
||||
$compute->action("listServers");
|
||||
$servers = json_decode($App->show(), true)["Servers"];
|
||||
$id = null;
|
||||
foreach($servers as $server){
|
||||
echo $server['name']." ".$server['id']." ".$server['ipv4']."<br>";
|
||||
if(strcmp($server['name'], "bob")){
|
||||
$id = $server['id'];
|
||||
}
|
||||
}
|
||||
echo "</br>";
|
||||
|
||||
|
||||
//Liste des networks
|
||||
echo "Liste des network : </br>";
|
||||
$network->action("list_network_ids");
|
||||
$servers = json_decode($App->show(), true)["ListNetworkIds"];
|
||||
$id = null;
|
||||
foreach($servers as $server){
|
||||
echo $server."<br>";
|
||||
}
|
||||
echo "</br>";
|
||||
|
||||
|
||||
// liste des floatingip
|
||||
echo "Liste des floatingip : </br>";
|
||||
$networkLayer3->action("listFloatingIp");
|
||||
$listFloatingIp = json_decode($App->show(), true)["NetworkLayer3"];
|
||||
foreach ($listFloatingIp as $floatIp){
|
||||
echo $floatIp['floatingIpAddress']." ".$floatIp['id']." ".$floatIp["status"]."<br>";
|
||||
}
|
||||
//$id = // id du réseau
|
||||
|
||||
/*
|
||||
// Création serveur avec ip publique
|
||||
echo "Test création serveur avec ip publique : </br>";
|
||||
$App->setPostParam('networkId', $id);
|
||||
$App->setPostParam('imageName', "ImageTest");
|
||||
$App->setPostParam('serverName', "ServerTest");
|
||||
$App->setPostParam('flavor', 1);
|
||||
$compute->action("createPublicServer");
|
||||
$servers = json_decode($App->show(), true)["Automating"];
|
||||
*/
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue