Module: Fluent::KinesisHelper::ClassMethods
- Defined in:
- lib/fluent/plugin/kinesis_helper/class_methods.rb
Instance Method Summary collapse
- #api? ⇒ Boolean
- #config_param_for_batch_request ⇒ Object
- #config_param_for_credentials ⇒ Object
- #config_param_for_debug ⇒ Object
- #config_param_for_firehose ⇒ Object
- #config_param_for_format ⇒ Object
- #config_param_for_producer ⇒ Object
- #config_param_for_sdk ⇒ Object
- #config_param_for_streams ⇒ Object
- #kpl? ⇒ Boolean
- #request_type ⇒ Object
Instance Method Details
#api? ⇒ Boolean
112 113 114 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 112 def api? [:streams, :firehose].include?(request_type) end |
#config_param_for_batch_request ⇒ Object
97 98 99 100 101 102 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 97 def config_param_for_batch_request config_param :retries_on_batch_request, :integer, default: 3 config_param :reset_backoff_if_success, :bool, default: true config_param :batch_request_max_count, :integer, default: const_get(:BatchRequestLimitCount) config_param :batch_request_max_size, :integer, default: const_get(:BatchRequestLimitSize) end |
#config_param_for_credentials ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 78 def config_param_for_credentials config_param :aws_key_id, :string, default: nil, secret: true config_param :aws_sec_key, :string, default: nil, secret: true config_section :shared_credentials, multi: false do config_param :profile_name, :string, default: nil config_param :path, :string, default: nil end config_section :assume_role_credentials, multi: false do config_param :role_arn, :string, secret: true config_param :external_id, :string, default: nil, secret: true end end |
#config_param_for_debug ⇒ Object
104 105 106 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 104 def config_param_for_debug config_param :debug, :bool, default: false end |
#config_param_for_firehose ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 32 def config_param_for_firehose const_set(:RequestType, :firehose) const_set(:BatchRequestLimitCount, 500) const_set(:BatchRequestLimitSize, 4 * 1024 * 1024) config_param :delivery_stream_name, :string config_param :region, :string, default: nil config_param :append_new_line, :bool, default: true config_param_for_sdk config_param_for_credentials config_param_for_format config_param_for_batch_request config_param_for_debug end |
#config_param_for_format ⇒ Object
91 92 93 94 95 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 91 def config_param_for_format config_param :formatter, :string, default: 'json' config_param :data_key, :string, default: nil config_param :log_truncate_max_size, :integer, default: 0 end |
#config_param_for_producer ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 46 def config_param_for_producer const_set(:RequestType, :producer) config_param :stream_name, :string, default: nil config_param :stream_name_prefix, :string, default: nil config_param :region, :string, default: nil config_param :partition_key, :string, default: nil config_param_for_credentials config_param_for_format config_param_for_debug config_section :kinesis_producer, multi: false do require 'kinesis_producer' type_map = { Protobuf::Field::BoolField => :bool, Protobuf::Field::Uint64Field => :integer, Protobuf::Field::StringField => :string, } KinesisProducer::ConfigurationFields.each do |field| next if field.name == 'region' type = type_map[field.type_class] config_param field.name, type, default: field.default_value end config_param :credentials_refresh_delay, :integer, default: 5000 end end |
#config_param_for_sdk ⇒ Object
72 73 74 75 76 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 72 def config_param_for_sdk config_param :http_proxy, :string, default: nil, secret: true config_param :endpoint, :string, default: nil config_param :ssl_verify_peer, :bool, default: true end |
#config_param_for_streams ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 18 def config_param_for_streams const_set(:RequestType, :streams) const_set(:BatchRequestLimitCount, 500) const_set(:BatchRequestLimitSize, 5 * 1024 * 1024) config_param :stream_name, :string config_param :region, :string, default: nil config_param :partition_key, :string, default: nil config_param_for_sdk config_param_for_credentials config_param_for_format config_param_for_batch_request config_param_for_debug end |
#kpl? ⇒ Boolean
116 117 118 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 116 def kpl? [:producer].include?(request_type) end |
#request_type ⇒ Object
108 109 110 |
# File 'lib/fluent/plugin/kinesis_helper/class_methods.rb', line 108 def request_type const_get(:RequestType) end |