Class: OutputConfiguration
- Inherits:
-
Object
- Object
- OutputConfiguration
- Defined in:
- lib/fluent/plugin/conffile.rb
Instance Attribute Summary collapse
-
#auth_type ⇒ Object
readonly
Returns the value of attribute auth_type.
-
#azure_cloud ⇒ Object
readonly
Returns the value of attribute azure_cloud.
-
#client_app_id ⇒ Object
readonly
Returns the value of attribute client_app_id.
-
#client_app_secret ⇒ Object
readonly
Returns the value of attribute client_app_secret.
-
#database_name ⇒ Object
readonly
Returns the value of attribute database_name.
-
#kusto_endpoint ⇒ Object
readonly
Returns the value of attribute kusto_endpoint.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#managed_identity_client_id ⇒ Object
readonly
Returns the value of attribute managed_identity_client_id.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
-
#workload_identity_client_id ⇒ Object
readonly
Returns the value of attribute workload_identity_client_id.
-
#workload_identity_tenant_id ⇒ Object
readonly
Returns the value of attribute workload_identity_tenant_id.
-
#workload_identity_token_file_path ⇒ Object
readonly
Returns the value of attribute workload_identity_token_file_path.
Instance Method Summary collapse
- #aad_endpoint ⇒ Object
-
#initialize(opts = {}) ⇒ OutputConfiguration
constructor
A new instance of OutputConfiguration.
- #print_missing_parameter_message_and_raise(param_name) ⇒ Object
- #validate_configuration ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ OutputConfiguration
Returns a new instance of OutputConfiguration.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fluent/plugin/conffile.rb', line 21 def initialize(opts = {}) # Initialize configuration options and logger @logger_path = opts[:logger_path] @logger = initialize_logger @client_app_id = opts[:client_app_id] @client_app_secret = opts[:client_app_secret] @tenant_id = opts[:tenant_id] @kusto_endpoint = opts[:kusto_endpoint] @database_name = opts[:database_name] @table_name = opts[:table_name] @azure_cloud = opts[:azure_cloud] || 'AzureCloud' @managed_identity_client_id = opts[:managed_identity_client_id] @azure_clouds = AZURE_CLOUDS @auth_type = opts[:auth_type] || 'aad' @workload_identity_client_id = opts[:workload_identity_client_id] @workload_identity_tenant_id = opts[:workload_identity_tenant_id] @workload_identity_token_file_path = opts[:workload_identity_token_file_path] validate_configuration end |
Instance Attribute Details
#auth_type ⇒ Object (readonly)
Returns the value of attribute auth_type.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def auth_type @auth_type end |
#azure_cloud ⇒ Object (readonly)
Returns the value of attribute azure_cloud.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def azure_cloud @azure_cloud end |
#client_app_id ⇒ Object (readonly)
Returns the value of attribute client_app_id.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def client_app_id @client_app_id end |
#client_app_secret ⇒ Object (readonly)
Returns the value of attribute client_app_secret.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def client_app_secret @client_app_secret end |
#database_name ⇒ Object (readonly)
Returns the value of attribute database_name.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def database_name @database_name end |
#kusto_endpoint ⇒ Object (readonly)
Returns the value of attribute kusto_endpoint.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def kusto_endpoint @kusto_endpoint end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def logger @logger end |
#managed_identity_client_id ⇒ Object (readonly)
Returns the value of attribute managed_identity_client_id.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def managed_identity_client_id @managed_identity_client_id end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def table_name @table_name end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def tenant_id @tenant_id end |
#workload_identity_client_id ⇒ Object (readonly)
Returns the value of attribute workload_identity_client_id.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def workload_identity_client_id @workload_identity_client_id end |
#workload_identity_tenant_id ⇒ Object (readonly)
Returns the value of attribute workload_identity_tenant_id.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def workload_identity_tenant_id @workload_identity_tenant_id end |
#workload_identity_token_file_path ⇒ Object (readonly)
Returns the value of attribute workload_identity_token_file_path.
66 67 68 |
# File 'lib/fluent/plugin/conffile.rb', line 66 def workload_identity_token_file_path @workload_identity_token_file_path end |
Instance Method Details
#aad_endpoint ⇒ Object
70 71 72 73 |
# File 'lib/fluent/plugin/conffile.rb', line 70 def aad_endpoint # Return Azure AD endpoint for selected cloud @azure_clouds[@azure_cloud]['aad'] end |
#print_missing_parameter_message_and_raise(param_name) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/fluent/plugin/conffile.rb', line 57 def (param_name) # Print error and raise if a required parameter is missing @logger.error( "Missing a required setting for the Kusto output plugin configuration:\n" \ "output {\nkusto {\n#{param_name} => # SETTING MISSING\n ...\n}\n}\n" ) raise ArgumentError, "The setting #{param_name} is required for Kusto configuration." end |
#validate_configuration ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/fluent/plugin/conffile.rb', line 41 def validate_configuration # Validate configuration based on authentication method case @auth_type&.downcase when 'aad' validate_aad_config when 'user_managed_identity', 'system_managed_identity', 'azcli' validate_base_config when 'workload_identity' validate_workload_identity_config else raise ArgumentError, "Unknown auth_type: #{@auth_type}" end validate_azure_cloud true end |