diff --git a/.apigentools-info b/.apigentools-info index 871606e4118d..a909873391aa 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-05 09:49:40.724881", - "spec_repo_commit": "faa72400" + "regenerated": "2025-06-05 21:26:03.097120", + "spec_repo_commit": "698653bf" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-05 09:49:40.740637", - "spec_repo_commit": "faa72400" + "regenerated": "2025-06-05 21:26:03.113230", + "spec_repo_commit": "698653bf" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2ea6329ff9a6..29ca8a2de400 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2211,6 +2211,97 @@ 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' + required: + - status + 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. Maximum of 20 links allowed. + items: + $ref: '#/components/schemas/AlertEventCustomAttributesLinksItems' + maxItems: 20 + minItems: 1 + type: array + AlertEventCustomAttributesLinksItems: + additionalProperties: false + description: A link. + properties: + category: + $ref: '#/components/schemas/AlertEventCustomAttributesLinksItemsCategory' + title: + description: The title of the link. Limited to 300 characters. + example: Runbook Link + maxLength: 300 + minLength: 1 + type: string + url: + description: The URL of the link. Limited to 2048 characters. + example: https://app.datadoghq.com/runbook + maxLength: 2048 + minLength: 1 + type: string + required: + - url + - category + type: object + AlertEventCustomAttributesLinksItemsCategory: + description: The category of the link. + enum: + - runbook + - documentation + - dashboard + example: runbook + type: string + x-enum-varnames: + - RUNBOOK + - DOCUMENTATION + - DASHBOARD + AlertEventCustomAttributesPriority: + default: '5' + description: The priority of the alert. Defaults to `5`. + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + example: '5' + type: string + x-enum-varnames: + - PRIORITY_ONE + - PRIORITY_TWO + - PRIORITY_THREE + - PRIORITY_FOUR + - PRIORITY_FIVE + AlertEventCustomAttributesStatus: + description: The status of the alert. + enum: + - warn + - error + - ok + example: warn + type: string + x-enum-varnames: + - WARN + - ERROR + - OK Annotation: description: A list of annotations used in the workflow. These are like sticky notes for your workflow! @@ -6903,6 +6994,7 @@ components: type: integer type: object ChangeEventCustomAttributes: + additionalProperties: false description: Object representing custom change event attributes. properties: author: @@ -6926,12 +7018,13 @@ components: to provide an impacted resource to display the change event at the right location. Only resources of type `service` - are supported.' + are supported. Maximum of 100 impacted resources allowed.' example: - name: payments_api type: service items: $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems' + maxItems: 100 type: array new_value: additionalProperties: {} @@ -6955,13 +7048,15 @@ components: - changed_resource type: object ChangeEventCustomAttributesAuthor: - description: Object representing the entity which made the change. Optional - field but if provided should include `type` and `name`. + additionalProperties: false + description: Object representing the entity that made the change. Optional field + but if provided should include `type` and `name`. properties: name: description: Author's name. Limited to 128 characters. example: datadog@datadog.com maxLength: 128 + minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType' @@ -6980,11 +7075,14 @@ components: - USER - SYSTEM ChangeEventCustomAttributesChangedResource: + additionalProperties: false description: Object representing a uniquely identified resource. properties: name: description: Resource's name. example: fallback_payments_test + maxLength: 128 + minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' @@ -7003,12 +7101,15 @@ components: - FEATURE_FLAG - CONFIGURATION ChangeEventCustomAttributesImpactedResourcesItems: + additionalProperties: false description: Object representing a uniquely identified resource. Only the resource type `service` is supported. properties: name: description: Resource's name. example: payments_api + maxLength: 128 + minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType' @@ -14542,15 +14643,15 @@ 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. enum: - change + - alert example: change type: string x-enum-varnames: - CHANGE + - ALERT EventCreateRequest: description: Object representing an event creation request. properties: @@ -14558,12 +14659,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. @@ -14579,7 +14685,7 @@ components: attributes: $ref: '#/components/schemas/EventCreateResponseAttributes' type: - description: Event type + description: Event type. example: event type: string type: object @@ -14600,7 +14706,12 @@ components: description: JSON object of event system attributes. properties: id: - description: Event id + deprecated: true + description: (Deprecated) Event id. Use `uid` instead. + type: string + uid: + description: A unique identifier for the event. You can use this id to query + or reference the event. type: string type: object EventCreateResponsePayload: @@ -14608,23 +14719,40 @@ 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. This link is only functional when using + the default subdomain. + type: string type: object EventPayload: + additionalProperties: false description: Event attributes. properties: aggregation_key: description: An arbitrary string to use for aggregation when correlating - events. Limited to 100 characters. + events. If you specify a key, events are deduplicated to alerts based + on this key. Limited to 100 characters. + example: aggregation_key_123 maxLength: 100 + minLength: 1 type: string attributes: $ref: '#/components/schemas/EventPayloadAttributes' category: $ref: '#/components/schemas/EventCategory' + integration_id: + $ref: '#/components/schemas/EventPayloadIntegrationId' message: description: The body of the event. Limited to 4000 characters. example: payment_processed feature flag has been enabled maxLength: 4000 + minLength: 1 type: string tags: description: 'A list of tags to apply to the event. @@ -14634,7 +14762,11 @@ components: - env:test items: description: A tag. + maxLength: 200 + minLength: 1 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) @@ -14649,6 +14781,7 @@ components: description: The event title. Limited to 500 characters. example: payment_processed feature flag updated maxLength: 500 + minLength: 1 type: string required: - title @@ -14656,10 +14789,20 @@ components: - attributes type: object EventPayloadAttributes: - description: JSON object for custom attributes. Schema are different per each - event category. + description: JSON object for custom attributes. Schema is different per event + category. oneOf: - $ref: '#/components/schemas/ChangeEventCustomAttributes' + - $ref: '#/components/schemas/AlertEventCustomAttributes' + EventPayloadIntegrationId: + description: Integration IDs sourced from integration manifests. Currently, + only `custom-events` is supported. + enum: + - custom-events + example: custom-events + type: string + x-enum-varnames: + - CUSTOM_EVENTS EventPriority: description: The priority of the event's monitor. For example, `normal` or `low`. enum: @@ -46725,9 +46868,12 @@ 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." + please use the V1 endpoint.\n\n\u274C Currently, notifications are not supported + for events sent to this endpoint, please use the V1 endpoint for notification + functionality." operationId: CreateEvent requestBody: content: @@ -46737,6 +46883,7 @@ paths: value: data: attributes: + aggregation_key: aggregation_key_123 attributes: author: name: datadog@datadog.com @@ -46765,9 +46912,11 @@ paths: rule: datacenter: devcycle.us1.prod category: change + integration_id: custom-events message: payment_processed feature flag has been enabled tags: - env:test + timestamp: '2020-01-01T01:30:15.010000Z' title: payment_processed feature flag updated type: event schema: @@ -46775,7 +46924,7 @@ paths: description: Event request object required: true responses: - '200': + '202': content: application/json: schema: @@ -46798,6 +46947,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/cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/frozen.json b/cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/frozen.json new file mode 100644 index 000000000000..63f3ef59dc89 --- /dev/null +++ b/cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/frozen.json @@ -0,0 +1 @@ +"2025-06-05T17:32:11.751Z" diff --git a/cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/recording.har b/cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/recording.har new file mode 100644 index 000000000000..5da0397b63b8 --- /dev/null +++ b/cassettes/v2/Events_3416228/Post-an-event-returns-Bad-request-response_947004866/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Events/Post an event returns \"Bad request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "85bb1b5aed6c5b80d685b1c2bb63a282", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 841, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 590, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\":\"invalid\",\"integration_id\":\"custom-events\",\"message\":\"payment_processed feature flag has been enabled\",\"tags\":[\"env:test\"],\"title\":\"Datadog api client test\"},\"type\":\"event\"}}" + }, + "queryString": [], + "url": "https://event-management-intake.datadoghq.com/api/v2/events" + }, + "response": { + "bodySize": 115, + "content": { + "mimeType": "application/json", + "size": 115, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"JSON validation failed at $.data.attributes.category\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 323, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-05T17:32:11.755Z", + "time": 128 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/frozen.json b/cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/frozen.json new file mode 100644 index 000000000000..20234a53e375 --- /dev/null +++ b/cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/frozen.json @@ -0,0 +1 @@ +"2025-06-05T18:20:54.371Z" diff --git a/cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/recording.har b/cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/recording.har new file mode 100644 index 000000000000..ddb435ef2b6a --- /dev/null +++ b/cassettes/v2/Events_3416228/Post-an-event-returns-OK-response_1209415328/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Events/Post an event returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e60df2c25e72c54054c7b695f339ea5f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 840, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\":\"Datadog api client test\"},\"type\":\"event\"}}" + }, + "queryString": [], + "url": "https://event-management-intake.datadoghq.com/api/v2/events" + }, + "response": { + "bodySize": 191, + "content": { + "mimeType": "application/json", + "size": 191, + "text": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"uid\":\"AZdBJDwVAAAKdndVgBFRzAAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZdBJDwVAAAKdndVgBFRzAAA\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 323, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 202, + "statusText": "Accepted" + }, + "startedDateTime": "2025-06-05T17:29:43.061Z", + "time": 185 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/events/CreateEvent.ts b/examples/v2/events/CreateEvent.ts index b08a4499b3f0..490c805c9438 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,9 +43,10 @@ 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", + title: "Datadog api client test", }, type: "event", }, diff --git a/features/v2/events.feature b/features/v2/events.feature index a8c1307ac683..71daeb47205c 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -50,19 +50,21 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 - @generated @skip @team:DataDog/event-management + @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": "invalid", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "Datadog api client test"}, "type": "event"}} When the request is sent Then the response status is 400 Bad request - @generated @skip @team:DataDog/event-management + @skip-validation @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": "Datadog api client test"}, "type": "event"}} When the request is sent - Then the response status is 200 OK + 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 diff --git a/features/v2/undo.json b/features/v2/undo.json index a7a5bb3ac1ec..03a1b598654c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -909,7 +909,7 @@ "CreateEvent": { "tag": "Events", "undo": { - "type": "unsafe" + "type": "safe" } }, "SearchEvents": { diff --git a/packages/datadog-api-client-common/servers.ts b/packages/datadog-api-client-common/servers.ts index 4dc46469001f..d9b9d8c878c0 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..4a114e9e4b1e 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -194,7 +194,7 @@ export class EventsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 200) { + if (response.httpStatusCode === 202) { const body: EventCreateResponsePayload = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "EventCreateResponsePayload" @@ -455,9 +455,11 @@ 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. + * + * ❌ Currently, notifications are not supported for events sent to this endpoint, please use the V1 endpoint for notification functionality. * @param param The request object */ public createEvent( diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index a867c30d862a..89c9cf1f198e 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -761,6 +761,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"; @@ -1580,8 +1585,10 @@ 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 { EventPayloadIntegrationId } from "./models/EventPayloadIntegrationId"; export { EventPriority } from "./models/EventPriority"; export { EventResponse } from "./models/EventResponse"; export { EventResponseAttributes } from "./models/EventResponseAttributes"; 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..105205a4883b --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributes.ts @@ -0,0 +1,69 @@ +/** + * 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. Maximum of 20 links allowed. + */ + "links"?: Array; + /** + * The priority of the alert. Defaults to `5`. + */ + "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", + required: true, + }, + }; + + /** + * @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..901d28dabc59 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItems.ts @@ -0,0 +1,60 @@ +/** + * 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. Limited to 300 characters. + */ + "title"?: string; + /** + * The URL of the link. Limited to 2048 characters. + */ + "url": string; + + /** + * @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, + }, + }; + + /** + * @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..3238bd693247 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesLinksItemsCategory.ts @@ -0,0 +1,20 @@ +/** + * 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 + | typeof DOCUMENTATION + | typeof DASHBOARD + | UnparsedObject; +export const RUNBOOK = "runbook"; +export const DOCUMENTATION = "documentation"; +export const DASHBOARD = "dashboard"; 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..119874dcc40c --- /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. Defaults to `5`. + */ + +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..bcde908b0a8a --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventCustomAttributesStatus.ts @@ -0,0 +1,20 @@ +/** + * 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 WARN + | typeof ERROR + | typeof OK + | UnparsedObject; +export const WARN = "warn"; +export const ERROR = "error"; +export const OK = "ok"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts index f418a22ef4b5..770c2c5a688c 100644 --- a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts @@ -14,7 +14,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class ChangeEventCustomAttributes { /** - * Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. + * Object representing the entity that made the change. Optional field but if provided should include `type` and `name`. */ "author"?: ChangeEventCustomAttributesAuthor; /** @@ -27,7 +27,7 @@ export class ChangeEventCustomAttributes { "changedResource": ChangeEventCustomAttributesChangedResource; /** * A list of resources impacted by this change. It is recommended to provide an impacted resource to display - * the change event at the right location. Only resources of type `service` are supported. + * the change event at the right location. Only resources of type `service` are supported. Maximum of 100 impacted resources allowed. */ "impactedResources"?: Array; /** @@ -39,13 +39,6 @@ export class ChangeEventCustomAttributes { */ "prevValue"?: { [key: string]: any }; - /** - * 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 */ @@ -80,10 +73,6 @@ export class ChangeEventCustomAttributes { baseName: "prev_value", type: "{ [key: string]: any; }", }, - additionalProperties: { - baseName: "additionalProperties", - type: "any", - }, }; /** diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts index 41b38ab3853d..9c3e2ff1eba9 100644 --- a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts @@ -8,7 +8,7 @@ import { ChangeEventCustomAttributesAuthorType } from "./ChangeEventCustomAttrib import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. + * Object representing the entity that made the change. Optional field but if provided should include `type` and `name`. */ export class ChangeEventCustomAttributesAuthor { /** @@ -20,13 +20,6 @@ export class ChangeEventCustomAttributesAuthor { */ "type": ChangeEventCustomAttributesAuthorType; - /** - * 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 */ @@ -46,10 +39,6 @@ export class ChangeEventCustomAttributesAuthor { type: "ChangeEventCustomAttributesAuthorType", required: true, }, - additionalProperties: { - baseName: "additionalProperties", - type: "any", - }, }; /** diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts index ee698837a8fd..878e24c82466 100644 --- a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts @@ -20,13 +20,6 @@ export class ChangeEventCustomAttributesChangedResource { */ "type": ChangeEventCustomAttributesChangedResourceType; - /** - * 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 */ @@ -46,10 +39,6 @@ export class ChangeEventCustomAttributesChangedResource { type: "ChangeEventCustomAttributesChangedResourceType", required: true, }, - additionalProperties: { - baseName: "additionalProperties", - type: "any", - }, }; /** diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts index 1677006e8d93..398de464aa72 100644 --- a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts @@ -20,13 +20,6 @@ export class ChangeEventCustomAttributesImpactedResourcesItems { */ "type": ChangeEventCustomAttributesImpactedResourcesItemsType; - /** - * 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 */ @@ -46,10 +39,6 @@ export class ChangeEventCustomAttributesImpactedResourcesItems { type: "ChangeEventCustomAttributesImpactedResourcesItemsType", required: true, }, - additionalProperties: { - baseName: "additionalProperties", - type: "any", - }, }; /** diff --git a/packages/datadog-api-client-v2/models/EventCategory.ts b/packages/datadog-api-client-v2/models/EventCategory.ts index 2b1796fd87d6..314056d5802c 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. */ -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..6b7d502fb64c 100644 --- a/packages/datadog-api-client-v2/models/EventCreateResponse.ts +++ b/packages/datadog-api-client-v2/models/EventCreateResponse.ts @@ -16,7 +16,7 @@ export class EventCreateResponse { */ "attributes"?: EventCreateResponseAttributes; /** - * Event type + * Event 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..a9877bd2341f 100644 --- a/packages/datadog-api-client-v2/models/EventCreateResponseAttributesAttributesEvt.ts +++ b/packages/datadog-api-client-v2/models/EventCreateResponseAttributesAttributesEvt.ts @@ -11,9 +11,13 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class EventCreateResponseAttributesAttributesEvt { /** - * Event id + * (Deprecated) Event id. Use `uid` instead. */ "id"?: string; + /** + * A unique identifier for the event. You can use this id to query or reference the event. + */ + "uid"?: string; /** * A container for additional, undeclared properties. @@ -35,6 +39,10 @@ export class EventCreateResponseAttributesAttributesEvt { baseName: "id", type: "string", }, + uid: { + baseName: "uid", + type: "string", + }, additionalProperties: { baseName: "additionalProperties", type: "any", 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..7db1cf672541 --- /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. This link is only functional when using the default subdomain. + */ + "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..1d383b864252 100644 --- a/packages/datadog-api-client-v2/models/EventPayload.ts +++ b/packages/datadog-api-client-v2/models/EventPayload.ts @@ -5,6 +5,7 @@ */ import { EventCategory } from "./EventCategory"; import { EventPayloadAttributes } from "./EventPayloadAttributes"; +import { EventPayloadIntegrationId } from "./EventPayloadIntegrationId"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -13,17 +14,21 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class EventPayload { /** - * An arbitrary string to use for aggregation when correlating events. Limited to 100 characters. + * An arbitrary string to use for aggregation when correlating events. If you specify a key, events are deduplicated to alerts based on this key. Limited to 100 characters. */ "aggregationKey"?: string; /** - * JSON object for custom attributes. Schema are different per each event category. + * JSON object for custom attributes. Schema is different per event category. */ "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. */ "category": EventCategory; + /** + * Integration IDs sourced from integration manifests. Currently, only `custom-events` is supported. + */ + "integrationId"?: EventPayloadIntegrationId; /** * The body of the event. Limited to 4000 characters. */ @@ -44,13 +49,6 @@ export class EventPayload { */ "title": 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 */ @@ -74,6 +72,10 @@ export class EventPayload { type: "EventCategory", required: true, }, + integrationId: { + baseName: "integration_id", + type: "EventPayloadIntegrationId", + }, message: { baseName: "message", type: "string", @@ -91,10 +93,6 @@ export class EventPayload { type: "string", required: true, }, - additionalProperties: { - baseName: "additionalProperties", - type: "any", - }, }; /** diff --git a/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts b/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts index 5bdf3f3dd14f..ca1d7e6666cf 100644 --- a/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts +++ b/packages/datadog-api-client-v2/models/EventPayloadAttributes.ts @@ -3,14 +3,16 @@ * 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"; /** - * JSON object for custom attributes. Schema are different per each event category. + * JSON object for custom attributes. Schema is different per event category. */ export type EventPayloadAttributes = | ChangeEventCustomAttributes + | AlertEventCustomAttributes | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/EventPayloadIntegrationId.ts b/packages/datadog-api-client-v2/models/EventPayloadIntegrationId.ts new file mode 100644 index 000000000000..6b67cc8b2609 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventPayloadIntegrationId.ts @@ -0,0 +1,14 @@ +/** + * 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"; + +/** + * Integration IDs sourced from integration manifests. Currently, only `custom-events` is supported. + */ + +export type EventPayloadIntegrationId = typeof CUSTOM_EVENTS | UnparsedObject; +export const CUSTOM_EVENTS = "custom-events"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 7ace9854b8f2..a40ef7ed07c4 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"; @@ -652,6 +654,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"; @@ -1964,6 +1967,13 @@ const enumsMap: { [key: string]: any[] } = { ActionConnectionDataType: ["action_connection"], ActionQueryType: ["action"], ActiveBillingDimensionsType: ["billing_dimensions"], + AlertEventCustomAttributesLinksItemsCategory: [ + "runbook", + "documentation", + "dashboard", + ], + AlertEventCustomAttributesPriority: ["1", "2", "3", "4", "5"], + AlertEventCustomAttributesStatus: ["warn", "error", "ok"], ApmRetentionFilterType: ["apm_retention_filter"], AppBuilderEventName: [ "pageChange", @@ -2268,8 +2278,9 @@ const enumsMap: { [key: string]: any[] } = { EscalationPolicyUserType: ["users"], EscalationRelationshipsRespondersDataItemsType: ["users"], EscalationType: ["escalation_policy_steps"], - EventCategory: ["change"], + EventCategory: ["change", "alert"], EventCreateRequestType: ["event"], + EventPayloadIntegrationId: ["custom-events"], EventPriority: ["normal", "low"], EventStatusType: [ "failure", @@ -3222,6 +3233,8 @@ const typeMap: { [index: string]: any } = { ActiveBillingDimensionsBody: ActiveBillingDimensionsBody, ActiveBillingDimensionsResponse: ActiveBillingDimensionsResponse, Advisory: Advisory, + AlertEventCustomAttributes: AlertEventCustomAttributes, + AlertEventCustomAttributesLinksItems: AlertEventCustomAttributesLinksItems, Annotation: Annotation, AnnotationDisplay: AnnotationDisplay, AnnotationDisplayBounds: AnnotationDisplayBounds, @@ -3929,6 +3942,7 @@ const typeMap: { [index: string]: any } = { EventCreateResponseAttributesAttributesEvt: EventCreateResponseAttributesAttributesEvt, EventCreateResponsePayload: EventCreateResponsePayload, + EventCreateResponsePayloadLinks: EventCreateResponsePayloadLinks, EventPayload: EventPayload, EventResponse: EventResponse, EventResponseAttributes: EventResponseAttributes, @@ -5499,7 +5513,10 @@ const oneOfMap: { [index: string]: string[] } = { "ScheduleData", ], EscalationTarget: ["TeamTarget", "UserTarget", "ScheduleTarget"], - EventPayloadAttributes: ["ChangeEventCustomAttributes"], + EventPayloadAttributes: [ + "ChangeEventCustomAttributes", + "AlertEventCustomAttributes", + ], HTTPCredentials: ["HTTPTokenAuth"], HTTPCredentialsUpdate: ["HTTPTokenAuthUpdate"], IncidentAttachmentAttributes: [