-
Notifications
You must be signed in to change notification settings - Fork 21
Create API spec for v2 get an event #2480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
api-clients-generation-pipeline
merged 1 commit into
master
from
datadog-api-spec/generated/3981
Jul 17, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "spec_repo_commit": "0becaa3", | ||
| "generated": "2025-07-17 13:13:07.458" | ||
| "spec_repo_commit": "214381f", | ||
| "generated": "2025-07-17 15:36:40.869" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2291,6 +2291,88 @@ components: | |
| - id | ||
| - base_severity | ||
| type: object | ||
| AlertEventAttributes: | ||
| description: Alert event attributes. | ||
| properties: | ||
| aggregation_key: | ||
| $ref: '#/components/schemas/V2EventAggregationKey' | ||
| custom: | ||
| description: JSON object of custom attributes. | ||
| example: {} | ||
| type: object | ||
| evt: | ||
| $ref: '#/components/schemas/EventSystemAttributes' | ||
| links: | ||
| description: The links related to the event. | ||
| example: | ||
| - category: runbook | ||
| title: Runbook Link | ||
| url: https://app.datadoghq.com/runbook | ||
| items: | ||
| $ref: '#/components/schemas/AlertEventAttributesLinksItem' | ||
| type: array | ||
| priority: | ||
| $ref: '#/components/schemas/AlertEventAttributesPriority' | ||
| service: | ||
| $ref: '#/components/schemas/V2EventService' | ||
| status: | ||
| $ref: '#/components/schemas/AlertEventAttributesStatus' | ||
| timestamp: | ||
| $ref: '#/components/schemas/V2EventTimestamp' | ||
| title: | ||
| $ref: '#/components/schemas/V2EventTitle' | ||
| type: object | ||
| AlertEventAttributesLinksItem: | ||
| description: A link. | ||
| properties: | ||
| category: | ||
| $ref: '#/components/schemas/AlertEventAttributesLinksItemCategory' | ||
| title: | ||
| description: The display text of the link. | ||
| type: string | ||
| url: | ||
| description: The URL of the link. | ||
| type: string | ||
| type: object | ||
| AlertEventAttributesLinksItemCategory: | ||
| description: The category of the link. | ||
| enum: | ||
| - runbook | ||
| - documentation | ||
| - dashboard | ||
| type: string | ||
| x-enum-varnames: | ||
| - RUNBOOK | ||
| - DOCUMENTATION | ||
| - DASHBOARD | ||
| AlertEventAttributesPriority: | ||
| description: The priority of the alert. | ||
| enum: | ||
| - '1' | ||
| - '2' | ||
| - '3' | ||
| - '4' | ||
| - '5' | ||
| example: '5' | ||
| type: string | ||
| x-enum-varnames: | ||
| - PRIORITY_ONE | ||
| - PRIORITY_TWO | ||
| - PRIORITY_THREE | ||
| - PRIORITY_FOUR | ||
| - PRIORITY_FIVE | ||
| AlertEventAttributesStatus: | ||
| description: The status of the alert. | ||
| enum: | ||
| - warn | ||
| - error | ||
| - ok | ||
| example: error | ||
| type: string | ||
| x-enum-varnames: | ||
| - WARN | ||
| - ERROR | ||
| - OK | ||
| AlertEventCustomAttributes: | ||
| additionalProperties: false | ||
| description: Alert event attributes. | ||
|
|
@@ -7102,6 +7184,116 @@ components: | |
| format: int64 | ||
| type: integer | ||
| type: object | ||
| ChangeEventAttributes: | ||
| description: Change event attributes. | ||
| properties: | ||
| aggregation_key: | ||
| $ref: '#/components/schemas/V2EventAggregationKey' | ||
| author: | ||
| $ref: '#/components/schemas/ChangeEventAttributesAuthor' | ||
| change_metadata: | ||
| description: JSON object of change metadata. | ||
| example: | ||
| dd: | ||
| team: datadog_team | ||
| user_email: [email protected] | ||
| user_id: datadog_user_id | ||
| user_name: datadog_username | ||
| type: object | ||
| changed_resource: | ||
| $ref: '#/components/schemas/ChangeEventAttributesChangedResource' | ||
| evt: | ||
| $ref: '#/components/schemas/EventSystemAttributes' | ||
| impacted_resources: | ||
| description: A list of resources impacted by this change. | ||
| example: | ||
| - name: service-name | ||
| type: service | ||
| items: | ||
| $ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItem' | ||
| type: array | ||
| new_value: | ||
| description: The new state of the changed resource. | ||
| example: | ||
| enabled: true | ||
| percentage: 50% | ||
| rule: | ||
| datacenter: devcycle.us1.prod | ||
| type: object | ||
| prev_value: | ||
| description: The previous state of the changed resource. | ||
| example: | ||
| enabled: true | ||
| percentage: 10% | ||
| rule: | ||
| datacenter: devcycle.us1.prod | ||
| type: object | ||
| service: | ||
| $ref: '#/components/schemas/V2EventService' | ||
| timestamp: | ||
| $ref: '#/components/schemas/V2EventTimestamp' | ||
| title: | ||
| $ref: '#/components/schemas/V2EventTitle' | ||
| type: object | ||
| ChangeEventAttributesAuthor: | ||
| description: The entity that made the change. | ||
| properties: | ||
| name: | ||
| description: The name of the user or system that made the change. | ||
| example: [email protected] | ||
| type: string | ||
| type: | ||
| $ref: '#/components/schemas/ChangeEventAttributesAuthorType' | ||
| type: object | ||
| ChangeEventAttributesAuthorType: | ||
| description: The type of the author. | ||
| enum: | ||
| - user | ||
| - system | ||
| - api | ||
| - automation | ||
| example: user | ||
| type: string | ||
| x-enum-varnames: | ||
| - USER | ||
| - SYSTEM | ||
| - API | ||
| - AUTOMATION | ||
| ChangeEventAttributesChangedResource: | ||
| description: A uniquely identified resource. | ||
| properties: | ||
| name: | ||
| description: The name of the changed resource. | ||
| type: string | ||
| type: | ||
| $ref: '#/components/schemas/ChangeEventAttributesChangedResourceType' | ||
| type: object | ||
| ChangeEventAttributesChangedResourceType: | ||
| description: The type of the changed resource. | ||
| enum: | ||
| - feature_flag | ||
| - configuration | ||
| example: feature_flag | ||
| type: string | ||
| x-enum-varnames: | ||
| - FEATURE_FLAG | ||
| - CONFIGURATION | ||
| ChangeEventAttributesImpactedResourcesItem: | ||
| description: A uniquely identified resource. | ||
| properties: | ||
| name: | ||
| description: The name of the impacted resource. | ||
| type: string | ||
| type: | ||
| $ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItemType' | ||
| type: object | ||
| ChangeEventAttributesImpactedResourcesItemType: | ||
| description: The type of the impacted resource. | ||
| enum: | ||
| - service | ||
| type: string | ||
| x-enum-varnames: | ||
| - SERVICE | ||
| ChangeEventCustomAttributes: | ||
| additionalProperties: false | ||
| description: Change event attributes. | ||
|
|
@@ -15189,6 +15381,44 @@ components: | |
| - USER_UPDATE | ||
| - RECOMMENDATION | ||
| - SNAPSHOT | ||
| EventSystemAttributes: | ||
| description: JSON object of event system attributes. | ||
| properties: | ||
| category: | ||
| $ref: '#/components/schemas/EventSystemAttributesCategory' | ||
| id: | ||
| description: Event identifier. This field is deprecated and will be removed | ||
| in a future version. Use the `uid` field instead. | ||
| type: string | ||
| integration_id: | ||
| $ref: '#/components/schemas/EventSystemAttributesIntegrationId' | ||
| source_id: | ||
| description: The source type ID of the event. | ||
| format: int64 | ||
| type: integer | ||
| uid: | ||
| description: A unique identifier for the event. You can use this identifier | ||
| to query or reference the event. | ||
| type: string | ||
| type: object | ||
| EventSystemAttributesCategory: | ||
| description: Event category identifying the type of event. | ||
| enum: | ||
| - change | ||
| - alert | ||
| example: change | ||
| type: string | ||
| x-enum-varnames: | ||
| - CHANGE | ||
| - ALERT | ||
| EventSystemAttributesIntegrationId: | ||
| description: Integration ID sourced from integration manifests. | ||
| enum: | ||
| - custom-events | ||
| example: custom-events | ||
| type: string | ||
| x-enum-varnames: | ||
| - CUSTOM_EVENTS | ||
| EventType: | ||
| default: event | ||
| description: Type of the event. | ||
|
|
@@ -41557,6 +41787,70 @@ components: | |
| type: string | ||
| x-enum-varnames: | ||
| - USERS | ||
| V2Event: | ||
| description: An event object. | ||
| properties: | ||
| attributes: | ||
| $ref: '#/components/schemas/V2EventAttributes' | ||
| id: | ||
| description: The event's ID. | ||
| example: '' | ||
| type: string | ||
| type: | ||
| description: Entity type. | ||
| example: event | ||
| type: string | ||
| type: object | ||
| V2EventAggregationKey: | ||
| description: Aggregation key of the event. | ||
| example: aggregation-key | ||
| type: string | ||
| V2EventAttributes: | ||
| description: Event attributes. | ||
| properties: | ||
| attributes: | ||
| $ref: '#/components/schemas/V2EventAttributesAttributes' | ||
| message: | ||
| description: Free-form text associated with the event. | ||
| example: The event message | ||
| type: string | ||
| tags: | ||
| description: A list of tags associated with the event. | ||
| example: | ||
| - env:api_client_test | ||
| items: | ||
| description: A tag. | ||
| type: string | ||
| type: array | ||
| timestamp: | ||
| description: Timestamp when the event occurred. | ||
| example: '2017-01-15T01:30:15.010000Z' | ||
| type: string | ||
| type: object | ||
| V2EventAttributesAttributes: | ||
| description: JSON object for category-specific attributes. | ||
| oneOf: | ||
| - $ref: '#/components/schemas/ChangeEventAttributes' | ||
| - $ref: '#/components/schemas/AlertEventAttributes' | ||
| V2EventResponse: | ||
| description: Get an event response. | ||
| properties: | ||
| data: | ||
| $ref: '#/components/schemas/V2Event' | ||
| type: object | ||
| V2EventService: | ||
| description: Service that triggered the event. | ||
| example: service-name | ||
| type: string | ||
| V2EventTimestamp: | ||
| description: POSIX timestamp of the event. | ||
| example: 175019386627 | ||
| format: int64 | ||
| type: integer | ||
| V2EventTitle: | ||
| description: The title of the event. | ||
| example: The event title | ||
| type: string | ||
| ValidationError: | ||
| description: Represents a single validation error, including a human-readable | ||
| title and metadata. | ||
|
|
@@ -48828,6 +49122,46 @@ paths: | |
| operator: OR | ||
| permissions: | ||
| - events_read | ||
| /api/v2/events/{event_id}: | ||
| get: | ||
| description: Get the details of an event by `event_id`. | ||
| operationId: GetEvent | ||
| parameters: | ||
| - description: The UID of the event. | ||
| in: path | ||
| name: event_id | ||
| required: true | ||
| schema: | ||
| type: string | ||
| responses: | ||
| '200': | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/V2EventResponse' | ||
| description: OK | ||
| '400': | ||
| $ref: '#/components/responses/BadRequestResponse' | ||
| '401': | ||
| $ref: '#/components/responses/UnauthorizedResponse' | ||
| '403': | ||
| $ref: '#/components/responses/ForbiddenResponse' | ||
| '404': | ||
| $ref: '#/components/responses/NotFoundResponse' | ||
| '429': | ||
| $ref: '#/components/responses/TooManyRequestsResponse' | ||
| security: | ||
| - apiKeyAuth: [] | ||
| appKeyAuth: [] | ||
| - AuthZ: | ||
| - events_read | ||
| summary: Get an event | ||
| tags: | ||
| - Events | ||
| x-permission: | ||
| operator: OR | ||
| permissions: | ||
| - events_read | ||
| /api/v2/incidents: | ||
| get: | ||
| description: Get all incidents for the user's organization. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Get an event returns "OK" response | ||
|
|
||
| require "datadog_api_client" | ||
| api_instance = DatadogAPIClient::V2::EventsAPI.new | ||
| p api_instance.get_event("AZeF-nTCAABzkAgGXzYPtgAA") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Consider using symbols instead of string hash keys (...read more)
In Ruby, it is a best practice to use symbols instead of strings as hash keys. This rule emphasizes that it's more efficient and idiomatic to use symbols for this purpose. Symbols are immutable and unique, which makes them ideal for identifying things, whereas strings are mutable and can create multiple objects for the same sequence of characters.
The importance of this rule lies in the performance and memory usage of your Ruby application. Using symbols as hash keys reduces memory usage because they are stored in memory only once during a Ruby process. This can make a significant difference in the efficiency of your application, especially when dealing with large data sets.
To ensure you're following good coding practices, always use symbols for hash keys unless there's a specific reason to use a string. A simple refactoring from
values = { 'foo' => 42, 'bar' => 99, 'baz' => 123 }tovalues = { foo: 42, bar: 99, baz: 123 }will make your code compliant with this rule. This not only improves your code's performance but also makes it more readable and consistent with Ruby's conventions.