Skip to content

Commit 029e942

Browse files
committed
Added support for vms + made a backwards compat instance class
1 parent adc2551 commit 029e942

File tree

9 files changed

+869
-794
lines changed

9 files changed

+869
-794
lines changed

src/Client.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class Client
6767
*/
6868
private $project = "default";
6969

70+
private $hasVmsCache = null;
71+
7072
/**
7173
* Create a new lxd client Instance
7274
*/
@@ -85,6 +87,14 @@ public function __construct(
8587
$this->addPlugin(new LxdExceptionThower());
8688

8789
$this->setUrl($this->url);
90+
91+
$extensions = $this->host->info()["api_extensions"];
92+
$this->hasVmsCache = in_array("virtual-machines", $extensions);
93+
}
94+
95+
public function hasVms()
96+
{
97+
return $this->hasVmsCache;
8898
}
8999

90100
/**

0 commit comments

Comments
 (0)