From 4caf47e9e2e29b97f664bc97e0f6a4d4bfe2ec84 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 20 May 2016 12:07:38 +0200 Subject: [PATCH] Status: allow IPs and move properties to base class We only allowed servers with the dns-name format, as such status server may often be in internal networks and with no hostname (testing, small network so no dns, ...) do not limit the configuration possibilities with no reason. Also move the base property part to the base Status class, all current plugins use server and port so no need for double declaration of format/descriptions. If a future plugin doesn't need them it can omit them by not returning the respective properties in the options method inherited by SectionConfig. Signed-off-by: Thomas Lamprecht --- PVE/Status/Graphite.pm | 8 -------- PVE/Status/Plugin.pm | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm index 407903b2..c125c908 100644 --- a/PVE/Status/Graphite.pm +++ b/PVE/Status/Graphite.pm @@ -20,14 +20,6 @@ sub type { sub properties { return { - server => { - type => 'string', format => 'dns-name', - description => "server dns name", - }, - port => { - type => 'integer', - description => "network port", - }, path => { type => 'string', format => 'graphite-path', description => "root graphite path (ex: proxmox.mycluster.mykey)", diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm index c11b6cc3..070467c3 100644 --- a/PVE/Status/Plugin.pm +++ b/PVE/Status/Plugin.pm @@ -26,6 +26,14 @@ my $defaultData = { type => 'boolean', optional => 1, }, + server => { + type => 'string', format => 'address', + description => "server dns name or IP address", + }, + port => { + type => 'integer', + description => "server network port", + }, }, };