Update validators for CustomVarObject

fixes #7542
This commit is contained in:
Gunnar Beutner 2015-02-10 08:53:15 +01:00
parent 898e385891
commit 9de7da4d2a
3 changed files with 15 additions and 13 deletions

View File

@ -31,8 +31,6 @@
%attribute %array "templates" { %attribute %array "templates" {
%attribute %string "*" %attribute %string "*"
}, },
%attribute %dictionary "vars"
} }
%type Logger { %type Logger {

View File

@ -25,7 +25,11 @@
%attribute %number "update_interval" %attribute %number "update_interval"
} }
%type Checkable { %type CustomVarObject {
%attribute %dictionary "vars",
}
%type Checkable %inherits CustomVarObject {
%validator "ValidateCheckableCheckInterval", %validator "ValidateCheckableCheckInterval",
%attribute %string "display_name", %attribute %string "display_name",
@ -70,7 +74,7 @@
%attribute %string "address6", %attribute %string "address6",
} }
%type HostGroup { %type HostGroup %inherits CustomVarObject {
%attribute %string "display_name" %attribute %string "display_name"
%attribute %array "groups" { %attribute %array "groups" {
@ -93,7 +97,7 @@
}, },
} }
%type ServiceGroup { %type ServiceGroup %inherits CustomVarObject {
%attribute %string "display_name" %attribute %string "display_name"
%attribute %array "groups" { %attribute %array "groups" {
@ -105,7 +109,7 @@
%attribute %string "action_url", %attribute %string "action_url",
} }
%type Notification { %type Notification %inherits CustomVarObject {
%validator "ValidateNotificationFilters" %validator "ValidateNotificationFilters"
%validator "ValidateNotificationUsers" %validator "ValidateNotificationUsers"
@ -143,7 +147,7 @@
%attribute %name(Endpoint) "command_endpoint", %attribute %name(Endpoint) "command_endpoint",
} }
%type User { %type User %inherits CustomVarObject {
%validator "ValidateUserFilters" %validator "ValidateUserFilters"
%attribute %string "display_name", %attribute %string "display_name",
@ -165,7 +169,7 @@
%attribute %string "pager", %attribute %string "pager",
} }
%type UserGroup { %type UserGroup %inherits CustomVarObject {
%attribute %string "display_name", %attribute %string "display_name",
%attribute %array "groups" { %attribute %array "groups" {
@ -173,7 +177,7 @@
}, },
} }
%type TimePeriod { %type TimePeriod %inherits CustomVarObject {
%attribute %string "display_name", %attribute %string "display_name",
%require "update", %require "update",
@ -187,7 +191,7 @@
/* } */ /* } */
} }
%type Command { %type Command %inherits CustomVarObject {
%validator "ValidateCommandAttributes", %validator "ValidateCommandAttributes",
%require "execute", %require "execute",
@ -235,7 +239,7 @@
} }
%type ScheduledDowntime { %type ScheduledDowntime %inherits CustomVarObject {
%require "host_name", %require "host_name",
%attribute %name(Host) "host_name", %attribute %name(Host) "host_name",
%attribute %string "service_name", %attribute %string "service_name",
@ -257,7 +261,7 @@
}, },
} }
%type Dependency { %type Dependency %inherits CustomVarObject {
%validator "ValidateDependencyFilters" %validator "ValidateDependencyFilters"
%require "parent_host_name", %require "parent_host_name",

View File

@ -23,7 +23,7 @@
namespace icinga namespace icinga
{ {
class IcingaStatusWriter : CustomVarObject class IcingaStatusWriter : DynamicObject
{ {
[config] String status_path { [config] String status_path {
default {{{ return Application::GetLocalStateDir() + "/cache/icinga2/status.json"; }}} default {{{ return Application::GetLocalStateDir() + "/cache/icinga2/status.json"; }}}