diff options
Diffstat (limited to 'server/core/FloatingIp.php')
| -rwxr-xr-x | server/core/FloatingIp.php | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/server/core/FloatingIp.php b/server/core/FloatingIp.php index c5a947e..bbcd888 100755 --- a/server/core/FloatingIp.php +++ b/server/core/FloatingIp.php @@ -14,7 +14,7 @@ use OpenCloud\Common\Error\BaseError; use OpenCloud\Common\Error\NotImplementedError; use OpenCloud\Common\Error\UserInputError; -include("CoreInterface.php"); +//include("CoreInterface.php"); /** * Image Class of the back-end application @@ -22,7 +22,7 @@ include("CoreInterface.php"); * Management of images * */ -class floatingIp implements Core{ +class floatingIp { /** @var App $app protected, contains the main app object */ protected $app; @@ -31,11 +31,11 @@ class floatingIp implements Core{ protected $libClass; /** - * Image constructor + * floatingip constructor * * @param App $app the main app object * - * @return Image + * @return floatingip */ public function __construct($app){ if(!isset($app)){ @@ -57,6 +57,36 @@ class floatingIp implements Core{ $this->{$action.""}(); } + + /** + * List floatingip + * + * @return list of the floatingip + */ + private function listFloatingIp(){ + try{ + $result = array(); + $l = $this->libClass->getFloatingIps(); + + + + foreach ($l as $tmp) { + $serult[] = $tmp; + } + $this->app->setOutput("FloatingIp", $result); + }catch(BadResponseError $e){ + $this->app->getErrorInstance()->BadResponseHandler($e); + }catch(UserInputError $e){ + $this->app->getErrorInstance()->UserInputHandler($e); + }catch(BaseError $e){ + $this->app->getErrorInstance()->BaseErrorHandler($e); + }catch(NotImplementedError $e){ + $this->app->getErrorInstance()->NotImplementedHandler($e); + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } + /** * Create a new floating IP adress * @@ -72,7 +102,7 @@ class floatingIp implements Core{ } try{ $floatingip = $this->libClass->create($opt); - if(!isset){ + if(!isset($floatingip)){ $this->app->setOutput("Error", "Unknowing error during floating ip creation"); } else{ @@ -118,9 +148,6 @@ class floatingIp implements Core{ $floatingip->update(); - if(!isset){ - $this->app->setOutput("Error", "Unknowing error during floating ip creation"); - } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); }catch(UserInputError $e){ @@ -161,9 +188,6 @@ class floatingIp implements Core{ $floatingip->delete(); - if(!isset){ - $this->app->setOutput("Error", "Unknowing error during floating ip creation"); - } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); }catch(UserInputError $e){ @@ -203,10 +227,6 @@ class floatingIp implements Core{ } $floatingip->retrieve(); - - if(!isset){ - $this->app->setOutput("Error", "Unknowing error during floating ip creation"); - } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); }catch(UserInputError $e){ |
