Skip to content

Commit 49f5fb5

Browse files
committed
Added support for recursion param on get all pools
1 parent a496430 commit 49f5fb5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All Notable changes to `php-lxd` will be documented in this file.
55
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

77

8+
# [0.18.2]
9+
10+
## Change
11+
- Support recursion param on get all pools
12+
813
# [0.18.1]
914

1015
## Added

src/Endpoint/Storage.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ protected function getEndpoint()
99
return '/storage-pools/';
1010
}
1111

12-
public function all()
12+
public function all(int $recursion = 0)
1313
{
14+
$config = [];
15+
16+
if ($recursion > 0) {
17+
$config["recursion"] = $recursion;
18+
}
19+
1420
$storagePools = [];
15-
foreach ($this->get($this->getEndpoint()) as $pool) {
21+
foreach ($this->get($this->getEndpoint(), $config) as $pool) {
1622
$storagePools[] = str_replace('/'.$this->client->getApiVersion().$this->getEndpoint(), '', $pool);
1723
}
1824
return $storagePools;

0 commit comments

Comments
 (0)