mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-09 20:51:06 +00:00
pveceph: change status from long JSON to ceph -s
Printing a lot of very detailed JSON output on the CLI is not very useful. Printing the `ceph -s` overview is much more suited to give an overview of the ceph cluster status. Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
parent
a7221f8b23
commit
1baeb2d130
@ -175,6 +175,26 @@ __PACKAGE__->register_method ({
|
|||||||
return undef;
|
return undef;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
__PACKAGE__->register_method ({
|
||||||
|
name => 'status',
|
||||||
|
path => 'status',
|
||||||
|
method => 'GET',
|
||||||
|
description => "Get Ceph Status.",
|
||||||
|
parameters => {
|
||||||
|
additionalProperties => 0,
|
||||||
|
},
|
||||||
|
returns => { type => 'null' },
|
||||||
|
code => sub {
|
||||||
|
PVE::Ceph::Tools::check_ceph_inited();
|
||||||
|
|
||||||
|
run_command(
|
||||||
|
['ceph', '-s'],
|
||||||
|
outfunc => sub { print "$_[0]\n" },
|
||||||
|
errfunc => sub { print STDERR "$_[0]\n" }
|
||||||
|
);
|
||||||
|
return undef;
|
||||||
|
}});
|
||||||
|
|
||||||
our $cmddef = {
|
our $cmddef = {
|
||||||
init => [ 'PVE::API2::Ceph', 'init', [], { node => $nodename } ],
|
init => [ 'PVE::API2::Ceph', 'init', [], { node => $nodename } ],
|
||||||
pool => {
|
pool => {
|
||||||
@ -229,11 +249,7 @@ our $cmddef = {
|
|||||||
stop => [ 'PVE::API2::Ceph', 'stop', [], { node => $nodename }, $upid_exit],
|
stop => [ 'PVE::API2::Ceph', 'stop', [], { node => $nodename }, $upid_exit],
|
||||||
install => [ __PACKAGE__, 'install', [] ],
|
install => [ __PACKAGE__, 'install', [] ],
|
||||||
purge => [ __PACKAGE__, 'purge', [] ],
|
purge => [ __PACKAGE__, 'purge', [] ],
|
||||||
status => [ 'PVE::API2::Ceph', 'status', [], { node => $nodename }, sub {
|
status => [ __PACKAGE__, 'status', []],
|
||||||
my $res = shift;
|
|
||||||
my $json = JSON->new->allow_nonref;
|
|
||||||
print $json->pretty->encode($res) . "\n";
|
|
||||||
}],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user