diff options
| author | Yoggzo <yogg@epsina.com> | 2016-04-19 23:57:03 +0200 |
|---|---|---|
| committer | Yoggzo <yogg@epsina.com> | 2016-04-19 23:57:03 +0200 |
| commit | 94629aeaf523f391f09ef18c1b2ca639e0b02d08 (patch) | |
| tree | 727920b8dba502ce729b9bc059b0235d37bce76b /server/core/FloatingIp.php | |
| parent | 438b9b4dcdee7e0c18c3477bb9592ac7efbebfec (diff) | |
tentative ip publique
Diffstat (limited to 'server/core/FloatingIp.php')
| -rwxr-xr-x | server/core/FloatingIp.php | 51 |
1 files changed, 49 insertions, 2 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); |
