modification in structure for ip and routers
This commit is contained in:
parent
94ce37f517
commit
3f6af0b644
7 changed files with 30 additions and 59 deletions
|
@ -64,7 +64,7 @@ class App{
|
|||
$opt = $this->tokenClass->getOptions($service);
|
||||
return $this->openstack->computeV2($opt);
|
||||
break;
|
||||
case "FloatingIp":
|
||||
case "NetworkLayer3":
|
||||
if($this->tokenPost == NULL) $this->tokenClass->genNetworkToken();
|
||||
$opt = $this->tokenClass->getOptions('Network');
|
||||
return $this->openstack->networkingV2ExtLayer3($opt);
|
||||
|
|
|
@ -14,6 +14,7 @@ include("CoreInterface.php");
|
|||
include("Image.php");
|
||||
include("Network.php");
|
||||
include("Compute.php");
|
||||
include("NetworkLayer3");
|
||||
|
||||
class automating implements Core{
|
||||
|
||||
|
@ -22,7 +23,7 @@ class automating implements Core{
|
|||
protected $appImage;
|
||||
protected $appNetwork;
|
||||
protected $appIdentity;
|
||||
protected $appFloatingIp;
|
||||
protected $appNetworkLayer3;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
|
@ -40,7 +41,7 @@ class automating implements Core{
|
|||
$this->appImage = $appImage;
|
||||
$this->appNetwork = $appNetwork;
|
||||
$this->appIdentity = $appIdentity;
|
||||
$this->appFloatingIp = $appFloatingIp;
|
||||
$this->appNetworkLayer3 = $appNetworkLayer3;
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ use OpenCloud\Common\Error\UserInputError;
|
|||
* Management of images
|
||||
*
|
||||
*/
|
||||
class floatingIp {
|
||||
class networkLayer3 {
|
||||
|
||||
/** @var App $app protected, contains the main app object */
|
||||
protected $app;
|
||||
|
@ -35,14 +35,14 @@ class floatingIp {
|
|||
*
|
||||
* @param App $app the main app object
|
||||
*
|
||||
* @return floatingip
|
||||
* @return networkLayer3
|
||||
*/
|
||||
public function __construct($app){
|
||||
if(!isset($app)){
|
||||
$this->app->setOutput("Error", "Incorrect parameter app");
|
||||
}
|
||||
$this->app = $app;
|
||||
$this->libClass = $app->getLibClass("FloatingIp");
|
||||
$this->libClass = $app->getLibClass("NetworkLayer3");
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ class floatingIp {
|
|||
$result[] = $tmp;
|
||||
}
|
||||
|
||||
$this->app->setOutput("FloatingIp", $result);
|
||||
$this->app->setOutput("NetworkLayer3", $result);
|
||||
}catch(BadResponseError $e){
|
||||
$this->app->getErrorInstance()->BadResponseHandler($e);
|
||||
}catch(UserInputError $e){
|
||||
|
@ -105,7 +105,7 @@ class floatingIp {
|
|||
if(!isset($floatingip)){
|
||||
$this->app->setOutput("Error", "Unknowing error during floating ip creation");
|
||||
}else{
|
||||
$this->app->setOutput("FloatingIp", $floatingip);
|
||||
$this->app->setOutput("NetworkLayer3", $floatingip);
|
||||
}
|
||||
}catch(BadResponseError $e){
|
||||
echo $e."</br>";
|
||||
|
@ -160,7 +160,7 @@ class floatingIp {
|
|||
$this->app->setOutput("Error", "Unknow id");
|
||||
}else{ // If id exists
|
||||
$res = $this->libClass->getFloatingIp($id);
|
||||
$this->app->setOutput("FloatingIp", $res);
|
||||
$this->app->setOutput("NetworkLayer3", $res);
|
||||
}
|
||||
|
||||
}catch(BadResponseError $e){
|
Loading…
Add table
Add a link
Reference in a new issue