summaryrefslogtreecommitdiff
path: root/server/core
diff options
context:
space:
mode:
authorYoggzo <yogg@epsina.com>2016-04-19 18:00:37 +0200
committerYoggzo <yogg@epsina.com>2016-04-19 18:00:37 +0200
commit3795d05a97dd144073d466be1ed0fd144683d8df (patch)
tree12ba6c68bcaeda43134506650e0f6fe3e19e2b79 /server/core
parent2d260aa6f591030f869063ccdb1f6997d12c1294 (diff)
trying test floatingip
Diffstat (limited to 'server/core')
-rwxr-xr-xserver/core/FloatingIp.php50
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){