// GetConfigPolicy returns a config policy
func (LibvirtCollector) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	policy := plugin.NewConfigPolicy()

	policy.AddNewStringRule([]string{"intel", "libvirt"}, "uri", false, plugin.SetDefaultString(defaultURI))
	policy.AddNewBoolRule([]string{"intel", "libvirt"}, "nova", false, plugin.SetDefaultBool(false))

	return *policy, nil
}
func (f *GraphitePublisher) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	policy := plugin.NewConfigPolicy()

	policy.AddNewStringRule([]string{""}, "server", true)
	policy.AddNewIntRule([]string{""}, "port", false, plugin.SetDefaultInt(2003))
	policy.AddNewStringRule([]string{""}, "prefix_tags", false, plugin.SetDefaultString("plugin_running_on"))
	policy.AddNewStringRule([]string{""}, "prefix", false)
	policy.AddNewStringRule([]string{""}, "log-level", false)

	return *policy, nil
}
Exemple #3
0
func (f *filePublisher) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	policy := plugin.NewConfigPolicy()

	err := policy.AddNewStringRule([]string{""}, "file", true)
	if err != nil {
		return *policy, err
	}

	err = policy.AddNewBoolRule([]string{}, debug, false)

	return *policy, err
}
Exemple #4
0
// GetConfigPolicy returns a ConfigPolicy for testing
func (f *Mock) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	p := plugin.NewConfigPolicy()

	err := p.AddNewStringRule([]string{"intel", "mock", "foo"}, "name", false, plugin.SetDefaultString("bob"))
	if err != nil {
		return *p, err
	}

	err = p.AddNewStringRule([]string{"intel", "mock", "foo"}, "password", true)

	return *p, err
}
Exemple #5
0
func (p *passthruProcessor) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	policy := plugin.NewConfigPolicy()
	return *policy, policy.AddNewBoolRule([]string{""}, debug, false)
}