diff --git a/src/cloud/azure/database/sqldatabase/mode/connections.pm b/src/cloud/azure/database/sqldatabase/mode/connections.pm index 40cfd3401..431e59cf7 100644 --- a/src/cloud/azure/database/sqldatabase/mode/connections.pm +++ b/src/cloud/azure/database/sqldatabase/mode/connections.pm @@ -87,6 +87,8 @@ sub check_options { $resource_group = $1; $server = $2; $resource = $2 . '/databases/' . $3; + } else { + $resource = $server . '/databases/' . $resource; } $self->{az_resource} = $resource; @@ -165,4 +167,4 @@ Critical threshold where '*' can be: 'connection-failed', 'connection-successfu =back -=cut \ No newline at end of file +=cut diff --git a/src/cloud/azure/database/sqldatabase/mode/deadlocks.pm b/src/cloud/azure/database/sqldatabase/mode/deadlocks.pm index 9bf4283b2..cc5d65ccf 100644 --- a/src/cloud/azure/database/sqldatabase/mode/deadlocks.pm +++ b/src/cloud/azure/database/sqldatabase/mode/deadlocks.pm @@ -71,6 +71,8 @@ sub check_options { $resource_group = $1; $server = $2; $resource = $2 . '/databases/' . $3; + } else { + $resource = $server . '/databases/' . $resource; } $self->{az_resource} = $resource; diff --git a/src/cloud/azure/database/sqldatabase/mode/sessions.pm b/src/cloud/azure/database/sqldatabase/mode/sessions.pm index 444932c2d..69463fed1 100644 --- a/src/cloud/azure/database/sqldatabase/mode/sessions.pm +++ b/src/cloud/azure/database/sqldatabase/mode/sessions.pm @@ -71,6 +71,8 @@ sub check_options { $resource_group = $1; $server = $2; $resource = $2 . '/databases/' . $3; + } else { + $resource = $server . '/databases/' . $resource; } $self->{az_resource} = $resource; @@ -148,4 +150,4 @@ Critical threshold. =back -=cut \ No newline at end of file +=cut diff --git a/src/cloud/azure/database/sqldatabase/mode/storage.pm b/src/cloud/azure/database/sqldatabase/mode/storage.pm index 0ccc097e5..c3cf70adf 100644 --- a/src/cloud/azure/database/sqldatabase/mode/storage.pm +++ b/src/cloud/azure/database/sqldatabase/mode/storage.pm @@ -79,6 +79,8 @@ sub check_options { $resource_group = $1; $server = $2; $resource = $2 . '/databases/' . $3; + } else { + $resource = $server . '/databases/' . $resource; } $self->{az_resource} = $resource; @@ -156,4 +158,4 @@ Critical threshold where '*' can be: 'usage-bytes','usage-percent'. =back -=cut \ No newline at end of file +=cut diff --git a/src/cloud/azure/database/sqldatabase/mode/workers.pm b/src/cloud/azure/database/sqldatabase/mode/workers.pm index 9b754767d..d06be415c 100644 --- a/src/cloud/azure/database/sqldatabase/mode/workers.pm +++ b/src/cloud/azure/database/sqldatabase/mode/workers.pm @@ -71,6 +71,8 @@ sub check_options { $resource_group = $1; $server = $2; $resource = $2 . '/databases/' . $3; + } else { + $resource = $server . '/databases/' . $resource; } $self->{az_resource} = $resource; @@ -148,4 +150,4 @@ Critical threshold. =back -=cut \ No newline at end of file +=cut diff --git a/src/cloud/azure/database/sqldatabase/plugin.pm b/src/cloud/azure/database/sqldatabase/plugin.pm index f6623465a..04489aac8 100644 --- a/src/cloud/azure/database/sqldatabase/plugin.pm +++ b/src/cloud/azure/database/sqldatabase/plugin.pm @@ -29,8 +29,7 @@ sub new { my $self = $class->SUPER::new( package => __PACKAGE__, %options ); bless $self, $class; - $self->{version} = '0.1'; - %{ $self->{modes} } = ( + $self->{modes} = { 'app-resources' => 'cloud::azure::database::sqldatabase::mode::appresources', 'connections' => 'cloud::azure::database::sqldatabase::mode::connections', 'discovery' => 'cloud::azure::database::sqldatabase::mode::discovery', @@ -39,7 +38,7 @@ sub new { 'sessions' => 'cloud::azure::database::sqldatabase::mode::sessions', 'storage' => 'cloud::azure::database::sqldatabase::mode::storage', 'workers' => 'cloud::azure::database::sqldatabase::mode::workers' - ); + }; $self->{custom_modes}->{azcli} = 'cloud::azure::custom::azcli'; $self->{custom_modes}->{api} = 'cloud::azure::custom::api'; @@ -50,7 +49,7 @@ sub init { my ($self, %options) = @_; $self->{options}->add_options(arguments => { - 'api-version:s' => { name => 'api_version', default => '2018-01-01' }, + 'api-version:s' => { name => 'api_version', default => '2018-01-01' } }); $self->SUPER::init(%options);