Skip to content

Commit d513271

Browse files
committed
Add the functionality to create & delete storage pool volume
1 parent 4ea3160 commit d513271

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All Notable changes to `php-lxd` will be documented in this file.
44

55
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

7+
# [0.20.0]
8+
## Added
9+
- Create storage pool volume
10+
- Delete storage pool volume
11+
712
# [0.19.1]
813

914
## Added

src/Endpoint/Storage/Volumes.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,25 @@ public function info(string $pool, string $path)
2727

2828
return $this->get($this->getEndpoint().$pool.'/volumes/'. $path, $config);
2929
}
30+
31+
public function create(string $pool, string $name, array $config)
32+
{
33+
$opts['name'] = $name;
34+
$opts["config"] = $config;
35+
36+
$httpConfig = [
37+
"project"=>$this->client->getProject()
38+
];
39+
40+
return $this->post($this->getEndpoint().$pool.'/volumes/custom', $opts, $httpConfig);
41+
}
42+
43+
public function remove(string $pool, string $name)
44+
{
45+
$httpConfig = [
46+
"project"=>$this->client->getProject()
47+
];
48+
49+
return $this->delete($this->getEndpoint().$pool . '/volumes/' . $name, [], $httpConfig);
50+
}
3051
}

0 commit comments

Comments
 (0)