Skip to content

Commit 8856749

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9f916c56 of spec repo
1 parent 0c7b0a1 commit 8856749

23 files changed

+537
-28
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-08 14:34:57.337651",
8-
"spec_repo_commit": "4b632dba"
7+
"regenerated": "2025-05-09 01:01:40.960108",
8+
"spec_repo_commit": "9f916c56"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-08 14:34:57.354509",
13-
"spec_repo_commit": "4b632dba"
12+
"regenerated": "2025-05-09 01:01:40.975857",
13+
"spec_repo_commit": "9f916c56"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 166 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,6 +2138,89 @@ components:
21382138
- id
21392139
- base_severity
21402140
type: object
2141+
AlertEventCustomAttributes:
2142+
additionalProperties: false
2143+
description: Object representing custom alert event attributes.
2144+
properties:
2145+
custom:
2146+
$ref: '#/components/schemas/AlertEventCustomAttributesCustom'
2147+
links:
2148+
$ref: '#/components/schemas/AlertEventCustomAttributesLinks'
2149+
priority:
2150+
$ref: '#/components/schemas/AlertEventCustomAttributesPriority'
2151+
status:
2152+
$ref: '#/components/schemas/AlertEventCustomAttributesStatus'
2153+
type: object
2154+
AlertEventCustomAttributesCustom:
2155+
additionalProperties: {}
2156+
description: Custom attributes. Support up to 100 properties and a maximum nesting
2157+
depth of 10 levels.
2158+
example: {}
2159+
type: object
2160+
AlertEventCustomAttributesLinks:
2161+
description: The links related to the event.
2162+
items:
2163+
$ref: '#/components/schemas/AlertEventCustomAttributesLinksItems'
2164+
maxItems: 20
2165+
minItems: 1
2166+
type: array
2167+
AlertEventCustomAttributesLinksItems:
2168+
description: A link.
2169+
properties:
2170+
category:
2171+
$ref: '#/components/schemas/AlertEventCustomAttributesLinksItemsCategory'
2172+
title:
2173+
description: The title of the link. Limited to 300 characters.
2174+
example: Runbook Link
2175+
maxLength: 300
2176+
type: string
2177+
url:
2178+
description: The URL of the link. Limited to 2048 characters.
2179+
example: https://app.datadoghq.com/runbook
2180+
maxLength: 2048
2181+
type: string
2182+
required:
2183+
- url
2184+
- category
2185+
type: object
2186+
AlertEventCustomAttributesLinksItemsCategory:
2187+
description: The category of the link.
2188+
enum:
2189+
- runbook
2190+
example: runbook
2191+
type: string
2192+
x-enum-varnames:
2193+
- RUNBOOK
2194+
AlertEventCustomAttributesPriority:
2195+
description: The priority of the alert.
2196+
enum:
2197+
- '1'
2198+
- '2'
2199+
- '3'
2200+
- '4'
2201+
- '5'
2202+
example: '1'
2203+
type: string
2204+
x-enum-varnames:
2205+
- PRIORITY_ONE
2206+
- PRIORITY_TWO
2207+
- PRIORITY_THREE
2208+
- PRIORITY_FOUR
2209+
- PRIORITY_FIVE
2210+
AlertEventCustomAttributesStatus:
2211+
description: The status of the alert.
2212+
enum:
2213+
- info
2214+
- warn
2215+
- error
2216+
- ok
2217+
example: warn
2218+
type: string
2219+
x-enum-varnames:
2220+
- INFO
2221+
- WARN
2222+
- ERROR
2223+
- OK
21412224
Annotation:
21422225
description: A list of annotations used in the workflow. These are like sticky
21432226
notes for your workflow!
@@ -13904,28 +13987,34 @@ components:
1390413987
type: string
1390513988
type: object
1390613989
EventCategory:
13907-
description: Event category to identify the type of event. Only the value `change`
13908-
is supported. Support for other categories are coming. please reach out to
13909-
datadog support if you're interested.
13990+
description: Event category to identify the type of event. For example, `change`
13991+
or `alert`.
1391013992
enum:
1391113993
- change
13994+
- alert
1391213995
example: change
1391313996
type: string
1391413997
x-enum-varnames:
1391513998
- CHANGE
13999+
- ALERT
1391614000
EventCreateRequest:
1391714001
description: Object representing an event creation request.
1391814002
properties:
1391914003
attributes:
1392014004
$ref: '#/components/schemas/EventPayload'
1392114005
type:
1392214006
$ref: '#/components/schemas/EventCreateRequestType'
14007+
required:
14008+
- type
14009+
- attributes
1392314010
type: object
1392414011
EventCreateRequestPayload:
1392514012
description: Payload for creating an event.
1392614013
properties:
1392714014
data:
1392814015
$ref: '#/components/schemas/EventCreateRequest'
14016+
required:
14017+
- data
1392914018
type: object
1393014019
EventCreateRequestType:
1393114020
description: Entity type.
@@ -13940,6 +14029,12 @@ components:
1394014029
properties:
1394114030
attributes:
1394214031
$ref: '#/components/schemas/EventCreateResponseAttributes'
14032+
id:
14033+
description: A numerical ID compatible with the V1 endpoint. This field
14034+
is not populated in response from the V2 endpoint. To retrieve this ID,
14035+
refer to the event attributes in the Event Explorer.
14036+
example: _
14037+
type: string
1394314038
type:
1394414039
description: Event type
1394514040
example: event
@@ -13961,28 +14056,44 @@ components:
1396114056
EventCreateResponseAttributesAttributesEvt:
1396214057
description: JSON object of event system attributes.
1396314058
properties:
13964-
id:
13965-
description: Event id
14059+
uid:
14060+
description: A unique identifier for the event. You can use this ID to query
14061+
or reference the event in the V2 endpoint.
14062+
example: ABCDEFGHIJKLMNOPQRSTUVWX
1396614063
type: string
1396714064
type: object
1396814065
EventCreateResponsePayload:
1396914066
description: Response containing information about created event.
1397014067
properties:
1397114068
data:
1397214069
$ref: '#/components/schemas/EventCreateResponse'
14070+
links:
14071+
$ref: '#/components/schemas/EventCreateResponsePayloadLinks'
14072+
type: object
14073+
EventCreateResponsePayloadLinks:
14074+
description: Links attributes.
14075+
properties:
14076+
self:
14077+
description: The URL of the event. This link is only functional when using
14078+
the `app` subdomain.
14079+
example: https://app.datadoghq.com/event/event?uid=ABCDEFGHIJKLMNOPQRSTUVWX
14080+
type: string
1397314081
type: object
1397414082
EventPayload:
1397514083
description: Event attributes.
1397614084
properties:
1397714085
aggregation_key:
1397814086
description: An arbitrary string to use for aggregation when correlating
1397914087
events. Limited to 100 characters.
14088+
example: aggregation_key_123
1398014089
maxLength: 100
1398114090
type: string
1398214091
attributes:
1398314092
$ref: '#/components/schemas/EventPayloadAttributes'
1398414093
category:
1398514094
$ref: '#/components/schemas/EventCategory'
14095+
integration_id:
14096+
$ref: '#/components/schemas/EventPayloadIntegrationId'
1398614097
message:
1398714098
description: The body of the event. Limited to 4000 characters.
1398814099
example: payment_processed feature flag has been enabled
@@ -13996,7 +14107,10 @@ components:
1399614107
- env:test
1399714108
items:
1399814109
description: A tag.
14110+
maxLength: 200
1399914111
type: string
14112+
maxItems: 100
14113+
minItems: 1
1400014114
type: array
1400114115
timestamp:
1400214116
description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
@@ -14022,6 +14136,16 @@ components:
1402214136
event category.
1402314137
oneOf:
1402414138
- $ref: '#/components/schemas/ChangeEventCustomAttributes'
14139+
- $ref: '#/components/schemas/AlertEventCustomAttributes'
14140+
EventPayloadIntegrationId:
14141+
description: Integration IDs sourced from integration manifests. Currently,
14142+
only `custom-events` is supported.
14143+
enum:
14144+
- custom-events
14145+
example: custom-events
14146+
type: string
14147+
x-enum-varnames:
14148+
- CUSTOM_EVENTS
1402514149
EventPriority:
1402614150
description: The priority of the event's monitor. For example, `normal` or `low`.
1402714151
enum:
@@ -45640,7 +45764,8 @@ paths:
4564045764
- events_read
4564145765
post:
4564245766
description: "This endpoint allows you to post events.\n\n\u2705 **Only events
45643-
with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking)
45767+
with the `change` or `alert` category** are in General Availability. For change
45768+
events, see [Change Tracking](https://docs.datadoghq.com/change_tracking)
4564445769
for more details.\n\n\u274C For use cases involving other event categories,
4564545770
please use the V1 endpoint."
4564645771
operationId: CreateEvent
@@ -45652,6 +45777,7 @@ paths:
4565245777
value:
4565345778
data:
4565445779
attributes:
45780+
aggregation_key: aggregation_key_123
4565545781
attributes:
4565645782
author:
4565745783
@@ -45680,6 +45806,7 @@ paths:
4568045806
rule:
4568145807
datacenter: devcycle.us1.prod
4568245808
category: change
45809+
integration_id: custom-events
4568345810
message: payment_processed feature flag has been enabled
4568445811
tags:
4568545812
- env:test
@@ -45690,7 +45817,7 @@ paths:
4569045817
description: Event request object
4569145818
required: true
4569245819
responses:
45693-
'200':
45820+
'202':
4569445821
content:
4569545822
application/json:
4569645823
schema:
@@ -45713,6 +45840,38 @@ paths:
4571345840
security:
4571445841
- apiKeyAuth: []
4571545842
appKeyAuth: []
45843+
servers:
45844+
- url: https://{subdomain}.{site}
45845+
variables:
45846+
site:
45847+
default: datadoghq.com
45848+
description: The regional site for customers.
45849+
enum:
45850+
- datadoghq.com
45851+
- us3.datadoghq.com
45852+
- us5.datadoghq.com
45853+
- ap1.datadoghq.com
45854+
- datadoghq.eu
45855+
- ddog-gov.com
45856+
subdomain:
45857+
default: event-management-intake
45858+
description: The subdomain where the API is deployed.
45859+
- url: '{protocol}://{name}'
45860+
variables:
45861+
name:
45862+
default: event-management-intake.datadoghq.com
45863+
description: Full site DNS name.
45864+
protocol:
45865+
default: https
45866+
description: The protocol for accessing the API.
45867+
- url: https://{subdomain}.{site}
45868+
variables:
45869+
site:
45870+
default: datadoghq.com
45871+
description: Any Datadog deployment.
45872+
subdomain:
45873+
default: event-management-intake
45874+
description: The subdomain where the API is deployed.
4571645875
summary: Post an event
4571745876
tags:
4571845877
- Events

examples/v2/events/CreateEvent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const params: v2.EventsApiCreateEventRequest = {
1111
body: {
1212
data: {
1313
attributes: {
14+
aggregationKey: "aggregation_key_123",
1415
attributes: {
1516
author: {
1617
@@ -42,6 +43,7 @@ const params: v2.EventsApiCreateEventRequest = {
4243
},
4344
},
4445
category: "change",
46+
integrationId: "custom-events",
4547
message: "payment_processed feature flag has been enabled",
4648
tags: ["env:test"],
4749
title: "payment_processed feature flag updated",

features/v2/events.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ Feature: Events
5353
@generated @skip @team:DataDog/event-management
5454
Scenario: Post an event returns "Bad request" response
5555
Given new "CreateEvent" request
56-
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "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"}}
56+
And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "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"}}
5757
When the request is sent
5858
Then the response status is 400 Bad request
5959

6060
@generated @skip @team:DataDog/event-management
6161
Scenario: Post an event returns "OK" response
6262
Given new "CreateEvent" request
63-
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "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"}}
63+
And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "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"}}
6464
When the request is sent
65-
Then the response status is 200 OK
65+
Then the response status is 202 OK
6666

