summaryrefslogtreecommitdiff
path: root/server/core
diff options
context:
space:
mode:
Diffstat (limited to 'server/core')
-rwxr-xr-xserver/core/App.php40
-rwxr-xr-x[-rw-r--r--]server/core/Compute.php7
-rwxr-xr-xserver/core/ErrorManagement.php14
-rwxr-xr-xserver/core/Identity.php715
-rwxr-xr-x[-rw-r--r--]server/core/Image.php777
-rwxr-xr-xserver/core/LibOverride/genTokenOptions.php36
6 files changed, 920 insertions, 669 deletions
diff --git a/server/core/App.php b/server/core/App.php
index edb75f6..d35ccc0 100755
--- a/server/core/App.php
+++ b/server/core/App.php
@@ -3,10 +3,10 @@ include_once("core/Plugin_Api.php");
include_once("core/LibOverride/genTokenOptions.php");
include_once("core/ErrorManagement.php");
-use OpenStack\Common\Error\BadResponseError;
-use OpenStack\Common\Error\BaseError;
-use OpenStack\Common\Error\NotImplementedError;
-use OpenStack\Common\Error\UserInputError;
+use OpenCloud\Common\Error\BadResponseError;
+use OpenCloud\Common\Error\BaseError;
+use OpenCloud\Common\Error\NotImplementedError;
+use OpenCloud\Common\Error\UserInputError;
class App{
@@ -56,10 +56,10 @@ class App{
return $this->openstack->networkingV2($opt);
break;
case "Compute":
- if($this->tokenPost == NULL) $this->tokenClass->genComputeToken();
- $opt = $this->tokenClass->getOptions($service);
- return $this->openstack->computeV2($opt);
- break;
+ if($this->tokenPost == NULL) $this->tokenClass->genComputeToken();
+ $opt = $this->tokenClass->getOptions($service);
+ return $this->openstack->computeV2($opt);
+ break;
}
}
@@ -81,7 +81,29 @@ class App{
$this->errorClass->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->errorClass->NotImplementedHandler($e);
- }
+ }
+
+ }
+
+ public function deauthenticate(){
+
+ try{
+
+ $this->tokenClass->revokeComputeToken();
+ $this->tokenClass->revokeImageToken();
+ $this->tokenClass->revokeNetworkToken();
+ $this->tokenClass->revokeIdentityToken();
+
+ $this->setOutput("deauthenticate", "Ok");
+ }catch(BadResponseError $e){
+ $this->errorClass->BadResponseHandler($e);
+ }catch(UserInputError $e){
+ $this->errorClass->UserInputHandler($e);
+ }catch(BaseError $e){
+ $this->errorClass->BaseErrorHandler($e);
+ }catch(NotImplementedError $e){
+ $this->errorClass->NotImplementedHandler($e);
+ }
}
diff --git a/server/core/Compute.php b/server/core/Compute.php
index df43c7c..9b01d49 100644..100755
--- a/server/core/Compute.php
+++ b/server/core/Compute.php
@@ -453,6 +453,13 @@ class compute
*/
public function rebuild()
{
+ $serverId = $this->app->getPostParam("serverId");
+ $imageId = $this->app->getPostParam("imageId");
+ $newName = $this->app->getPostParam("newName");
+ $adminPass = $this->app->getPostParam("adminPass");
+ if(!isset($serverId)|| !isset($imageId) || isset($newName) || isset($adminPass)) {
+ $this->app->setOutput("Error", "You'll have to provide server ID and the new image, name and admin password!");
+ return;
try{
$serverId = $this->app->getPostParam("serverId");
$imageId = $this->app->getPostParam("imageId");
diff --git a/server/core/ErrorManagement.php b/server/core/ErrorManagement.php
index 6bff61f..3257dd3 100755
--- a/server/core/ErrorManagement.php
+++ b/server/core/ErrorManagement.php
@@ -1,9 +1,9 @@
<?php
-use OpenStack\Common\Error\BadResponseError;
-use OpenStack\Common\Error\BaseError;
-use OpenStack\Common\Error\NotImplementedError;
-use OpenStack\Common\Error\UserInputError;
+use OpenCloud\Common\Error\BadResponseError;
+use OpenCloud\Common\Error\BaseError;
+use OpenCloud\Common\Error\NotImplementedError;
+use OpenCloud\Common\Error\UserInputError;
Class errorManagement{
@@ -32,8 +32,12 @@ Class errorManagement{
public function UserInputHandler($error){
}
+
+ public function OtherException($error){
+ $this->app->setOutput("Error", $error->getMessage());
+ }
}
-?> \ No newline at end of file
+?>
diff --git a/server/core/Identity.php b/server/core/Identity.php
index 2638985..464522a 100755
--- a/server/core/Identity.php
+++ b/server/core/Identity.php
@@ -9,7 +9,7 @@
*
* @todo Complete the functions and finish the descriptions
*/
-use OpenStack\Common\Error;
+use OpenCloud\Common\Error;
/**
* Identity Class of the back-end application
@@ -87,13 +87,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -111,13 +113,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -144,13 +148,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -187,13 +193,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -220,14 +228,17 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
+
}-
/**
@@ -266,13 +277,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -291,13 +304,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -325,13 +340,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -374,13 +391,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -407,13 +426,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -442,13 +463,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -480,13 +503,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -519,13 +544,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -557,13 +584,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -592,13 +621,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -630,13 +661,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -669,13 +702,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -714,13 +749,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -754,13 +791,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -786,13 +825,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -810,13 +851,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -849,13 +892,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -881,13 +926,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -914,13 +961,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -947,13 +996,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -981,13 +1032,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -1022,13 +1075,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1056,13 +1111,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1090,13 +1147,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1125,13 +1184,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1160,13 +1221,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1195,13 +1258,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1228,13 +1293,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -1261,13 +1328,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -1294,13 +1363,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -1328,13 +1399,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -1361,13 +1434,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}*/
}
@@ -1398,13 +1473,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1422,13 +1499,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1455,13 +1534,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1495,13 +1576,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1528,13 +1611,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1563,13 +1648,17 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1602,13 +1691,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1643,13 +1734,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1682,13 +1775,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1718,13 +1813,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1757,13 +1854,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1798,13 +1897,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1837,13 +1938,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1871,13 +1974,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1895,13 +2000,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1919,13 +2026,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1954,13 +2063,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -1978,13 +2089,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2009,13 +2122,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2043,13 +2158,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2081,13 +2198,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2123,13 +2242,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2159,13 +2280,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2201,13 +2324,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2249,13 +2374,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2285,13 +2412,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2317,13 +2446,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2362,13 +2493,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2386,13 +2519,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2419,13 +2554,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2458,13 +2595,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2491,13 +2630,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2525,13 +2666,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
@@ -2559,13 +2702,15 @@ class identity implements Core{
//TODO parse answer
}catch(BadResponseError $e){
- $this->app->getErrorInstance->BadResponseHandler($e);
+ $this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
}
}
diff --git a/server/core/Image.php b/server/core/Image.php
index ddd8390..71e19ce 100644..100755
--- a/server/core/Image.php
+++ b/server/core/Image.php
@@ -9,10 +9,10 @@
*
* @todo Complete the functions with errors detection and finish the descriptions
*/
-use OpenStack\Common\Error\BadResponseError;
-use OpenStack\Common\Error\BaseError;
-use OpenStack\Common\Error\NotImplementedError;
-use OpenStack\Common\Error\UserInputError;
+use OpenCloud\Common\Error\BadResponseError;
+use OpenCloud\Common\Error\BaseError;
+use OpenCloud\Common\Error\NotImplementedError;
+use OpenCloud\Common\Error\UserInputError;
include("CoreInterface.php");
@@ -35,26 +35,14 @@ class image implements Core{
*
* @param App $app the main app object
*
- * @throws [Type] [<description>]
- *
* @return Image
*/
public function __construct($app){
if(!isset($app)){
- $this->app->setOutput("Error", "Incorrect parameter");
+ $this->app->setOutput("Error", "Incorrect parameter app");
}
- try{
- $this->app = $app;
- $this->libClass = $app->getLibClass("Image");
- }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);
- }
+ $this->app = $app;
+ $this->libClass = $app->getLibClass("Image");
}
@@ -66,46 +54,46 @@ class image implements Core{
* @return void
*/
public function action($action){
-
- $this->{$action.""}();
-
+ $this->{$action.""}();
}
/**
- * Details about an image
+ * Create a new image
*
- * @param array $opt
- * options for the image creation
+ * @param array $opt Options for the image creation (name is required, others are optionals)
*
- **/
- private function createImage(array $opt){
+ * @return Image
+ */
+ private function createImage(){
$opt = $this->app->getPostParam("opt");
if(!isset($opt)){
- $this->app->setOutput("Error", "Incorrect parameter");
+ $this->app->setOutput("Error", "Incorrect parameter opt");
}
-
try{
- // VOIR SI MAUVAIS TYPE
$options = Array();
- if(isset($opt['name'])){ // if the image name already exists -> error
+
+ // Check the image name
+ if(isset($opt['name'])){
$imagesList = listImage();
- if(isset($images)){
+ if(isset($imagesList)){
foreach($imagesList as $image){
- if(strcmp($image->name, $opt['name']) == 0){
-
+ if(strcmp($image->name, $opt['name']) == 0){ // if the image name already exists -> error
+ $this->app->setOutput("Error", "Image name already exists");
}
}
}
}
else{
- $this->app->setOutput("Error", "Image name already exists");
+ $this->app->setOutput("Error", "Missing parameter 'name' for the new image");
}
+
+ // Check optionals arguments
if(isset($opt['id'])){ // UUID : nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn
if($this->libClass->getImage($opt['id']) != null){ // if the id already exists -> error
-
+ $this->app->setOutput("Error", "Image id already exists");
}
$options['id'] = $opt['id'];
}
@@ -138,19 +126,22 @@ class image implements Core{
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $image);
+
}
/**
* List the images of the server
*
- * @return the list with all images on the server
+ * @return List of Image
*/
private function listImage(){
try{
@@ -162,112 +153,129 @@ class image implements Core{
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
- $this->app->getErrorInstance->UserInputHandler($e);
+ $this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
- $this->app->getErrorInstance->BaseErrorHandler($e);
+ $this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
- $this->app->getErrorInstance->NotImplementedHandler($e);
+ $this->app->getErrorInstance()->NotImplementedHandler($e);
+ }catch(Exception $e){
+ $this->app->getErrorInstance()->OtherException($e);
}
+
$this->app->setOutput("Images", $result);
+
}
/**
* Details about an image
*
- * @param string $id
- * identifier of the image
- *
- **/
+ * @param String $id Identifier of the image
+ *
+ * @return Image
+ */
private function detailsImage(){
$id = $this->app->getPostParam("id");
+
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
- try{
- $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $this->app->setOutput("Images", $image);
- }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);
- }
+ else{
+ try{
+ $service = $this->libClass;
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ else{
+ echo 'toto';
+ $this->app->setOutput("Images", $image);
+ }
+ }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);
+ }
+ }
}
/**
- * Details about an image
+ * Update informations about an image
*
- * @param string $id
- * id of the image
- *
- * @param array $opt
- * options for the image creation
- **/
+ * @param String $id id of the image
+ * @param array $opt Options for the image creation
+ *
+ * @return Image
+ */
+
private function updateImage(){
$id = $this->app->getPostParam("id");
$opt = $this->app->getPostParam("opt");
+
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
- if(!isset($opt)){
+ else if(!isset($opt)){
$this->app->setOutput("Error", "Incorrect opt parameter");
}
+ else{
+ try{
+ //vérifier existence image
+ $service = $this->libClass;
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
- try{
- //vérifier existence image
- $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
-
- $options = Array();
+ $options = Array();
- // Voir vérification des types
- if(isset($opt['name'])){ //string
- $options['name'] = $opt['name'];
- }
- if(isset($opt['minDisk'])){ //int
- $options['minDisk'] = $opt['minDisk'];
- }
- if(isset($opt['minRam'])){ // int
- $options['minRam'] = $opt['minRam'];
- }
- if(isset($opt['protected'])){ // boolean
- $options['protected'] = $opt['protected'];
- }
- if(isset($opt['visibility'])){ // public, private
- $options['visibility'] = $opt['visibility'];
- }
- if(isset($opt['tags'])){ // list
- $options['tags'] = $opt['tags'];
- }
- $image->update($options);
- }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);
- }
- $this->app->setOutput("Images", $image);
+ // Voir vérification des types
+ if(isset($opt['name'])){ //string
+ $options['name'] = $opt['name'];
+ }
+ if(isset($opt['minDisk'])){ //int
+ $options['minDisk'] = $opt['minDisk'];
+ }
+ if(isset($opt['minRam'])){ // int
+ $options['minRam'] = $opt['minRam'];
+ }
+ if(isset($opt['protected'])){ // boolean
+ $options['protected'] = $opt['protected'];
+ }
+ if(isset($opt['visibility'])){ // public, private
+ $options['visibility'] = $opt['visibility'];
+ }
+ if(isset($opt['tags'])){ // list
+ $options['tags'] = $opt['tags'];
+ }
+ $image->update($options);
+ }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);
+ }
+ $this->app->setOutput("Images", $image);
+ }
}
/**
* Delete an image
*
- * @param string $id
- * identifier of the image
- **/
+ * @param String $id Identifier of the image
+ *
+ * @return void
+ */
private function deleteImage(){
// si protected = true, demander de le mettre a false
// vérifier existence image
@@ -275,363 +283,404 @@ class image implements Core{
if(!isset($id)){
$this->app->setOutput("Error", "Image doesn't exist");
}
-
- try{
- $service = $this->libClass;
- $image = $this->libClass->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $image->delete();
- }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);
- }
+ else{
+ try{
+ $service = $this->libClass;
+ $image = $this->libClass->getImage($id);
+ if($image == null){ // if the image doesn't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $image->delete();
+ }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);
+ }
+ }
}
/**
* Resactive an image
*
- * @param string $id
- * identifier of the image
- **/
+ * @param String $id Identifier of the image
+ *
+ * @return void
+ */
private function reactivateImage(){
$id = $this->app->getPostParam("id");
+
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter");
}
- try{
- // vérifier existence image
- $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $image->reactivate();
- }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);
- }
+ else
+ {
+ try{
+ $service = $this->libClass;
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $image->reactivate();
+ }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);
+ }
+ }
}
/**
* Desactive an image
*
- * @param string $id
- * identifier of the image
- **/
+ * @param String $id Identifier of the image
+ *
+ * @return void
+ */
private function desactivateImage(){
$id = $this->app->getPostParam("id");
+
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter");
}
- try{
- // vérifier existence image
- $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $image->deactivate();
- }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);
- }
+ else
+ {
+ try{
+ // vérifier existence image
+ $service = $this->libClass;
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $image->deactivate();
+ }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);
+ }
+ }
}
/**
* Upload an image
*
- * @param string $id
- * identifier of the image
- *
- * @param string $file_name
- * path of the image
- **/
- private function uploadImage($id, $file_name){
+ * @param String $id Identifier of the image
+ * @param String $file_name Path of the image
+ *
+ * @return void
+ */
+ private function uploadImage(){
$id = $this->app->getPostParam("id");
$file_name = $this->app->getPostParam("file_name");
+
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
- if(!isset($file_name)){
- $this->app->setOutput("Error", "Incorrect file_name parameter");
+ else if(!isset($file_name)){
+ $this->app->setOutput("Error", "Incorrect file name parameter");
}
- try{
- // vérifier existence image
- $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $stream = \GuzzleHttp\Psr7\stream_for(fopen($file_name, 'r'));
- $image->uploadData($stream);
- }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);
+ else{
+ try{
+ // vérifier existence image
+ $service = $this->libClass;
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $stream = \GuzzleHttp\Psr7\stream_for(fopen($file_name, 'r'));
+ $image->uploadData($stream);
+ }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);
+ }
}
}
/**
* Download an image
*
- * @param string $id
- * identifier of the image
- **/
- private function downloadImage($id){
+ * @param String $id Identifier of the image
+ *
+ * @return Stream
+ */
+ private function downloadImage(){
$id = $this->app->getPostParam("id");
+
if(!isset($id)){
- $this->app->setOutput("Error", "Incorrect parameter");
+ $this->app->setOutput("Error", "Incorrect id parameter");
}
- try{
- // vérifier existence image
- $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $stream = $image->downloadData();
- }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);
- }
- $this->app->setOutput("Images", $stream);
+ else{
+ try{
+ // vérifier existence image
+ $service = $this->libClass;
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $stream = $image->downloadData();
+ }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);
+ }
+ $this->app->setOutput("Images", $stream);
+ }
}
/**
* Add a member to image
*
- * @param string $image_id
- * identifier of the image
- *
- * @param string $member_id
- * identifier of the member
- **/
+ * @param String $image_id Identifier of the image
+ * @param String $member_id Identifier of the member
+ *
+ * @return Member
+ */
private function addMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
if(!isset($image_id)){
- $this->app->setOutput("Error", "Incorrect parameter image_id");
+ $this->app->setOutput("Error", "Incorrect image id parameter");
}
- if(!isset($member_id)){
- $this->app->setOutput("Error", "Incorrect parameter member_id");
+ else if(!isset($member_id)){
+ $this->app->setOutput("Error", "Incorrect member id parameter");
}
- try{
- $service = $this->libClass;
+ else{
+ try{
+ $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $member_id = $image->addMember($member_id);
- }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);
- }
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $member_id = $image->addMember($member_id);
+ $this->app->setOutput("Images", $member_id);
+ }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);
+ }
+ }
}
/**
* List members of an image
*
- * @param string $image_id
- * identifier of the image
- **/
+ * @param String $image_id identifier of the image
+ *
+ * @return List of Member
+ */
private function listMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
+
if(!isset($image_id)){
- $this->app->setOutput("Error", "Incorrect parameter image_id");
+ $this->app->setOutput("Error", "Incorrect image id parameter");
}
- if(!isset($member_id)){
- $this->app->setOutput("Error", "Incorrect parameter member_id");
+ else if(!isset($member_id)){
+ $this->app->setOutput("Error", "Incorrect member id parameter");
+ }
+ else{
+ try{
+ // vérifier existence image
+ $service = $this->libClass;
+ $image = $service->getImage($image_id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $members = $image->listMembers();
+ if($members == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "No member");
+ }
+ }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);
+ }
+ $this->app->setOutput("Images", $members);
}
- try{
- // vérifier existence image
- $service = $this->libClass;
- $image = $service->getImage($image_id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $members = $image->listMembers();
- if($member == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "No member");
- }
- }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);
- }
- $this->app->setOutput("Images", $member);
}
/**
* Show details of a member of an image
*
- * @param string $image_id
- * identifier of the image
+ * @param String $image_id Identifier of the image
+ * @param String $member_id Identifier of the member
*
- * @param string $member_id
- * identifier of the member
- **/
+ * @return Member
+ */
private function detailMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
+
if(!isset($image_id)){
- $this->app->setOutput("Error", "Incorrect parameter image_id");
+ $this->app->setOutput("Error", "Incorrect image id parameter");
}
- if(!isset($member_id)){
- $this->app->setOutput("Error", "Incorrect parameter member_id");
+ else if(!isset($member_id)){
+ $this->app->setOutput("Error", "Incorrect member id parameter");
}
- try{
- // vérifier existence image
- // on doit être le proprio de l'image
- // vérifier membre existe
- $service = $this->libClass;
-
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
+ else{
+ try{
+ $service = $this->libClass;
- $member = $image->getMember($member_id);
- if($member == null){ // if the member don't exists -> error
- $this->app->setOutput("Error", "Member doesn't exist");
- }
- }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);
- }
- $this->app->setOutput("Images", $member);
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+
+ $member = $image->getMember($member_id);
+ if($member == null){ // if the member don't exists -> error
+ $this->app->setOutput("Error", "Member doesn't exist");
+ }
+ }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);
+ }
+ $this->app->setOutput("Images", $member);
+ }
}
/**
* Remove a member of an image
*
- * @param string $image_id
- * identifier of the image
- *
- * @param string $member_id
- * identifier of the member
- **/
+ * @param String $image_id Identifier of the image
+ * @param String $member_id Identifier of the member
+ *
+ * @return void
+ */
private function removeMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
if(!isset($image_id)){
- $this->app->setOutput("Error", "Incorrect parameter image_id");
+ $this->app->setOutput("Error", "Incorrect image id parameter");
}
- if(!isset($member_id)){
- $this->app->setOutput("Error", "Incorrect parameter member_id");
+ else if(!isset($member_id)){
+ $this->app->setOutput("Error", "Incorrect member id parameter");
}
- try{
- $service = $this->libClass;
-
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $member = $image->getMember($member_id);
- if($member == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Member doesn't exist");
- }
- $member->delete();
- }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);
- }
+ else{
+ try{
+ $service = $this->libClass;
+
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $member = $image->getMember($member_id);
+ if($member == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Member doesn't exist");
+ }
+ $member->delete();
+ }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);
+ }
+ }
}
/**
* Update a member of an image
*
- * @param string $image_id
- * identifier of the image
- *
- * @param string $member_id
- * identifier of the member
+ * @param String $image_id Identifier of the image
+ * @param String $member_id Identifier of the member
+ * @param String $status New status for the member
*
- * @param string $status
- * new status for the member
+ * @return void
**/
- private function updateMemberImage($image_id, $member_id, $status){
+ private function updateMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
$status = $this->app->getPostParam("status");
if(!isset($image_id)){
- $this->app->setOutput("Error", "Incorrect parameter image_id");
+ $this->app->setOutput("Error", "Incorrect image id parameter");
}
- if(!isset($member_id)){
- $this->app->setOutput("Error", "Incorrect parameter member_id");
+ else if(!isset($member_id)){
+ $this->app->setOutput("Error", "Incorrect member id parameter");
}
- try{
- $service = $this->libClass;
+ else{
+ try{
+ $service = $this->libClass;
- $image = $service->getImage($id);
- if($image == null){ // if the image don't exists -> error
- $this->app->setOutput("Error", "Image doesn't exist");
- }
- $member = $image->getMember($member_id);
- if($member == null){ // if the member don't exists -> error
- $this->app->setOutput("Error", "Member doesn't exist");
- }
- $member->updateStatus($status);
- }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);
- }
+ $image = $service->getImage($id);
+ if($image == null){ // if the image don't exists -> error
+ $this->app->setOutput("Error", "Image doesn't exist");
+ }
+ $member = $image->getMember($member_id);
+ if($member == null){ // if the member don't exists -> error
+ $this->app->setOutput("Error", "Member doesn't exist");
+ }
+ $member->updateStatus($status);
+ }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);
+ }
+ }
}
}
diff --git a/server/core/LibOverride/genTokenOptions.php b/server/core/LibOverride/genTokenOptions.php
index 50826ed..bdae8a6 100755
--- a/server/core/LibOverride/genTokenOptions.php
+++ b/server/core/LibOverride/genTokenOptions.php
@@ -1,12 +1,12 @@
<?php
use GuzzleHttp\Client;
-use OpenStack\Common\Transport\HandlerStack;
-use OpenStack\Common\Transport\Middleware;
+use OpenCloud\Common\Transport\HandlerStack;
+use OpenCloud\Common\Transport\Middleware;
use OpenStack\Identity\v3\Service;
use OpenStack\Identity\v3\Api;
-use OpenStack\Common\Auth\Token;
-use OpenStack\Common\Transport\Utils;
+use OpenCloud\Common\Auth\Token;
+use OpenCloud\Common\Transport\Utils;
use OpenStack\Identity\v3\Models;
class genTokenOptions
@@ -75,6 +75,12 @@ class genTokenOptions
$this->optionsGlobal['Identity'] = $options;
}
+ public function revokeIdentityToken(){
+ $token = $this->unserializeToken($this->backup['Identity']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadIdentityBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'false';
@@ -123,6 +129,12 @@ class genTokenOptions
$this->optionsGlobal['Image'] = $options;
}
+ public function revokeImageToken(){
+ $token = $this->unserializeToken($this->backup['Image']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadImageBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'glance';
@@ -157,7 +169,7 @@ class genTokenOptions
$stack = HandlerStack::create();
- $stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
@@ -170,6 +182,12 @@ class genTokenOptions
$this->optionsGlobal['Network'] = $options;
}
+ public function revokeNetworkToken(){
+ $token = $this->unserializeToken($this->backup['Network']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadNetworkBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'neutron';
@@ -217,6 +235,12 @@ class genTokenOptions
$this->optionsGlobal['Compute'] = $options;
}
+ public function revokeComputeToken(){
+ $token = $this->unserializeToken($this->backup['Compute']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadComputeBackup($opt){
$options = $this->optionsGlobal['Common'];
@@ -245,7 +269,7 @@ class genTokenOptions
private function saveBackup($name, $data){
$token = $this->serializeToken($data["token"]);
$path = "core/LibOverride/projectTokenData/".$token['saved']["project"]["name"];
- error_log(print_r($path, true), 0);
+ //error_log(print_r($path, true), 0);
file_put_contents("core/LibOverride/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved']));
$this->backup["roles"] = $token["roles"];
$this->backup["project"] = $token['saved']["project"]["name"];