Skip to content

Commit

Permalink
CTOR-633 : plugin(storage::datacore::restapi) : Add little fixes and …
Browse files Browse the repository at this point in the history
…enhancements (centreon#5058)
  • Loading branch information
lucie-dubrunfaut authored Jun 7, 2024
1 parent e91780d commit 5dcacf1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/storage/datacore/restapi/custom/api.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/storage/datacore/restapi/mode/poolspaceusage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand All @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions tests/resources/spellcheck/stopwords.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--add-sysdesc
--api-password
--critical-bytesallocatedpercentage
--display-transform-dst
--display-transform-src
--exclude-fs
Expand All @@ -13,6 +14,7 @@
--oid-display
--oid-extra-display
--oid-filter
--warning-bytesallocatedpercentage
2c
ADSL
Avigilon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5dcacf1

Please sign in to comment.