Skip to content

Commit e20a2d8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Create API spec for v2 get an event (#730)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent c14bc67 commit e20a2d8

27 files changed

+2756
-2
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "0becaa3",
3-
"generated": "2025-07-17 13:17:40.267"
2+
"spec_repo_commit": "214381f",
3+
"generated": "2025-07-17 15:42:35.217"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 334 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,88 @@ components:
22912291
- id
22922292
- base_severity
22932293
type: object
2294+
AlertEventAttributes:
2295+
description: Alert event attributes.
2296+
properties:
2297+
aggregation_key:
2298+
$ref: '#/components/schemas/V2EventAggregationKey'
2299+
custom:
2300+
description: JSON object of custom attributes.
2301+
example: {}
2302+
type: object
2303+
evt:
2304+
$ref: '#/components/schemas/EventSystemAttributes'
2305+
links:
2306+
description: The links related to the event.
2307+
example:
2308+
- category: runbook
2309+
title: Runbook Link
2310+
url: https://app.datadoghq.com/runbook
2311+
items:
2312+
$ref: '#/components/schemas/AlertEventAttributesLinksItem'
2313+
type: array
2314+
priority:
2315+
$ref: '#/components/schemas/AlertEventAttributesPriority'
2316+
service:
2317+
$ref: '#/components/schemas/V2EventService'
2318+
status:
2319+
$ref: '#/components/schemas/AlertEventAttributesStatus'
2320+
timestamp:
2321+
$ref: '#/components/schemas/V2EventTimestamp'
2322+
title:
2323+
$ref: '#/components/schemas/V2EventTitle'
2324+
type: object
2325+
AlertEventAttributesLinksItem:
2326+
description: A link.
2327+
properties:
2328+
category:
2329+
$ref: '#/components/schemas/AlertEventAttributesLinksItemCategory'
2330+
title:
2331+
description: The display text of the link.
2332+
type: string
2333+
url:
2334+
description: The URL of the link.
2335+
type: string
2336+
type: object
2337+
AlertEventAttributesLinksItemCategory:
2338+
description: The category of the link.
2339+
enum:
2340+
- runbook
2341+
- documentation
2342+
- dashboard
2343+
type: string
2344+
x-enum-varnames:
2345+
- RUNBOOK
2346+
- DOCUMENTATION
2347+
- DASHBOARD
2348+
AlertEventAttributesPriority:
2349+
description: The priority of the alert.
2350+
enum:
2351+
- '1'
2352+
- '2'
2353+
- '3'
2354+
- '4'
2355+
- '5'
2356+
example: '5'
2357+
type: string
2358+
x-enum-varnames:
2359+
- PRIORITY_ONE
2360+
- PRIORITY_TWO
2361+
- PRIORITY_THREE
2362+
- PRIORITY_FOUR
2363+
- PRIORITY_FIVE
2364+
AlertEventAttributesStatus:
2365+
description: The status of the alert.
2366+
enum:
2367+
- warn
2368+
- error
2369+
- ok
2370+
example: error
2371+
type: string
2372+
x-enum-varnames:
2373+
- WARN
2374+
- ERROR
2375+
- OK
22942376
AlertEventCustomAttributes:
22952377
additionalProperties: false
22962378
description: Alert event attributes.
@@ -7102,6 +7184,116 @@ components:
71027184
format: int64
71037185
type: integer
71047186
type: object
7187+
ChangeEventAttributes:
7188+
description: Change event attributes.
7189+
properties:
7190+
aggregation_key:
7191+
$ref: '#/components/schemas/V2EventAggregationKey'
7192+
author:
7193+
$ref: '#/components/schemas/ChangeEventAttributesAuthor'
7194+
change_metadata:
7195+
description: JSON object of change metadata.
7196+
example:
7197+
dd:
7198+
team: datadog_team
7199+
user_email: [email protected]
7200+
user_id: datadog_user_id
7201+
user_name: datadog_username
7202+
type: object
7203+
changed_resource:
7204+
$ref: '#/components/schemas/ChangeEventAttributesChangedResource'
7205+
evt:
7206+
$ref: '#/components/schemas/EventSystemAttributes'
7207+
impacted_resources:
7208+
description: A list of resources impacted by this change.
7209+
example:
7210+
- name: service-name
7211+
type: service
7212+
items:
7213+
$ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItem'
7214+
type: array
7215+
new_value:
7216+
description: The new state of the changed resource.
7217+
example:
7218+
enabled: true
7219+
percentage: 50%
7220+
rule:
7221+
datacenter: devcycle.us1.prod
7222+
type: object
7223+
prev_value:
7224+
description: The previous state of the changed resource.
7225+
example:
7226+
enabled: true
7227+
percentage: 10%
7228+
rule:
7229+
datacenter: devcycle.us1.prod
7230+
type: object
7231+
service:
7232+
$ref: '#/components/schemas/V2EventService'
7233+
timestamp:
7234+
$ref: '#/components/schemas/V2EventTimestamp'
7235+
title:
7236+
$ref: '#/components/schemas/V2EventTitle'
7237+
type: object
7238+
ChangeEventAttributesAuthor:
7239+
description: The entity that made the change.
7240+
properties:
7241+
name:
7242+
description: The name of the user or system that made the change.
7243+
7244+
type: string
7245+
type:
7246+
$ref: '#/components/schemas/ChangeEventAttributesAuthorType'
7247+
type: object
7248+
ChangeEventAttributesAuthorType:
7249+
description: The type of the author.
7250+
enum:
7251+
- user
7252+
- system
7253+
- api
7254+
- automation
7255+
example: user
7256+
type: string
7257+
x-enum-varnames:
7258+
- USER
7259+
- SYSTEM
7260+
- API
7261+
- AUTOMATION
7262+
ChangeEventAttributesChangedResource:
7263+
description: A uniquely identified resource.
7264+
properties:
7265+
name:
7266+
description: The name of the changed resource.
7267+
type: string
7268+
type:
7269+
$ref: '#/components/schemas/ChangeEventAttributesChangedResourceType'
7270+
type: object
7271+
ChangeEventAttributesChangedResourceType:
7272+
description: The type of the changed resource.
7273+
enum:
7274+
- feature_flag
7275+
- configuration
7276+
example: feature_flag
7277+
type: string
7278+
x-enum-varnames:
7279+
- FEATURE_FLAG
7280+
- CONFIGURATION
7281+
ChangeEventAttributesImpactedResourcesItem:
7282+
description: A uniquely identified resource.
7283+
properties:
7284+
name:
7285+
description: The name of the impacted resource.
7286+
type: string
7287+
type:
7288+
$ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItemType'
7289+
type: object
7290+
ChangeEventAttributesImpactedResourcesItemType:
7291+
description: The type of the impacted resource.
7292+
enum:
7293+
- service
7294+
type: string
7295+
x-enum-varnames:
7296+
- SERVICE
71057297
ChangeEventCustomAttributes:
71067298
additionalProperties: false
71077299
description: Change event attributes.
@@ -15189,6 +15381,44 @@ components:
1518915381
- USER_UPDATE
1519015382
- RECOMMENDATION
1519115383
- SNAPSHOT
15384+
EventSystemAttributes:
15385+
description: JSON object of event system attributes.
15386+
properties:
15387+
category:
15388+
$ref: '#/components/schemas/EventSystemAttributesCategory'
15389+
id:
15390+
description: Event identifier. This field is deprecated and will be removed
15391+
in a future version. Use the `uid` field instead.
15392+
type: string
15393+
integration_id:
15394+
$ref: '#/components/schemas/EventSystemAttributesIntegrationId'
15395+
source_id:
15396+
description: The source type ID of the event.
15397+
format: int64
15398+
type: integer
15399+
uid:
15400+
description: A unique identifier for the event. You can use this identifier
15401+
to query or reference the event.
15402+
type: string
15403+
type: object
15404+
EventSystemAttributesCategory:
15405+
description: Event category identifying the type of event.
15406+
enum:
15407+
- change
15408+
- alert
15409+
example: change
15410+
type: string
15411+
x-enum-varnames:
15412+
- CHANGE
15413+
- ALERT
15414+
EventSystemAttributesIntegrationId:
15415+
description: Integration ID sourced from integration manifests.
15416+
enum:
15417+
- custom-events
15418+
example: custom-events
15419+
type: string
15420+
x-enum-varnames:
15421+
- CUSTOM_EVENTS
1519215422
EventType:
1519315423
default: event
1519415424
description: Type of the event.
@@ -41557,6 +41787,70 @@ components:
4155741787
type: string
4155841788
x-enum-varnames:
4155941789
- USERS
41790+
V2Event:
41791+
description: An event object.
41792+
properties:
41793+
attributes:
41794+
$ref: '#/components/schemas/V2EventAttributes'
41795+
id:
41796+
description: The event's ID.
41797+
example: ''
41798+
type: string
41799+
type:
41800+
description: Entity type.
41801+
example: event
41802+
type: string
41803+
type: object
41804+
V2EventAggregationKey:
41805+
description: Aggregation key of the event.
41806+
example: aggregation-key
41807+
type: string
41808+
V2EventAttributes:
41809+
description: Event attributes.
41810+
properties:
41811+
attributes:
41812+
$ref: '#/components/schemas/V2EventAttributesAttributes'
41813+
message:
41814+
description: Free-form text associated with the event.
41815+
example: The event message
41816+
type: string
41817+
tags:
41818+
description: A list of tags associated with the event.
41819+
example:
41820+
- env:api_client_test
41821+
items:
41822+
description: A tag.
41823+
type: string
41824+
type: array
41825+
timestamp:
41826+
description: Timestamp when the event occurred.
41827+
example: '2017-01-15T01:30:15.010000Z'
41828+
type: string
41829+
type: object
41830+
V2EventAttributesAttributes:
41831+
description: JSON object for category-specific attributes.
41832+
oneOf:
41833+
- $ref: '#/components/schemas/ChangeEventAttributes'
41834+
- $ref: '#/components/schemas/AlertEventAttributes'
41835+
V2EventResponse:
41836+
description: Get an event response.
41837+
properties:
41838+
data:
41839+
$ref: '#/components/schemas/V2Event'
41840+
type: object
41841+
V2EventService:
41842+
description: Service that triggered the event.
41843+
example: service-name
41844+
type: string
41845+
V2EventTimestamp:
41846+
description: POSIX timestamp of the event.
41847+
example: 175019386627
41848+
format: int64
41849+
type: integer
41850+
V2EventTitle:
41851+
description: The title of the event.
41852+
example: The event title
41853+
type: string
4156041854
ValidationError:
4156141855
description: Represents a single validation error, including a human-readable
4156241856
title and metadata.
@@ -48828,6 +49122,46 @@ paths:
4882849122
operator: OR
4882949123
permissions:
4883049124
- events_read
49125+
/api/v2/events/{event_id}:
49126+
get:
49127+
description: Get the details of an event by `event_id`.
49128+
operationId: GetEvent
49129+
parameters:
49130+
- description: The UID of the event.
49131+
in: path
49132+
name: event_id
49133+
required: true
49134+
schema:
49135+
type: string
49136+
responses:
49137+
'200':
49138+
content:
49139+
application/json:
49140+
schema:
49141+
$ref: '#/components/schemas/V2EventResponse'
49142+
description: OK
49143+
'400':
49144+
$ref: '#/components/responses/BadRequestResponse'
49145+
'401':
49146+
$ref: '#/components/responses/UnauthorizedResponse'
49147+
'403':
49148+
$ref: '#/components/responses/ForbiddenResponse'
49149+
'404':
49150+
$ref: '#/components/responses/NotFoundResponse'
49151+
'429':
49152+
$ref: '#/components/responses/TooManyRequestsResponse'
49153+
security:
49154+
- apiKeyAuth: []
49155+
appKeyAuth: []
49156+
- AuthZ:
49157+
- events_read
49158+
summary: Get an event
49159+
tags:
49160+
- Events
49161+
x-permission:
49162+
operator: OR
49163+
permissions:
49164+
- events_read
4883149165
/api/v2/incidents:
4883249166
get:
4883349167
description: Get all incidents for the user's organization.

examples/v2_events_GetEvent.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Get an event returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_events::EventsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = EventsAPI::with_config(configuration);
9+
let resp = api.get_event("AZeF-nTCAABzkAgGXzYPtgAA".to_string()).await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}

0 commit comments

Comments
 (0)