From 7db1e20b3ef97291c3377797d90b91807dcff816 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 22 Jun 2026 21:03:45 +0000 Subject: [PATCH] Regenerate client from commit 9f4994a of spec repo --- .generator/schemas/v2/openapi.yaml | 195 +++++++++++ ...w-stream-format-returns-OK-response.frozen | 1 + ...rrow-stream-format-returns-OK-response.yml | 27 ++ ...use-destination-returns-OK-response.frozen | 1 + ...kHouse-destination-returns-OK-response.yml | 27 ++ .../ValidatePipeline_1238441879.rb | 61 ++++ .../ValidatePipeline_620504950.rb | 66 ++++ features/v2/observability_pipelines.feature | 16 + lib/datadog_api_client/inflector.rb | 11 + ...ability_pipeline_clickhouse_destination.rb | 309 ++++++++++++++++++ ...ty_pipeline_clickhouse_destination_auth.rb | 145 ++++++++ ...ne_clickhouse_destination_auth_strategy.rb | 26 ++ ...y_pipeline_clickhouse_destination_batch.rb | 148 +++++++++ ...e_clickhouse_destination_batch_encoding.rb | 135 ++++++++ ...khouse_destination_batch_encoding_codec.rb | 26 ++ ...line_clickhouse_destination_compression.rb | 65 ++++ ...house_destination_compression_algorithm.rb | 27 ++ ...ickhouse_destination_compression_object.rb | 149 +++++++++ ..._pipeline_clickhouse_destination_format.rb | 33 ++ ...ty_pipeline_clickhouse_destination_type.rb | 26 ++ ...bility_pipeline_config_destination_item.rb | 1 + 21 files changed, 1495 insertions(+) create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.frozen create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.yml create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.frozen create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.yml create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_1238441879.rb create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_620504950.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth_strategy.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding_codec.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_algorithm.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_object.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_format.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 99b25f0ac87f..213267287249 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -63735,6 +63735,200 @@ components: x-enum-varnames: - BLOCK - DROP_NEWEST + ObservabilityPipelineClickhouseDestination: + description: |- + The `clickhouse` destination sends log events to a ClickHouse database table over HTTP. + + **Supported pipeline types:** logs. + properties: + auth: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationAuth" + batch: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationBatch" + batch_encoding: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationBatchEncoding" + compression: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationCompression" + database: + description: Optional ClickHouse database name. When omitted, the user's default database on the ClickHouse server is used. + example: my_database + type: string + date_time_best_effort: + description: When `true`, enables flexible DateTime parsing on the ClickHouse server side. + example: false + type: boolean + endpoint_url_key: + description: |- + Name of the environment variable or secret that holds the ClickHouse HTTP endpoint URL. + Defaults to `DESTINATION_CLICKHOUSE_ENDPOINT_URL` (prefixed with `DD_OP_` at runtime). + example: CLICKHOUSE_ENDPOINT_URL + type: string + format: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationFormat" + id: + description: The unique identifier for this component. Used to reference this component from other parts of the pipeline. + example: clickhouse-destination + type: string + inputs: + description: A list of component IDs whose output is used as the `input` for this component. + example: ["filter-processor"] + items: + description: The ID of a component whose output is used as input for this destination. + type: string + type: array + skip_unknown_fields: + description: |- + When `true`, fields not present in the target table schema are dropped instead of causing insert errors. + When unset, the ClickHouse server's own `input_format_skip_unknown_fields` setting applies. + example: true + nullable: true + type: boolean + table: + description: Target ClickHouse table name. Events are inserted into this table. + example: application_logs + type: string + tls: + $ref: "#/components/schemas/ObservabilityPipelineTls" + type: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationType" + required: + - id + - type + - inputs + - table + type: object + x-pipeline-types: [logs] + ObservabilityPipelineClickhouseDestinationAuth: + description: |- + HTTP Basic Authentication credentials for the ClickHouse destination. + When `strategy` is `basic`, provide `username_key` and `password_key` referencing + environment variables or secrets that hold the credentials. + properties: + password_key: + description: Name of the environment variable or secret that holds the ClickHouse password. + example: CLICKHOUSE_PASSWORD + type: string + strategy: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationAuthStrategy" + username_key: + description: Name of the environment variable or secret that holds the ClickHouse username. + example: CLICKHOUSE_USERNAME + type: string + required: + - strategy + type: object + ObservabilityPipelineClickhouseDestinationAuthStrategy: + description: The authentication strategy for ClickHouse HTTP requests. Only `basic` is supported. + enum: + - basic + example: basic + type: string + x-enum-varnames: + - BASIC + ObservabilityPipelineClickhouseDestinationBatch: + description: Batching configuration for ClickHouse inserts. + properties: + max_events: + description: Maximum number of events per batch before it is flushed. + example: 1000 + format: int64 + minimum: 1 + type: integer + timeout_secs: + description: Maximum number of seconds to wait before flushing a partial batch. + example: 1 + format: int64 + maximum: 65535 + minimum: 1 + type: integer + type: object + ObservabilityPipelineClickhouseDestinationBatchEncoding: + description: |- + Batch encoding configuration for the ClickHouse destination. + Required when `format` is `arrow_stream`. The `codec` field must be set to `arrow_stream`. + properties: + allow_nullable_fields: + description: |- + When `true`, null values are allowed for non-nullable fields in the ClickHouse schema. + When `false` (default), missing values for non-nullable columns cause encoding errors. + example: false + type: boolean + codec: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationBatchEncodingCodec" + required: + - codec + type: object + ObservabilityPipelineClickhouseDestinationBatchEncodingCodec: + description: The codec used for batch encoding. Only `arrow_stream` is supported. + enum: + - arrow_stream + example: arrow_stream + type: string + x-enum-varnames: + - ARROW_STREAM + ObservabilityPipelineClickhouseDestinationCompression: + description: |- + Compression setting for outbound HTTP requests to ClickHouse. + Can be specified as a shorthand string (`"gzip"` or `"none"`) or as an object + with an `algorithm` field and an optional `level` (gzip only, 1–9). + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationCompressionAlgorithm" + - $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationCompressionObject" + ObservabilityPipelineClickhouseDestinationCompressionAlgorithm: + description: The compression algorithm applied to outbound HTTP requests. + enum: + - gzip + - none + example: gzip + type: string + x-enum-varnames: + - GZIP + - NONE + ObservabilityPipelineClickhouseDestinationCompressionObject: + description: |- + Structured compression configuration for the ClickHouse destination. + Use `algorithm` to specify the compression type and `level` (optional, gzip only) to control compression strength. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationCompressionAlgorithm" + level: + description: Compression level (1–9). Only applicable when `algorithm` is `gzip`. + example: 6 + format: int64 + maximum: 9 + minimum: 1 + type: integer + required: + - algorithm + type: object + ObservabilityPipelineClickhouseDestinationFormat: + description: |- + Insert format for events sent to ClickHouse. + - `json_each_row`: Maps event fields to columns by name (ClickHouse `JSONEachRow`). + - `json_as_object`: Inserts each event into a single `Object('json')` / `JSON` column (ClickHouse `JSONAsObject`). + - `json_as_string`: Inserts each event into a single `String`-typed column as raw JSON (ClickHouse `JSONAsString`). + - `arrow_stream`: Batches events using Apache Arrow IPC streaming format. Requires `batch_encoding`. + enum: + - json_each_row + - json_as_object + - json_as_string + - arrow_stream + example: json_each_row + type: string + x-enum-varnames: + - JSON_EACH_ROW + - JSON_AS_OBJECT + - JSON_AS_STRING + - ARROW_STREAM + ObservabilityPipelineClickhouseDestinationType: + default: clickhouse + description: The destination type. The value must be `clickhouse`. + enum: + - clickhouse + example: clickhouse + type: string + x-enum-varnames: + - CLICKHOUSE ObservabilityPipelineCloudPremDestination: description: |- The `cloud_prem` destination sends logs to Datadog CloudPrem. @@ -63834,6 +64028,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineAmazonS3GenericDestination" - $ref: "#/components/schemas/ObservabilityPipelineAmazonSecurityLakeDestination" - $ref: "#/components/schemas/AzureStorageDestination" + - $ref: "#/components/schemas/ObservabilityPipelineClickhouseDestination" - $ref: "#/components/schemas/ObservabilityPipelineCloudPremDestination" - $ref: "#/components/schemas/ObservabilityPipelineCrowdStrikeNextGenSiemDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatadogLogsDestination" diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.frozen new file mode 100644 index 000000000000..663907587bf2 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-22T20:44:30.778Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.yml new file mode 100644 index 000000000000..c6c5c1835190 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-arrow-stream-format-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Mon, 22 Jun 2026 20:44:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"config":{"destinations":[{"auth":{"password_key":"CLICKHOUSE_PASSWORD","strategy":"basic","username_key":"CLICKHOUSE_USERNAME"},"batch":{"max_events":1000,"timeout_secs":1},"batch_encoding":{"allow_nullable_fields":false,"codec":"arrow_stream"},"compression":"gzip","database":"my_database","format":"arrow_stream","id":"clickhouse-destination","inputs":["my-processor-group"],"table":"application_logs","type":"clickhouse"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline + with ClickHouse Destination Arrow Stream"},"type":"pipelines"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + encoding: UTF-8 + string: '{"errors":[]} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.frozen new file mode 100644 index 000000000000..9b0a43318604 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-22T20:44:32.514Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.yml new file mode 100644 index 000000000000..61855cbf22e5 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-ClickHouse-destination-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Mon, 22 Jun 2026 20:44:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"config":{"destinations":[{"auth":{"password_key":"CLICKHOUSE_PASSWORD","strategy":"basic","username_key":"CLICKHOUSE_USERNAME"},"batch":{"max_events":1000,"timeout_secs":1},"compression":"gzip","database":"my_database","id":"clickhouse-destination","inputs":["my-processor-group"],"table":"application_logs","type":"clickhouse"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline + with ClickHouse Destination"},"type":"pipelines"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + encoding: UTF-8 + string: '{"errors":[]} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1238441879.rb b/examples/v2/observability-pipelines/ValidatePipeline_1238441879.rb new file mode 100644 index 000000000000..96cb4b2c75df --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1238441879.rb @@ -0,0 +1,61 @@ +# Validate an observability pipeline with ClickHouse destination returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ObservabilityPipelinesAPI.new + +body = DatadogAPIClient::V2::ObservabilityPipelineSpec.new({ + data: DatadogAPIClient::V2::ObservabilityPipelineSpecData.new({ + attributes: DatadogAPIClient::V2::ObservabilityPipelineDataAttributes.new({ + config: DatadogAPIClient::V2::ObservabilityPipelineConfig.new({ + destinations: [ + DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestination.new({ + id: "clickhouse-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationType::CLICKHOUSE, + table: "application_logs", + database: "my_database", + compression: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationCompressionAlgorithm::GZIP, + auth: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationAuth.new({ + strategy: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationAuthStrategy::BASIC, + username_key: "CLICKHOUSE_USERNAME", + password_key: "CLICKHOUSE_PASSWORD", + }), + batch: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationBatch.new({ + max_events: 1000, + timeout_secs: 1, + }), + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "service:my-service", + inputs: [ + "datadog-agent-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineFilterProcessor.new({ + enabled: true, + id: "filter-processor", + include: "status:error", + type: DatadogAPIClient::V2::ObservabilityPipelineFilterProcessorType::FILTER, + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSource.new({ + id: "datadog-agent-source", + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSourceType::DATADOG_AGENT, + }), + ], + }), + name: "Pipeline with ClickHouse Destination", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/examples/v2/observability-pipelines/ValidatePipeline_620504950.rb b/examples/v2/observability-pipelines/ValidatePipeline_620504950.rb new file mode 100644 index 000000000000..f1874c6384d4 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_620504950.rb @@ -0,0 +1,66 @@ +# Validate an observability pipeline with ClickHouse destination arrow_stream format returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ObservabilityPipelinesAPI.new + +body = DatadogAPIClient::V2::ObservabilityPipelineSpec.new({ + data: DatadogAPIClient::V2::ObservabilityPipelineSpecData.new({ + attributes: DatadogAPIClient::V2::ObservabilityPipelineDataAttributes.new({ + config: DatadogAPIClient::V2::ObservabilityPipelineConfig.new({ + destinations: [ + DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestination.new({ + id: "clickhouse-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationType::CLICKHOUSE, + table: "application_logs", + database: "my_database", + format: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationFormat::ARROW_STREAM, + batch_encoding: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationBatchEncoding.new({ + codec: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationBatchEncodingCodec::ARROW_STREAM, + allow_nullable_fields: false, + }), + compression: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationCompressionAlgorithm::GZIP, + auth: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationAuth.new({ + strategy: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationAuthStrategy::BASIC, + username_key: "CLICKHOUSE_USERNAME", + password_key: "CLICKHOUSE_PASSWORD", + }), + batch: DatadogAPIClient::V2::ObservabilityPipelineClickhouseDestinationBatch.new({ + max_events: 1000, + timeout_secs: 1, + }), + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "service:my-service", + inputs: [ + "datadog-agent-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineFilterProcessor.new({ + enabled: true, + id: "filter-processor", + include: "status:error", + type: DatadogAPIClient::V2::ObservabilityPipelineFilterProcessorType::FILTER, + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSource.new({ + id: "datadog-agent-source", + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSourceType::DATADOG_AGENT, + }), + ], + }), + name: "Pipeline with ClickHouse Destination Arrow Stream", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/features/v2/observability_pipelines.feature b/features/v2/observability_pipelines.feature index 487d6971f822..a57aed2a0325 100644 --- a/features/v2/observability_pipelines.feature +++ b/features/v2/observability_pipelines.feature @@ -176,6 +176,22 @@ Feature: Observability Pipelines Then the response status is 200 OK And the response "errors" has length 0 + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with ClickHouse destination arrow_stream format returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "clickhouse-destination", "inputs": ["my-processor-group"], "type": "clickhouse", "table": "application_logs", "database": "my_database", "format": "arrow_stream", "batch_encoding": {"codec": "arrow_stream", "allow_nullable_fields": false}, "compression": "gzip", "auth": {"strategy": "basic", "username_key": "CLICKHOUSE_USERNAME", "password_key": "CLICKHOUSE_PASSWORD"}, "batch": {"max_events": 1000, "timeout_secs": 1}}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with ClickHouse Destination Arrow Stream"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with ClickHouse destination returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "clickhouse-destination", "inputs": ["my-processor-group"], "type": "clickhouse", "table": "application_logs", "database": "my_database", "compression": "gzip", "auth": {"strategy": "basic", "username_key": "CLICKHOUSE_USERNAME", "password_key": "CLICKHOUSE_PASSWORD"}, "batch": {"max_events": 1000, "timeout_secs": 1}}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with ClickHouse Destination"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate an observability pipeline with HTTP server source valid_tokens returns "OK" response Given new "ValidatePipeline" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1912c3a1f419..03990376a310 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4908,6 +4908,17 @@ def overrides "v2.observability_pipeline_buffer_options_disk_type" => "ObservabilityPipelineBufferOptionsDiskType", "v2.observability_pipeline_buffer_options_memory_type" => "ObservabilityPipelineBufferOptionsMemoryType", "v2.observability_pipeline_buffer_options_when_full" => "ObservabilityPipelineBufferOptionsWhenFull", + "v2.observability_pipeline_clickhouse_destination" => "ObservabilityPipelineClickhouseDestination", + "v2.observability_pipeline_clickhouse_destination_auth" => "ObservabilityPipelineClickhouseDestinationAuth", + "v2.observability_pipeline_clickhouse_destination_auth_strategy" => "ObservabilityPipelineClickhouseDestinationAuthStrategy", + "v2.observability_pipeline_clickhouse_destination_batch" => "ObservabilityPipelineClickhouseDestinationBatch", + "v2.observability_pipeline_clickhouse_destination_batch_encoding" => "ObservabilityPipelineClickhouseDestinationBatchEncoding", + "v2.observability_pipeline_clickhouse_destination_batch_encoding_codec" => "ObservabilityPipelineClickhouseDestinationBatchEncodingCodec", + "v2.observability_pipeline_clickhouse_destination_compression" => "ObservabilityPipelineClickhouseDestinationCompression", + "v2.observability_pipeline_clickhouse_destination_compression_algorithm" => "ObservabilityPipelineClickhouseDestinationCompressionAlgorithm", + "v2.observability_pipeline_clickhouse_destination_compression_object" => "ObservabilityPipelineClickhouseDestinationCompressionObject", + "v2.observability_pipeline_clickhouse_destination_format" => "ObservabilityPipelineClickhouseDestinationFormat", + "v2.observability_pipeline_clickhouse_destination_type" => "ObservabilityPipelineClickhouseDestinationType", "v2.observability_pipeline_cloud_prem_destination" => "ObservabilityPipelineCloudPremDestination", "v2.observability_pipeline_cloud_prem_destination_type" => "ObservabilityPipelineCloudPremDestinationType", "v2.observability_pipeline_config" => "ObservabilityPipelineConfig", diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination.rb new file mode 100644 index 000000000000..93f1750e6bf5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination.rb @@ -0,0 +1,309 @@ +=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 + # The `clickhouse` destination sends log events to a ClickHouse database table over HTTP. + # + # **Supported pipeline types:** logs. + class ObservabilityPipelineClickhouseDestination + include BaseGenericModel + + # HTTP Basic Authentication credentials for the ClickHouse destination. + # When `strategy` is `basic`, provide `username_key` and `password_key` referencing + # environment variables or secrets that hold the credentials. + attr_accessor :auth + + # Batching configuration for ClickHouse inserts. + attr_accessor :batch + + # Batch encoding configuration for the ClickHouse destination. + # Required when `format` is `arrow_stream`. The `codec` field must be set to `arrow_stream`. + attr_accessor :batch_encoding + + # Compression setting for outbound HTTP requests to ClickHouse. + # Can be specified as a shorthand string (`"gzip"` or `"none"`) or as an object + # with an `algorithm` field and an optional `level` (gzip only, 1–9). + attr_accessor :compression + + # Optional ClickHouse database name. When omitted, the user's default database on the ClickHouse server is used. + attr_accessor :database + + # When `true`, enables flexible DateTime parsing on the ClickHouse server side. + attr_accessor :date_time_best_effort + + # Name of the environment variable or secret that holds the ClickHouse HTTP endpoint URL. + # Defaults to `DESTINATION_CLICKHOUSE_ENDPOINT_URL` (prefixed with `DD_OP_` at runtime). + attr_accessor :endpoint_url_key + + # Insert format for events sent to ClickHouse. + # - `json_each_row`: Maps event fields to columns by name (ClickHouse `JSONEachRow`). + # - `json_as_object`: Inserts each event into a single `Object('json')` / `JSON` column (ClickHouse `JSONAsObject`). + # - `json_as_string`: Inserts each event into a single `String`-typed column as raw JSON (ClickHouse `JSONAsString`). + # - `arrow_stream`: Batches events using Apache Arrow IPC streaming format. Requires `batch_encoding`. + attr_accessor :format + + # The unique identifier for this component. Used to reference this component from other parts of the pipeline. + attr_reader :id + + # A list of component IDs whose output is used as the `input` for this component. + attr_reader :inputs + + # When `true`, fields not present in the target table schema are dropped instead of causing insert errors. + # When unset, the ClickHouse server's own `input_format_skip_unknown_fields` setting applies. + attr_accessor :skip_unknown_fields + + # Target ClickHouse table name. Events are inserted into this table. + attr_reader :table + + # Configuration for enabling TLS encryption between the pipeline component and external services. + attr_accessor :tls + + # The destination type. The value must be `clickhouse`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'auth' => :'auth', + :'batch' => :'batch', + :'batch_encoding' => :'batch_encoding', + :'compression' => :'compression', + :'database' => :'database', + :'date_time_best_effort' => :'date_time_best_effort', + :'endpoint_url_key' => :'endpoint_url_key', + :'format' => :'format', + :'id' => :'id', + :'inputs' => :'inputs', + :'skip_unknown_fields' => :'skip_unknown_fields', + :'table' => :'table', + :'tls' => :'tls', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'auth' => :'ObservabilityPipelineClickhouseDestinationAuth', + :'batch' => :'ObservabilityPipelineClickhouseDestinationBatch', + :'batch_encoding' => :'ObservabilityPipelineClickhouseDestinationBatchEncoding', + :'compression' => :'ObservabilityPipelineClickhouseDestinationCompression', + :'database' => :'String', + :'date_time_best_effort' => :'Boolean', + :'endpoint_url_key' => :'String', + :'format' => :'ObservabilityPipelineClickhouseDestinationFormat', + :'id' => :'String', + :'inputs' => :'Array', + :'skip_unknown_fields' => :'Boolean', + :'table' => :'String', + :'tls' => :'ObservabilityPipelineTls', + :'type' => :'ObservabilityPipelineClickhouseDestinationType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'skip_unknown_fields', + ]) + 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::ObservabilityPipelineClickhouseDestination` 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?(:'auth') + self.auth = attributes[:'auth'] + end + + if attributes.key?(:'batch') + self.batch = attributes[:'batch'] + end + + if attributes.key?(:'batch_encoding') + self.batch_encoding = attributes[:'batch_encoding'] + end + + if attributes.key?(:'compression') + self.compression = attributes[:'compression'] + end + + if attributes.key?(:'database') + self.database = attributes[:'database'] + end + + if attributes.key?(:'date_time_best_effort') + self.date_time_best_effort = attributes[:'date_time_best_effort'] + end + + if attributes.key?(:'endpoint_url_key') + self.endpoint_url_key = attributes[:'endpoint_url_key'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'inputs') + if (value = attributes[:'inputs']).is_a?(Array) + self.inputs = value + end + end + + if attributes.key?(:'skip_unknown_fields') + self.skip_unknown_fields = attributes[:'skip_unknown_fields'] + end + + if attributes.key?(:'table') + self.table = attributes[:'table'] + end + + if attributes.key?(:'tls') + self.tls = attributes[:'tls'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @id.nil? + return false if @inputs.nil? + return false if @table.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param inputs [Object] Object to be assigned + # @!visibility private + def inputs=(inputs) + if inputs.nil? + fail ArgumentError, 'invalid value for "inputs", inputs cannot be nil.' + end + @inputs = inputs + end + + # Custom attribute writer method with validation + # @param table [Object] Object to be assigned + # @!visibility private + def table=(table) + if table.nil? + fail ArgumentError, 'invalid value for "table", table cannot be nil.' + end + @table = table + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + auth == o.auth && + batch == o.batch && + batch_encoding == o.batch_encoding && + compression == o.compression && + database == o.database && + date_time_best_effort == o.date_time_best_effort && + endpoint_url_key == o.endpoint_url_key && + format == o.format && + id == o.id && + inputs == o.inputs && + skip_unknown_fields == o.skip_unknown_fields && + table == o.table && + tls == o.tls && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [auth, batch, batch_encoding, compression, database, date_time_best_effort, endpoint_url_key, format, id, inputs, skip_unknown_fields, table, tls, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth.rb new file mode 100644 index 000000000000..9e47f6708255 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth.rb @@ -0,0 +1,145 @@ +=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 + # HTTP Basic Authentication credentials for the ClickHouse destination. + # When `strategy` is `basic`, provide `username_key` and `password_key` referencing + # environment variables or secrets that hold the credentials. + class ObservabilityPipelineClickhouseDestinationAuth + include BaseGenericModel + + # Name of the environment variable or secret that holds the ClickHouse password. + attr_accessor :password_key + + # The authentication strategy for ClickHouse HTTP requests. Only `basic` is supported. + attr_reader :strategy + + # Name of the environment variable or secret that holds the ClickHouse username. + attr_accessor :username_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'password_key' => :'password_key', + :'strategy' => :'strategy', + :'username_key' => :'username_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'password_key' => :'String', + :'strategy' => :'ObservabilityPipelineClickhouseDestinationAuthStrategy', + :'username_key' => :'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::ObservabilityPipelineClickhouseDestinationAuth` 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?(:'password_key') + self.password_key = attributes[:'password_key'] + end + + if attributes.key?(:'strategy') + self.strategy = attributes[:'strategy'] + end + + if attributes.key?(:'username_key') + self.username_key = attributes[:'username_key'] + 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 @strategy.nil? + true + end + + # Custom attribute writer method with validation + # @param strategy [Object] Object to be assigned + # @!visibility private + def strategy=(strategy) + if strategy.nil? + fail ArgumentError, 'invalid value for "strategy", strategy cannot be nil.' + end + @strategy = strategy + 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 && + password_key == o.password_key && + strategy == o.strategy && + username_key == o.username_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [password_key, strategy, username_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth_strategy.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth_strategy.rb new file mode 100644 index 000000000000..8a266a753e01 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_auth_strategy.rb @@ -0,0 +1,26 @@ +=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 + # The authentication strategy for ClickHouse HTTP requests. Only `basic` is supported. + class ObservabilityPipelineClickhouseDestinationAuthStrategy + include BaseEnumModel + + BASIC = "basic".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch.rb new file mode 100644 index 000000000000..60739ee404dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch.rb @@ -0,0 +1,148 @@ +=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 + # Batching configuration for ClickHouse inserts. + class ObservabilityPipelineClickhouseDestinationBatch + include BaseGenericModel + + # Maximum number of events per batch before it is flushed. + attr_reader :max_events + + # Maximum number of seconds to wait before flushing a partial batch. + attr_reader :timeout_secs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'max_events' => :'max_events', + :'timeout_secs' => :'timeout_secs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'max_events' => :'Integer', + :'timeout_secs' => :'Integer' + } + 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::ObservabilityPipelineClickhouseDestinationBatch` 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?(:'max_events') + self.max_events = attributes[:'max_events'] + end + + if attributes.key?(:'timeout_secs') + self.timeout_secs = attributes[:'timeout_secs'] + 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 !@max_events.nil? && @max_events < 1 + return false if !@timeout_secs.nil? && @timeout_secs > 65535 + return false if !@timeout_secs.nil? && @timeout_secs < 1 + true + end + + # Custom attribute writer method with validation + # @param max_events [Object] Object to be assigned + # @!visibility private + def max_events=(max_events) + if !max_events.nil? && max_events < 1 + fail ArgumentError, 'invalid value for "max_events", must be greater than or equal to 1.' + end + @max_events = max_events + end + + # Custom attribute writer method with validation + # @param timeout_secs [Object] Object to be assigned + # @!visibility private + def timeout_secs=(timeout_secs) + if !timeout_secs.nil? && timeout_secs > 65535 + fail ArgumentError, 'invalid value for "timeout_secs", must be smaller than or equal to 65535.' + end + if !timeout_secs.nil? && timeout_secs < 1 + fail ArgumentError, 'invalid value for "timeout_secs", must be greater than or equal to 1.' + end + @timeout_secs = timeout_secs + 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 && + max_events == o.max_events && + timeout_secs == o.timeout_secs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [max_events, timeout_secs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding.rb new file mode 100644 index 000000000000..a69faa59e479 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding.rb @@ -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 + # Batch encoding configuration for the ClickHouse destination. + # Required when `format` is `arrow_stream`. The `codec` field must be set to `arrow_stream`. + class ObservabilityPipelineClickhouseDestinationBatchEncoding + include BaseGenericModel + + # When `true`, null values are allowed for non-nullable fields in the ClickHouse schema. + # When `false` (default), missing values for non-nullable columns cause encoding errors. + attr_accessor :allow_nullable_fields + + # The codec used for batch encoding. Only `arrow_stream` is supported. + attr_reader :codec + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allow_nullable_fields' => :'allow_nullable_fields', + :'codec' => :'codec' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allow_nullable_fields' => :'Boolean', + :'codec' => :'ObservabilityPipelineClickhouseDestinationBatchEncodingCodec' + } + 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::ObservabilityPipelineClickhouseDestinationBatchEncoding` 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?(:'allow_nullable_fields') + self.allow_nullable_fields = attributes[:'allow_nullable_fields'] + end + + if attributes.key?(:'codec') + self.codec = attributes[:'codec'] + 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 @codec.nil? + true + end + + # Custom attribute writer method with validation + # @param codec [Object] Object to be assigned + # @!visibility private + def codec=(codec) + if codec.nil? + fail ArgumentError, 'invalid value for "codec", codec cannot be nil.' + end + @codec = codec + 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 && + allow_nullable_fields == o.allow_nullable_fields && + codec == o.codec && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allow_nullable_fields, codec, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding_codec.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding_codec.rb new file mode 100644 index 000000000000..5e73c9c52b6d --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_batch_encoding_codec.rb @@ -0,0 +1,26 @@ +=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 + # The codec used for batch encoding. Only `arrow_stream` is supported. + class ObservabilityPipelineClickhouseDestinationBatchEncodingCodec + include BaseEnumModel + + ARROW_STREAM = "arrow_stream".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression.rb new file mode 100644 index 000000000000..f55feeb6287d --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression.rb @@ -0,0 +1,65 @@ +=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 + # Compression setting for outbound HTTP requests to ClickHouse. + # Can be specified as a shorthand string (`"gzip"` or `"none"`) or as an object + # with an `algorithm` field and an optional `level` (gzip only, 1–9). + module ObservabilityPipelineClickhouseDestinationCompression + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineClickhouseDestinationCompressionAlgorithm', + :'ObservabilityPipelineClickhouseDestinationCompressionObject' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_algorithm.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_algorithm.rb new file mode 100644 index 000000000000..0d17c17671d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_algorithm.rb @@ -0,0 +1,27 @@ +=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 + # The compression algorithm applied to outbound HTTP requests. + class ObservabilityPipelineClickhouseDestinationCompressionAlgorithm + include BaseEnumModel + + GZIP = "gzip".freeze + NONE = "none".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_object.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_object.rb new file mode 100644 index 000000000000..a4dec05efb37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_compression_object.rb @@ -0,0 +1,149 @@ +=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 + # Structured compression configuration for the ClickHouse destination. + # Use `algorithm` to specify the compression type and `level` (optional, gzip only) to control compression strength. + class ObservabilityPipelineClickhouseDestinationCompressionObject + include BaseGenericModel + + # The compression algorithm applied to outbound HTTP requests. + attr_reader :algorithm + + # Compression level (1–9). Only applicable when `algorithm` is `gzip`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineClickhouseDestinationCompressionAlgorithm', + :'level' => :'Integer' + } + 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::ObservabilityPipelineClickhouseDestinationCompressionObject` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if !@level.nil? && @level > 9 + return false if !@level.nil? && @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if !level.nil? && level > 9 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 9.' + end + if !level.nil? && level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_format.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_format.rb new file mode 100644 index 000000000000..83264334aac4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_format.rb @@ -0,0 +1,33 @@ +=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 + # Insert format for events sent to ClickHouse. + # - `json_each_row`: Maps event fields to columns by name (ClickHouse `JSONEachRow`). + # - `json_as_object`: Inserts each event into a single `Object('json')` / `JSON` column (ClickHouse `JSONAsObject`). + # - `json_as_string`: Inserts each event into a single `String`-typed column as raw JSON (ClickHouse `JSONAsString`). + # - `arrow_stream`: Batches events using Apache Arrow IPC streaming format. Requires `batch_encoding`. + class ObservabilityPipelineClickhouseDestinationFormat + include BaseEnumModel + + JSON_EACH_ROW = "json_each_row".freeze + JSON_AS_OBJECT = "json_as_object".freeze + JSON_AS_STRING = "json_as_string".freeze + ARROW_STREAM = "arrow_stream".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_type.rb new file mode 100644 index 000000000000..b6fa85a0565c --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_clickhouse_destination_type.rb @@ -0,0 +1,26 @@ +=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 + # The destination type. The value must be `clickhouse`. + class ObservabilityPipelineClickhouseDestinationType + include BaseEnumModel + + CLICKHOUSE = "clickhouse".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_config_destination_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_destination_item.rb index f12386e67e6f..aa8bdb83f5c6 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_destination_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_destination_item.rb @@ -33,6 +33,7 @@ def openapi_one_of :'ObservabilityPipelineAmazonS3GenericDestination', :'ObservabilityPipelineAmazonSecurityLakeDestination', :'AzureStorageDestination', + :'ObservabilityPipelineClickhouseDestination', :'ObservabilityPipelineCloudPremDestination', :'ObservabilityPipelineCrowdStrikeNextGenSiemDestination', :'ObservabilityPipelineDatadogLogsDestination',