metrics: influx: special case 'health' api path i _get_v2url

the forwards compatible api of 1.8 only contains this path
(not api/v2/health) and it it also contained in the v2 api

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-03-15 15:26:46 +01:00
parent c69faba311
commit c7777408ea

View File

@ -175,7 +175,12 @@ sub _get_v2url {
if ($api_prefix ne '' && $api_prefix =~ m!^/*(.+)/*$!) {
$api_prefix = "/$1/";
}
return "${proto}://${host}:${port}${api_prefix}api/v2/${api_path}";
if ($api_path ne 'health') {
$api_path = "api/v2/${api_path}";
}
return "${proto}://${host}:${port}${api_prefix}${api_path}";
}
sub _connect {