Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36203,7 +36203,8 @@ components:
type: object
ObservabilityPipelineEnrichmentTableProcessor:
description: The `enrichment_table` processor enriches logs using a static CSV
file or GeoIP database.
file, GeoIP database, or reference table. Exactly one of `file`, `geoip`,
or `reference_table` must be configured.
properties:
display_name:
$ref: '#/components/schemas/ObservabilityPipelineComponentDisplayName'
Expand All @@ -36224,6 +36225,8 @@ components:
targets.
example: source:my-source
type: string
reference_table:
$ref: '#/components/schemas/ObservabilityPipelineEnrichmentTableReferenceTable'
target:
description: Path where enrichment results should be stored in the log.
example: enriched.geoip
Expand All @@ -36246,6 +36249,34 @@ components:
type: string
x-enum-varnames:
- ENRICHMENT_TABLE
ObservabilityPipelineEnrichmentTableReferenceTable:
description: Uses a Datadog reference table to enrich logs.
properties:
app_key_key:
default: PROCESSOR_ENRICHMENT_TABLES_APP_KEY
description: Environment variable name containing the application key used
for reference table authentication.
type: string
columns:
description: List of column names to include from the reference table. If
not provided, all columns are included.
items:
type: string
nullable: true
type: array
key_field:
description: Path to the field in the log event to match against the reference
table.
example: log.user.id
type: string
table_id:
description: The unique identifier of the reference table.
example: 550e8400-e29b-41d4-a716-446655440000
type: string
required:
- key_field
- table_id
type: object
ObservabilityPipelineFieldValue:
description: Represents a static key-value pair used in various processors.
properties:
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,7 @@ def overrides
"v2.observability_pipeline_enrichment_table_geo_ip" => "ObservabilityPipelineEnrichmentTableGeoIp",
"v2.observability_pipeline_enrichment_table_processor" => "ObservabilityPipelineEnrichmentTableProcessor",
"v2.observability_pipeline_enrichment_table_processor_type" => "ObservabilityPipelineEnrichmentTableProcessorType",
"v2.observability_pipeline_enrichment_table_reference_table" => "ObservabilityPipelineEnrichmentTableReferenceTable",
"v2.observability_pipeline_field_value" => "ObservabilityPipelineFieldValue",
"v2.observability_pipeline_filter_processor" => "ObservabilityPipelineFilterProcessor",
"v2.observability_pipeline_filter_processor_type" => "ObservabilityPipelineFilterProcessorType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require 'time'

module DatadogAPIClient::V2
# The `enrichment_table` processor enriches logs using a static CSV file or GeoIP database.
# The `enrichment_table` processor enriches logs using a static CSV file, GeoIP database, or reference table. Exactly one of `file`, `geoip`, or `reference_table` must be configured.
class ObservabilityPipelineEnrichmentTableProcessor
include BaseGenericModel

Expand All @@ -39,6 +39,9 @@ class ObservabilityPipelineEnrichmentTableProcessor
# A Datadog search query used to determine which logs this processor targets.
attr_reader :include

# Uses a Datadog reference table to enrich logs.
attr_accessor :reference_table

# Path where enrichment results should be stored in the log.
attr_reader :target

Expand All @@ -57,6 +60,7 @@ def self.attribute_map
:'geoip' => :'geoip',
:'id' => :'id',
:'include' => :'include',
:'reference_table' => :'reference_table',
:'target' => :'target',
:'type' => :'type'
}
Expand All @@ -72,6 +76,7 @@ def self.openapi_types
:'geoip' => :'ObservabilityPipelineEnrichmentTableGeoIp',
:'id' => :'String',
:'include' => :'String',
:'reference_table' => :'ObservabilityPipelineEnrichmentTableReferenceTable',
:'target' => :'String',
:'type' => :'ObservabilityPipelineEnrichmentTableProcessorType'
}
Expand Down Expand Up @@ -119,6 +124,10 @@ def initialize(attributes = {})
self.include = attributes[:'include']
end

if attributes.key?(:'reference_table')
self.reference_table = attributes[:'reference_table']
end

if attributes.key?(:'target')
self.target = attributes[:'target']
end
Expand Down Expand Up @@ -222,6 +231,7 @@ def ==(o)
geoip == o.geoip &&
id == o.id &&
include == o.include &&
reference_table == o.reference_table &&
target == o.target &&
type == o.type &&
additional_properties == o.additional_properties
Expand All @@ -231,7 +241,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[display_name, enabled, file, geoip, id, include, target, type, additional_properties].hash
[display_name, enabled, file, geoip, id, include, reference_table, target, type, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Uses a Datadog reference table to enrich logs.
class ObservabilityPipelineEnrichmentTableReferenceTable
include BaseGenericModel

# Environment variable name containing the application key used for reference table authentication.
attr_accessor :app_key_key

# List of column names to include from the reference table. If not provided, all columns are included.
attr_accessor :columns

# Path to the field in the log event to match against the reference table.
attr_reader :key_field

# The unique identifier of the reference table.
attr_reader :table_id

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'app_key_key' => :'app_key_key',
:'columns' => :'columns',
:'key_field' => :'key_field',
:'table_id' => :'table_id'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'app_key_key' => :'String',
:'columns' => :'Array<String>',
:'key_field' => :'String',
:'table_id' => :'String'
}
end

# List of attributes with nullable: true
# @!visibility private
def self.openapi_nullable
Set.new([
:'columns',
])
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineEnrichmentTableReferenceTable` initialize method"
end

self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}

if attributes.key?(:'app_key_key')
self.app_key_key = attributes[:'app_key_key']
end

if attributes.key?(:'columns')
if (value = attributes[:'columns']).is_a?(Array)
self.columns = value
end
end

if attributes.key?(:'key_field')
self.key_field = attributes[:'key_field']
end

if attributes.key?(:'table_id')
self.table_id = attributes[:'table_id']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @key_field.nil?
return false if @table_id.nil?
true
end

# Custom attribute writer method with validation
# @param key_field [Object] Object to be assigned
# @!visibility private
def key_field=(key_field)
if key_field.nil?
fail ArgumentError, 'invalid value for "key_field", key_field cannot be nil.'
end
@key_field = key_field
end

# Custom attribute writer method with validation
# @param table_id [Object] Object to be assigned
# @!visibility private
def table_id=(table_id)
if table_id.nil?
fail ArgumentError, 'invalid value for "table_id", table_id cannot be nil.'
end
@table_id = table_id
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end

hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
app_key_key == o.app_key_key &&
columns == o.columns &&
key_field == o.key_field &&
table_id == o.table_id &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[app_key_key, columns, key_field, table_id, additional_properties].hash
end
end
end
Loading