From 154d49d1089d34ada6744556cca8028d1ec11430 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 23 Feb 2016 21:36:07 +0100 Subject: la premiere version de la classe netork --- server/core/Network.php | 104 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) (limited to 'server/core/Network.php') diff --git a/server/core/Network.php b/server/core/Network.php index 8d1c8b6..38e20be 100644 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -1 +1,103 @@ - +] + * + * @return Image + */ + public function __construct($app, $openstack){ + $this->app = $app; + $this->libClass = $app->getLibClass("networkingV2"); + $this->networking = $openstack->networkingV2(["region"=>"RegionOne"]); + } + + + + + + public function create_network(array $options) + { + + $network = $networking->createNetworks($options); + + + return $network; + } + + public function create_subnet(array $options) + { + + $subnet = $networking->createSubnet($options); + + + return $subnet; + } + + public function list_network_ids() + { + + $ln = $networking->listNetworks(); + + $list_ids = array(); + + + foreach($ln as $n) + { + + $list_ids[] = $n->id; + + + } + + return $list_ids; + } + + public function list_network_names() + { + + $ln = $networking->listNetworks(); + + $list_names = array(); + + + foreach($ln as $n) + { + + $list_names[] = $n->name; + + + } + + return $list_names; + } + + public function list_cidr() + { + + $ls = $networking->listSubnets(); + $list_cidr = array(); + foreach ($ls as $subnet) + { + + $list_cidr[] = $subnet->cidr; + } + + return $list_names; + } + + -- cgit v1.2.3 From 38ba61c6eebadb79a23044b06671fd7c73975516 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 24 Feb 2016 19:42:01 +0100 Subject: modification dans network --- server/core/Network.php | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'server/core/Network.php') diff --git a/server/core/Network.php b/server/core/Network.php index 38e20be..2e09508 100644 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -6,34 +6,29 @@ class network{ protected $libClass; - protected $networking; + - protected $actions = array(); + - /** - * Image constructor - * - * @param App $app the main app object - * - * @throws [Type] [] - * - * @return Image - */ - public function __construct($app, $openstack){ + public function __construct($app){ $this->app = $app; - $this->libClass = $app->getLibClass("networkingV2"); - $this->networking = $openstack->networkingV2(["region"=>"RegionOne"]); + $this->libClass = $app->getLibClass("network"); + } - + public function action($action){ + + $this->{$action.""}(); + + } public function create_network(array $options) { - $network = $networking->createNetworks($options); + $network = $this->libClass->createNetworks($options); return $network; @@ -42,7 +37,7 @@ class network{ public function create_subnet(array $options) { - $subnet = $networking->createSubnet($options); + $subnet = $this->libClass->createSubnet($options); return $subnet; @@ -51,7 +46,7 @@ class network{ public function list_network_ids() { - $ln = $networking->listNetworks(); + $ln = $this->libClass->listNetworks(); $list_ids = array(); @@ -70,7 +65,7 @@ class network{ public function list_network_names() { - $ln = $networking->listNetworks(); + $ln = $this->libClass->listNetworks(); $list_names = array(); @@ -89,7 +84,7 @@ class network{ public function list_cidr() { - $ls = $networking->listSubnets(); + $ls = $this->libClass->listSubnets(); $list_cidr = array(); foreach ($ls as $subnet) { -- cgit v1.2.3 From 70fcf3553abb4a25672ee198dafb89e430e2bd79 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 2 Mar 2016 01:34:10 +0100 Subject: ajout des fonctions --- server/Test/getIdNetwork.php | 34 +++++++++++++++ server/Test/getNetwork.php | 26 ++++++++++++ server/core/Network.php | 98 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 server/Test/getIdNetwork.php create mode 100644 server/Test/getNetwork.php (limited to 'server/core/Network.php') diff --git a/server/Test/getIdNetwork.php b/server/Test/getIdNetwork.php new file mode 100644 index 0000000..1e38627 --- /dev/null +++ b/server/Test/getIdNetwork.php @@ -0,0 +1,34 @@ +"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]); + $options["scope"] = Array("project"=>Array("name"=>"admin", "domain"=>["id"=>"Default"])); + $options["authUrl"] = "http://148.60.11.31:5000/v3"; + $openstack = new OpenStack\OpenStack($options); + $networking = $openstack->networkingV2(["region"=>"RegionOne"]); + + $ls = $networking->getNetwork('5f78d3c1-1f53-4be7-897b-cf3c797961e0'); +try{ +$ls->retrieve(); + + + +echo "oui";} + + catch (OpenStack\Common\Error\BadResponseError $e){ +echo "non"; } + + + + + + + + + + + diff --git a/server/Test/getNetwork.php b/server/Test/getNetwork.php new file mode 100644 index 0000000..4c76480 --- /dev/null +++ b/server/Test/getNetwork.php @@ -0,0 +1,26 @@ +"admin", "password"=>"ae5or6cn", "domain"=>["id"=>"Default"]); + $options["scope"] = Array("project"=>Array("name"=>"admin", "domain"=>["id"=>"Default"])); + $options["authUrl"] = "http://148.60.11.31:5000/v3"; + $openstack = new OpenStack\OpenStack($options); + $networking = $openstack->networkingV2(["region"=>"RegionOne"]); + $ls = $networking->listNetworks(); + + foreach ($ls as $subnet) { + echo $subnet->id."
"; +} + + + + + + + + + diff --git a/server/core/Network.php b/server/core/Network.php index 2e09508..6363fdb 100644 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -94,5 +94,101 @@ class network{ return $list_names; } + //option array() + public function getNetwork($idNet) + { + $network=""; + + try + { $newtork = $networking->getNetwork($idNet); + $network->retrieve(); + + + } + + catch (OpenStack\Common\Error\BadResponseError $e) + { + $network = "Id non existant "; + } + catch (Exception $e) + { + $network = 'Exception reçue : ', $e->getMessage(), "\n"; + } + + return $network; + } + + public function getSubnet($idSub) + { + $sbnet=""; + + try + { $subnet = $networking->getSubnet($idSub); + $subnet->retrieve(); + + + } + + catch (OpenStack\Common\Error\BadResponseError $e) + { + $sbnet = "Id non existant "; + } + catch (Exception $e) + { + $sbnet = 'Exception reçue : ', $e->getMessage(), "\n"; + } + + return $sbnet; + } + + public function updateNetwork($idNet,$name,$shared,$adminStateUp) + { + $network = getNetwork($idNet); + if(!is_null($name)) + { + $network->name = $name; + } + if(!is_null($shared)) + { + $network->shared = $shared; + } + if(!is_null($adminStateUp)) + { + $network->adminStateUp = $shared; + } + $network->update(); + } - + public function updateSubnet($idSub,$name,$networkId,$ipVersion,$cidr) + { + $subnet = getNetwork($idSub); + if(!is_null($name)) + { + $subnet->name = $name; + } + if(!is_null($networkId)) + { + $subnet->networkId = $networkId; + } + if(!is_null($ipVersion)) + { + $subnet->ipVersion = $ipVersion; + } + if(!is_null($cidr)) + { + $subnet->cidr = $cidr; + } + $subnet->update(); + } + + public function deleteNetwork($idNet) + { + $network = getNetwork($idNet); + $network->delete(); + } + + public function deleteSubnet($idSub) + { + $subnet = getNetwork($idSub); + $subnet->delete(); + } -- cgit v1.2.3 From a51bcad21a526b5077f52bb8e12417e4b921f06b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 8 Mar 2016 00:26:20 +0100 Subject: terminaison des fonctions --- server/core/Network.php | 276 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 265 insertions(+), 11 deletions(-) (limited to 'server/core/Network.php') diff --git a/server/core/Network.php b/server/core/Network.php index 6363fdb..75ba2fd 100644 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -25,18 +25,77 @@ class network{ } - public function create_network(array $options) + public function create_network($name,$adminStateUp,$shared,$tenantId) { - + $options = array(); + if (!is_null($name)) + { + $options['name'] = $name; + } + if (!is_null($adminStateUp)) + { + $options['adminStateUp'] = $adminStateUp; + } + if (!is_null($shared)) + { + $options['shared'] = $shared; + } + if (!is_null($tenantId)) + { + $options['tenantId'] = $tenantId; + } $network = $this->libClass->createNetworks($options); return $network; } - public function create_subnet(array $options) - { - + public function create_subnet($networkId,$ipVersion,$cidr,$name,$gatewayIp,$dnsNameservers,$allocationPools,$hostRoutes,$enableDhcp,$tenantId) + { $options = array(); + if (!is_null($networkId)) + { + $options['networkId'] = $networkId; + } + if (!is_null($ipVersion)) + { + $options['ipVersion'] = $ipVersion; + } + if (!is_null($cidr)) + { + $options['cidr'] = $cidr; + } + if (!is_null($tenantId)) + { + $options['tenantId'] = $tenantId; + } + if (!is_null($name)) + { + $options['name'] = $name; + } + if (!is_null($gatewayIp)) + { + $options['gatewayIp'] = $gatewayIp; + } + if (!is_null($dnsNameservers)) + { + $options['dnsNameservers'] = $dnsNameservers; + } + if (!is_null($allocationPools)) + { + $options['allocationPools'] = $allocationPools; + } + if (!is_null($hostRoutes)) + { + $options['hostRoutes'] = $hostRoutes; + } + if (!is_null($enableDhcp)) + { + $options['enableDhcp'] = $enableDhcp; + } + if (!is_null($tenantId)) + { + $options['tenantId'] = $tenantId; + } $subnet = $this->libClass->createSubnet($options); @@ -100,7 +159,7 @@ class network{ $network=""; try - { $newtork = $networking->getNetwork($idNet); + { $newtork = $this->libClass->getNetwork($idNet); $network->retrieve(); @@ -123,22 +182,22 @@ class network{ $sbnet=""; try - { $subnet = $networking->getSubnet($idSub); + { $subnet = $this->libClass->getSubnet($idSub); $subnet->retrieve(); - + return $sbnet; } catch (OpenStack\Common\Error\BadResponseError $e) { - $sbnet = "Id non existant "; + echo "Id non existant "; } catch (Exception $e) { - $sbnet = 'Exception reçue : ', $e->getMessage(), "\n"; + echo 'Exception reçue : ', $e->getMessage(), "\n"; } - return $sbnet; + } public function updateNetwork($idNet,$name,$shared,$adminStateUp) @@ -192,3 +251,198 @@ class network{ $subnet = getNetwork($idSub); $subnet->delete(); } + + public function createPort($networkId,$name,$adminStateUp,$macAddress,$fixedIps,$deviceId,$deviceOwner,$securityGroups,$tenantId) + { + $options = array(); + if (!is_null($networkId)) + { + $options['networkId'] = $networkId; + } + if (!is_null($name)) + { + $options['name'] = $name; + } + if (!is_null($adminStateUp)) + { + $options['adminStateUp'] = $adminStateUp; + } + if (!is_null($macAddress)) + { + $options['macAddress'] = $macAddress; + } + if (!is_null($fixedIps)) + { + $options['fixedIps'] = $fixedIps; + } + if (!is_null($deviceId)) + { + $options['deviceId'] = $deviceId; + } + if (!is_null($deviceOwner)) + { + $options['deviceOwner'] = $deviceOwner; + } + if (!is_null($securityGroups)) + { + $options['securityGroups'] = $securityGroups; + } + if (!is_null($tenantId)) + { + $options['tenantId'] = $tenantId; + } + + $this->libClass->createPort($options); + } + + public function listPorts() + { + return $this->libClass->listPorts(); + } + + public function getPort($portId) + { + try + { + $port = $this->libClass->getport($portId); + return $port; + } + catch (Exception $e) + { + echo 'id fourni non disponible'; + } + + } + + public function updatePort($networkId,$name,$adminStateUp,$macAddress,$fixedIps,$deviceId,$deviceOwner,$securityGroups,$tenantId) + { + $options = array(); + if (!is_null($networkId)) + { + $options['networkId'] = $networkId; + } + if (!is_null($name)) + { + $options['name'] = $name; + } + if (!is_null($adminStateUp)) + { + $options['adminStateUp'] = $adminStateUp; + } + if (!is_null($macAddress)) + { + $options['macAddress'] = $macAddress; + } + if (!is_null($fixedIps)) + { + $options['fixedIps'] = $fixedIps; + } + if (!is_null($deviceId)) + { + $options['deviceId'] = $deviceId; + } + if (!is_null($deviceOwner)) + { + $options['deviceOwner'] = $deviceOwner; + } + if (!is_null($securityGroups)) + { + $options['securityGroups'] = $securityGroups; + } + if (!is_null($tenantId)) + { + $options['tenantId'] = $tenantId; + } + + $this->libClass->update($options); + } + + public function deletePort($portId) + { + $port = getPort($portId); + $port->delete(); + } + + public function createSecurityGroup($name,$description) + { + $options = array(); + if (!is_null($name)) + { + $options['name'] = $name; + } + if (!is_null($description)) + { + $options['description'] = $description; + } + + $this->libClass->createSecurityGroup($options); + } + + public function createSecurityGroupRule($securityGroupId,$direction,$ethertype,$portRangeMin,$portRangeMax,$protocol,$remoteGroupId,$remoteIpPrefix) + { + $options = array(); + if (!is_null($securityGroupId)) + { + $options['securityGroupId'] = $securityGroupId; + } + if (!is_null($direction)) + { + $options['direction'] = $direction; + } + if (!is_null($ethertype)) + { + $options['ethertype'] = $ethertype; + } + if (!is_null($portRangeMin)) + { + $options['portRangeMin'] = $portRangeMin; + } + if (!is_null($portRangeMax)) + { + $options['portRangeMax'] = $portRangeMax; + } + if (!is_null($protocol)) + { + $options['protocol'] = $protocol; + } + if (!is_null($remoteGroupId)) + { + $options['remoteGroupId'] = $remoteGroupId; + } + if (!is_null($remoteIpPrefix)) + { + $options['remoteIpPrefix'] = $remoteIpPrefix; + } + $this->libClass->createSecurityGroupRule($options); + } + + + public function listSecurityGroupe() + { + return $this->libClass->listSecurityGroups(); + } + + public function listSecurityGroupeRule() + { + return $this->libClass->listSecurityGroupRules(); + } + + public function getSecurityGroupe($securityGroupeId) + { + try + { + $securityGroupe = $this->libClass->getSecurityGroupe($securityGroupeId); + return $securityGroupe; + } + catch (Exception $e) + { + echo 'id fourni non disponible'; + } + + } + + public function deleteSecurityGroupe($securityGroupeId) + { + $securityGroupe = getSecurityGroupe($securityGroupeId); + $securityGroupe->delete(); + } -- cgit v1.2.3 From 20f8eb41d3ae5e53fd4bb53e55f0627ff7b7f15c Mon Sep 17 00:00:00 2001 From: Othmane Kabir <16008902@e003m10.istic.univ-rennes1.fr> Date: Wed, 9 Mar 2016 16:13:20 +0100 Subject: commit finale --- server/core/Network.php | 880 +++++++++++++++++++++++++++++++++---------- server/core/Network.php~ | 952 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1644 insertions(+), 188 deletions(-) create mode 100644 server/core/Network.php~ (limited to 'server/core/Network.php') diff --git a/server/core/Network.php b/server/core/Network.php index 75ba2fd..65de962 100644 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -25,279 +25,595 @@ class network{ } - public function create_network($name,$adminStateUp,$shared,$tenantId) + public function create_network() { $options = array(); - if (!is_null($name)) + if (isset($this->app->getPostParam("name"))) { - $options['name'] = $name; + $options['name'] = $this->app->getPostParam("name"); } - if (!is_null($adminStateUp)) + if (isset($this->app->getPostParam("adminStateUp"))) { - $options['adminStateUp'] = $adminStateUp; + $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); } - if (!is_null($shared)) + if (isset($this->app->getPostParam("shared"))) { - $options['shared'] = $shared; + $options['shared'] = $this->app->getPostParam("shared"); } - if (!is_null($tenantId)) + if (isset($this->app->getPostParam("tenantId"))) { - $options['tenantId'] = $tenantId; + $options['tenantId'] = $this->app->getPostParam("tenantId"); } + try + { $network = $this->libClass->createNetworks($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); + } - return $network; + } - public function create_subnet($networkId,$ipVersion,$cidr,$name,$gatewayIp,$dnsNameservers,$allocationPools,$hostRoutes,$enableDhcp,$tenantId) + public function create_subnet() { $options = array(); - if (!is_null($networkId)) + if (isset($this->app->getPostParam("networkId"))) { $options['networkId'] = $networkId; } - if (!is_null($ipVersion)) + if (isset($this->app->getPostParam("ipVersion"))) { - $options['ipVersion'] = $ipVersion; + $options['ipVersion'] = $this->app->getPostParam("ipVersion"); } - if (!is_null($cidr)) + if (isset($this->app->getPostParam("cidr"))) { - $options['cidr'] = $cidr; + $options['cidr'] = $this->app->getPostParam("cidr"); } - if (!is_null($tenantId)) + if (isset($this->app->getPostParam("tenantId"))) { - $options['tenantId'] = $tenantId; + $options['tenantId'] = $this->app->getPostParam("tenantId"); } - if (!is_null($name)) + if (isset($this->app->getPostParam("name"))) { - $options['name'] = $name; + $options['name'] = $$this->app->getPostParam("name"); } - if (!is_null($gatewayIp)) + if (isset($this->app->getPostParam("gatewayIp"))) { - $options['gatewayIp'] = $gatewayIp; + $options['gatewayIp'] = $this->app->getPostParam("gatewayIp"); } - if (!is_null($dnsNameservers)) + if (isset($this->app->getPostParam("dnsNameservers"))) { - $options['dnsNameservers'] = $dnsNameservers; + $options['dnsNameservers'] = $this->app->getPostParam("dnsNameservers"); } - if (!is_null($allocationPools)) + if (isset($this->app->getPostParam("allocationPools"))) { - $options['allocationPools'] = $allocationPools; + $options['allocationPools'] = $this->app->getPostParam("allocationPools"); } - if (!is_null($hostRoutes)) + if (isset($this->app->getPostParam("hostRoutes"))) { - $options['hostRoutes'] = $hostRoutes; + $options['hostRoutes'] = $this->app->getPostParam("hostRoutes"); } - if (!is_null($enableDhcp)) + if (isset($this->app->getPostParam("enableDhcp"))) { - $options['enableDhcp'] = $enableDhcp; + $options['enableDhcp'] = $this->app->getPostParam("enableDhcp"); } - if (!is_null($tenantId)) + if (isset($this->app->getPostParam("tenantId"))) { - $options['tenantId'] = $tenantId; + $options['tenantId'] = $this->app->getPostParam("tenantId"); } - $subnet = $this->libClass->createSubnet($options); + try + { + $subnet = $this->libClass->createSubnet($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); + } - return $subnet; + } public function list_network_ids() { + try + { + $ln = $this->libClass->listNetworks(); - $ln = $this->libClass->listNetworks(); - - $list_ids = array(); + $list_ids = array(); - foreach($ln as $n) - { + foreach($ln as $n) + { - $list_ids[] = $n->id; + $list_ids[] = $n->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); + } - return $list_ids; + $this->app->setOutput("ListNetworkIds", $list_ids); } public function list_network_names() { + try + { + $ln = $this->libClass->listNetworks(); - $ln = $this->libClass->listNetworks(); - - $list_names = array(); + $list_names = array(); - foreach($ln as $n) - { + foreach($ln as $n) + { - $list_names[] = $n->name; + $list_names[] = $n->name; + } + } + 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); + } - return $list_names; + $this->app->setOutput("ListNetworkNames", $list_names); } public function list_cidr() { - - $ls = $this->libClass->listSubnets(); - $list_cidr = array(); - foreach ($ls as $subnet) - { - - $list_cidr[] = $subnet->cidr; - } - - return $list_names; + try + { + $ls = $this->libClass->listSubnets(); + $list_cidr = array(); + foreach ($ls as $subnet) + { + + $list_cidr[] = $subnet->cidr; + } + + $this->app->setOutput("ListCidr", $list_cidr); + } + 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); + } } - //option array() - public function getNetwork($idNet) + + public function getNetwork() { $network=""; try - { $newtork = $this->libClass->getNetwork($idNet); + { $newtork = $this->libClass->getNetwork($this->app->getPostParam("networkId")); $network->retrieve(); } - catch (OpenStack\Common\Error\BadResponseError $e) + + catch(BadResponseError $e) + { + $this->app->getErrorInstance->BadResponseHandler($e); + } + catch(UserInputError $e) { - $network = "Id non existant "; - } - catch (Exception $e) + $this->app->getErrorInstance->UserInputHandler($e); + } + catch(BaseError $e) { - $network = 'Exception reçue : ', $e->getMessage(), "\n"; + $this->app->getErrorInstance->BaseErrorHandler($e); + } + catch(NotImplementedError $e) + { + $this->app->getErrorInstance->NotImplementedHandler($e); + } + + $this->app->setOutput("Network", $network); + } + + public function getNetwork($netId) + { + $network=""; + + try + { $newtork = $this->libClass->getNetwork($netId); + $network->retrieve(); + + } + + 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); + } + return $network; } - public function getSubnet($idSub) + public function getSubnet() { $sbnet=""; try - { $subnet = $this->libClass->getSubnet($idSub); + { $subnet = $this->libClass->getSubnet($this->app->getPostParam("subnetId")); $subnet->retrieve(); - return $sbnet; + } - catch (OpenStack\Common\Error\BadResponseError $e) + catch(BadResponseError $e) + { + $this->app->getErrorInstance->BadResponseHandler($e); + } + catch(UserInputError $e) + { + $this->app->getErrorInstance->UserInputHandler($e); + } + catch(BaseError $e) { - echo "Id non existant "; - } - catch (Exception $e) + $this->app->getErrorInstance->BaseErrorHandler($e); + } + catch(NotImplementedError $e) { - echo 'Exception reçue : ', $e->getMessage(), "\n"; + $this->app->getErrorInstance->NotImplementedHandler($e); + } + $this->app->setOutput("Subnet", subnet); + + } + + public function getSubnet($subnetId) + { + $subnet=""; + + try + { $subnet = $this->libClass->getSubnet($subnetId); + $subnet->retrieve(); + + } + 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); + } + return $subnet; - } + } - public function updateNetwork($idNet,$name,$shared,$adminStateUp) - { - $network = getNetwork($idNet); - if(!is_null($name)) + public function updateNetwork() + { + $options = array(); + if(isset($this->app->getPostParam("name"))) { - $network->name = $name; + $options['name'] = $this->app->getPostParam("name"); } - if(!is_null($shared)) + if(isset($this->app->getPostParam("shared"))) { - $network->shared = $shared; + $options['shared'] = $this->app->getPostParam("shared"); } - if(!is_null($adminStateUp)) + if(isset($this->app->getPostParam("adminStateUp"))) { - $network->adminStateUp = $shared; + $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); } - $network->update(); + try + { + $network = getNetwork($this->app->getPostParam("networkId")); + + $network->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); + } } - public function updateSubnet($idSub,$name,$networkId,$ipVersion,$cidr) - { - $subnet = getNetwork($idSub); - if(!is_null($name)) + public function updateSubnet() + { + $options = array(); + if(isset($this->app->getPostParam("name"))) { - $subnet->name = $name; + $options['name'] = $this->app->getPostParam("name"); } - if(!is_null($networkId)) + if(isset($this->app->getPostParam("networkId"))) { - $subnet->networkId = $networkId; + $options['networkId'] = $this->app->getPostParam("networkId"); } - if(!is_null($ipVersion)) + if(isset($this->app->getPostParam("ipVersion"))) { - $subnet->ipVersion = $ipVersion; + $options['ipVersion'] = $this->app->getPostParam("ipVersion"); } - if(!is_null($cidr)) + if(isset($this->app->getPostParam("cidr"))) { - $subnet->cidr = $cidr; + $options['cidr'] = $this->app->getPostParam("cidr"); } - $subnet->update(); + try + { + $subnet = getSubnet($this->app->getPostParam("networkId")); + + $subnet->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); + } } - public function deleteNetwork($idNet) + public function deleteNetwork() { - $network = getNetwork($idNet); - $network->delete(); + try + { + + $network = getNetwork($this->app->getPostParam("networkId")); + $network->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); + } } - public function deleteSubnet($idSub) + public function deleteSubnet() { - $subnet = getNetwork($idSub); - $subnet->delete(); + try + { + $subnet = getNetwork($this->app->getPostParam("subnetId")); + $subnet->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); + } } - public function createPort($networkId,$name,$adminStateUp,$macAddress,$fixedIps,$deviceId,$deviceOwner,$securityGroups,$tenantId) + public function createPort() { $options = array(); - if (!is_null($networkId)) + if (isset($this->app->getPostParam("networkId"))) { - $options['networkId'] = $networkId; + $options['networkId'] = $this->app->getPostParam("networkId"); } - if (!is_null($name)) + if (isset($this->app->getPostParam("name"))) { - $options['name'] = $name; + $options['name'] = $this->app->getPostParam("name"); } - if (!is_null($adminStateUp)) + if (isset($this->app->getPostParam("adminStateUp"))) { - $options['adminStateUp'] = $adminStateUp; + $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); } - if (!is_null($macAddress)) + if (isset($this->app->getPostParam("macAddress"))) { - $options['macAddress'] = $macAddress; + $options['macAddress'] = $this->app->getPostParam("macAddress"); } - if (!is_null($fixedIps)) + if (isset($this->app->getPostParam("fixedIps"))) { - $options['fixedIps'] = $fixedIps; + $options['fixedIps'] = $this->app->getPostParam("fixedIps"); } - if (!is_null($deviceId)) + if (isset($this->app->getPostParam("deviceId"))) { - $options['deviceId'] = $deviceId; + $options['deviceId'] = $this->app->getPostParam("deviceId"); } - if (!is_null($deviceOwner)) + if (isset($this->app->getPostParam("deviceOwner"))) { - $options['deviceOwner'] = $deviceOwner; + $options['deviceOwner'] = $this->app->getPostParam("deviceOwner"); } - if (!is_null($securityGroups)) + if (isset($this->app->getPostParam("securityGroups"))) { - $options['securityGroups'] = $securityGroups; + $options['securityGroups'] = $this->app->getPostParam("securityGroups"); } - if (!is_null($tenantId)) + if (isset($this->app->getPostParam("tenantId"))) { - $options['tenantId'] = $tenantId; + $options['tenantId'] = $this->app->getPostParam("tenantId"); } - - $this->libClass->createPort($options); + try + { + $this->libClass->createPort($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); + } } public function listPorts() { - return $this->libClass->listPorts(); + try + { + $this->app->setOutput("listPorts", $this->libClass->listPorts()); + } + 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); + } + } + + public function getPort() + { + try + { + $port = $this->libClass->getport($this->app->getPostParam("portId")); + $this->app->setOutput("Port", $port); + } + 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); + } + } public function getPort($portId) @@ -307,124 +623,280 @@ class network{ $port = $this->libClass->getport($portId); return $port; } - catch (Exception $e) + catch(BadResponseError $e) { - echo 'id fourni non disponible'; - } + $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); + } - } + } - public function updatePort($networkId,$name,$adminStateUp,$macAddress,$fixedIps,$deviceId,$deviceOwner,$securityGroups,$tenantId) + public function updatePort() { $options = array(); - if (!is_null($networkId)) + + if (isset($this->app->getPostParam("networkId"))) { - $options['networkId'] = $networkId; + $options['networkId'] = $this->app->getPostParam("networkId"); } - if (!is_null($name)) + if (isset($this->app->getPostParam("name"))) { - $options['name'] = $name; + $options['name'] =$this->app->getPostParam("name"); } - if (!is_null($adminStateUp)) + if (isset($this->app->getPostParam("adminStateUp"))) { - $options['adminStateUp'] = $adminStateUp; + $options['adminStateUp'] =$this->app->getPostParam("adminStateUp"); } - if (!is_null($macAddress)) + if (isset($this->app->getPostParam("macAddress"))) { - $options['macAddress'] = $macAddress; + $options['macAddress'] = $this->app->getPostParam("macAddress"); } - if (!is_null($fixedIps)) + if (isset($this->app->getPostParam("fixedIps"))) { - $options['fixedIps'] = $fixedIps; + $options['fixedIps'] = $this->app->getPostParam("fixedIps"); } - if (!is_null($deviceId)) + if (isset($this->app->getPostParam("deviceId"))) { - $options['deviceId'] = $deviceId; + $options['deviceId'] = $this->app->getPostParam("deviceId"); } - if (!is_null($deviceOwner)) + if (isset($this->app->getPostParam("deviceOwner"))) { - $options['deviceOwner'] = $deviceOwner; + $options['deviceOwner'] = $this->app->getPostParam("deviceOwner"); } - if (!is_null($securityGroups)) + if (isset($this->app->getPostParam("networkId"))) { - $options['securityGroups'] = $securityGroups; + $options['securityGroups'] = $this->app->getPostParam("securityGroups"); } - if (!is_null($tenantId)) + if (isset($this->app->getPostParam("tenantId"))) { - $options['tenantId'] = $tenantId; + $options['tenantId'] = $this->app->getPostParam("tenantId"); } - - $this->libClass->update($options); + try + { + $port = getPort($this->app->getPostParam("networkId")); + $port->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); + } } - public function deletePort($portId) + public function deletePort() { - $port = getPort($portId); - $port->delete(); + + try + { + $port = getPort($this->app->getPostParam("portId")); + $port->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); + } } - public function createSecurityGroup($name,$description) + public function createSecurityGroup() { $options = array(); - if (!is_null($name)) + if (isset($this->app->getPostParam("name"))) { - $options['name'] = $name; + $options['name'] = $this->app->getPostParam("name"); } - if (!is_null($description)) + if (isset($this->app->getPostParam("description"))) { - $options['description'] = $description; + $options['description'] = $this->app->getPostParam("description"); } - - $this->libClass->createSecurityGroup($options); + try + { + $this->libClass->createSecurityGroup($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); + } + } - public function createSecurityGroupRule($securityGroupId,$direction,$ethertype,$portRangeMin,$portRangeMax,$protocol,$remoteGroupId,$remoteIpPrefix) + public function createSecurityGroupRule() { $options = array(); - if (!is_null($securityGroupId)) + if (isset($this->app->getPostParam("securityGroupId"))) { - $options['securityGroupId'] = $securityGroupId; + $options['securityGroupId'] = $this->app->getPostParam("securityGroupId"); } - if (!is_null($direction)) + if (isset($this->app->getPostParam("direction"))) { - $options['direction'] = $direction; + $options['direction'] = $this->app->getPostParam("direction"); } - if (!is_null($ethertype)) + if (isset($this->app->getPostParam("ethertype"))) { - $options['ethertype'] = $ethertype; + $options['ethertype'] = $this->app->getPostParam("ethertype"); } - if (!is_null($portRangeMin)) + if (isset($this->app->getPostParam("portRangeMin"))) { - $options['portRangeMin'] = $portRangeMin; + $options['portRangeMin'] = $this->app->getPostParam("portRangeMin"); } - if (!is_null($portRangeMax)) + if (isset($this->app->getPostParam("portRangeMax"))) { - $options['portRangeMax'] = $portRangeMax; + $options['portRangeMax'] = $this->app->getPostParam("portRangeMax"); } - if (!is_null($protocol)) + if (isset($this->app->getPostParam("protocol"))) { - $options['protocol'] = $protocol; + $options['protocol'] = $this->app->getPostParam("protocol"); } - if (!is_null($remoteGroupId)) + if (isset($this->app->getPostParam("remoteGroupId"))) { - $options['remoteGroupId'] = $remoteGroupId; + $options['remoteGroupId'] = $this->app->getPostParam("remoteGroupId"); } - if (!is_null($remoteIpPrefix)) + if (isset($this->app->getPostParam("remoteIpPrefix"))) { - $options['remoteIpPrefix'] = $remoteIpPrefix; + $options['remoteIpPrefix'] = $this->app->getPostParam("remoteIpPrefix"); } - $this->libClass->createSecurityGroupRule($options); + try + { + $this->libClass->createSecurityGroupRule($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); + } } public function listSecurityGroupe() { - return $this->libClass->listSecurityGroups(); + try + { + $this->app->setOutput("listSecurityGroups", $this->libClass->listSecurityGroups()); + } + 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); + } } public function listSecurityGroupeRule() { - return $this->libClass->listSecurityGroupRules(); + try + { + + $this->app->setOutput("listSecurityGroupeRule", $this->libClass->listSecurityGroupRules()); + + } + 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); + } + } + + public function getSecurityGroupe() + { + try + { + $securityGroupe = $this->libClass->getSecurityGroupe($this->app->getPostParam("securityGroupeId")); + $this->app->setOutput("securityGroupe", $securityGroupe); + } + 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); + } + } public function getSecurityGroupe($securityGroupeId) @@ -434,15 +906,47 @@ class network{ $securityGroupe = $this->libClass->getSecurityGroupe($securityGroupeId); return $securityGroupe; } - catch (Exception $e) + catch(BadResponseError $e) { - echo 'id fourni non disponible'; - } + $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); + } } - public function deleteSecurityGroupe($securityGroupeId) - { - $securityGroupe = getSecurityGroupe($securityGroupeId); - $securityGroupe->delete(); + public function deleteSecurityGroupe() + { + try + { + + $securityGroupe = getSecurityGroupe($this->app->getPostParam("securityGroupeId")); + $securityGroupe->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); + } } diff --git a/server/core/Network.php~ b/server/core/Network.php~ new file mode 100644 index 0000000..65de962 --- /dev/null +++ b/server/core/Network.php~ @@ -0,0 +1,952 @@ +app = $app; + $this->libClass = $app->getLibClass("network"); + + } + + + public function action($action){ + + $this->{$action.""}(); + + } + + + public function create_network() + { + $options = array(); + if (isset($this->app->getPostParam("name"))) + { + $options['name'] = $this->app->getPostParam("name"); + } + if (isset($this->app->getPostParam("adminStateUp"))) + { + $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); + } + if (isset($this->app->getPostParam("shared"))) + { + $options['shared'] = $this->app->getPostParam("shared"); + } + if (isset($this->app->getPostParam("tenantId"))) + { + $options['tenantId'] = $this->app->getPostParam("tenantId"); + } + try + { + $network = $this->libClass->createNetworks($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); + } + + + } + + public function create_subnet() + { $options = array(); + if (isset($this->app->getPostParam("networkId"))) + { + $options['networkId'] = $networkId; + } + if (isset($this->app->getPostParam("ipVersion"))) + { + $options['ipVersion'] = $this->app->getPostParam("ipVersion"); + } + if (isset($this->app->getPostParam("cidr"))) + { + $options['cidr'] = $this->app->getPostParam("cidr"); + } + if (isset($this->app->getPostParam("tenantId"))) + { + $options['tenantId'] = $this->app->getPostParam("tenantId"); + } + if (isset($this->app->getPostParam("name"))) + { + $options['name'] = $$this->app->getPostParam("name"); + } + if (isset($this->app->getPostParam("gatewayIp"))) + { + $options['gatewayIp'] = $this->app->getPostParam("gatewayIp"); + } + if (isset($this->app->getPostParam("dnsNameservers"))) + { + $options['dnsNameservers'] = $this->app->getPostParam("dnsNameservers"); + } + if (isset($this->app->getPostParam("allocationPools"))) + { + $options['allocationPools'] = $this->app->getPostParam("allocationPools"); + } + if (isset($this->app->getPostParam("hostRoutes"))) + { + $options['hostRoutes'] = $this->app->getPostParam("hostRoutes"); + } + if (isset($this->app->getPostParam("enableDhcp"))) + { + $options['enableDhcp'] = $this->app->getPostParam("enableDhcp"); + } + if (isset($this->app->getPostParam("tenantId"))) + { + $options['tenantId'] = $this->app->getPostParam("tenantId"); + } + + try + { + $subnet = $this->libClass->createSubnet($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); + } + + + } + + public function list_network_ids() + { + try + { + $ln = $this->libClass->listNetworks(); + + $list_ids = array(); + + + foreach($ln as $n) + { + + $list_ids[] = $n->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); + } + + $this->app->setOutput("ListNetworkIds", $list_ids); + } + + public function list_network_names() + { + try + { + $ln = $this->libClass->listNetworks(); + + $list_names = array(); + + + foreach($ln as $n) + { + + $list_names[] = $n->name; + + + } + + } + 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("ListNetworkNames", $list_names); + } + + public function list_cidr() + { + try + { + $ls = $this->libClass->listSubnets(); + $list_cidr = array(); + foreach ($ls as $subnet) + { + + $list_cidr[] = $subnet->cidr; + } + + $this->app->setOutput("ListCidr", $list_cidr); + } + 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); + } + } + + public function getNetwork() + { + $network=""; + + try + { $newtork = $this->libClass->getNetwork($this->app->getPostParam("networkId")); + $network->retrieve(); + + + } + + + 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("Network", $network); + } + + public function getNetwork($netId) + { + $network=""; + + try + { $newtork = $this->libClass->getNetwork($netId); + $network->retrieve(); + + + } + + + 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); + } + + return $network; + } + + public function getSubnet() + { + $sbnet=""; + + try + { $subnet = $this->libClass->getSubnet($this->app->getPostParam("subnetId")); + $subnet->retrieve(); + + + } + + 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("Subnet", subnet); + + } + + public function getSubnet($subnetId) + { + $subnet=""; + + try + { $subnet = $this->libClass->getSubnet($subnetId); + $subnet->retrieve(); + + + } + + 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); + } + return $subnet; + + } + + public function updateNetwork() + { + $options = array(); + if(isset($this->app->getPostParam("name"))) + { + $options['name'] = $this->app->getPostParam("name"); + } + if(isset($this->app->getPostParam("shared"))) + { + $options['shared'] = $this->app->getPostParam("shared"); + } + if(isset($this->app->getPostParam("adminStateUp"))) + { + $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); + } + try + { + $network = getNetwork($this->app->getPostParam("networkId")); + + $network->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); + } + } + + public function updateSubnet() + { + $options = array(); + if(isset($this->app->getPostParam("name"))) + { + $options['name'] = $this->app->getPostParam("name"); + } + if(isset($this->app->getPostParam("networkId"))) + { + $options['networkId'] = $this->app->getPostParam("networkId"); + } + if(isset($this->app->getPostParam("ipVersion"))) + { + $options['ipVersion'] = $this->app->getPostParam("ipVersion"); + } + if(isset($this->app->getPostParam("cidr"))) + { + $options['cidr'] = $this->app->getPostParam("cidr"); + } + try + { + $subnet = getSubnet($this->app->getPostParam("networkId")); + + $subnet->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); + } + } + + public function deleteNetwork() + { + try + { + + $network = getNetwork($this->app->getPostParam("networkId")); + $network->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); + } + } + + public function deleteSubnet() + { + try + { + $subnet = getNetwork($this->app->getPostParam("subnetId")); + $subnet->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); + } + } + + public function createPort() + { + $options = array(); + if (isset($this->app->getPostParam("networkId"))) + { + $options['networkId'] = $this->app->getPostParam("networkId"); + } + if (isset($this->app->getPostParam("name"))) + { + $options['name'] = $this->app->getPostParam("name"); + } + if (isset($this->app->getPostParam("adminStateUp"))) + { + $options['adminStateUp'] = $this->app->getPostParam("adminStateUp"); + } + if (isset($this->app->getPostParam("macAddress"))) + { + $options['macAddress'] = $this->app->getPostParam("macAddress"); + } + if (isset($this->app->getPostParam("fixedIps"))) + { + $options['fixedIps'] = $this->app->getPostParam("fixedIps"); + } + if (isset($this->app->getPostParam("deviceId"))) + { + $options['deviceId'] = $this->app->getPostParam("deviceId"); + } + if (isset($this->app->getPostParam("deviceOwner"))) + { + $options['deviceOwner'] = $this->app->getPostParam("deviceOwner"); + } + if (isset($this->app->getPostParam("securityGroups"))) + { + $options['securityGroups'] = $this->app->getPostParam("securityGroups"); + } + if (isset($this->app->getPostParam("tenantId"))) + { + $options['tenantId'] = $this->app->getPostParam("tenantId"); + } + try + { + $this->libClass->createPort($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); + } + } + + public function listPorts() + { + try + { + $this->app->setOutput("listPorts", $this->libClass->listPorts()); + } + 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); + } + } + + public function getPort() + { + try + { + $port = $this->libClass->getport($this->app->getPostParam("portId")); + $this->app->setOutput("Port", $port); + } + 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); + } + + } + + public function getPort($portId) + { + try + { + $port = $this->libClass->getport($portId); + return $port; + } + 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); + } + + } + + public function updatePort() + { + $options = array(); + + if (isset($this->app->getPostParam("networkId"))) + { + $options['networkId'] = $this->app->getPostParam("networkId"); + } + if (isset($this->app->getPostParam("name"))) + { + $options['name'] =$this->app->getPostParam("name"); + } + if (isset($this->app->getPostParam("adminStateUp"))) + { + $options['adminStateUp'] =$this->app->getPostParam("adminStateUp"); + } + if (isset($this->app->getPostParam("macAddress"))) + { + $options['macAddress'] = $this->app->getPostParam("macAddress"); + } + if (isset($this->app->getPostParam("fixedIps"))) + { + $options['fixedIps'] = $this->app->getPostParam("fixedIps"); + } + if (isset($this->app->getPostParam("deviceId"))) + { + $options['deviceId'] = $this->app->getPostParam("deviceId"); + } + if (isset($this->app->getPostParam("deviceOwner"))) + { + $options['deviceOwner'] = $this->app->getPostParam("deviceOwner"); + } + if (isset($this->app->getPostParam("networkId"))) + { + $options['securityGroups'] = $this->app->getPostParam("securityGroups"); + } + if (isset($this->app->getPostParam("tenantId"))) + { + $options['tenantId'] = $this->app->getPostParam("tenantId"); + } + try + { + $port = getPort($this->app->getPostParam("networkId")); + $port->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); + } + } + + public function deletePort() + { + + try + { + $port = getPort($this->app->getPostParam("portId")); + $port->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); + } + } + + public function createSecurityGroup() + { + $options = array(); + if (isset($this->app->getPostParam("name"))) + { + $options['name'] = $this->app->getPostParam("name"); + } + if (isset($this->app->getPostParam("description"))) + { + $options['description'] = $this->app->getPostParam("description"); + } + try + { + $this->libClass->createSecurityGroup($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); + } + + } + + public function createSecurityGroupRule() + { + $options = array(); + if (isset($this->app->getPostParam("securityGroupId"))) + { + $options['securityGroupId'] = $this->app->getPostParam("securityGroupId"); + } + if (isset($this->app->getPostParam("direction"))) + { + $options['direction'] = $this->app->getPostParam("direction"); + } + if (isset($this->app->getPostParam("ethertype"))) + { + $options['ethertype'] = $this->app->getPostParam("ethertype"); + } + if (isset($this->app->getPostParam("portRangeMin"))) + { + $options['portRangeMin'] = $this->app->getPostParam("portRangeMin"); + } + if (isset($this->app->getPostParam("portRangeMax"))) + { + $options['portRangeMax'] = $this->app->getPostParam("portRangeMax"); + } + if (isset($this->app->getPostParam("protocol"))) + { + $options['protocol'] = $this->app->getPostParam("protocol"); + } + if (isset($this->app->getPostParam("remoteGroupId"))) + { + $options['remoteGroupId'] = $this->app->getPostParam("remoteGroupId"); + } + if (isset($this->app->getPostParam("remoteIpPrefix"))) + { + $options['remoteIpPrefix'] = $this->app->getPostParam("remoteIpPrefix"); + } + try + { + $this->libClass->createSecurityGroupRule($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); + } + } + + + public function listSecurityGroupe() + { + try + { + $this->app->setOutput("listSecurityGroups", $this->libClass->listSecurityGroups()); + } + 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); + } + } + + public function listSecurityGroupeRule() + { + try + { + + $this->app->setOutput("listSecurityGroupeRule", $this->libClass->listSecurityGroupRules()); + + } + 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); + } + } + + public function getSecurityGroupe() + { + try + { + $securityGroupe = $this->libClass->getSecurityGroupe($this->app->getPostParam("securityGroupeId")); + $this->app->setOutput("securityGroupe", $securityGroupe); + } + 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); + } + + } + + public function getSecurityGroupe($securityGroupeId) + { + try + { + $securityGroupe = $this->libClass->getSecurityGroupe($securityGroupeId); + return $securityGroupe; + } + 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); + } + + } + + public function deleteSecurityGroupe() + { + try + { + + $securityGroupe = getSecurityGroupe($this->app->getPostParam("securityGroupeId")); + $securityGroupe->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); + } + } -- cgit v1.2.3 From 3c336f00d29ba927d41e2029a3c1d893cee43f9d Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Mon, 21 Mar 2016 06:47:01 +0100 Subject: Add login check witouth reloading page --- .gitignore | 2 +- client/index.html | 5 +- client/js/app.js | 2 +- client/js/controllers/home/home.js | 2 +- client/js/controllers/image/image.js | 3 -- client/js/controllers/image/upload.js | 60 +++++++++++++++++++++ client/js/controllers/login.js | 16 +++--- client/js/controllers/status.js | 4 +- client/js/services/Identity.js | 15 ++++-- client/js/services/Image.js | 37 ++++++++++--- client/partials/image/upload.html | 13 +++-- .../vendors/angularjs/angular-file-upload.min.js | 7 +++ client/vendors/angularjs/angular-upload.min.js | 1 + client/vendors/jquery/dmuploader.min.js | 9 ++++ server/Readme.md | 0 server/Test/DisplayNetIds.php | 0 server/Test/computeTest.php | 0 server/Test/create_network.php | 0 server/Test/create_subnet.php | 0 server/Test/genTokenOptionsTest.php | 0 server/Test/imageTests.php | 0 server/composer.json | 0 server/composer.lock | 0 server/composer.phar | Bin server/config.inc.php | 0 server/core/CoreInterface.php | 0 server/core/LibOverride/projectTokenData/demo | 0 server/core/Network.php | 0 server/core/Plugin.php | 0 server/core/Plugin_Api.php | 0 server/core/Readme.txt | 0 server/create_serv.php | 0 server/modules/Readme.txt | 0 server/vendor/autoload.php | 0 server/vendor/composer/ClassLoader.php | 0 server/vendor/composer/LICENSE | 0 server/vendor/composer/autoload_classmap.php | 0 server/vendor/composer/autoload_files.php | 0 server/vendor/composer/autoload_namespaces.php | 0 server/vendor/composer/autoload_psr4.php | 0 server/vendor/composer/autoload_real.php | 0 server/vendor/composer/installed.json | 0 server/vendor/guzzlehttp/guzzle/.travis.yml | 0 server/vendor/guzzlehttp/guzzle/CHANGELOG.md | 0 server/vendor/guzzlehttp/guzzle/LICENSE | 0 server/vendor/guzzlehttp/guzzle/README.md | 0 server/vendor/guzzlehttp/guzzle/UPGRADING.md | 0 server/vendor/guzzlehttp/guzzle/composer.json | 0 server/vendor/guzzlehttp/guzzle/src/Client.php | 0 .../guzzlehttp/guzzle/src/ClientInterface.php | 0 .../guzzlehttp/guzzle/src/Cookie/CookieJar.php | 0 .../guzzle/src/Cookie/CookieJarInterface.php | 0 .../guzzlehttp/guzzle/src/Cookie/FileCookieJar.php | 0 .../guzzle/src/Cookie/SessionCookieJar.php | 0 .../guzzlehttp/guzzle/src/Cookie/SetCookie.php | 0 .../guzzle/src/Exception/BadResponseException.php | 0 .../guzzle/src/Exception/ClientException.php | 0 .../guzzle/src/Exception/ConnectException.php | 0 .../guzzle/src/Exception/GuzzleException.php | 0 .../guzzle/src/Exception/RequestException.php | 0 .../guzzle/src/Exception/SeekException.php | 0 .../guzzle/src/Exception/ServerException.php | 0 .../src/Exception/TooManyRedirectsException.php | 0 .../guzzle/src/Exception/TransferException.php | 0 .../guzzlehttp/guzzle/src/Handler/CurlFactory.php | 0 .../guzzle/src/Handler/CurlFactoryInterface.php | 0 .../guzzlehttp/guzzle/src/Handler/CurlHandler.php | 0 .../guzzle/src/Handler/CurlMultiHandler.php | 0 .../guzzlehttp/guzzle/src/Handler/EasyHandle.php | 0 .../guzzlehttp/guzzle/src/Handler/MockHandler.php | 0 .../vendor/guzzlehttp/guzzle/src/Handler/Proxy.php | 0 .../guzzle/src/Handler/StreamHandler.php | 0 .../vendor/guzzlehttp/guzzle/src/HandlerStack.php | 0 .../guzzlehttp/guzzle/src/MessageFormatter.php | 0 server/vendor/guzzlehttp/guzzle/src/Middleware.php | 0 server/vendor/guzzlehttp/guzzle/src/Pool.php | 0 .../guzzle/src/PrepareBodyMiddleware.php | 0 .../guzzlehttp/guzzle/src/RedirectMiddleware.php | 0 .../guzzlehttp/guzzle/src/RequestOptions.php | 0 .../guzzlehttp/guzzle/src/RetryMiddleware.php | 0 .../vendor/guzzlehttp/guzzle/src/TransferStats.php | 0 .../vendor/guzzlehttp/guzzle/src/UriTemplate.php | 0 server/vendor/guzzlehttp/guzzle/src/functions.php | 0 .../guzzlehttp/guzzle/src/functions_include.php | 0 server/vendor/guzzlehttp/promises/.gitignore | 0 server/vendor/guzzlehttp/promises/.travis.yml | 0 server/vendor/guzzlehttp/promises/CHANGELOG.md | 0 server/vendor/guzzlehttp/promises/LICENSE | 0 server/vendor/guzzlehttp/promises/Makefile | 0 server/vendor/guzzlehttp/promises/README.md | 0 server/vendor/guzzlehttp/promises/composer.json | 0 server/vendor/guzzlehttp/promises/phpunit.xml.dist | 0 .../guzzlehttp/promises/src/AggregateException.php | 0 .../promises/src/CancellationException.php | 0 .../vendor/guzzlehttp/promises/src/EachPromise.php | 0 .../guzzlehttp/promises/src/FulfilledPromise.php | 0 server/vendor/guzzlehttp/promises/src/Promise.php | 0 .../guzzlehttp/promises/src/PromiseInterface.php | 0 .../guzzlehttp/promises/src/PromisorInterface.php | 0 .../guzzlehttp/promises/src/RejectedPromise.php | 0 .../guzzlehttp/promises/src/RejectionException.php | 0 .../vendor/guzzlehttp/promises/src/TaskQueue.php | 0 .../vendor/guzzlehttp/promises/src/functions.php | 0 .../guzzlehttp/promises/src/functions_include.php | 0 .../promises/tests/AggregateExceptionTest.php | 0 .../guzzlehttp/promises/tests/EachPromiseTest.php | 0 .../promises/tests/FulfilledPromiseTest.php | 0 .../promises/tests/NotPromiseInstance.php | 0 .../guzzlehttp/promises/tests/PromiseTest.php | 0 .../promises/tests/RejectedPromiseTest.php | 0 .../promises/tests/RejectionExceptionTest.php | 0 .../guzzlehttp/promises/tests/TaskQueueTest.php | 0 .../vendor/guzzlehttp/promises/tests/Thennable.php | 0 .../vendor/guzzlehttp/promises/tests/bootstrap.php | 0 .../guzzlehttp/promises/tests/functionsTest.php | 0 server/vendor/guzzlehttp/psr7/.gitignore | 0 server/vendor/guzzlehttp/psr7/.travis.yml | 0 server/vendor/guzzlehttp/psr7/CHANGELOG.md | 0 server/vendor/guzzlehttp/psr7/LICENSE | 0 server/vendor/guzzlehttp/psr7/Makefile | 0 server/vendor/guzzlehttp/psr7/README.md | 0 server/vendor/guzzlehttp/psr7/composer.json | 0 server/vendor/guzzlehttp/psr7/phpunit.xml.dist | 0 server/vendor/guzzlehttp/psr7/src/AppendStream.php | 0 server/vendor/guzzlehttp/psr7/src/BufferStream.php | 0 .../vendor/guzzlehttp/psr7/src/CachingStream.php | 0 .../vendor/guzzlehttp/psr7/src/DroppingStream.php | 0 server/vendor/guzzlehttp/psr7/src/FnStream.php | 0 .../vendor/guzzlehttp/psr7/src/InflateStream.php | 0 .../vendor/guzzlehttp/psr7/src/LazyOpenStream.php | 0 server/vendor/guzzlehttp/psr7/src/LimitStream.php | 0 server/vendor/guzzlehttp/psr7/src/MessageTrait.php | 0 .../vendor/guzzlehttp/psr7/src/MultipartStream.php | 0 server/vendor/guzzlehttp/psr7/src/NoSeekStream.php | 0 server/vendor/guzzlehttp/psr7/src/PumpStream.php | 0 server/vendor/guzzlehttp/psr7/src/Request.php | 0 server/vendor/guzzlehttp/psr7/src/Response.php | 0 server/vendor/guzzlehttp/psr7/src/Stream.php | 0 .../guzzlehttp/psr7/src/StreamDecoratorTrait.php | 0 .../vendor/guzzlehttp/psr7/src/StreamWrapper.php | 0 server/vendor/guzzlehttp/psr7/src/Uri.php | 0 server/vendor/guzzlehttp/psr7/src/functions.php | 0 .../guzzlehttp/psr7/src/functions_include.php | 0 .../guzzlehttp/psr7/tests/AppendStreamTest.php | 0 .../guzzlehttp/psr7/tests/BufferStreamTest.php | 0 .../guzzlehttp/psr7/tests/CachingStreamTest.php | 0 .../guzzlehttp/psr7/tests/DroppingStreamTest.php | 0 .../vendor/guzzlehttp/psr7/tests/FnStreamTest.php | 0 .../vendor/guzzlehttp/psr7/tests/FunctionsTest.php | 0 .../guzzlehttp/psr7/tests/InflateStreamTest.php | 0 .../guzzlehttp/psr7/tests/LazyOpenStreamTest.php | 0 .../guzzlehttp/psr7/tests/LimitStreamTest.php | 0 .../guzzlehttp/psr7/tests/MultipartStreamTest.php | 0 .../guzzlehttp/psr7/tests/NoSeekStreamTest.php | 0 .../guzzlehttp/psr7/tests/PumpStreamTest.php | 0 .../vendor/guzzlehttp/psr7/tests/RequestTest.php | 0 .../vendor/guzzlehttp/psr7/tests/ResponseTest.php | 0 .../psr7/tests/StreamDecoratorTraitTest.php | 0 server/vendor/guzzlehttp/psr7/tests/StreamTest.php | 0 .../guzzlehttp/psr7/tests/StreamWrapperTest.php | 0 server/vendor/guzzlehttp/psr7/tests/UriTest.php | 0 server/vendor/guzzlehttp/psr7/tests/bootstrap.php | 0 .../justinrainbow/json-schema/.gitattributes | 0 server/vendor/justinrainbow/json-schema/LICENSE | 0 server/vendor/justinrainbow/json-schema/README.md | 0 .../justinrainbow/json-schema/bin/validate-json | 0 .../vendor/justinrainbow/json-schema/composer.json | 0 .../justinrainbow/json-schema/phpunit.xml.dist | 0 .../Constraints/CollectionConstraint.php | 0 .../src/JsonSchema/Constraints/Constraint.php | 0 .../JsonSchema/Constraints/ConstraintInterface.php | 0 .../src/JsonSchema/Constraints/EnumConstraint.php | 0 .../src/JsonSchema/Constraints/Factory.php | 0 .../JsonSchema/Constraints/FormatConstraint.php | 0 .../JsonSchema/Constraints/NumberConstraint.php | 0 .../JsonSchema/Constraints/ObjectConstraint.php | 0 .../JsonSchema/Constraints/SchemaConstraint.php | 0 .../JsonSchema/Constraints/StringConstraint.php | 0 .../src/JsonSchema/Constraints/TypeConstraint.php | 0 .../JsonSchema/Constraints/UndefinedConstraint.php | 0 .../Exception/InvalidArgumentException.php | 0 .../Exception/InvalidSchemaMediaTypeException.php | 0 .../Exception/InvalidSourceUriException.php | 0 .../JsonSchema/Exception/JsonDecodingException.php | 0 .../Exception/ResourceNotFoundException.php | 0 .../JsonSchema/Exception/UriResolverException.php | 0 .../json-schema/src/JsonSchema/RefResolver.php | 0 .../Uri/Retrievers/AbstractRetriever.php | 0 .../src/JsonSchema/Uri/Retrievers/Curl.php | 0 .../JsonSchema/Uri/Retrievers/FileGetContents.php | 0 .../JsonSchema/Uri/Retrievers/PredefinedArray.php | 0 .../Uri/Retrievers/UriRetrieverInterface.php | 0 .../json-schema/src/JsonSchema/Uri/UriResolver.php | 0 .../src/JsonSchema/Uri/UriRetriever.php | 0 .../json-schema/src/JsonSchema/Validator.php | 0 server/vendor/php-opencloud/common/.gitignore | 0 server/vendor/php-opencloud/common/composer.json | 0 .../vendor/php-opencloud/common/phpunit.xml.dist | 0 .../common/src/Common/Api/AbstractApi.php | 0 .../common/src/Common/Api/AbstractParams.php | 0 .../common/src/Common/Api/ApiInterface.php | 0 .../common/src/Common/Api/Operation.php | 0 .../common/src/Common/Api/Operator.php | 0 .../common/src/Common/Api/OperatorInterface.php | 0 .../common/src/Common/Api/Parameter.php | 0 .../common/src/Common/ArrayAccessTrait.php | 0 .../common/src/Common/Auth/AuthHandler.php | 0 .../common/src/Common/Auth/Catalog.php | 0 .../common/src/Common/Auth/IdentityService.php | 0 .../php-opencloud/common/src/Common/Auth/Token.php | 0 .../common/src/Common/Error/BadResponseError.php | 0 .../common/src/Common/Error/BaseError.php | 0 .../common/src/Common/Error/Builder.php | 0 .../src/Common/Error/NotImplementedError.php | 0 .../common/src/Common/Error/UserInputError.php | 0 .../common/src/Common/HydratorStrategyTrait.php | 0 .../php-opencloud/common/src/Common/JsonPath.php | 0 .../common/src/Common/JsonSchema/JsonPatch.php | 0 .../common/src/Common/JsonSchema/Schema.php | 0 .../src/Common/Resource/AbstractResource.php | 0 .../common/src/Common/Resource/Creatable.php | 0 .../common/src/Common/Resource/Deletable.php | 0 .../common/src/Common/Resource/HasMetadata.php | 0 .../common/src/Common/Resource/HasWaiterTrait.php | 0 .../common/src/Common/Resource/Iterator.php | 0 .../common/src/Common/Resource/Listable.php | 0 .../src/Common/Resource/ResourceInterface.php | 0 .../common/src/Common/Resource/Retrievable.php | 0 .../common/src/Common/Resource/Updateable.php | 0 .../common/src/Common/Service/AbstractService.php | 0 .../common/src/Common/Service/Builder.php | 0 .../common/src/Common/Service/ServiceInterface.php | 0 .../common/src/Common/Transport/HandlerStack.php | 0 .../common/src/Common/Transport/JsonSerializer.php | 0 .../common/src/Common/Transport/Middleware.php | 0 .../src/Common/Transport/RequestSerializer.php | 0 .../common/src/Common/Transport/Utils.php | 0 .../common/tests/integration/DefaultLogger.php | 0 .../common/tests/integration/Runner.php | 0 .../common/tests/integration/SampleManager.php | 0 .../tests/integration/SampleManagerInterface.php | 0 .../common/tests/integration/TestCase.php | 0 .../common/tests/integration/TestInterface.php | 0 .../common/tests/integration/Utils.php | 0 .../php-opencloud/common/tests/integration/run.php | 0 .../common/tests/unit/Common/Api/OperationTest.php | 0 .../common/tests/unit/Common/Api/OperatorTest.php | 0 .../common/tests/unit/Common/Api/ParameterTest.php | 0 .../tests/unit/Common/Api/fixtures/headers.php | 0 .../tests/unit/Common/Api/fixtures/jsonBody.php | 0 .../tests/unit/Common/ArrayAccessTraitTest.php | 0 .../tests/unit/Common/Auth/AuthHandlerTest.php | 0 .../common/tests/unit/Common/DateTime.php | 0 .../unit/Common/Error/BadResponseErrorTest.php | 0 .../common/tests/unit/Common/Error/BuilderTest.php | 0 .../tests/unit/Common/HydratorStrategyTraitTes.php | 0 .../common/tests/unit/Common/JsonPathTest.php | 0 .../Common/JsonSchema/Fixtures/jsonPatchTests.json | 0 .../tests/unit/Common/JsonSchema/JsonPatchTest.php | 0 .../tests/unit/Common/JsonSchema/SchemaTest.php | 0 .../unit/Common/Resource/AbstractResourceTest.php | 0 .../Common/Resource/Fixtures/servers-empty.resp | 0 .../Common/Resource/Fixtures/servers-page1.resp | 0 .../Common/Resource/Fixtures/servers-page2.resp | 0 .../tests/unit/Common/Service/BuilderTest.php | 0 .../unit/Common/Transport/HandlerStackTest.php | 0 .../unit/Common/Transport/JsonSerializerTest.php | 0 .../tests/unit/Common/Transport/MiddlewareTest.php | 0 .../Common/Transport/RequestSerializerTest.php | 0 .../tests/unit/Common/Transport/UtilsTest.php | 0 .../common/tests/unit/Fixtures/ComputeV2Api.php | 0 .../common/tests/unit/Fixtures/IdentityV2Api.php | 0 .../common/tests/unit/Fixtures/IdentityV3Api.php | 0 .../php-opencloud/common/tests/unit/TestCase.php | 0 server/vendor/psr/http-message/LICENSE | 0 server/vendor/psr/http-message/README.md | 0 server/vendor/psr/http-message/composer.json | 0 .../psr/http-message/src/MessageInterface.php | 0 .../psr/http-message/src/RequestInterface.php | 0 .../psr/http-message/src/ResponseInterface.php | 0 .../http-message/src/ServerRequestInterface.php | 0 .../psr/http-message/src/StreamInterface.php | 0 .../psr/http-message/src/UploadedFileInterface.php | 0 .../vendor/psr/http-message/src/UriInterface.php | 0 284 files changed, 143 insertions(+), 33 deletions(-) create mode 100644 client/js/controllers/image/upload.js create mode 100644 client/vendors/angularjs/angular-file-upload.min.js create mode 100644 client/vendors/angularjs/angular-upload.min.js create mode 100644 client/vendors/jquery/dmuploader.min.js mode change 100644 => 100755 server/Readme.md mode change 100644 => 100755 server/Test/DisplayNetIds.php mode change 100644 => 100755 server/Test/computeTest.php mode change 100644 => 100755 server/Test/create_network.php mode change 100644 => 100755 server/Test/create_subnet.php mode change 100644 => 100755 server/Test/genTokenOptionsTest.php mode change 100644 => 100755 server/Test/imageTests.php mode change 100644 => 100755 server/composer.json mode change 100644 => 100755 server/composer.lock mode change 100644 => 100755 server/composer.phar mode change 100644 => 100755 server/config.inc.php mode change 100644 => 100755 server/core/CoreInterface.php mode change 100644 => 100755 server/core/LibOverride/projectTokenData/demo mode change 100644 => 100755 server/core/Network.php mode change 100644 => 100755 server/core/Plugin.php mode change 100644 => 100755 server/core/Plugin_Api.php mode change 100644 => 100755 server/core/Readme.txt mode change 100644 => 100755 server/create_serv.php mode change 100644 => 100755 server/modules/Readme.txt mode change 100644 => 100755 server/vendor/autoload.php mode change 100644 => 100755 server/vendor/composer/ClassLoader.php mode change 100644 => 100755 server/vendor/composer/LICENSE mode change 100644 => 100755 server/vendor/composer/autoload_classmap.php mode change 100644 => 100755 server/vendor/composer/autoload_files.php mode change 100644 => 100755 server/vendor/composer/autoload_namespaces.php mode change 100644 => 100755 server/vendor/composer/autoload_psr4.php mode change 100644 => 100755 server/vendor/composer/autoload_real.php mode change 100644 => 100755 server/vendor/composer/installed.json mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/.travis.yml mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/CHANGELOG.md mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/LICENSE mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/README.md mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/UPGRADING.md mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/composer.json mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Client.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/ClientInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/HandlerStack.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/MessageFormatter.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Middleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Pool.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/RequestOptions.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/TransferStats.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/UriTemplate.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/functions.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/functions_include.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/.gitignore mode change 100644 => 100755 server/vendor/guzzlehttp/promises/.travis.yml mode change 100644 => 100755 server/vendor/guzzlehttp/promises/CHANGELOG.md mode change 100644 => 100755 server/vendor/guzzlehttp/promises/LICENSE mode change 100644 => 100755 server/vendor/guzzlehttp/promises/Makefile mode change 100644 => 100755 server/vendor/guzzlehttp/promises/README.md mode change 100644 => 100755 server/vendor/guzzlehttp/promises/composer.json mode change 100644 => 100755 server/vendor/guzzlehttp/promises/phpunit.xml.dist mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/AggregateException.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/CancellationException.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/EachPromise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/FulfilledPromise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/Promise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/PromiseInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/PromisorInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/RejectedPromise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/RejectionException.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/TaskQueue.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/functions.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/functions_include.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/EachPromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/PromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/TaskQueueTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/Thennable.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/bootstrap.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/functionsTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/.gitignore mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/.travis.yml mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/CHANGELOG.md mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/LICENSE mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/Makefile mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/README.md mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/composer.json mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/phpunit.xml.dist mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/AppendStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/BufferStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/CachingStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/DroppingStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/FnStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/InflateStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/LazyOpenStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/LimitStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/MessageTrait.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/MultipartStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/NoSeekStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/PumpStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Request.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Response.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Stream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/StreamWrapper.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Uri.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/functions.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/functions_include.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/FnStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/FunctionsTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/RequestTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/ResponseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/StreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/UriTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/bootstrap.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/.gitattributes mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/LICENSE mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/README.md mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/bin/validate-json mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/composer.json mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/phpunit.xml.dist mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ConstraintInterface.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidArgumentException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSchemaMediaTypeException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSourceUriException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/JsonDecodingException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/ResourceNotFoundException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/UriResolverException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/AbstractRetriever.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/UriRetrieverInterface.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php mode change 100644 => 100755 server/vendor/php-opencloud/common/.gitignore mode change 100644 => 100755 server/vendor/php-opencloud/common/composer.json mode change 100644 => 100755 server/vendor/php-opencloud/common/phpunit.xml.dist mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/AbstractApi.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/ApiInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/Operation.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/Operator.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/OperatorInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/Parameter.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/AuthHandler.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/Catalog.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/IdentityService.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/Token.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/BadResponseError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/BaseError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/Builder.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/NotImplementedError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/UserInputError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/HydratorStrategyTrait.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/JsonPath.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/JsonSchema/JsonPatch.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/JsonSchema/Schema.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/AbstractResource.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Creatable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Deletable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/HasMetadata.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/HasWaiterTrait.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Iterator.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Listable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/ResourceInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Retrievable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Updateable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Service/AbstractService.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Service/Builder.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Service/ServiceInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/HandlerStack.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/JsonSerializer.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/Middleware.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/RequestSerializer.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/Utils.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/DefaultLogger.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/Runner.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/SampleManager.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/SampleManagerInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/TestCase.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/TestInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/Utils.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/run.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/OperatorTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/ParameterTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/fixtures/headers.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/fixtures/jsonBody.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/ArrayAccessTraitTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Auth/AuthHandlerTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/DateTime.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Error/BadResponseErrorTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Error/BuilderTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/HydratorStrategyTraitTes.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/Fixtures/jsonPatchTests.json mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/JsonPatchTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/SchemaTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/AbstractResourceTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/Fixtures/servers-empty.resp mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/Fixtures/servers-page1.resp mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/Fixtures/servers-page2.resp mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Service/BuilderTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/HandlerStackTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/JsonSerializerTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/MiddlewareTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/RequestSerializerTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/UtilsTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Fixtures/ComputeV2Api.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Fixtures/IdentityV2Api.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Fixtures/IdentityV3Api.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/TestCase.php mode change 100644 => 100755 server/vendor/psr/http-message/LICENSE mode change 100644 => 100755 server/vendor/psr/http-message/README.md mode change 100644 => 100755 server/vendor/psr/http-message/composer.json mode change 100644 => 100755 server/vendor/psr/http-message/src/MessageInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/RequestInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/ResponseInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/ServerRequestInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/StreamInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/UploadedFileInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/UriInterface.php (limited to 'server/core/Network.php') diff --git a/.gitignore b/.gitignore index 00495dc..424829c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/nbproject \ No newline at end of file +nbproject \ No newline at end of file diff --git a/client/index.html b/client/index.html index 08be038..97e0734 100644 --- a/client/index.html +++ b/client/index.html @@ -66,7 +66,8 @@ - + + @@ -75,6 +76,7 @@ + @@ -90,6 +92,7 @@ + diff --git a/client/js/app.js b/client/js/app.js index 1602e65..f571cb7 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -3,7 +3,7 @@ * The main app module instance * @type angular.module.angular-1_3_6_L1749.moduleInstance */ -var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize', 'ngCookies']); +var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize', 'ngCookies','lr.upload']); /** * Configure routeProvider diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js index 2b355b1..835d6ac 100644 --- a/client/js/controllers/home/home.js +++ b/client/js/controllers/home/home.js @@ -29,7 +29,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I if(Identity.isAlreadyLogin()){ - if(Compute.getData().machines == null{ + if(Compute.getData().machines == null){ Loading.start(); Compute.pullData(callMeAfterPullData); } diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js index b0b162b..d9a9c06 100644 --- a/client/js/controllers/image/image.js +++ b/client/js/controllers/image/image.js @@ -11,9 +11,6 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', funct Loading.stop(); }; - $scope.doUpload = function () { - Image.uploadImage($scope.myFile,function(){}); - }; if(Identity.isAlreadyLogin()){ diff --git a/client/js/controllers/image/upload.js b/client/js/controllers/image/upload.js new file mode 100644 index 0000000..eca9406 --- /dev/null +++ b/client/js/controllers/image/upload.js @@ -0,0 +1,60 @@ +/** + * The image controller + * + * @param {$scope} $scope The $scope service from angular + */ +mainApp.controller('uploadImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', 'upload', function ($scope, Image, Loading, Identity,upload) +{ + /*$scope.uploader = new FileUploader({ + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564' + }); + $scope.uploader.url='../server/index.php' + $scope.uploader.alias='file_name' + $scope.uploader.formData={ + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564' + } + */ + + $scope.doUpload = function () { + console.log($('#imageToUpload').prop('files')[0]); + Image.uploadImage($('#imageToUpload').prop('files')[0], function(){alert("done")}) + /*$("#drop-area-div").dmUploader({ + extraData: { + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564'}, + url:"../server/index.php" + }); + */ + + /*upload({ + url: '../server/index.php', + method: 'POST', + data: { + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564', + "file_name": $scope.myFile, // a jqLite type="file" element, upload() will extract all the files from the input and put them into the FormData object before sending. + } + }).then( + function (response) { + console.log(response.data); // will output whatever you choose to return from the server on a successful upload + }, + function (response) { + console.error(response); // Will return if status code is above 200 and lower than 300, same as $http + } + );*/ + + + }; + + +}]); diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js index 63cb6d1..fed358d 100644 --- a/client/js/controllers/login.js +++ b/client/js/controllers/login.js @@ -9,15 +9,15 @@ */ mainApp.controller('loginCtrl', ['$scope','$sce','Identity', function ($scope,$sce, Identity) { - // Check for login and define default states - if(!Identity.isAlreadyLogin()){ - $('#loginModal').modal({backdrop: 'static', keyboard: false}); - } + // Check for login and define default states + if(!Identity.isAlreadyLogin()){ + $('#loginModal').modal({backdrop: 'static', keyboard: false}); + } - // Manager logout event - $scope.$on('logoutEvent', function(){ - $('#loginModal').modal({backdrop: 'static', keyboard: false}); - }); + // Manager logout event + $scope.$on('logoutEvent', function(){ + $('#loginModal').modal({backdrop: 'static', keyboard: false}); + }); diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index b4a5dd9..15850f4 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -15,7 +15,7 @@ mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($ // Function to logout $scope.logout=function(){ - Identity.logout(); - }; + Identity.logout(); + }; }]); diff --git a/client/js/services/Identity.js b/client/js/services/Identity.js index f9d1df4..1e8d9ff 100644 --- a/client/js/services/Identity.js +++ b/client/js/services/Identity.js @@ -1,5 +1,5 @@ -mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ +mainApp.factory('Identity',[ '$http', '$cookies', '$rootScope', function($http, $cookies, $rootScope){ /* Create profile structure to store informations * about current session @@ -27,17 +27,20 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ && typeof tokenPart_1InCookie !== 'undefined' ){ - if(token!==null){ + //if(token!==null){ // If yes, put it into variables angular.extend(profile, profileInCookie); token=tokenPart_0InCookie+tokenPart_1InCookie; - } + //} // Return I'm Login return true; } - + + // Show the login overlay + $rootScope.$broadcast("logoutEvent"); + // Return I'm not Login return false; } @@ -56,7 +59,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ profile.projectname=null; // Reload Page - location.reload(); + //location.reload(); + $rootScope.$broadcast("logoutEvent"); + } diff --git a/client/js/services/Image.js b/client/js/services/Image.js index decb5b2..d427e51 100644 --- a/client/js/services/Image.js +++ b/client/js/services/Image.js @@ -45,17 +45,42 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){ }; var uploadImage=function(fileToUpload, callback) { - - - var result=$http.post('../server/index.php', - $.param({"token" : Identity.getToken(), "task" : "image", 'action':'uploadImage', 'filename':fileToUpload, 'id':'6564'})); + var form_data = new FormData(); + form_data.append('file', fileToUpload); + console.log(fileToUpload) + form_data.append("task" , "image") + form_data.append("token" , Identity.getToken()) + form_data.append('action',"uploadImage") + form_data.append('id','6564') + form_data.append('file_name', fileToUpload.name); + + $.ajax({ + url: "../server/index.php", // Url to which the request is send + type: "POST", // Type of request to be send, called as method + data: form_data, // Data sent to server, a set of key/value pairs (i.e. form fields and values) + file_name:fileToUpload.name, + token : Identity.getToken(), + task : "image", + action:'uploadImage', + id:'6564', + contentType: false, // The content type used when sending data to the server. + cache: false, // To unable request pages to be cached + processData:false, // To send DOMDocument or non processed data file it is set to false + success: function(data) // A function to be called if request succeeds + { + alert("success") + } + }); + + //var result=$http.post('../server/index.php', + // $.param({"token" : Identity.getToken(), "task" : "image", 'action':'uploadImage', 'file_name':form_data, 'id':'6564'})); // Wait and handle the response - result.then(function (response){ + /* result.then(function (response){ callback(parseUploadImageAnswer(response, false)); },function(response){ callback(parseUploadImageAnswer(response, true)); - }); + });*/ diff --git a/client/partials/image/upload.html b/client/partials/image/upload.html index 9049abf..72a8e01 100644 --- a/client/partials/image/upload.html +++ b/client/partials/image/upload.html @@ -1,4 +1,4 @@ -