diff --git a/storage/hp/storeonce/restapi/custom/api.pm b/storage/hp/storeonce/restapi/custom/api.pm index 95a225f22..53418404c 100644 --- a/storage/hp/storeonce/restapi/custom/api.pm +++ b/storage/hp/storeonce/restapi/custom/api.pm @@ -126,6 +126,7 @@ sub get { $self->settings(); my $response = $self->{http}->request(url_path => '/storeonceservices' . $options{path}, critical_status => '', warning_status => ''); + my $content; eval { $content = XMLin($response, ForceArray => $options{ForceArray}, KeyAttr => []); diff --git a/storage/hp/storeonce/restapi/mode/clusterusage.pm b/storage/hp/storeonce/restapi/mode/clusterusage.pm index 05b4a3260..2d99de0a8 100644 --- a/storage/hp/storeonce/restapi/mode/clusterusage.pm +++ b/storage/hp/storeonce/restapi/mode/clusterusage.pm @@ -148,15 +148,14 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' }, - "critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, - }); - + $options{options}->add_options(arguments => { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' }, + "critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + return $self; } @@ -194,15 +193,16 @@ sub manage_selection { next; } - my $total = (defined($entry->{properties}->{capacity})) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes}; - my $used = $total - (defined($entry->{properties}->{freeSpace})) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes}; + my $total = defined($entry->{properties}->{capacity}) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes}; + my $used = $total - (defined($entry->{properties}->{freeSpace}) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes}); $self->{cluster}->{$entry->{properties}->{serialNumber}} = { display => $entry->{properties}->{applianceName}, health => $mapping_health_level{$entry->{properties}->{healthLevel}}, total => $total, used => $used, - dedup => $entry->{properties}->{dedupeRatio} }; + dedup => $entry->{properties}->{dedupeRatio} + }; } } diff --git a/storage/hp/storeonce/restapi/mode/fcsusage.pm b/storage/hp/storeonce/restapi/mode/fcsusage.pm index 2c0487144..714de7392 100644 --- a/storage/hp/storeonce/restapi/mode/fcsusage.pm +++ b/storage/hp/storeonce/restapi/mode/fcsusage.pm @@ -95,12 +95,11 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' }, - "critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' }, - }); + $options{options}->add_options(arguments => { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' }, + }); return $self; } @@ -155,7 +154,8 @@ sub manage_selection { is_online => $entry->{properties}->{isOnline} eq 'true' ? 1 : 0, used => $entry->{properties}->{diskBytes}, dedup => $entry->{properties}->{dedupeRatio}, - num_items => $entry->{properties}->{numItems} }; + num_items => $entry->{properties}->{numItems} + }; } } diff --git a/storage/hp/storeonce/restapi/mode/nasusage.pm b/storage/hp/storeonce/restapi/mode/nasusage.pm index 9306468f0..cb5d2c9de 100644 --- a/storage/hp/storeonce/restapi/mode/nasusage.pm +++ b/storage/hp/storeonce/restapi/mode/nasusage.pm @@ -95,15 +95,14 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-nas-status:s" => { name => 'warning_nas_status', default => '%{health} =~ /warning/i' }, - "critical-nas-status:s" => { name => 'critical_nas_status', default => '%{health} =~ /critical/i' }, - "warning-share-status:s" => { name => 'warning_share_status', default => '%{health} =~ /warning/i' }, - "critical-share-status:s" => { name => 'critical_share_status', default => '%{health} =~ /critical/i' }, - }); - + $options{options}->add_options(arguments => { + "filter-name:s" => { name => 'filter_name' }, + "warning-nas-status:s" => { name => 'warning_nas_status', default => '%{health} =~ /warning/i' }, + "critical-nas-status:s" => { name => 'critical_nas_status', default => '%{health} =~ /critical/i' }, + "warning-share-status:s" => { name => 'warning_share_status', default => '%{health} =~ /warning/i' }, + "critical-share-status:s" => { name => 'critical_share_status', default => '%{health} =~ /critical/i' }, + }); + return $self; } diff --git a/storage/hp/storeonce/restapi/mode/servicesetusage.pm b/storage/hp/storeonce/restapi/mode/servicesetusage.pm index b5cdd6eb9..960393114 100644 --- a/storage/hp/storeonce/restapi/mode/servicesetusage.pm +++ b/storage/hp/storeonce/restapi/mode/servicesetusage.pm @@ -151,15 +151,14 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' }, - "critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, - }); - + $options{options}->add_options(arguments => { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' }, + "critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + }); + return $self; } @@ -204,7 +203,8 @@ sub manage_selection { replication_health => $mapping_health_level{$entry->{properties}->{repHealthLevel}}, total => $entry->{properties}->{capacityBytes}, used => $entry->{properties}->{capacityBytes} - $entry->{properties}->{freeBytes}, - dedup => $entry->{properties}->{dedupeRatio} }; + dedup => $entry->{properties}->{dedupeRatio} + }; } }