Add support for periodic notification

Change-Id: I024969c5e9568898db3401292a93535491fd45c6
This commit is contained in:
Brad Klein 2016-06-09 12:46:31 -06:00
parent 1a4ae8a903
commit 46c945e2f8
3 changed files with 12 additions and 0 deletions

View File

@ -58,6 +58,9 @@
# [*vertica_db_hint*]
# database hint to pass to vertica
#
# [*valid_notif_periods*]
# list of valid notification periods in seconds (defaults to 60)
#
# [*zookeeper_servers*]
# list of zookeeper servers and ports
#
@ -79,6 +82,7 @@ class monasca::api (
$role_delegate = 'monitoring-delegate',
$roles_default = ['admin','monasca-user','_member_'],
$roles_agent = ['monasca-agent'],
$valid_notif_periods = [60],
$vertica_db_hint = '',
$zookeeper_servers = undef,
) {

View File

@ -8,6 +8,13 @@ eventsTopic: events
maxQueryLimit: <%= @max_query_limit %>
<% if @valid_notif_periods and not @valid_notif_periods.empty? -%>
validNotificationPeriods:
<% @valid_notif_periods.each do |period| -%>
- <%= period %>
<%- end -%>
<% end -%>
kafka:
brokerUris:
- <%= @kafka_brokers %>

View File

@ -121,6 +121,7 @@ CREATE TABLE IF NOT EXISTS `notification_method` (
`name` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`period` int NOT NULL DEFAULT 0,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),