(plugin) cloud::azure::database::sqldatabase - fix --server option (#4366)

This commit is contained in:
qgarnier 2023-04-19 13:11:53 +02:00 committed by David Boucher
parent 22e22c811b
commit 983361b768
6 changed files with 17 additions and 8 deletions

View File

@ -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
=cut

View File

@ -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;

View File

@ -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
=cut

View File

@ -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
=cut

View File

@ -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
=cut

View File

@ -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);