Skip to content

Commit a496430

Browse files
committed
Add get volume info
1 parent 8f1aa1d commit a496430

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-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.1]
9+
10+
## Added
11+
- Get volume info
12+
813
# [0.18.0]
914

1015
## Added

src/Endpoint/Storage/Volumes.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ protected function getEndpoint()
1111
return '/storage-pools/';
1212
}
1313

14+
public function all($pool)
15+
{
16+
return $this->get($this->getEndpoint().$pool.'/volumes');
17+
}
18+
1419
/**
20+
* $path for /1.0/storage-pools/default/volumes/custom/test would be custom/test
1521
*/
16-
public function info($name)
22+
public function info(string $pool, string $path)
1723
{
18-
return $this->get($this->getEndpoint().$name.'/volumes');
24+
$config = [
25+
"project"=>$this->client->getProject()
26+
];
27+
28+
return $this->get($this->getEndpoint().$pool.'/volumes/'. $path, $config);
1929
}
2030
}

0 commit comments

Comments
 (0)