mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-16 14:49:31 +00:00
ceph: add get_storages helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
ae672a64ce
commit
f4aae93bbf
@ -714,6 +714,22 @@ my $add_storage = sub {
|
|||||||
PVE::API2::Storage::Config->create($storage_params);
|
PVE::API2::Storage::Config->create($storage_params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
my $get_storages = sub {
|
||||||
|
my ($pool) = @_;
|
||||||
|
|
||||||
|
my $cfg = PVE::Storage::config();
|
||||||
|
|
||||||
|
my $storages = $cfg->{ids};
|
||||||
|
my $res = {};
|
||||||
|
foreach my $storeid (keys %$storages) {
|
||||||
|
my $curr = $storages->{$storeid};
|
||||||
|
$res->{$storeid} = $storages->{$storeid}
|
||||||
|
if $curr->{type} eq 'rbd' && $pool eq $curr->{pool};
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
};
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'listmon',
|
name => 'listmon',
|
||||||
path => 'mon',
|
path => 'mon',
|
||||||
|
Loading…
Reference in New Issue
Block a user