summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@kabir-PC>2016-02-24 19:42:01 +0100
committerroot <root@kabir-PC>2016-02-24 19:42:01 +0100
commit38ba61c6eebadb79a23044b06671fd7c73975516 (patch)
treee7bca6160f5f9232a4280b2985cc74cc64bbde5e
parent154d49d1089d34ada6744556cca8028d1ec11430 (diff)
modification dans network
-rw-r--r--server/core/Network.php35
1 files changed, 15 insertions, 20 deletions
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] [<description>]
- *
- * @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)
{