summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorstupidon <bhupendra.siyag@gmail.com>2016-02-28 10:48:28 +0100
committerstupidon <bhupendra.siyag@gmail.com>2016-02-28 10:48:28 +0100
commit869538121bdc07adba1637252bf1d7338f1a27de (patch)
tree44bb31c93694677bc4292ab8f1110aa4b92879bf /server
parent07aea6ce3991db4a87d16663412aecde199adbc0 (diff)
updated Compute.php
Diffstat (limited to 'server')
-rw-r--r--server/core/Compute.php146
1 files changed, 146 insertions, 0 deletions
diff --git a/server/core/Compute.php b/server/core/Compute.php
index 8d1c8b6..3df3ada 100644
--- a/server/core/Compute.php
+++ b/server/core/Compute.php
@@ -1 +1,147 @@
+<?php
+//namespace istic-openstack\Server\core;
+// TODO introduce error-handling based on errors specific to the compute module
+use OpenStack\Common\Error;
+
+class compute
+{
+ /** @var App $app protected, contains the main app object */
+ protected $app;
+
+ /** @var OpenStack\Identity $libClass protected, contains the library Compute object */
+ protected $libClass;
+
+
+ public function __construct($app)
+ {
+ $this->app = $app;
+ $this->libClass = $app->getLibClass("Compute");
+ }
+ /**
+ * List servers.
+ * @return array
+ */
+ public function listServers()
+ {
+ $servers = $this->libClass->listServers();
+ return $servers;
+ }
+ /**
+ * List flavors.
+ * @return array
+ */
+ public function listFlavors()
+ {
+ $flavors = $this->libClass->listFlavors();
+ return $flavors;
+ }
+ /**
+ * List images.
+ * @return array
+ */
+ public function listImages()
+ {
+ $images = $this->libClass->listImages();
+ return $images;
+ }
+ /**
+ * Create server.
+ * @return array
+
+ public function createServer(array $options)
+ {
+
+ $server = $this->libClass->createServer();
+ }
+ /**
+ * Get server details.
+ * @return array
+ */
+ public function getServer(array $options = [])
+ {
+ $server = $this->libClass->getServer($options);
+ return $server;
+ }
+ /**
+ * Get flavor details.
+ * @return array
+ */
+ public function getFlavor(array $options = [])
+ {
+ $flavor = $this->libClass->getFlavor($options);
+ return $flavor;
+ }
+ /**
+ * Get image details.
+ * @return array
+ */
+ public function getImage(array $options = [])
+ {
+ $image = $this->libClass->getImage($options);
+ return $image;
+ }
+ //working on tests
+ public function update()
+ {
+ $image = $this->app->getServer(array $options = []);
+
+ }
+ public function delete()
+ {
+ //TODO
+ }
+ public function changePassword($newPassword)
+ {
+ //TODO
+ }
+ public function reboot($type = Enum::REBOOT_SOFT)
+ {
+ //TODO
+ }
+ public function rebuild(array $options)
+ {
+ //TODO
+ }
+ public function resize($flavorId)
+ {
+ //TODO
+ }
+ public function confirmResize()
+ {
+ //TODO
+ }
+ public function revertResize()
+ {
+ //TODO
+ }
+ public function createImage(array $options)
+ {
+ //TODO
+ }
+ public function listAddresses(array $options = [])
+ {
+ //TODO
+ }
+ public function getMetadata()
+ {
+ //TODO
+ }
+ public function resetMetadata(array $metadata)
+ {
+ //TODO
+ }
+ public function mergeMetadata(array $metadata)
+ {
+ //TODO
+ }
+ public function getMetadataItem($key)
+ {
+ //TODO
+ }
+ public function deleteMetadataItem($key)
+ {
+ //TODO
+ }
+
+}