6767
@team:DataDog/event-management
6868
Scenario: Search events returns "Bad Request" response

packages/datadog-api-client-common/servers.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,35 @@ export const operationServers: {
153153
subdomain: "http-intake.logs",
154154
}),
155155
],
156+
"v2.EventsApi.createEvent": [
157+
new ServerConfiguration<{
158+
site:
159+
| "datadoghq.com"
160+
| "us3.datadoghq.com"
161+
| "us5.datadoghq.com"
162+
| "ap1.datadoghq.com"
163+
| "datadoghq.eu"
164+
| "ddog-gov.com";
165+
subdomain: string;
166+
}>("https://{subdomain}.{site}", {
167+
site: "datadoghq.com",
168+
subdomain: "event-management-intake",
169+
}),
170+
new ServerConfiguration<{
171+
name: string;
172+
protocol: string;
173+
}>("{protocol}://{name}", {
174+
name: "event-management-intake.datadoghq.com",
175+
protocol: "https",
176+
}),
177+
new ServerConfiguration<{
178+
site: string;
179+
subdomain: string;
180+
}>("https://{subdomain}.{site}", {
181+
site: "datadoghq.com",
182+
subdomain: "event-management-intake",
183+
}),
184+
],
156185
"v2.LogsApi.submitLog": [
157186
new ServerConfiguration<{
158187
site:

packages/datadog-api-client-v2/apis/EventsApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class EventsApiResponseProcessor {
194194
const contentType = ObjectSerializer.normalizeMediaType(
195195
response.headers["content-type"]
196196
);
197-
if (response.httpStatusCode === 200) {
197+
if (response.httpStatusCode === 202) {
198198
const body: EventCreateResponsePayload = ObjectSerializer.deserialize(
199199
ObjectSerializer.parse(await response.body.text(), contentType),
200200
"EventCreateResponsePayload"
@@ -455,7 +455,7 @@ export class EventsApi {
455455
/**
456456
* This endpoint allows you to post events.
457457
*
458-
* ✅ **Only events with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.
458+
* ✅ **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.
459459
*
460460
* ❌ For use cases involving other event categories, please use the V1 endpoint.
461461
* @param param The request object

0 commit comments

Comments
 (0)