add router functions

This commit is contained in:
Yoggzo 2016-04-21 22:52:00 +02:00
parent 3f6af0b644
commit 7e5b9f3a72
2 changed files with 278 additions and 15 deletions

View file

@ -47,7 +47,7 @@ foreach ($listFloatingIp as $floatIp){
echo "</br>";
// Liste des floatingip
// get floatingip
echo "Get floatingip : </br>";
$App->setPostParam('id', $id);
$networkLayer3->action("getFloatingIp");
@ -70,12 +70,14 @@ if(!isset($float)){
echo "</br>";
*/
/*
// Suppression d'une ip flotante
$App->setPostParam('id', $id);
$networkLayer3->action("deleteFloatingIp");
*/
// Liste des floatingip
echo "Liste des floatingip : </br>";
$networkLayer3->action("listFloatingIp");
@ -83,6 +85,62 @@ $listFloatingIp = json_decode($App->show(), true)["NetworkLayer3"];
foreach ($listFloatingIp as $floatIp){
echo $floatIp['floatingIpAddress']." ".$floatIp['id']." ".$floatIp["status"]."<br>";
}
echo "</br>";
// Liste des routeurs
echo "Liste des routeurs : </br>";
$networkLayer3->action("listRouters");
$listRouters = json_decode($App->show(), true)["NetworkLayer3"];
foreach ($listRouters as $router){
echo $router['name']." ".$router['id']."<br>";
if(strcmp($router['name'], "Test")){
$id = $router['id'];
}
}
echo "</br>";
// get floatingip
echo "Get router : </br>";
$App->setPostParam('id', $id);
$networkLayer3->action("getRouter");
$getRouter = json_decode($App->show(), true)["NetworkLayer3"];
echo $getRouter['id']."<br>";
echo "</br>";
/*
// Création d'un routeur'
$opt = array();
$optGate = array();
$optGate['networkId'] = "251b4641-20ff-4a72-8549-1758788b51ce";
$opt['externalGatewayInfo'] = $optGate;
$opt['name'] = "Test";
$App->setPostParam('opt', $opt);
$networkLayer3->action("createRouter");
$r = json_decode($App->show(), true)["NetworkLayer3"];
if(!isset($r)){
echo "Erreur pendant la création</br>";
}
echo "</br>";
*/
/*
// Suppression d'un routeur
$App->setPostParam('id', $id);
$networkLayer3->action("deleteRouter");
echo "</br>";
*/
// Liste des routeurs
echo "Liste des routeurs : </br>";
$networkLayer3->action("listRouters");
$listRouters = json_decode($App->show(), true)["NetworkLayer3"];
foreach ($listRouters as $router){
echo $router['name']." ".$router['id']."<br>";
}
?>