diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f535b34d3eb0..e8790871ff0c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20125,10 +20125,14 @@ components: - CONTAINER - CALLOUTVALUE Condition: - description: Targeting condition details. + description: |- + Targeting condition details. A condition is either an inline + predicate with `operator`, `attribute`, and `value`, or a reference to a + saved filter with `saved_filter_id`. The inline fields are omitted for saved-filter + references. properties: attribute: - description: The user or request attribute to evaluate. + description: The user or request attribute to evaluate. Omitted for saved-filter references. example: "country" type: string created_at: @@ -20143,13 +20147,19 @@ components: type: string operator: $ref: "#/components/schemas/ConditionOperator" + saved_filter_id: + description: The ID of the saved filter referenced by this condition, or null for inline conditions. + example: "550e8400-e29b-41d4-a716-446655440090" + format: uuid + nullable: true + type: string updated_at: description: The timestamp when the condition was last updated. example: "2024-01-01T12:00:00Z" format: date-time type: string value: - description: Values used by the selected operator. + description: Values used by the selected operator. Omitted for saved-filter references. example: ["US", "CA"] items: description: Target value for the selected operator. @@ -20157,9 +20167,6 @@ components: type: array required: - id - - operator - - attribute - - value - created_at - updated_at type: object @@ -20190,25 +20197,32 @@ components: - IS_NULL - EQUALS ConditionRequest: - description: Condition request payload for targeting rules. + description: |- + Condition request payload for targeting rules. A condition is either an inline + predicate with `operator`, `attribute`, and `value`, or a reference to a + saved filter with `saved_filter_id`. The two shapes are mutually exclusive. properties: attribute: - description: The user or request attribute to evaluate. + description: The user or request attribute to evaluate. Required for inline conditions; omit when `saved_filter_id` is set. example: "user_tier" type: string operator: $ref: "#/components/schemas/ConditionOperator" + saved_filter_id: + description: |- + The ID of a saved filter to reference as this condition. Mutually exclusive + with `operator`, `attribute`, and `value`. When set, the saved filter's + targeting rules are evaluated in place of an inline predicate. + example: "550e8400-e29b-41d4-a716-446655440090" + format: uuid + type: string value: - description: Values used by the selected operator. + description: Values used by the selected operator. Required for inline conditions; omit when `saved_filter_id` is set. example: ["premium", "enterprise"] items: description: Target value for the selected operator. type: string type: array - required: - - operator - - attribute - - value type: object ConfigCatCredentials: description: The definition of the `ConfigCatCredentials` object. @@ -57746,19 +57760,35 @@ components: - client_email type: object LogsArchiveIntegrationS3: - description: The S3 Archive's integration destination. + description: >- + The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. + oneOf: + - $ref: "#/components/schemas/LogsArchiveIntegrationS3AccessKey" + - $ref: "#/components/schemas/LogsArchiveIntegrationS3Role" + LogsArchiveIntegrationS3AccessKey: + description: The S3 Archive's integration destination using an access key. + properties: + access_key_id: + description: The access key ID for the integration. + example: AKIAIOSFODNN7EXAMPLE + type: string + required: + - access_key_id + type: object + LogsArchiveIntegrationS3Role: + description: The S3 Archive's integration destination using an IAM role. properties: account_id: description: The account ID for the integration. example: "123456789012" type: string role_name: - description: The path of the integration. + description: The name of the role to assume for the integration. example: role-name type: string required: - - role_name - account_id + - role_name type: object LogsArchiveOrder: description: A ordered list of archive IDs. @@ -67693,6 +67723,10 @@ components: The `parse_grok` processor extracts structured fields from unstructured log messages using Grok patterns. **Supported pipeline types:** logs + example: + id: "parse-grok-processor" + include: "service:my-service" + type: "parse_grok" properties: disable_library_rules: default: false @@ -67705,6 +67739,11 @@ components: description: Indicates whether the processor is enabled. example: true type: boolean + field: + default: "message" + description: The log field to parse with the Grok rules. + example: "message" + type: string id: description: A unique identifier for this processor. example: "parse-grok-processor" @@ -67714,9 +67753,9 @@ components: example: "service:my-service" type: string rules: - description: The list of Grok parsing rules. If multiple matching rules are provided, they are evaluated in order. The first successful match is applied. + description: The list of Grok parsing rules selected by either source field or include query. items: - $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorRule" + $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorRuleItem" type: array type: $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorType" @@ -67728,6 +67767,37 @@ components: - enabled type: object x-pipeline-types: [logs] + ObservabilityPipelineParseGrokProcessorIncludeRule: + description: |- + A Grok parsing rule selected using the `include` query. Each rule defines how to extract structured fields + from logs matching a Datadog search query. + properties: + include: + description: A Datadog search query used to determine which logs this Grok rule targets. + example: "service:my-service" + type: string + match_rules: + description: |- + A list of Grok parsing rules that define how to extract fields from matching logs. + Each rule must contain a name and a valid Grok pattern. + example: + - name: "MyParsingRule" + rule: '%{word:user} connected on %{date("MM/dd/yyyy"):date}' + items: + $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorRuleMatchRule" + type: array + support_rules: + description: A list of Grok helper rules that can be referenced by the parsing rules. + example: + - name: "user" + rule: "%{word:user.name}" + items: + $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorRuleSupportRule" + type: array + required: + - include + - match_rules + type: object ObservabilityPipelineParseGrokProcessorRule: description: |- A Grok parsing rule used in the `parse_grok` processor. Each rule defines how to extract structured fields @@ -67760,6 +67830,11 @@ components: - source - match_rules type: object + ObservabilityPipelineParseGrokProcessorRuleItem: + description: A single Grok parsing rule, selected by either source field or include query. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorRule" + - $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessorIncludeRule" ObservabilityPipelineParseGrokProcessorRuleMatchRule: description: |- Defines a Grok parsing rule, which extracts structured fields from log content using named Grok patterns. @@ -150968,6 +151043,18 @@ paths: - team:intake - team:app type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + name: Nginx Archive + query: source:nginx + type: archives schema: $ref: "#/components/schemas/LogsArchiveCreateRequest" description: The definition of the new archive. @@ -150993,6 +151080,21 @@ paths: state: WORKING id: 00000000-0000-0000-0000-000000000002 type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + include_tags: false + name: Nginx Archive + query: source:nginx + state: WORKING + id: 00000000-0000-0000-0000-000000000002 + type: archives schema: $ref: "#/components/schemas/LogsArchive" description: OK @@ -151142,6 +151244,18 @@ paths: - team:intake - team:app type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + name: Nginx Archive + query: source:nginx + type: archives schema: $ref: "#/components/schemas/LogsArchiveCreateRequest" description: New definition of the archive. @@ -151167,6 +151281,21 @@ paths: state: WORKING id: 00000000-0000-0000-0000-000000000004 type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + include_tags: false + name: Nginx Archive + query: source:nginx + state: WORKING + id: 00000000-0000-0000-0000-000000000004 + type: archives schema: $ref: "#/components/schemas/LogsArchive" description: OK diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-include-rules-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-include-rules-returns-OK-response.frozen new file mode 100644 index 000000000000..985fe4f60aeb --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-include-rules-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-29T20:01:05.978Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-include-rules-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-include-rules-returns-OK-response.yml new file mode 100644 index 000000000000..66e846593dd9 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-include-rules-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Mon, 29 Jun 2026 20:01:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"field":"content","id":"parse-grok-processor","include":"*","rules":[{"include":"service:foo","match_rules":[{"name":"MyParsingRule","rule":"%{word:user}"}]}],"type":"parse_grok"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline + with Parse Grok Include Rules"},"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-parse-grok-processor-source-rules-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-source-rules-returns-OK-response.frozen new file mode 100644 index 000000000000..4db9a90b937e --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-source-rules-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-29T18:24:15.839Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-source-rules-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-source-rules-returns-OK-response.yml new file mode 100644 index 000000000000..ac9e6191b357 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-parse-grok-processor-source-rules-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Mon, 29 Jun 2026 18:24:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"id":"parse-grok-processor","include":"*","rules":[{"match_rules":[{"name":"MyParsingRule","rule":"%{word:user}"}],"source":"message"}],"type":"parse_grok"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline + with Parse Grok Source Rules"},"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/feature-flags/CreateAllocationsForFeatureFlagInEnvironment.rb b/examples/v2/feature-flags/CreateAllocationsForFeatureFlagInEnvironment.rb index 87ecc035c698..df32da29392b 100644 --- a/examples/v2/feature-flags/CreateAllocationsForFeatureFlagInEnvironment.rb +++ b/examples/v2/feature-flags/CreateAllocationsForFeatureFlagInEnvironment.rb @@ -42,6 +42,7 @@ DatadogAPIClient::V2::ConditionRequest.new({ attribute: "user_tier", operator: DatadogAPIClient::V2::ConditionOperator::ONE_OF, + saved_filter_id: "550e8400-e29b-41d4-a716-446655440090", value: [ "premium", "enterprise", diff --git a/examples/v2/feature-flags/UpdateAllocationsForFeatureFlagInEnvironment.rb b/examples/v2/feature-flags/UpdateAllocationsForFeatureFlagInEnvironment.rb index 8e2755919002..07de47f0e039 100644 --- a/examples/v2/feature-flags/UpdateAllocationsForFeatureFlagInEnvironment.rb +++ b/examples/v2/feature-flags/UpdateAllocationsForFeatureFlagInEnvironment.rb @@ -43,6 +43,7 @@ DatadogAPIClient::V2::ConditionRequest.new({ attribute: "user_tier", operator: DatadogAPIClient::V2::ConditionOperator::ONE_OF, + saved_filter_id: "550e8400-e29b-41d4-a716-446655440090", value: [ "premium", "enterprise", diff --git a/examples/v2/observability-pipelines/ValidatePipeline_3345949653.rb b/examples/v2/observability-pipelines/ValidatePipeline_3345949653.rb new file mode 100644 index 000000000000..57e5d4158841 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_3345949653.rb @@ -0,0 +1,60 @@ +# Validate an observability pipeline with parse grok processor source rules 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::ObservabilityPipelineDatadogLogsDestination.new({ + id: "datadog-logs-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogLogsDestinationType::DATADOG_LOGS, + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "service:my-service", + inputs: [ + "datadog-agent-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessor.new({ + enabled: true, + id: "parse-grok-processor", + include: "*", + type: DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessorType::PARSE_GROK, + rules: [ + DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessorRule.new({ + source: "message", + match_rules: [ + DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessorRuleMatchRule.new({ + name: "MyParsingRule", + rule: "%{word:user}", + }), + ], + }), + ], + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSource.new({ + id: "datadog-agent-source", + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSourceType::DATADOG_AGENT, + }), + ], + }), + name: "Pipeline with Parse Grok Source Rules", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/examples/v2/observability-pipelines/ValidatePipeline_3928499240.rb b/examples/v2/observability-pipelines/ValidatePipeline_3928499240.rb new file mode 100644 index 000000000000..88e409a34f09 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_3928499240.rb @@ -0,0 +1,61 @@ +# Validate an observability pipeline with parse grok processor include rules 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::ObservabilityPipelineDatadogLogsDestination.new({ + id: "datadog-logs-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogLogsDestinationType::DATADOG_LOGS, + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "service:my-service", + inputs: [ + "datadog-agent-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessor.new({ + enabled: true, + id: "parse-grok-processor", + include: "*", + type: DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessorType::PARSE_GROK, + field: "content", + rules: [ + DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessorIncludeRule.new({ + include: "service:foo", + match_rules: [ + DatadogAPIClient::V2::ObservabilityPipelineParseGrokProcessorRuleMatchRule.new({ + name: "MyParsingRule", + rule: "%{word:user}", + }), + ], + }), + ], + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSource.new({ + id: "datadog-agent-source", + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogAgentSourceType::DATADOG_AGENT, + }), + ], + }), + name: "Pipeline with Parse Grok Include Rules", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/features/v2/feature_flags.feature b/features/v2/feature_flags.feature index c98cd04f77ce..f44699236d86 100644 --- a/features/v2/feature_flags.feature +++ b/features/v2/feature_flags.feature @@ -122,7 +122,7 @@ Feature: Feature Flags Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} + And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent Then the response status is 202 Accepted - Approval required for this change @@ -131,7 +131,7 @@ Feature: Feature Flags Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} + And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent Then the response status is 400 Bad Request @@ -140,7 +140,7 @@ Feature: Feature Flags Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} + And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent Then the response status is 409 Conflict @@ -149,7 +149,7 @@ Feature: Feature Flags Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} + And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent Then the response status is 201 Created @@ -158,7 +158,7 @@ Feature: Feature Flags Given new "CreateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} + And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}} When the request is sent Then the response status is 404 Not Found @@ -549,7 +549,7 @@ Feature: Feature Flags Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} + And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent Then the response status is 202 Accepted - Approval required for this change @@ -558,7 +558,7 @@ Feature: Feature Flags Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} + And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent Then the response status is 400 Bad Request @@ -567,7 +567,7 @@ Feature: Feature Flags Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} + And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent Then the response status is 409 Conflict @@ -576,7 +576,7 @@ Feature: Feature Flags Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} + And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent Then the response status is 404 Not Found @@ -585,6 +585,6 @@ Feature: Feature Flags Given new "UpdateAllocationsForFeatureFlagInEnvironment" request And request contains "feature_flag_id" parameter from "REPLACE.ME" And request contains "environment_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} + And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "saved_filter_id": "550e8400-e29b-41d4-a716-446655440090", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]} When the request is sent Then the response status is 200 OK diff --git a/features/v2/observability_pipelines.feature b/features/v2/observability_pipelines.feature index e42bbd7b0335..8aa6ef361596 100644 --- a/features/v2/observability_pipelines.feature +++ b/features/v2/observability_pipelines.feature @@ -295,6 +295,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 parse grok processor include rules returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "parse-grok-processor", "include": "*", "type": "parse_grok", "field": "content", "rules": [{"include": "service:foo", "match_rules": [{"name": "MyParsingRule", "rule": "%{word:user}"}]}]}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with Parse Grok Include Rules"}, "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 parse grok processor source rules returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "parse-grok-processor", "include": "*", "type": "parse_grok", "rules": [{"source": "message", "match_rules": [{"name": "MyParsingRule", "rule": "%{word:user}"}]}]}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with Parse Grok Source Rules"}, "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 source secret key returns "OK" response Given new "ValidatePipeline" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index cd59777811a4..60146fbaa7eb 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4494,6 +4494,8 @@ def overrides "v2.logs_archive_integration_azure" => "LogsArchiveIntegrationAzure", "v2.logs_archive_integration_gcs" => "LogsArchiveIntegrationGCS", "v2.logs_archive_integration_s3" => "LogsArchiveIntegrationS3", + "v2.logs_archive_integration_s3_access_key" => "LogsArchiveIntegrationS3AccessKey", + "v2.logs_archive_integration_s3_role" => "LogsArchiveIntegrationS3Role", "v2.logs_archive_order" => "LogsArchiveOrder", "v2.logs_archive_order_attributes" => "LogsArchiveOrderAttributes", "v2.logs_archive_order_definition" => "LogsArchiveOrderDefinition", @@ -5115,7 +5117,9 @@ def overrides "v2.observability_pipeline_opentelemetry_source" => "ObservabilityPipelineOpentelemetrySource", "v2.observability_pipeline_opentelemetry_source_type" => "ObservabilityPipelineOpentelemetrySourceType", "v2.observability_pipeline_parse_grok_processor" => "ObservabilityPipelineParseGrokProcessor", + "v2.observability_pipeline_parse_grok_processor_include_rule" => "ObservabilityPipelineParseGrokProcessorIncludeRule", "v2.observability_pipeline_parse_grok_processor_rule" => "ObservabilityPipelineParseGrokProcessorRule", + "v2.observability_pipeline_parse_grok_processor_rule_item" => "ObservabilityPipelineParseGrokProcessorRuleItem", "v2.observability_pipeline_parse_grok_processor_rule_match_rule" => "ObservabilityPipelineParseGrokProcessorRuleMatchRule", "v2.observability_pipeline_parse_grok_processor_rule_support_rule" => "ObservabilityPipelineParseGrokProcessorRuleSupportRule", "v2.observability_pipeline_parse_grok_processor_type" => "ObservabilityPipelineParseGrokProcessorType", diff --git a/lib/datadog_api_client/v2/models/condition.rb b/lib/datadog_api_client/v2/models/condition.rb index f755b1cd887d..2b5916059fb4 100644 --- a/lib/datadog_api_client/v2/models/condition.rb +++ b/lib/datadog_api_client/v2/models/condition.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # Targeting condition details. + # Targeting condition details. A condition is either an inline + # predicate with `operator`, `attribute`, and `value`, or a reference to a + # saved filter with `saved_filter_id`. The inline fields are omitted for saved-filter + # references. class Condition include BaseGenericModel - # The user or request attribute to evaluate. - attr_reader :attribute + # The user or request attribute to evaluate. Omitted for saved-filter references. + attr_accessor :attribute # The timestamp when the condition was created. attr_reader :created_at @@ -31,13 +34,16 @@ class Condition attr_reader :id # The operator used in a targeting condition. - attr_reader :operator + attr_accessor :operator + + # The ID of the saved filter referenced by this condition, or null for inline conditions. + attr_accessor :saved_filter_id # The timestamp when the condition was last updated. attr_reader :updated_at - # Values used by the selected operator. - attr_reader :value + # Values used by the selected operator. Omitted for saved-filter references. + attr_accessor :value attr_accessor :additional_properties @@ -49,6 +55,7 @@ def self.attribute_map :'created_at' => :'created_at', :'id' => :'id', :'operator' => :'operator', + :'saved_filter_id' => :'saved_filter_id', :'updated_at' => :'updated_at', :'value' => :'value' } @@ -62,11 +69,20 @@ def self.openapi_types :'created_at' => :'Time', :'id' => :'UUID', :'operator' => :'ConditionOperator', + :'saved_filter_id' => :'UUID', :'updated_at' => :'Time', :'value' => :'Array' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'saved_filter_id', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -101,6 +117,10 @@ def initialize(attributes = {}) self.operator = attributes[:'operator'] end + if attributes.key?(:'saved_filter_id') + self.saved_filter_id = attributes[:'saved_filter_id'] + end + if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end @@ -116,25 +136,12 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @attribute.nil? return false if @created_at.nil? return false if @id.nil? - return false if @operator.nil? return false if @updated_at.nil? - return false if @value.nil? true end - # Custom attribute writer method with validation - # @param attribute [Object] Object to be assigned - # @!visibility private - def attribute=(attribute) - if attribute.nil? - fail ArgumentError, 'invalid value for "attribute", attribute cannot be nil.' - end - @attribute = attribute - end - # Custom attribute writer method with validation # @param created_at [Object] Object to be assigned # @!visibility private @@ -155,16 +162,6 @@ def id=(id) @id = id end - # Custom attribute writer method with validation - # @param operator [Object] Object to be assigned - # @!visibility private - def operator=(operator) - if operator.nil? - fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' - end - @operator = operator - end - # Custom attribute writer method with validation # @param updated_at [Object] Object to be assigned # @!visibility private @@ -175,16 +172,6 @@ def updated_at=(updated_at) @updated_at = updated_at end - # Custom attribute writer method with validation - # @param value [Object] Object to be assigned - # @!visibility private - def value=(value) - if value.nil? - fail ArgumentError, 'invalid value for "value", value cannot be nil.' - end - @value = value - end - # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -215,6 +202,7 @@ def ==(o) created_at == o.created_at && id == o.id && operator == o.operator && + saved_filter_id == o.saved_filter_id && updated_at == o.updated_at && value == o.value && additional_properties == o.additional_properties @@ -224,7 +212,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attribute, created_at, id, operator, updated_at, value, additional_properties].hash + [attribute, created_at, id, operator, saved_filter_id, updated_at, value, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/condition_request.rb b/lib/datadog_api_client/v2/models/condition_request.rb index fcfbf35eced8..c6179357eb95 100644 --- a/lib/datadog_api_client/v2/models/condition_request.rb +++ b/lib/datadog_api_client/v2/models/condition_request.rb @@ -17,18 +17,25 @@ require 'time' module DatadogAPIClient::V2 - # Condition request payload for targeting rules. + # Condition request payload for targeting rules. A condition is either an inline + # predicate with `operator`, `attribute`, and `value`, or a reference to a + # saved filter with `saved_filter_id`. The two shapes are mutually exclusive. class ConditionRequest include BaseGenericModel - # The user or request attribute to evaluate. - attr_reader :attribute + # The user or request attribute to evaluate. Required for inline conditions; omit when `saved_filter_id` is set. + attr_accessor :attribute # The operator used in a targeting condition. - attr_reader :operator + attr_accessor :operator - # Values used by the selected operator. - attr_reader :value + # The ID of a saved filter to reference as this condition. Mutually exclusive + # with `operator`, `attribute`, and `value`. When set, the saved filter's + # targeting rules are evaluated in place of an inline predicate. + attr_accessor :saved_filter_id + + # Values used by the selected operator. Required for inline conditions; omit when `saved_filter_id` is set. + attr_accessor :value attr_accessor :additional_properties @@ -38,6 +45,7 @@ def self.attribute_map { :'attribute' => :'attribute', :'operator' => :'operator', + :'saved_filter_id' => :'saved_filter_id', :'value' => :'value' } end @@ -48,6 +56,7 @@ def self.openapi_types { :'attribute' => :'String', :'operator' => :'ConditionOperator', + :'saved_filter_id' => :'UUID', :'value' => :'Array' } end @@ -78,6 +87,10 @@ def initialize(attributes = {}) self.operator = attributes[:'operator'] end + if attributes.key?(:'saved_filter_id') + self.saved_filter_id = attributes[:'saved_filter_id'] + end + if attributes.key?(:'value') if (value = attributes[:'value']).is_a?(Array) self.value = value @@ -85,46 +98,6 @@ def initialize(attributes = {}) 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 @attribute.nil? - return false if @operator.nil? - return false if @value.nil? - true - end - - # Custom attribute writer method with validation - # @param attribute [Object] Object to be assigned - # @!visibility private - def attribute=(attribute) - if attribute.nil? - fail ArgumentError, 'invalid value for "attribute", attribute cannot be nil.' - end - @attribute = attribute - end - - # Custom attribute writer method with validation - # @param operator [Object] Object to be assigned - # @!visibility private - def operator=(operator) - if operator.nil? - fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' - end - @operator = operator - end - - # Custom attribute writer method with validation - # @param value [Object] Object to be assigned - # @!visibility private - def value=(value) - if value.nil? - fail ArgumentError, 'invalid value for "value", value cannot be nil.' - end - @value = value - end - # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -153,6 +126,7 @@ def ==(o) self.class == o.class && attribute == o.attribute && operator == o.operator && + saved_filter_id == o.saved_filter_id && value == o.value && additional_properties == o.additional_properties end @@ -161,7 +135,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attribute, operator, value, additional_properties].hash + [attribute, operator, saved_filter_id, value, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb b/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb index 6da62c43547e..daad7a516102 100644 --- a/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb +++ b/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb @@ -27,7 +27,7 @@ class LogsArchiveDestinationS3 # The S3 encryption settings. attr_accessor :encryption - # The S3 Archive's integration destination. + # The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. attr_reader :integration # The archive path. diff --git a/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb b/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb index fd73c2112c68..66130b8c6f94 100644 --- a/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb +++ b/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb @@ -17,128 +17,47 @@ require 'time' module DatadogAPIClient::V2 - # The S3 Archive's integration destination. - class LogsArchiveIntegrationS3 - include BaseGenericModel - - # The account ID for the integration. - attr_reader :account_id - - # The path of the integration. - attr_reader :role_name - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'account_id' => :'account_id', - :'role_name' => :'role_name' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'account_id' => :'String', - :'role_name' => :'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::LogsArchiveIntegrationS3` initialize method" + # The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. + module LogsArchiveIntegrationS3 + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LogsArchiveIntegrationS3AccessKey', + :'LogsArchiveIntegrationS3Role' + ] 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 + # 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 attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'role_name') - self.role_name = attributes[:'role_name'] - 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 @account_id.nil? - return false if @role_name.nil? - true - end - - # Custom attribute writer method with validation - # @param account_id [Object] Object to be assigned - # @!visibility private - def account_id=(account_id) - if account_id.nil? - fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' - end - @account_id = account_id - end - - # Custom attribute writer method with validation - # @param role_name [Object] Object to be assigned - # @!visibility private - def role_name=(role_name) - if role_name.nil? - fail ArgumentError, 'invalid value for "role_name", role_name cannot be nil.' - end - @role_name = role_name - 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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - account_id == o.account_id && - role_name == o.role_name && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [account_id, role_name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.rb b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.rb new file mode 100644 index 000000000000..95398bb975ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.rb @@ -0,0 +1,123 @@ +=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 S3 Archive's integration destination using an access key. + class LogsArchiveIntegrationS3AccessKey + include BaseGenericModel + + # The access key ID for the integration. + attr_reader :access_key_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_key_id' => :'access_key_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_key_id' => :'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::LogsArchiveIntegrationS3AccessKey` 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?(:'access_key_id') + self.access_key_id = attributes[:'access_key_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 @access_key_id.nil? + true + end + + # Custom attribute writer method with validation + # @param access_key_id [Object] Object to be assigned + # @!visibility private + def access_key_id=(access_key_id) + if access_key_id.nil? + fail ArgumentError, 'invalid value for "access_key_id", access_key_id cannot be nil.' + end + @access_key_id = access_key_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 && + access_key_id == o.access_key_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_key_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.rb b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.rb new file mode 100644 index 000000000000..0d85e7e8976b --- /dev/null +++ b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.rb @@ -0,0 +1,144 @@ +=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 S3 Archive's integration destination using an IAM role. + class LogsArchiveIntegrationS3Role + include BaseGenericModel + + # The account ID for the integration. + attr_reader :account_id + + # The name of the role to assume for the integration. + attr_reader :role_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'role_name' => :'role_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'role_name' => :'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::LogsArchiveIntegrationS3Role` 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?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'role_name') + self.role_name = attributes[:'role_name'] + 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 @account_id.nil? + return false if @role_name.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param role_name [Object] Object to be assigned + # @!visibility private + def role_name=(role_name) + if role_name.nil? + fail ArgumentError, 'invalid value for "role_name", role_name cannot be nil.' + end + @role_name = role_name + 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 && + account_id == o.account_id && + role_name == o.role_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, role_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb index e7f3e1ab34e1..802f43a6f112 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb @@ -32,13 +32,16 @@ class ObservabilityPipelineParseGrokProcessor # Indicates whether the processor is enabled. attr_reader :enabled + # The log field to parse with the Grok rules. + attr_accessor :field + # A unique identifier for this processor. attr_reader :id # A Datadog search query used to determine which logs this processor targets. attr_reader :include - # The list of Grok parsing rules. If multiple matching rules are provided, they are evaluated in order. The first successful match is applied. + # The list of Grok parsing rules selected by either source field or include query. attr_reader :rules # The processor type. The value should always be `parse_grok`. @@ -53,6 +56,7 @@ def self.attribute_map :'disable_library_rules' => :'disable_library_rules', :'display_name' => :'display_name', :'enabled' => :'enabled', + :'field' => :'field', :'id' => :'id', :'include' => :'include', :'rules' => :'rules', @@ -67,9 +71,10 @@ def self.openapi_types :'disable_library_rules' => :'Boolean', :'display_name' => :'String', :'enabled' => :'Boolean', + :'field' => :'String', :'id' => :'String', :'include' => :'String', - :'rules' => :'Array', + :'rules' => :'Array', :'type' => :'ObservabilityPipelineParseGrokProcessorType' } end @@ -104,6 +109,10 @@ def initialize(attributes = {}) self.enabled = attributes[:'enabled'] end + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -214,6 +223,7 @@ def ==(o) disable_library_rules == o.disable_library_rules && display_name == o.display_name && enabled == o.enabled && + field == o.field && id == o.id && include == o.include && rules == o.rules && @@ -225,7 +235,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [disable_library_rules, display_name, enabled, id, include, rules, type, additional_properties].hash + [disable_library_rules, display_name, enabled, field, id, include, rules, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor_include_rule.rb b/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor_include_rule.rb new file mode 100644 index 000000000000..b173475cab06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor_include_rule.rb @@ -0,0 +1,160 @@ +=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 + # A Grok parsing rule selected using the `include` query. Each rule defines how to extract structured fields + # from logs matching a Datadog search query. + class ObservabilityPipelineParseGrokProcessorIncludeRule + include BaseGenericModel + + # A Datadog search query used to determine which logs this Grok rule targets. + attr_reader :include + + # A list of Grok parsing rules that define how to extract fields from matching logs. + # Each rule must contain a name and a valid Grok pattern. + attr_reader :match_rules + + # A list of Grok helper rules that can be referenced by the parsing rules. + attr_accessor :support_rules + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include' => :'include', + :'match_rules' => :'match_rules', + :'support_rules' => :'support_rules' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include' => :'String', + :'match_rules' => :'Array', + :'support_rules' => :'Array' + } + 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::ObservabilityPipelineParseGrokProcessorIncludeRule` 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?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'match_rules') + if (value = attributes[:'match_rules']).is_a?(Array) + self.match_rules = value + end + end + + if attributes.key?(:'support_rules') + if (value = attributes[:'support_rules']).is_a?(Array) + self.support_rules = value + end + 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 @include.nil? + return false if @match_rules.nil? + true + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param match_rules [Object] Object to be assigned + # @!visibility private + def match_rules=(match_rules) + if match_rules.nil? + fail ArgumentError, 'invalid value for "match_rules", match_rules cannot be nil.' + end + @match_rules = match_rules + 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 && + include == o.include && + match_rules == o.match_rules && + support_rules == o.support_rules && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include, match_rules, support_rules, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor_rule_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor_rule_item.rb new file mode 100644 index 000000000000..65e254c5854f --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor_rule_item.rb @@ -0,0 +1,63 @@ +=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 + # A single Grok parsing rule, selected by either source field or include query. + module ObservabilityPipelineParseGrokProcessorRuleItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineParseGrokProcessorRule', + :'ObservabilityPipelineParseGrokProcessorIncludeRule' + ] + 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