diff --git a/.apigentools-info b/.apigentools-info index a17bbcd99e8c..7b9a3c83d43a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-02 04:31:15.271278", - "spec_repo_commit": "272cce39" + "regenerated": "2025-05-03 12:36:02.528934", + "spec_repo_commit": "d5e18a51" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-02 04:31:15.291066", - "spec_repo_commit": "272cce39" + "regenerated": "2025-05-03 12:36:02.544567", + "spec_repo_commit": "d5e18a51" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 14c6d2062fab..16c00c0e3e40 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2138,6 +2138,89 @@ components: - id - base_severity type: object + AlertEventCustomAttributes: + additionalProperties: false + description: Object representing custom alert event attributes. + properties: + custom: + $ref: '#/components/schemas/AlertEventCustomAttributesCustom' + links: + $ref: '#/components/schemas/AlertEventCustomAttributesLinks' + priority: + $ref: '#/components/schemas/AlertEventCustomAttributesPriority' + status: + $ref: '#/components/schemas/AlertEventCustomAttributesStatus' + type: object + AlertEventCustomAttributesCustom: + additionalProperties: {} + description: Custom attributes support up to 100 properties and a maximum nesting + depth of 10 levels. + example: {} + type: object + AlertEventCustomAttributesLinks: + description: The links related to the event. + items: + $ref: '#/components/schemas/AlertEventCustomAttributesLinksItems' + maxItems: 20 + minItems: 1 + type: array + AlertEventCustomAttributesLinksItems: + description: A link. + properties: + category: + $ref: '#/components/schemas/AlertEventCustomAttributesLinksItemsCategory' + title: + description: The title of the link. + example: Runbook Link + maxLength: 300 + type: string + url: + description: The URL of the link. + example: https://app.datadoghq.com/runbook + maxLength: 2048 + type: string + required: + - url + - category + type: object + AlertEventCustomAttributesLinksItemsCategory: + description: The category of the link. + enum: + - runbook + example: runbook + type: string + x-enum-varnames: + - RUNBOOK + AlertEventCustomAttributesPriority: + description: The priority of the alert. + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + example: '1' + type: string + x-enum-varnames: + - PRIORITY_ONE + - PRIORITY_TWO + - PRIORITY_THREE + - PRIORITY_FOUR + - PRIORITY_FIVE + AlertEventCustomAttributesStatus: + description: The status of the alert. + enum: + - info + - warn + - error + - ok + example: warn + type: string + x-enum-varnames: + - INFO + - WARN + - ERROR + - OK Annotation: description: A list of annotations used in the workflow. These are like sticky notes for your workflow! @@ -13949,15 +14032,16 @@ components: type: string type: object EventCategory: - description: Event category to identify the type of event. Only the value `change` - is supported. Support for other categories are coming. please reach out to - datadog support if you're interested. + description: Event category to identify the type of event. For example, `change` + or `alert`. enum: - change + - alert example: change type: string x-enum-varnames: - CHANGE + - ALERT EventCreateRequest: description: Object representing an event creation request. properties: @@ -13965,12 +14049,17 @@ components: $ref: '#/components/schemas/EventPayload' type: $ref: '#/components/schemas/EventCreateRequestType' + required: + - type + - attributes type: object EventCreateRequestPayload: description: Payload for creating an event. properties: data: $ref: '#/components/schemas/EventCreateRequest' + required: + - data type: object EventCreateRequestType: description: Entity type. @@ -13985,6 +14074,10 @@ components: properties: attributes: $ref: '#/components/schemas/EventCreateResponseAttributes' + id: + description: Event ID + example: _ + type: string type: description: Event type example: event @@ -14006,8 +14099,9 @@ components: EventCreateResponseAttributesAttributesEvt: description: JSON object of event system attributes. properties: - id: - description: Event id + uid: + description: Event UID + example: ABCDEFGHIJKLMNOPQRSTUVWX type: string type: object EventCreateResponsePayload: @@ -14015,6 +14109,16 @@ components: properties: data: $ref: '#/components/schemas/EventCreateResponse' + links: + $ref: '#/components/schemas/EventCreateResponsePayloadLinks' + type: object + EventCreateResponsePayloadLinks: + description: Links attributes. + properties: + self: + description: The URL of the event. + example: https://app.datadoghq.com/event/event?id=123 + type: string type: object EventPayload: description: Event attributes. @@ -14022,12 +14126,19 @@ components: aggregation_key: description: An arbitrary string to use for aggregation when correlating events. Limited to 100 characters. + example: aggregation_key_123 maxLength: 100 type: string attributes: $ref: '#/components/schemas/EventPayloadAttributes' category: $ref: '#/components/schemas/EventCategory' + integration_id: + description: Integration IDs sourced from manifests. Examples include custom-events, + containerd, docker, elasticsearch, helm, mongodb, mysql, and nagios. See + the full list of available IDs [here](https://docs.datadoghq.com/getting_started/integrations/). + example: custom-events + type: string message: description: The body of the event. Limited to 4000 characters. example: payment_processed feature flag has been enabled @@ -14041,7 +14152,10 @@ components: - env:test items: description: A tag. + maxLength: 200 type: string + maxItems: 100 + minItems: 1 type: array timestamp: description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) @@ -14067,6 +14181,7 @@ components: event category. oneOf: - $ref: '#/components/schemas/ChangeEventCustomAttributes' + - $ref: '#/components/schemas/AlertEventCustomAttributes' EventPriority: description: The priority of the event's monitor. For example, `normal` or `low`. enum: @@ -45283,7 +45398,8 @@ paths: - events_read post: description: "This endpoint allows you to post events.\n\n\u2705 **Only events - with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) + with the `change` or `alert` category** are in General Availability. For change + events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.\n\n\u274C For use cases involving other event categories, please use the V1 endpoint." operationId: CreateEvent @@ -45295,6 +45411,7 @@ paths: value: data: attributes: + aggregation_key: aggregation_key_123 attributes: author: name: datadog@datadog.com @@ -45323,6 +45440,7 @@ paths: rule: datacenter: devcycle.us1.prod category: change + integration_id: custom-events message: payment_processed feature flag has been enabled tags: - env:test @@ -45356,6 +45474,38 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] + servers: + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: The regional site for customers. + enum: + - datadoghq.com + - us3.datadoghq.com + - us5.datadoghq.com + - ap1.datadoghq.com + - datadoghq.eu + - ddog-gov.com + subdomain: + default: event-management-intake + description: The subdomain where the API is deployed. + - url: '{protocol}://{name}' + variables: + name: + default: event-management-intake.datadoghq.com + description: Full site DNS name. + protocol: + default: https + description: The protocol for accessing the API. + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: Any Datadog deployment. + subdomain: + default: event-management-intake + description: The subdomain where the API is deployed. summary: Post an event tags: - Events diff --git a/examples/v2/events/CreateEvent.ts b/examples/v2/events/CreateEvent.ts index b08a4499b3f0..244b0faf1d95 100644 --- a/examples/v2/events/CreateEvent.ts +++ b/examples/v2/events/CreateEvent.ts @@ -11,6 +11,7 @@ const params: v2.EventsApiCreateEventRequest = { body: { data: { attributes: { + aggregationKey: "aggregation_key_123", attributes: { author: { name: "datadog@datadog.com", @@ -42,6 +43,7 @@ const params: v2.EventsApiCreateEventRequest = { }, }, category: "change", + integrationId: "custom-events", message: "payment_processed feature flag has been enabled", tags: ["env:test"], title: "payment_processed feature flag updated", diff --git a/features/v2/events.feature b/features/v2/events.feature index a8c1307ac683..71a689b2cb68 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -53,14 +53,14 @@ Feature: Events @generated @skip @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request - And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@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/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "datadog@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/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} When the request is sent Then the response status is 400 Bad request @generated @skip @team:DataDog/event-management Scenario: Post an event returns "OK" response Given new "CreateEvent" request - And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@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/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "datadog@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/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} When the request is sent Then the response status is 200 OK diff --git a/packages/datadog-api-client-common/servers.ts b/packages/datadog-api-client-common/servers.ts index 00f033949a1b..9dc3d1d2f36c 100644 --- a/packages/datadog-api-client-common/servers.ts +++ b/packages/datadog-api-client-common/servers.ts @@ -153,6 +153,35 @@ export const operationServers: { subdomain: "http-intake.logs", }), ], + "v2.EventsApi.createEvent": [ + new ServerConfiguration<{ + site: + | "datadoghq.com" + | "us3.datadoghq.com" + | "us5.datadoghq.com" + | "ap1.datadoghq.com" + | "datadoghq.eu" + | "ddog-gov.com"; + subdomain: string; + }>("https://{subdomain}.{site}", { + site: "datadoghq.com", + subdomain: "event-management-intake", + }), + new ServerConfiguration<{ + name: string; + protocol: string; + }>("{protocol}://{name}", { + name: "event-management-intake.datadoghq.com", + protocol: "https", + }), + new ServerConfiguration<{ + site: string; + subdomain: string; + }>("https://{subdomain}.{site}", { + site: "datadoghq.com", + subdomain: "event-management-intake", + }), + ], "v2.LogsApi.submitLog": [ new ServerConfiguration<{ site: diff --git a/packages/datadog-api-client-v2/apis/EventsApi.ts b/packages/datadog-api-client-v2/apis/EventsApi.ts index 02f640340e58..aa7b87f66549 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -455,7 +455,7 @@ export class EventsApi { /** * This endpoint allows you to post events. * - * ✅ **Only events with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details. + * ✅ **Only events with the `change` or `alert` category** are in General Availability. For change events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details. * * ❌ For use cases involving other event categories, please use the V1 endpoint. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 98f69de95130..755146e9bc76 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -736,6 +736,11 @@ export { ActiveBillingDimensionsBody } from "./models/ActiveBillingDimensionsBod export { ActiveBillingDimensionsResponse } from "./models/ActiveBillingDimensionsResponse"; export { ActiveBillingDimensionsType } from "./models/ActiveBillingDimensionsType"; export { Advisory } from "./models/Advisory"; +export { AlertEventCustomAttributes } from "./models/AlertEventCustomAttributes"; +export { AlertEventCustomAttributesLinksItems } from "./models/AlertEventCustomAttributesLinksItems"; +export { AlertEventCustomAttributesLinksItemsCategory } from "./models/AlertEventCustomAttributesLinksItemsCategory"; +export { AlertEventCustomAttributesPriority } from "./models/AlertEventCustomAttributesPriority"; +export { AlertEventCustomAttributesStatus } from "./models/AlertEventCustomAttributesStatus"; export { Annotation } from "./models/Annotation"; export { AnnotationDisplay } from "./models/AnnotationDisplay"; export { AnnotationDisplayBounds } from "./models/AnnotationDisplayBounds"; @@ -1525,6 +1530,7 @@ export { EventCreateResponseAttributes } from "./models/EventCreateResponseAttri export { EventCreateResponseAttributesAttributes } from "./models/EventCreateResponseAttributesAttributes"; export { EventCreateResponseAttributesAttributesEvt } from "./models/EventCreateResponseAttributesAttributesEvt"; export { EventCreateResponsePayload } from "./models/EventCreateResponsePayload"; +export { EventCreateResponsePayloadLinks } from "./models/EventCreateResponsePayloadLinks"; export { EventPayload } from "./models/EventPayload"; export { EventPayloadAttributes } from "./models/EventPayloadAttributes"; export { EventPriority } from "./models/EventPriority"; diff --git a/packages/datadog-api-client-v2/models/AlertEventCustomAttributes.ts b/packages/datadog-api-client-v2/models/AlertEventCustomAttributes.ts new file mode 100644 index 000000000000..c436a8bcc092 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributes.ts @@ -0,0 +1,68 @@ +/** + * 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. + */ +import { AlertEventCustomAttributesLinksItems } from "./AlertEventCustomAttributesLinksItems"; +import { AlertEventCustomAttributesPriority } from "./AlertEventCustomAttributesPriority"; +import { AlertEventCustomAttributesStatus } from "./AlertEventCustomAttributesStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object representing custom alert event attributes. + */ +export class AlertEventCustomAttributes { + /** + * Custom attributes support up to 100 properties and a maximum nesting depth of 10 levels. + */ + "custom"?: { [key: string]: any }; + /** + * The links related to the event. + */ + "links"?: Array; + /** + * The priority of the alert. + */ + "priority"?: AlertEventCustomAttributesPriority; + /** + * The status of the alert. + */ + "status"?: AlertEventCustomAttributesStatus; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + custom: { + baseName: "custom", + type: "{ [key: string]: any; }", + }, + links: { + baseName: "links", + type: "Array", + }, + priority: { + baseName: "priority", + type: "AlertEventCustomAttributesPriority", + }, + status: { + baseName: "status", + type: "AlertEventCustomAttributesStatus", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AlertEventCustomAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItems.ts b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItems.ts new file mode 100644 index 000000000000..d67b41f7ef27 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItems.ts @@ -0,0 +1,71 @@ +/** + * 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. + */ +import { AlertEventCustomAttributesLinksItemsCategory } from "./AlertEventCustomAttributesLinksItemsCategory"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A link. + */ +export class AlertEventCustomAttributesLinksItems { + /** + * The category of the link. + */ + "category": AlertEventCustomAttributesLinksItemsCategory; + /** + * The title of the link. + */ + "title"?: string; + /** + * The URL of the link. + */ + "url": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + category: { + baseName: "category", + type: "AlertEventCustomAttributesLinksItemsCategory", + required: true, + }, + title: { + baseName: "title", + type: "string", + }, + url: { + baseName: "url", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AlertEventCustomAttributesLinksItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItemsCategory.ts b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItemsCategory.ts new file mode 100644 index 000000000000..6090e0b4dc17 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItemsCategory.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The category of the link. + */ + +export type AlertEventCustomAttributesLinksItemsCategory = + | typeof RUNBOOK + | UnparsedObject; +export const RUNBOOK = "runbook"; diff --git a/packages/datadog-api-client-v2/models/AlertEventCustomAttributesPriority.ts b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesPriority.ts new file mode 100644 index 000000000000..1ff27794cfab --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesPriority.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The priority of the alert. + */ + +export type AlertEventCustomAttributesPriority = + | typeof PRIORITY_ONE + | typeof PRIORITY_TWO + | typeof PRIORITY_THREE + | typeof PRIORITY_FOUR + | typeof PRIORITY_FIVE + | UnparsedObject; +export const PRIORITY_ONE = "1"; +export const PRIORITY_TWO = "2"; +export const PRIORITY_THREE = "3"; +export const PRIORITY_FOUR = "4"; +export const PRIORITY_FIVE = "5"; diff --git a/packages/datadog-api-client-v2/models/AlertEventCustomAttributesStatus.ts b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesStatus.ts new file mode 100644 index 000000000000..a075963f1a1f --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesStatus.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The status of the alert. + */ + +export type AlertEventCustomAttributesStatus = + | typeof INFO + | typeof WARN + | typeof ERROR + | typeof OK + | UnparsedObject; +export const INFO = "info"; +export const WARN = "warn"; +export const ERROR = "error"; +export const OK = "ok"; diff --git a/packages/datadog-api-client-v2/models/EventCategory.ts b/packages/datadog-api-client-v2/models/EventCategory.ts index 2b1796fd87d6..a2cb7d7fd4c3 100644 --- a/packages/datadog-api-client-v2/models/EventCategory.ts +++ b/packages/datadog-api-client-v2/models/EventCategory.ts @@ -7,8 +7,9 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; /** - * Event category to identify the type of event. Only the value `change` is supported. Support for other categories are coming. please reach out to datadog support if you're interested. + * Event category to identify the type of event. For example, `change` or `alert`. */ -export type EventCategory = typeof CHANGE | UnparsedObject; +export type EventCategory = typeof CHANGE | typeof ALERT | UnparsedObject; export const CHANGE = "change"; +export const ALERT = "alert"; diff --git a/packages/datadog-api-client-v2/models/EventCreateRequest.ts b/packages/datadog-api-client-v2/models/EventCreateRequest.ts index 45945e5315ae..dc7264ebd0de 100644 --- a/packages/datadog-api-client-v2/models/EventCreateRequest.ts +++ b/packages/datadog-api-client-v2/models/EventCreateRequest.ts @@ -15,11 +15,11 @@ export class EventCreateRequest { /** * Event attributes. */ - "attributes"?: EventPayload; + "attributes": EventPayload; /** * Entity type. */ - "type"?: EventCreateRequestType; + "type": EventCreateRequestType; /** * A container for additional, undeclared properties. @@ -40,10 +40,12 @@ export class EventCreateRequest { attributes: { baseName: "attributes", type: "EventPayload", + required: true, }, type: { baseName: "type", type: "EventCreateRequestType", + required: true, }, additionalProperties: { baseName: "additionalProperties", diff --git a/packages/datadog-api-client-v2/models/EventCreateRequestPayload.ts b/packages/datadog-api-client-v2/models/EventCreateRequestPayload.ts index 74d64c448c88..32a69db7be3c 100644 --- a/packages/datadog-api-client-v2/models/EventCreateRequestPayload.ts +++ b/packages/datadog-api-client-v2/models/EventCreateRequestPayload.ts @@ -14,7 +14,7 @@ export class EventCreateRequestPayload { /** * Object representing an event creation request. */ - "data"?: EventCreateRequest; + "data": EventCreateRequest; /** * A container for additional, undeclared properties. @@ -35,6 +35,7 @@ export class EventCreateRequestPayload { data: { baseName: "data", type: "EventCreateRequest", + required: true, }, additionalProperties: { baseName: "additionalProperties", diff --git a/packages/datadog-api-client-v2/models/EventCreateResponse.ts b/packages/datadog-api-client-v2/models/EventCreateResponse.ts index dbbb3269c241..692e47443550 100644 --- a/packages/datadog-api-client-v2/models/EventCreateResponse.ts +++ b/packages/datadog-api-client-v2/models/EventCreateResponse.ts @@ -15,6 +15,10 @@ export class EventCreateResponse { * JSON object containing all events attributes and their associated values. */ "attributes"?: EventCreateResponseAttributes; + /** + * Event ID + */ + "id"?: string; /** * Event type */ @@ -40,6 +44,10 @@ export class EventCreateResponse { baseName: "attributes", type: "EventCreateResponseAttributes", }, + id: { + baseName: "id", + type: "string", + }, type: { baseName: "type", type: "string", diff --git a/packages/datadog-api-client-v2/models/EventCreateResponseAttributesAttributesEvt.ts b/packages/datadog-api-client-v2/models/EventCreateResponseAttributesAttributesEvt.ts index c21556081522..a1be0ca97bb7 100644 --- a/packages/datadog-api-client-v2/models/EventCreateResponseAttributesAttributesEvt.ts +++ b/packages/datadog-api-client-v2/models/EventCreateResponseAttributesAttributesEvt.ts @@ -11,9 +11,9 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class EventCreateResponseAttributesAttributesEvt { /** - * Event id + * Event UID */ - "id"?: string; + "uid"?: string; /** * A container for additional, undeclared properties. @@ -31,8 +31,8 @@ export class EventCreateResponseAttributesAttributesEvt { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { - id: { - baseName: "id", + uid: { + baseName: "uid", type: "string", }, additionalProperties: { diff --git a/packages/datadog-api-client-v2/models/EventCreateResponsePayload.ts b/packages/datadog-api-client-v2/models/EventCreateResponsePayload.ts index b0a1da3130c1..56fd4d679ab5 100644 --- a/packages/datadog-api-client-v2/models/EventCreateResponsePayload.ts +++ b/packages/datadog-api-client-v2/models/EventCreateResponsePayload.ts @@ -4,6 +4,7 @@ * Copyright 2020-Present Datadog, Inc. */ import { EventCreateResponse } from "./EventCreateResponse"; +import { EventCreateResponsePayloadLinks } from "./EventCreateResponsePayloadLinks"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -15,6 +16,10 @@ export class EventCreateResponsePayload { * Object containing an event response. */ "data"?: EventCreateResponse; + /** + * Links attributes. + */ + "links"?: EventCreateResponsePayloadLinks; /** * A container for additional, undeclared properties. @@ -36,6 +41,10 @@ export class EventCreateResponsePayload { baseName: "data", type: "EventCreateResponse", }, + links: { + baseName: "links", + type: "EventCreateResponsePayloadLinks", + }, additionalProperties: { baseName: "additionalProperties", type: "any", diff --git a/packages/datadog-api-client-v2/models/EventCreateResponsePayloadLinks.ts b/packages/datadog-api-client-v2/models/EventCreateResponsePayloadLinks.ts new file mode 100644 index 000000000000..38c857502c5d --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventCreateResponsePayloadLinks.ts @@ -0,0 +1,52 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Links attributes. + */ +export class EventCreateResponsePayloadLinks { + /** + * The URL of the event. + */ + "self"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + self: { + baseName: "self", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventCreateResponsePayloadLinks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventPayload.ts b/packages/datadog-api-client-v2/models/EventPayload.ts index ce55fadebb51..38c438be4f84 100644 --- a/packages/datadog-api-client-v2/models/EventPayload.ts +++ b/packages/datadog-api-client-v2/models/EventPayload.ts @@ -21,9 +21,13 @@ export class EventPayload { */ "attributes": EventPayloadAttributes; /** - * Event category to identify the type of event. Only the value `change` is supported. Support for other categories are coming. please reach out to datadog support if you're interested. + * Event category to identify the type of event. For example, `change` or `alert`. */ "category": EventCategory; + /** + * Integration IDs sourced from manifests. Examples include custom-events, containerd, docker, elasticsearch, helm, mongodb, mysql, and nagios. See the full list of available IDs [here](https://docs.datadoghq.com/getting_started/integrations/). + */ + "integrationId"?: string; /** * The body of the event. Limited to 4000 characters. */ @@ -74,6 +78,10 @@ export class EventPayload { type: "EventCategory", required: true, }, + integrationId: { + baseName: "integration_id", + type: "string", + }, message: { baseName: "message", type: "string", diff --git a/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts b/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts index 5bdf3f3dd14f..b563eae38d88 100644 --- a/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts +++ b/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts @@ -3,6 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { AlertEventCustomAttributes } from "./AlertEventCustomAttributes"; import { ChangeEventCustomAttributes } from "./ChangeEventCustomAttributes"; import { UnparsedObject } from "../../datadog-api-client-common/util"; @@ -13,4 +14,5 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; export type EventPayloadAttributes = | ChangeEventCustomAttributes + | AlertEventCustomAttributes | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 3650c49748b7..a5d1c688643e 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -61,6 +61,8 @@ import { ActiveBillingDimensionsAttributes } from "./ActiveBillingDimensionsAttr import { ActiveBillingDimensionsBody } from "./ActiveBillingDimensionsBody"; import { ActiveBillingDimensionsResponse } from "./ActiveBillingDimensionsResponse"; import { Advisory } from "./Advisory"; +import { AlertEventCustomAttributes } from "./AlertEventCustomAttributes"; +import { AlertEventCustomAttributesLinksItems } from "./AlertEventCustomAttributesLinksItems"; import { Annotation } from "./Annotation"; import { AnnotationDisplay } from "./AnnotationDisplay"; import { AnnotationDisplayBounds } from "./AnnotationDisplayBounds"; @@ -624,6 +626,7 @@ import { EventCreateResponseAttributes } from "./EventCreateResponseAttributes"; import { EventCreateResponseAttributesAttributes } from "./EventCreateResponseAttributesAttributes"; import { EventCreateResponseAttributesAttributesEvt } from "./EventCreateResponseAttributesAttributesEvt"; import { EventCreateResponsePayload } from "./EventCreateResponsePayload"; +import { EventCreateResponsePayloadLinks } from "./EventCreateResponsePayloadLinks"; import { EventPayload } from "./EventPayload"; import { EventResponse } from "./EventResponse"; import { EventResponseAttributes } from "./EventResponseAttributes"; @@ -1905,6 +1908,9 @@ const enumsMap: { [key: string]: any[] } = { ActionConnectionDataType: ["action_connection"], ActionQueryType: ["action"], ActiveBillingDimensionsType: ["billing_dimensions"], + AlertEventCustomAttributesLinksItemsCategory: ["runbook"], + AlertEventCustomAttributesPriority: ["1", "2", "3", "4", "5"], + AlertEventCustomAttributesStatus: ["info", "warn", "error", "ok"], ApmRetentionFilterType: ["apm_retention_filter"], AppBuilderEventName: [ "pageChange", @@ -2221,7 +2227,7 @@ const enumsMap: { [key: string]: any[] } = { EscalationPolicyUpdateRequestDataRelationshipsTeamsDataItemsType: ["teams"], EscalationPolicyUpdateRequestDataType: ["policies"], EscalationPolicyUserType: ["users"], - EventCategory: ["change"], + EventCategory: ["change", "alert"], EventCreateRequestType: ["event"], EventPriority: ["normal", "low"], EventStatusType: [ @@ -3195,6 +3201,8 @@ const typeMap: { [index: string]: any } = { ActiveBillingDimensionsBody: ActiveBillingDimensionsBody, ActiveBillingDimensionsResponse: ActiveBillingDimensionsResponse, Advisory: Advisory, + AlertEventCustomAttributes: AlertEventCustomAttributes, + AlertEventCustomAttributesLinksItems: AlertEventCustomAttributesLinksItems, Annotation: Annotation, AnnotationDisplay: AnnotationDisplay, AnnotationDisplayBounds: AnnotationDisplayBounds, @@ -3869,6 +3877,7 @@ const typeMap: { [index: string]: any } = { EventCreateResponseAttributesAttributesEvt: EventCreateResponseAttributesAttributesEvt, EventCreateResponsePayload: EventCreateResponsePayload, + EventCreateResponsePayloadLinks: EventCreateResponsePayloadLinks, EventPayload: EventPayload, EventResponse: EventResponse, EventResponseAttributes: EventResponseAttributes, @@ -5409,7 +5418,10 @@ const oneOfMap: { [index: string]: string[] } = { "ScheduleData", ], EscalationTarget: ["TeamTarget", "UserTarget", "ScheduleTarget"], - EventPayloadAttributes: ["ChangeEventCustomAttributes"], + EventPayloadAttributes: [ + "ChangeEventCustomAttributes", + "AlertEventCustomAttributes", + ], HTTPCredentials: ["HTTPTokenAuth"], HTTPCredentialsUpdate: ["HTTPTokenAuthUpdate"], IncidentAttachmentAttributes: [