Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36571,6 +36571,18 @@ components:
items:
type: string
type: array
routes:
description: A list of routing rules that forward matching logs to Datadog
using dedicated API keys.
example:
- api_key_key: API_KEY_IDENTIFIER
include: service:api
route_id: datadog-logs-route-us1
site: us1
items:
$ref: '#/components/schemas/ObservabilityPipelineDatadogLogsDestinationRoute'
maxItems: 100
type: array
type:
$ref: '#/components/schemas/ObservabilityPipelineDatadogLogsDestinationType'
required:
Expand All @@ -36580,6 +36592,29 @@ components:
type: object
x-pipeline-types:
- logs
ObservabilityPipelineDatadogLogsDestinationRoute:
description: Defines how the `datadog_logs` destination routes matching logs
to a Datadog site using a specific API key.
properties:
api_key_key:
description: Name of the environment variable or secret that stores the
Datadog API key used by this route.
example: API_KEY_IDENTIFIER
type: string
include:
description: A Datadog search query that determines which logs are forwarded
using this route.
example: service:api
type: string
route_id:
description: Unique identifier for this route within the destination.
example: datadog-logs-route-us
type: string
site:
description: Datadog site where matching logs are sent (for example, `us1`).
example: us1
type: string
type: object
ObservabilityPipelineDatadogLogsDestinationType:
default: datadog_logs
description: The destination type. The value should always be `datadog_logs`.
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 @@ -3228,6 +3228,7 @@ def overrides
"v2.observability_pipeline_datadog_agent_source" => "ObservabilityPipelineDatadogAgentSource",
"v2.observability_pipeline_datadog_agent_source_type" => "ObservabilityPipelineDatadogAgentSourceType",
"v2.observability_pipeline_datadog_logs_destination" => "ObservabilityPipelineDatadogLogsDestination",
"v2.observability_pipeline_datadog_logs_destination_route" => "ObservabilityPipelineDatadogLogsDestinationRoute",
"v2.observability_pipeline_datadog_logs_destination_type" => "ObservabilityPipelineDatadogLogsDestinationType",
"v2.observability_pipeline_datadog_metrics_destination" => "ObservabilityPipelineDatadogMetricsDestination",
"v2.observability_pipeline_datadog_metrics_destination_type" => "ObservabilityPipelineDatadogMetricsDestinationType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class ObservabilityPipelineDatadogLogsDestination
# A list of component IDs whose output is used as the `input` for this component.
attr_reader :inputs

# A list of routing rules that forward matching logs to Datadog using dedicated API keys.
attr_reader :routes

# The destination type. The value should always be `datadog_logs`.
attr_reader :type

Expand All @@ -40,6 +43,7 @@ def self.attribute_map
{
:'id' => :'id',
:'inputs' => :'inputs',
:'routes' => :'routes',
:'type' => :'type'
}
end
Expand All @@ -50,6 +54,7 @@ def self.openapi_types
{
:'id' => :'String',
:'inputs' => :'Array<String>',
:'routes' => :'Array<ObservabilityPipelineDatadogLogsDestinationRoute>',
:'type' => :'ObservabilityPipelineDatadogLogsDestinationType'
}
end
Expand Down Expand Up @@ -82,6 +87,12 @@ def initialize(attributes = {})
end
end

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

if attributes.key?(:'type')
self.type = attributes[:'type']
end
Expand All @@ -93,6 +104,7 @@ def initialize(attributes = {})
def valid?
return false if @id.nil?
return false if @inputs.nil?
return false if !@routes.nil? && @routes.length > 100
return false if @type.nil?
true
end
Expand All @@ -117,6 +129,16 @@ def inputs=(inputs)
@inputs = inputs
end

# Custom attribute writer method with validation
# @param routes [Object] Object to be assigned
# @!visibility private
def routes=(routes)
if !routes.nil? && routes.length > 100
fail ArgumentError, 'invalid value for "routes", number of items must be less than or equal to 100.'
end
@routes = routes
end

# Custom attribute writer method with validation
# @param type [Object] Object to be assigned
# @!visibility private
Expand Down Expand Up @@ -155,6 +177,7 @@ def ==(o)
self.class == o.class &&
id == o.id &&
inputs == o.inputs &&
routes == o.routes &&
type == o.type &&
additional_properties == o.additional_properties
end
Expand All @@ -163,7 +186,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[id, inputs, type, additional_properties].hash
[id, inputs, routes, type, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
=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
# Defines how the `datadog_logs` destination routes matching logs to a Datadog site using a specific API key.
class ObservabilityPipelineDatadogLogsDestinationRoute
include BaseGenericModel

# Name of the environment variable or secret that stores the Datadog API key used by this route.
attr_accessor :api_key_key

# A Datadog search query that determines which logs are forwarded using this route.
attr_accessor :include

# Unique identifier for this route within the destination.
attr_accessor :route_id

# Datadog site where matching logs are sent (for example, `us1`).
attr_accessor :site

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'api_key_key' => :'api_key_key',
:'include' => :'include',
:'route_id' => :'route_id',
:'site' => :'site'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'api_key_key' => :'String',
:'include' => :'String',
:'route_id' => :'String',
:'site' => :'String'
}
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::ObservabilityPipelineDatadogLogsDestinationRoute` 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?(:'api_key_key')
self.api_key_key = attributes[:'api_key_key']
end

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

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

if attributes.key?(:'site')
self.site = attributes[:'site']
end
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 &&
api_key_key == o.api_key_key &&
include == o.include &&
route_id == o.route_id &&
site == o.site &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[api_key_key, include, route_id, site, additional_properties].hash
end
end
end
Loading