diff --git a/.generated-info b/.generated-info index ca23f6db0fc2..66e09aadb5a2 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "8001cbb", - "generated": "2025-08-13 20:27:09.207" + "spec_repo_commit": "d394b63", + "generated": "2025-08-14 13:57:42.325" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5ab5923ba83d..0bf5675ba15a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7649,12 +7649,12 @@ components: description: The type of the changed resource. enum: - feature_flag - - configuration + - metric_configuration example: feature_flag type: string x-enum-varnames: - FEATURE_FLAG - - CONFIGURATION + - METRIC_CONFIGURATION ChangeEventAttributesImpactedResourcesItem: description: A uniquely identified resource. properties: @@ -7780,12 +7780,12 @@ components: description: The type of the resource that was changed. enum: - feature_flag - - configuration + - metric_configuration example: feature_flag type: string x-enum-varnames: - FEATURE_FLAG - - CONFIGURATION + - METRIC_CONFIGURATION ChangeEventCustomAttributesImpactedResourcesItems: additionalProperties: false description: Object representing a uniquely identified resource. diff --git a/features/v2/events.feature b/features/v2/events.feature index 61d824ce1084..f89a1d53789a 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -87,6 +87,15 @@ Feature: Events And the response "data.type" is equal to "event" And the response "data.attributes.attributes.evt" has field "uid" + @skip-validation @team:DataDog/event-management + Scenario: Post an event with metric_configuration resource type returns "OK" response + Given new "CreateEvent" request + And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/metric/config_test"}, "changed_resource": {"name": "config_test", "type": "metric_configuration"}, "impacted_resources": [{"name": "system.cpu.usage", "type": "service"}], "new_value": {"aggregation": "avg", "tags": ["env:prod", "service:web"], "unit": "percent"}, "prev_value": {"aggregation": "sum", "tags": ["env:prod"], "unit": "percent"}}, "category": "change", "integration_id": "custom-events", "message": "metric configuration has been updated", "tags": ["env:api_client_test"], "title": "metric configuration updated"}, "type": "event"}} + When the request is sent + Then the response status is 202 OK + And the response "data.type" is equal to "event" + And the response "data.attributes.attributes.evt" has field "uid" + @team:DataDog/event-management Scenario: Search events returns "Bad Request" response Given new "SearchEvents" request diff --git a/services/events/src/v2/models/ChangeEventAttributesChangedResourceType.ts b/services/events/src/v2/models/ChangeEventAttributesChangedResourceType.ts index 34bd086800b1..dde41e8fecc8 100644 --- a/services/events/src/v2/models/ChangeEventAttributesChangedResourceType.ts +++ b/services/events/src/v2/models/ChangeEventAttributesChangedResourceType.ts @@ -5,7 +5,7 @@ import { UnparsedObject } from "@datadog/datadog-api-client"; */ export type ChangeEventAttributesChangedResourceType = | typeof FEATURE_FLAG - | typeof CONFIGURATION + | typeof METRIC_CONFIGURATION | UnparsedObject; export const FEATURE_FLAG = "feature_flag"; -export const CONFIGURATION = "configuration"; +export const METRIC_CONFIGURATION = "metric_configuration"; diff --git a/services/events/src/v2/models/ChangeEventCustomAttributesChangedResourceType.ts b/services/events/src/v2/models/ChangeEventCustomAttributesChangedResourceType.ts index ce207a086e61..f20b48c9157c 100644 --- a/services/events/src/v2/models/ChangeEventCustomAttributesChangedResourceType.ts +++ b/services/events/src/v2/models/ChangeEventCustomAttributesChangedResourceType.ts @@ -5,7 +5,7 @@ import { UnparsedObject } from "@datadog/datadog-api-client"; */ export type ChangeEventCustomAttributesChangedResourceType = | typeof FEATURE_FLAG - | typeof CONFIGURATION + | typeof METRIC_CONFIGURATION | UnparsedObject; export const FEATURE_FLAG = "feature_flag"; -export const CONFIGURATION = "configuration"; +export const METRIC_CONFIGURATION = "metric_configuration"; diff --git a/services/events/src/v2/models/TypingInfo.ts b/services/events/src/v2/models/TypingInfo.ts index a5e52364faf7..05c55f12df3c 100644 --- a/services/events/src/v2/models/TypingInfo.ts +++ b/services/events/src/v2/models/TypingInfo.ts @@ -61,7 +61,10 @@ export const TypingInfo: ModelTypingInfo = { AlertEventCustomAttributesPriority: ["1", "2", "3", "4", "5"], AlertEventCustomAttributesStatus: ["warn", "error", "ok"], ChangeEventAttributesAuthorType: ["user", "system", "api", "automation"], - ChangeEventAttributesChangedResourceType: ["feature_flag", "configuration"], + ChangeEventAttributesChangedResourceType: [ + "feature_flag", + "metric_configuration", + ], ChangeEventAttributesImpactedResourcesItemType: ["service"], ChangeEventCustomAttributesAuthorType: [ "user", @@ -71,7 +74,7 @@ export const TypingInfo: ModelTypingInfo = { ], ChangeEventCustomAttributesChangedResourceType: [ "feature_flag", - "configuration", + "metric_configuration", ], ChangeEventCustomAttributesImpactedResourcesItemsType: ["service"], EventCategory: ["change", "alert"],