From 00a586629695f55b9af5839c7b25ab943f71feb7 Mon Sep 17 00:00:00 2001 From: Simon Bomm Date: Tue, 26 May 2020 09:34:58 +0200 Subject: [PATCH] fix(pvx)compat-with-last-api(2) (#2014) --- apps/pvx/restapi/mode/httphits.pm | 5 +++++ apps/pvx/restapi/mode/networkconnection.pm | 5 +++++ apps/pvx/restapi/mode/networktraffic.pm | 5 +++++ apps/pvx/restapi/mode/networkuserexperience.pm | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/pvx/restapi/mode/httphits.pm b/apps/pvx/restapi/mode/httphits.pm index fd49502a3..16e1b99b0 100644 --- a/apps/pvx/restapi/mode/httphits.pm +++ b/apps/pvx/restapi/mode/httphits.pm @@ -88,6 +88,11 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); + if (!defined($self->{option_results}->{from}) || $self->{option_results}->{from} eq '') { + $self->{output}->add_option_msg(short_msg => "Need to specify --from option as a PVQL object."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{instance}) || $self->{option_results}->{instance} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --instance option as a PVQL object."); $self->{output}->option_exit(); diff --git a/apps/pvx/restapi/mode/networkconnection.pm b/apps/pvx/restapi/mode/networkconnection.pm index c0692da69..792005e08 100644 --- a/apps/pvx/restapi/mode/networkconnection.pm +++ b/apps/pvx/restapi/mode/networkconnection.pm @@ -97,6 +97,11 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); + if (!defined($self->{option_results}->{from}) || $self->{option_results}->{from} eq '') { + $self->{output}->add_option_msg(short_msg => "Need to specify --from option as a PVQL object."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{instance}) || $self->{option_results}->{instance} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --instance option as a PVQL object."); $self->{output}->option_exit(); diff --git a/apps/pvx/restapi/mode/networktraffic.pm b/apps/pvx/restapi/mode/networktraffic.pm index aecdbda04..41ec25d51 100644 --- a/apps/pvx/restapi/mode/networktraffic.pm +++ b/apps/pvx/restapi/mode/networktraffic.pm @@ -132,6 +132,11 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); + if (!defined($self->{option_results}->{from}) || $self->{option_results}->{from} eq '') { + $self->{output}->add_option_msg(short_msg => "Need to specify --from option as a PVQL object."); + $self->{output}->option_exit(); + } + if (!defined($self->{option_results}->{instance}) || $self->{option_results}->{instance} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --instance option as a PVQL object."); $self->{output}->option_exit(); diff --git a/apps/pvx/restapi/mode/networkuserexperience.pm b/apps/pvx/restapi/mode/networkuserexperience.pm index 6110bbfbc..afe36432e 100644 --- a/apps/pvx/restapi/mode/networkuserexperience.pm +++ b/apps/pvx/restapi/mode/networkuserexperience.pm @@ -75,7 +75,7 @@ sub check_options { $self->{output}->option_exit(); } - if (!defined($self->{option_results}->{from}) || $self->{option_results}->{instance} eq '') { + if (!defined($self->{option_results}->{instance}) || $self->{option_results}->{instance} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --instance option as a PVQL object."); $self->{output}->option_exit(); }