Skip to content

Commit

Permalink
plugin::filter::target - Use data types
Browse files Browse the repository at this point in the history
  • Loading branch information
juniorsysadmin committed Nov 12, 2017
1 parent d06acc6 commit a171457
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
12 changes: 4 additions & 8 deletions manifests/plugin/filter/target.pp
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# https://collectd.org/wiki/index.php/Chains
define collectd::plugin::filter::target (
$chain,
$plugin,
$options = undef,
$rule = undef,
String $chain,
Collectd::Filter::Target $plugin,
Optional[Hash] $options = undef,
Optional[String] $rule = undef,
) {

include ::collectd
include ::collectd::plugin::filter

unless $plugin in ['return','stop','write', 'jump'] or $plugin in $collectd::plugin::filter::plugin_targets {
fail("Unknown rule plugin '${plugin}' provided")
}

# Load plugins
if $plugin in $collectd::plugin::filter::plugin_targets {
$order = 30
Expand Down
2 changes: 2 additions & 0 deletions types/filter/builtintarget.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://collectd.org/wiki/index.php/Chains#Built-in_targets
type Collectd::Filter::Builtintarget = Enum['jump', 'stop', 'return', 'write']
2 changes: 2 additions & 0 deletions types/filter/plugintarget.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://collectd.org/wiki/index.php/Table_of_Targets
type Collectd::Filter::Plugintarget = Enum['notification', 'replace', 'scale', 'set']
2 changes: 2 additions & 0 deletions types/filter/target.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://collectd.org/wiki/index.php/Chains
type Collectd::Filter::Target = Variant[Collectd::Plugin::Filter::Builtintarget, Collectd::Plugin::Filter::Plugintarget]

0 comments on commit a171457

Please sign in to comment.