forked from SumoLogic/sumologic-collector-chef-cookbook
/
resource_source.rb
51 lines (45 loc) · 2.38 KB
/
resource_source.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# frozen_string_literal: true
require 'chef/resource/lwrp_base'
require 'chef/platform/query_helpers'
class Chef
class Resource
class SumoSource < Chef::Resource::LWRPBase
provides :sumo_source if respond_to?(:provides)
default_action :create
actions :create
attribute :owner, regex: Chef::Config[:user_valid_regex]
attribute :group, regex: Chef::Config[:group_valid_regex]
attribute :mode, kind_of: [String, NilClass], default: nil
attribute :checksum, kind_of: [String, NilClass], default: nil
attribute :backup, kind_of: [Integer, FalseClass], default: 5
if Platform.windows?
attribute :inherits, kind_of: [TrueClass, FalseClass], default: true
attribute :rights, kind_of: Hash, default: nil
end
attribute :source_name, kind_of: String, name_attribute: true
attribute :source_type, kind_of: Symbol, required: true, equal_to: %i[local_file
remote_file
local_win_event_log
remote_win_event_log
syslog
script
docker_stats
graphite]
attribute :source_json_directory, kind_of: String, required: true
attribute :description, kind_of: String
attribute :category, kind_of: String
attribute :host_name, kind_of: String
attribute :time_zone, kind_of: String
attribute :automatic_date_parsing, kind_of: [TrueClass, FalseClass]
attribute :multiline_processing_enabled, kind_of: [TrueClass, FalseClass]
attribute :use_autoline_matching, kind_of: [TrueClass, FalseClass]
attribute :manual_prefix_regexp, kind_of: String
attribute :force_time_zone, kind_of: [TrueClass, FalseClass]
attribute :default_date_format, kind_of: String
attribute :filters, kind_of: Array
attribute :alive, kind_of: [TrueClass, FalseClass]
attribute :cuttoff_timestamp, kind_of: String
attribute :cuttoff_relative_time, kind_of: String
end
end
end