summaryrefslogtreecommitdiff
path: root/server/core
diff options
context:
space:
mode:
authorYoggzo <yogg@epsina.com>2016-04-19 23:57:03 +0200
committerYoggzo <yogg@epsina.com>2016-04-19 23:57:03 +0200
commit94629aeaf523f391f09ef18c1b2ca639e0b02d08 (patch)
tree727920b8dba502ce729b9bc059b0235d37bce76b /server/core
parent438b9b4dcdee7e0c18c3477bb9592ac7efbebfec (diff)
tentative ip publique
Diffstat (limited to 'server/core')
-rwxr-xr-xserver/core/FloatingIp.php51
-rwxr-xr-xserver/core/Network.php2
2 files changed, 50 insertions, 3 deletions
diff --git a/server/core/FloatingIp.php b/server/core/FloatingIp.php
index f26c3fb..528ab4f 100755
--- a/server/core/FloatingIp.php
+++ b/server/core/FloatingIp.php
@@ -68,7 +68,6 @@ class floatingIp {
$result = array();
$l = $this->libClass->listFloatingIps();
error_log(var_export($l, true), 0);
- echo 'toto';
foreach ($l as $tmp) {
$result[] = $tmp;
}
@@ -101,7 +100,8 @@ class floatingIp {
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
- $floatingip = $this->libClass->create($opt);
+ $floatingip = $this->libClass->createFloatingIp($opt);
+ echo 'YOLO';
if(!isset($floatingip)){
$this->app->setOutput("Error", "Unknowing error during floating ip creation");
}
@@ -109,6 +109,53 @@ class floatingIp {
$this->app->setOutput("FloatingIp", $floatingip);
}
}catch(BadResponseError $e){
+ echo $e."</br>";
+ $this->app->getErrorInstance()->BadResponseHandler($e);
+ }catch(UserInputError $e){
+ echo $e."</br>";
+ $this->app->getErrorInstance()->UserInputHandler($e);
+ }catch(BaseError $e){
+ echo $e."</br>";
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
+ }catch(NotImplementedError $e){
+ echo $e."</br>";
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ echo $e->getMessage()."</br>";
+ $this->app->getErrorInstance()->OtherException($e);
+ }
+ }
+
+
+ /**
+ * Show floatingip details
+ *
+ * @param String id the id of the floatingip
+ *
+ * @return floatingip details
+ */
+ private function getFloatingIp(){
+ $id = $this->app->getPostParam("id");
+ if(!isset($id)){
+ $this->app->setOutput("Error", "Incorrect parameter opt");
+ }
+
+ try{
+ /*$l = $this->listFloatingIp();
+ $res = null;
+ foreach ($l as $f) {
+ if($f['id']==$id){
+ $res = $f;
+ }
+ }
+ if(!isset($f)){
+ $this->app->setOutput("Error", "Unknow id");
+ }
+ else{*/
+ $res = $this->libClass->getFloatingIp($id);
+ $this->app->setOutput("FloatingIp", $res);
+ //}
+ }catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
diff --git a/server/core/Network.php b/server/core/Network.php
index 9564f06..3e5e2ca 100755
--- a/server/core/Network.php
+++ b/server/core/Network.php
@@ -40,7 +40,7 @@ class network{
public function __construct($app){
$this->app = $app;
- $this->libClass = $app->getLibClass("network");
+ $this->libClass = $app->getLibClass("Network");
}