summaryrefslogtreecommitdiff
path: root/server/core/Image.php
diff options
context:
space:
mode:
Diffstat (limited to 'server/core/Image.php')
-rw-r--r--server/core/Image.php32
1 files changed, 22 insertions, 10 deletions
diff --git a/server/core/Image.php b/server/core/Image.php
index c9d9845..a986a40 100644
--- a/server/core/Image.php
+++ b/server/core/Image.php
@@ -67,18 +67,24 @@ class Image {
return $image;
}
-
+ /**
+ * Details about an image
+ *
+ * @param string $id
+ * id of the image
+ *
+ * @param array $opt
+ * options for the image creation
+ **/
public function update_image($id, array $opt){
$service = $this->oidentity;
-
- //OPTIONS A VOIR
$image = $service->getImage($id);
$image->update([
- 'minDisk' => 1,
- 'minRam' => 1,
- 'name' => $opt[name],
- 'protected' => false,
- 'visibility' => $opt[visibility],
+ 'minDisk' => $opt['minDisk'],
+ 'minRam' => $opt['minRam'],
+ 'name' => $opt['name'],
+ 'protected' => $opt['protected'],
+ 'visibility' => $opt['visibility'],
]);
return $image;
@@ -135,11 +141,17 @@ class Image {
$image->uploadData($stream);
}
- // RETOUR A VOIR
- public function download_image($id){
+ /**
+ * Download an image
+ *
+ * @param string $id
+ * identifier of the image
+ */
+ public function download_image($id){
$service = $this->oidentity;
$image = $service->getImage($id);
$stream = $image->downloadData();
+ return $stream;
}
}
?>