summaryrefslogtreecommitdiff
path: root/server/core/Automating.php
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-30 14:14:10 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-30 14:14:10 +0200
commit237b627bf6cdf31e8923fc67653a73b6b9978540 (patch)
tree20449eb6aee87f582639ad6e3bd5dcf3dc06ecfa /server/core/Automating.php
parentf4da4f285a4689e1d4eb8bb7d800d6570dfba6d0 (diff)
parentb6ffc16d78e3fd22f9d728d45cef1c78c182cc1f (diff)
Merge branch 'develop' into loic
Diffstat (limited to 'server/core/Automating.php')
-rwxr-xr-xserver/core/Automating.php48
1 files changed, 36 insertions, 12 deletions
diff --git a/server/core/Automating.php b/server/core/Automating.php
index 7f2c654..1eef72c 100755
--- 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,27 @@ class automating implements Core{
$this->{$action.""}();
}
+ public function script()
+ {
+ $opt = Array();
+ $opt['name'] = getPostParam('name');
+
+ appImage->setPostParam('opt' $opt);
+ appImage->createImage();
+
+ appNetwork->create_network();
+ appnetwork->list_network_ids();
+ appNetwork->create_subnet();
+
+ appCompute->listFlavors(); //to show all flavors with detail.
+ appCompute->listImages(); //to show all images with detail and to verify that the image was created successfully by the call above.
+
+ appCompute->setPostParam("name","Test");
+ appCompute->setPostParam("imageId","CREATED_ABOVE");
+ appCompute->setPostParam("flavorId","1");
+ appCompute->createServer();
+
+ }
/**
* Create a new image on a new server
*
@@ -124,4 +148,4 @@ class automating implements Core{
}
}
-?> \ No newline at end of file
+?>