summaryrefslogtreecommitdiff
path: root/server/core/Automating.php
diff options
context:
space:
mode:
authorstupidon <bhupendra.siyag@gmail.com>2016-03-29 08:07:35 +0200
committerstupidon <bhupendra.siyag@gmail.com>2016-03-29 08:07:35 +0200
commitcb2e0a46dff0349400e02410f4cdecad2fc87db4 (patch)
tree88fc5de9fcbe877201cdad5a1f3323afa4551572 /server/core/Automating.php
parent804fa322d841d73ee7592885ec500dc94e91b9e6 (diff)
added script function and put in a layout of module-specific functions for automation to be called from objects of various classes of our app
Diffstat (limited to 'server/core/Automating.php')
-rw-r--r--server/core/Automating.php38
1 files changed, 26 insertions, 12 deletions
diff --git a/server/core/Automating.php b/server/core/Automating.php
index 7f2c654..adad348 100644
--- a/server/core/Automating.php
+++ b/server/core/Automating.php
@@ -5,7 +5,7 @@
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
-* @author Evan Pisani 'yogg at epsina . com'
+* @author Evan Pisani 'yogg at epsina . com' et bhupi
*
* @todo Complete the functions with errors detection and finish the descriptions
*/
@@ -16,25 +16,28 @@ include("Network.php");
include("Compute.php");
class automating implements Core{
+
/** @var App $app protected, contains the main app object */
- protected $app;
-
- /** @var OpenStack\Identity $libClass protected, contains the library Identity object */
- protected $libClass;
+ protected $appCompute;
+ protected $appImage;
+ protected $appNetwork;
+ protected $appIdentity;
/**
- * Image constructor
+ * Our library's app constructor for all server app objects
*
- * @param App $app the main app object
+ * @param App $app the main app object, e.g. compute, image, network, etc.
*
- * @return Image
+ * @return
*/
public function __construct($app){
if(!isset($app)){
- $this->app->setOutput("Error", "Incorrect parameter app");
+ $this->app->setOutput("Error", "Parameter app missing.");
}
- $this->app = $app;
- $this->libClass = $app->getLibClass("Automating");
+ $this->appCompute = $appCompute;
+ $this->appImage = $appImage;
+ $this->appNetwork = $appNetwork;
+ $this->appIdentity = $appIdentity;
}
/**
@@ -48,6 +51,17 @@ class automating implements Core{
$this->{$action.""}();
}
+ public function script()
+ {
+ appImage->createImage();
+ appImage->create_network();
+ appImage->list_network_ids();
+ appImage->create_subnet();
+ appCompute->listFlavors();
+ appCompute->listImages();
+ appCompute->createServer();
+
+ }
/**
* Create a new image on a new server
*
@@ -124,4 +138,4 @@ class automating implements Core{
}
}
-?> \ No newline at end of file
+?>