[pve-devel] [RFC manager 1/2] node: add journal api
Dietmar Maurer
dietmar at proxmox.com
Mon May 13 16:32:47 CEST 2019
comments inline
> On 13 May 2019 at 14:49 Dominik Csapak <d.csapak at proxmox.com> wrote:
>
>
> this uses the new journalreader instead of journalctl, which is a bit
> faster and can read from/to cursor and returns a start/end cursor
>
> also you can give an unix epoch as time parameters
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> PVE/API2/Nodes.pm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> index df47be1f..7f13f809 100644
> --- a/PVE/API2/Nodes.pm
> +++ b/PVE/API2/Nodes.pm
> @@ -699,6 +699,58 @@ __PACKAGE__->register_method({
> return $lines;
> }});
>
> +__PACKAGE__->register_method({
> + name => 'journal',
> + path => 'journal',
> + method => 'GET',
> + description => "Read Journal",
> + proxyto => 'node',
> + permissions => {
> + check => ['perm', '/nodes/{node}', [ 'Sys.Syslog' ]],
> + },
> + protected => 1,
> + parameters => {
> + additionalProperties => 0,
> + properties => {
> + node => get_standard_option('pve-node'),
> + since => {
> + type=> 'number',
> + description => "Display all log since this UNIX epoch.",
> + optional => 1,
> + },
> + until => {
> + type=> 'number',
> + description => "Display all log until this UNIX epoch.",
> + optional => 1,
> + },
> + lastentries => {
Please can we get a description for all parameters?
> + type => 'integer',
> + optional => 1,
> + },
> + startcursor => {
> + type => 'string',
> + optional => 1,
> + },
> + endcursor => {
> + type => 'string',
> + optional => 1,
> + },
> + },
> + },
> + returns => {
> + type => 'array',
> + },
> + code => sub {
> + my ($param) = @_;
> +
> + my $rpcenv = PVE::RPCEnvironment::get();
> + my $user = $rpcenv->get_user();
> +
> + return PVE::Tools::read_journal($param->{since}, $param->{until},
> + $param->{last}, $param->{startcursor}, $param->{endcursor});
> +
> + }});
> +
> my $sslcert;
>
> my $shell_cmd_map = {
> --
> 2.11.0
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
More information about the pve-devel
mailing list