id = $id; if ($config) { $config = self::asArray($config); $this->location = key($config); $ex = explode(":", $this->location ); $config['storage'] = $ex[0]; $this->setAttributes($config); } } /** * @return mixed */ public function getPath() { return $this->path; } /** * @param mixed $path */ public function setPath($path) { $this->path = $path; } /** * @return mixed */ public function getStorage() { return $this->storage; } /** * @param mixed $storage */ public function setStorage($storage) { $this->storage = $storage; } /** * @return mixed */ public function getMedia() { return $this->media; } /** * @param mixed $media */ public function setMedia($media) { $this->media = $media; } public function unmount(){ return $this->api()->put($this->getPath(),[$this->id => 'none,media=cdrom' ]); } public function mount(){ return $this->api()->put($this->getPath(),[$this->id => "{$this->storage}:cloudinit,format=raw" ]); } }