|
|
@@ -96,8 +96,7 @@ class SnapshotKvm extends AbstractObject
|
|
|
public function setPath($path)
|
|
|
{
|
|
|
|
|
|
- if (!preg_match('/\/snapshot/', $path))
|
|
|
- {
|
|
|
+ if (!preg_match('/\/snapshot/', $path)) {
|
|
|
throw new proxmox\ProxmoxApiException(sprintf("Snapshot Path ('%s') is not valid", $path));
|
|
|
}
|
|
|
|
|
|
@@ -105,8 +104,7 @@ class SnapshotKvm extends AbstractObject
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
- public function create()
|
|
|
- {
|
|
|
+ public function create() {
|
|
|
|
|
|
if (empty($this->path))
|
|
|
throw new proxmox\ProxmoxApiException('Snapshot [path] - property is missing and it is not optional');
|
|
|
@@ -119,32 +117,27 @@ class SnapshotKvm extends AbstractObject
|
|
|
return $this->api()->post($this->path, $request);
|
|
|
}
|
|
|
|
|
|
- public function update()
|
|
|
- {
|
|
|
+ public function update() {
|
|
|
|
|
|
if (empty($this->path))
|
|
|
throw new proxmox\ProxmoxApiException('Snapshot [path] - property is missing and it is not optional');
|
|
|
return $this->api()->put($this->path . "/config", array("description" => $this->getDescription()));
|
|
|
}
|
|
|
|
|
|
- public function rollback()
|
|
|
- {
|
|
|
+ public function rollback() {
|
|
|
|
|
|
if (empty($this->path))
|
|
|
throw new proxmox\ProxmoxApiException('Snapshot [path] - property is missing and it is not optional');
|
|
|
return $this->api()->post($this->path . '/rollback');
|
|
|
}
|
|
|
|
|
|
- public function delete()
|
|
|
- {
|
|
|
-
|
|
|
+ public function delete() {
|
|
|
if (empty($this->path))
|
|
|
throw new proxmox\ProxmoxApiException('Snapshot [path] - property is missing and it is not optional');
|
|
|
return $this->api()->delete($this->path);
|
|
|
}
|
|
|
|
|
|
- public function getAttributes()
|
|
|
- {
|
|
|
+ public function getAttributes() {
|
|
|
|
|
|
return array(
|
|
|
"name" => $this->getName(),
|