diff options
| author | yogg@epsina.com <evan.pisani@etudiant.univ-rennes1.fr> | 2016-01-31 17:47:06 +0100 |
|---|---|---|
| committer | yogg@epsina.com <evan.pisani@etudiant.univ-rennes1.fr> | 2016-01-31 17:47:06 +0100 |
| commit | 0db8d0ebbe36528346987cb21db67f31bfbe6017 (patch) | |
| tree | 006a5dc00df2e876d30b6ce9f1cedff9c77765f1 /server/core | |
| parent | 10a6cd146db2bc509059d07ff8b7887445524cab (diff) | |
Add activate_image, desactivate_image, uplaod_image
Diffstat (limited to 'server/core')
| -rw-r--r-- | server/core/Image.php | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index bf67e75..c9d9845 100644 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -8,27 +8,27 @@ class Image { protected $oidentity; //protected $plugins; - /* + /** * Constructor * * @param $openstack * * @param $options * - */ + **/ public function __construct($ostack, $options){ //, $apiP $this->oidentity = $ostack->imagesV2($options); //$this->plugins = $apiP; } - /* + /** * Details about an image * * @param array $opt * options for the image creation * - */ + **/ public function create_image(array $opt){ // VOIR COMMENT RENDRE LES CHAMPS OPTIONNELS (SAUF NAME) $image = $this->oidentity->createImage([ @@ -54,13 +54,13 @@ class Image { return $images; } - /* + /** * Details about an image * * @param string $id * identifier of the image * - */ + **/ public function image_details($id){ $service = $this->oidentity; $image = $service->getImage($id); @@ -84,27 +84,50 @@ class Image { return $image; } - // RETOUR A VOIR - public function delete_image($name){ + /** + * Delete an image + * + * @param string $id + * identifier of the image + **/ + public function delete_image($id){ $service = $this->oidentity; - $service->getImage($name)->delete(); + $service->getImage($id)->delete(); } - // RETOUR A VOIR + /** + * Resactive an image + * + * @param string $id + * identifier of the image + **/ public function reactivate_image($id){ $service = $this->oidentity; $image = $service->getImage($id); $image->reactivate(); } - // RETOUR A VOIR - public function desactivate_function($id){ + /** + * Desactive an image + * + * @param string $id + * identifier of the image + **/ + public function desactivate_image($id){ $service = $this->oidentity; $image = $service->getImage($id); $image->deactivate(); } - // RETOUR A VOIR + /** + * Upload an image + * + * @param string $id + * identifier of the image + * + * @param string $file_name + * path of the image + **/ public function upload_image($id, $file_name){ $service = $this->oidentity; $image = $service->getImage($id); |
