Add apiinfo helper to pvesm
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
dc3655a1a5
commit
5f184292fe
@ -47,6 +47,30 @@ sub setup_environment {
|
|||||||
PVE::RPCEnvironment->setup_default_cli_env();
|
PVE::RPCEnvironment->setup_default_cli_env();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__PACKAGE__->register_method ({
|
||||||
|
name => 'apiinfo',
|
||||||
|
path => 'apiinfo',
|
||||||
|
method => 'GET',
|
||||||
|
description => "Returns APIVER and APIAGE.",
|
||||||
|
parameters => {
|
||||||
|
additionalProperties => 0,
|
||||||
|
properties => {},
|
||||||
|
},
|
||||||
|
returns => {
|
||||||
|
type => 'object',
|
||||||
|
properties => {
|
||||||
|
apiver => { type => 'integer' },
|
||||||
|
apiage => { type => 'integer' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
code => sub {
|
||||||
|
return {
|
||||||
|
apiver => PVE::Storage::APIVER,
|
||||||
|
apiage => PVE::Storage::APIAGE,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'path',
|
name => 'path',
|
||||||
path => 'path',
|
path => 'path',
|
||||||
@ -778,6 +802,12 @@ our $cmddef = {
|
|||||||
extractconfig => [__PACKAGE__, 'extractconfig', ['volume']],
|
extractconfig => [__PACKAGE__, 'extractconfig', ['volume']],
|
||||||
export => [ __PACKAGE__, 'export', ['volume', 'format', 'filename']],
|
export => [ __PACKAGE__, 'export', ['volume', 'format', 'filename']],
|
||||||
import => [ __PACKAGE__, 'import', ['volume', 'format', 'filename']],
|
import => [ __PACKAGE__, 'import', ['volume', 'format', 'filename']],
|
||||||
|
apiinfo => [ __PACKAGE__, 'apiinfo', [], {}, sub {
|
||||||
|
my $res = shift;
|
||||||
|
|
||||||
|
print "APIVER $res->{apiver}\n";
|
||||||
|
print "APIAGE $res->{apiage}\n";
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
Reference in New Issue
Block a user