CTOR-633 : plugin(storage::datacore::restapi) : Add little fixes and enhancements (#5058)

This commit is contained in:
Lucie Dubrunfaut 2024-06-07 14:39:17 +02:00 committed by GitHub
parent e91780d35e
commit 5dcacf11a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 5 deletions

View File

@ -102,6 +102,7 @@ sub settings {
# output : deserialized json from the api if not error found in http call.
sub request_api {
my ($self, %options) = @_;
$self->settings();
# datacore api require a ServerHost header with the hostname used to query the api to respond.
# authentication is http standard basic auth.

View File

@ -84,7 +84,7 @@ sub manage_selection {
my ($self, %options) = @_;
my $data = $options{custom}->request_api(
url_path => '/RestService/rest.svc/1.0/performances/' . $self->{option_results}->{pool_id},
url_path => '/RestService/rest.svc/1.0/performance/' . $self->{option_results}->{pool_id},
);
if (defined($data->[1])) {
$self->{output}->add_option_msg(short_msg => 'multiples pools found in api response, only one is expected. Please check pool_id and datacore versions.');
@ -100,17 +100,17 @@ __END__
=head1 MODE
Check Datacore pool space and over subscribed usage exposed through the rest api.
Check Datacore pool space and over subscribed usage exposed through the Rest API.
=over 8
=item B<--pool-id>
Id of the pool to check. See list-pool autodiscovery mode to list pools id (required).
Id of the pool to check. See list-pool auto discovery mode to list pools id (required).
=item B<--warning-oversubscribed> B<--critical-oversubscribed>
Warning and critical threshold on the number of Bytes suscribed over the real space of the pool.
Warning and critical threshold on the number of Bytes subscribed over the real space of the pool.
=item B<--warning-bytesallocatedpercentage> B<--critical-bytesallocatedpercentage>

View File

@ -1,5 +1,6 @@
--add-sysdesc
--api-password
--critical-bytesallocatedpercentage
--display-transform-dst
--display-transform-src
--exclude-fs
@ -13,6 +14,7 @@
--oid-display
--oid-extra-display
--oid-filter
--warning-bytesallocatedpercentage
2c
ADSL
Avigilon

View File

@ -41,7 +41,7 @@
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "RestService/rest.svc/1.0/performances/B5C140F5-6B13-4CAD-AF9D-F7C4172B3A1D:%7B4dec1b5a-2577-11e5-80c3-00155d651622%7D",
"endpoint": "RestService/rest.svc/1.0/performance/B5C140F5-6B13-4CAD-AF9D-F7C4172B3A1D:%7B4dec1b5a-2577-11e5-80c3-00155d651622%7D",
"responses": [
{
"uuid": "a5bf53e2-5edf-437e-a684-68315cfa7824",