Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 60 additions & 16 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51167,18 +51167,19 @@ components:
from:
default: "now-15m"
description: |-
The minimum time for the requested events. Supports date math and regular timestamps in milliseconds.
The minimum time for the requested events. Supports date math, ISO 8601, and timestamps in milliseconds.
Set an earlier time than the default to search beyond the last 15 minutes.
example: "now-15m"
type: string
query:
default: "*"
description: The search query following the event search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
description: The search query following the event search syntax. Attributes take `@` (`@evt.category:alert`); tags and reserved fields don't (`service:web`).
example: "@evt.integration_id:kubernetes @evt.category:alert"
type: string
to:
default: "now"
description: |-
The maximum time for the requested events. Supports date math and regular timestamps in milliseconds.
The maximum time for the requested events. Supports date math, ISO 8601, and timestamps in milliseconds.
example: "now"
type: string
type: object
Expand Down Expand Up @@ -51292,7 +51293,9 @@ components:
type: string
type: object
EventsSort:
description: The sort parameters when querying events.
description: |-
The sort order of events. `-timestamp` (the default) returns the newest events first, and `timestamp` returns
the oldest first. The client libraries reject any other value.
enum:
- timestamp
- -timestamp
Expand Down Expand Up @@ -189946,21 +189949,33 @@ paths:
[Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).

Use this endpoint to see your latest events.

Query syntax: Attributes take `@` (`@evt.integration_id:kubernetes`, `@evt.category:alert`), while tags and
reserved fields don't (`kube_cluster_name:gizmo`, `service:web`, `source:oom_kill`). A name that needs `@`
matches nothing without it. To filter by integration, prefer `@evt.integration_id`, whose values use hyphens
(`oom-kill`), over `source`, whose values use underscores (`oom_kill`). Bare words search the event text.
Quoted phrases, `OR`, `-` negation, and value wildcards are supported. Wildcards in attribute names, such as
`@*.name`, are not supported.

Without `filter[from]`, the endpoint searches only the last 15 minutes. Widen the time window before concluding that no event exists.
Each event's own fields are under `data[].attributes.attributes`, for example `evt.integration_id`, `evt.category`,
`title`, and `service`. To fetch one event with `GetEvent`, use its `evt.id` or `evt.uid`, not the top-level `data[].id`.
operationId: ListEvents
parameters:
- description: Search query following events syntax.
- description: Search query following events syntax. Attributes take `@` (`@evt.category:alert`); tags and reserved fields don't (`service:web`).
example: "@evt.integration_id:kubernetes @evt.category:alert"
in: query
name: filter[query]
required: false
schema:
type: string
- description: Minimum timestamp for requested events, in milliseconds.
- description: Minimum time for requested events, as date math (`now-1h`), ISO 8601, or a timestamp in milliseconds. Defaults to `now-15m`.
in: query
name: filter[from]
required: false
schema:
type: string
- description: Maximum timestamp for requested events, in milliseconds.
- description: Maximum time for requested events, as date math, ISO 8601, or a timestamp in milliseconds. Defaults to `now`.
in: query
name: filter[to]
required: false
Expand Down Expand Up @@ -190187,23 +190202,52 @@ paths:
[Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).

Use this endpoint to build complex events filtering and search.

Query syntax: Attributes take `@` (`@evt.integration_id:kubernetes`, `@evt.category:alert`), while tags and
reserved fields don't (`kube_cluster_name:gizmo`, `service:web`, `source:oom_kill`). A name that needs `@`
matches nothing without it. To filter by integration, prefer `@evt.integration_id`, whose values use hyphens
(`oom-kill`), over `source`, whose values use underscores (`oom_kill`). Bare words search the event text.
Quoted phrases, `OR`, `-` negation, and value wildcards are supported. Wildcards in attribute names, such as
`@*.name`, are not supported.

Without `filter.from`, the endpoint searches only the last 15 minutes. Widen the time window before concluding that no event exists.
Each event's own fields are under `data[].attributes.attributes`, for example `evt.integration_id`, `evt.category`,
`title`, and `service`. To fetch one event with `GetEvent`, use its `evt.id` or `evt.uid`, not the top-level `data[].id`.
operationId: SearchEvents
requestBody:
content:
"application/json":
examples:
default:
summary: Alert events from an integration at a cluster, newest first
value:
filter:
from: now-15m
query: service:web* AND @http.status_code:[200 TO 299]
from: now-1h
query: "@evt.integration_id:kubernetes @evt.category:alert kube_cluster_name:prod-cluster"
to: now
options:
timezone: GMT
page:
cursor: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==
limit: 25
sort: timestamp
limit: 100
sort: -timestamp
impacted_resource_changes:
summary: Changes that name an impacted resource
value:
filter:
from: now-24h
query: '@evt.integration_id:change-tracking @impacted_resources.name:"checkout-api"'
to: now
page:
limit: 100
sort: -timestamp
service_changes:
summary: Changes to a service over the last day
value:
filter:
from: now-24h
query: "@evt.category:change service:checkout"
to: now
page:
limit: 100
sort: -timestamp
schema:
$ref: "#/components/schemas/EventsListRequest"
required: false
Expand Down Expand Up @@ -190256,7 +190300,7 @@ paths:
Get the details of an event by `event_id`.
operationId: GetEvent
parameters:
- description: The UID of the event.
- description: The event's `evt.id` or `evt.uid`, read from `data[].attributes.attributes.evt` in `ListEvents` or `SearchEvents` results. The top-level `data[].id` is not accepted.
in: path
name: event_id
required: true
Expand Down
58 changes: 51 additions & 7 deletions src/main/java/com/datadog/api/client/v2/api/EventsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public CompletableFuture<ApiResponse<EventCreateResponsePayload>> createEventWit
*
* <p>See {@link #getEventWithHttpInfo}.
*
* @param eventId The UID of the event. (required)
* @param eventId The event's <code>evt.id</code> or <code>evt.uid</code>, read from <code>
* data[].attributes.attributes.evt</code> in <code>ListEvents</code> or <code>SearchEvents
* </code> results. The top-level <code>data[].id</code> is not accepted. (required)
* @return V2EventResponse
* @throws ApiException if fails to make API call
*/
Expand All @@ -215,7 +217,9 @@ public V2EventResponse getEvent(String eventId) throws ApiException {
*
* <p>See {@link #getEventWithHttpInfoAsync}.
*
* @param eventId The UID of the event. (required)
* @param eventId The event's <code>evt.id</code> or <code>evt.uid</code>, read from <code>
* data[].attributes.attributes.evt</code> in <code>ListEvents</code> or <code>SearchEvents
* </code> results. The top-level <code>data[].id</code> is not accepted. (required)
* @return CompletableFuture&lt;V2EventResponse&gt;
*/
public CompletableFuture<V2EventResponse> getEventAsync(String eventId) {
Expand All @@ -229,7 +233,9 @@ public CompletableFuture<V2EventResponse> getEventAsync(String eventId) {
/**
* Get the details of an event by <code>event_id</code>.
*
* @param eventId The UID of the event. (required)
* @param eventId The event's <code>evt.id</code> or <code>evt.uid</code>, read from <code>
* data[].attributes.attributes.evt</code> in <code>ListEvents</code> or <code>SearchEvents
* </code> results. The top-level <code>data[].id</code> is not accepted. (required)
* @return ApiResponse&lt;V2EventResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
Expand Down Expand Up @@ -283,7 +289,9 @@ public ApiResponse<V2EventResponse> getEventWithHttpInfo(String eventId) throws
*
* <p>See {@link #getEventWithHttpInfo}.
*
* @param eventId The UID of the event. (required)
* @param eventId The event's <code>evt.id</code> or <code>evt.uid</code>, read from <code>
* data[].attributes.attributes.evt</code> in <code>ListEvents</code> or <code>SearchEvents
* </code> results. The top-level <code>data[].id</code> is not accepted. (required)
* @return CompletableFuture&lt;ApiResponse&lt;V2EventResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<V2EventResponse>> getEventWithHttpInfoAsync(String eventId) {
Expand Down Expand Up @@ -342,7 +350,9 @@ public static class ListEventsOptionalParameters {
/**
* Set filterQuery.
*
* @param filterQuery Search query following events syntax. (optional)
* @param filterQuery Search query following events syntax. Attributes take <code>@</code> (
* <code>@evt.category:alert</code>); tags and reserved fields don't (<code>service:web
* </code>). (optional)
* @return ListEventsOptionalParameters
*/
public ListEventsOptionalParameters filterQuery(String filterQuery) {
Expand All @@ -353,7 +363,8 @@ public ListEventsOptionalParameters filterQuery(String filterQuery) {
/**
* Set filterFrom.
*
* @param filterFrom Minimum timestamp for requested events, in milliseconds. (optional)
* @param filterFrom Minimum time for requested events, as date math (<code>now-1h</code>), ISO
* 8601, or a timestamp in milliseconds. Defaults to <code>now-15m</code>. (optional)
* @return ListEventsOptionalParameters
*/
public ListEventsOptionalParameters filterFrom(String filterFrom) {
Expand All @@ -364,7 +375,8 @@ public ListEventsOptionalParameters filterFrom(String filterFrom) {
/**
* Set filterTo.
*
* @param filterTo Maximum timestamp for requested events, in milliseconds. (optional)
* @param filterTo Maximum time for requested events, as date math, ISO 8601, or a timestamp in
* milliseconds. Defaults to <code>now</code>. (optional)
* @return ListEventsOptionalParameters
*/
public ListEventsOptionalParameters filterTo(String filterTo) {
Expand Down Expand Up @@ -526,6 +538,22 @@ public PaginationIterable<EventResponse> listEventsWithPagination(
*
* <p>Use this endpoint to see your latest events.
*
* <p>Query syntax: Attributes take <code>@</code> (<code>@evt.integration_id:kubernetes</code>,
* <code>@evt.category:alert</code>), while tags and reserved fields don't (<code>
* kube_cluster_name:gizmo</code>, <code>service:web</code>, <code>source:oom_kill</code>). A name
* that needs <code>@</code> matches nothing without it. To filter by integration, prefer <code>
* @evt.integration_id</code>, whose values use hyphens (<code>oom-kill</code>), over <code>source
* </code>, whose values use underscores (<code>oom_kill</code>). Bare words search the event
* text. Quoted phrases, <code>OR</code>, <code>-</code> negation, and value wildcards are
* supported. Wildcards in attribute names, such as <code>@*.name</code>, are not supported.
*
* <p>Without <code>filter[from]</code>, the endpoint searches only the last 15 minutes. Widen the
* time window before concluding that no event exists. Each event's own fields are under <code>
* data[].attributes.attributes</code>, for example <code>evt.integration_id</code>, <code>
* evt.category</code>, <code>title</code>, and <code>service</code>. To fetch one event with
* <code>GetEvent</code>, use its <code>evt.id</code> or <code>evt.uid</code>, not the top-level
* <code>data[].id</code>.
*
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;EventsListResponse&gt;
* @throws ApiException if fails to make API call
Expand Down Expand Up @@ -781,6 +809,22 @@ public PaginationIterable<EventResponse> searchEventsWithPagination(
*
* <p>Use this endpoint to build complex events filtering and search.
*
* <p>Query syntax: Attributes take <code>@</code> (<code>@evt.integration_id:kubernetes</code>,
* <code>@evt.category:alert</code>), while tags and reserved fields don't (<code>
* kube_cluster_name:gizmo</code>, <code>service:web</code>, <code>source:oom_kill</code>). A name
* that needs <code>@</code> matches nothing without it. To filter by integration, prefer <code>
* @evt.integration_id</code>, whose values use hyphens (<code>oom-kill</code>), over <code>source
* </code>, whose values use underscores (<code>oom_kill</code>). Bare words search the event
* text. Quoted phrases, <code>OR</code>, <code>-</code> negation, and value wildcards are
* supported. Wildcards in attribute names, such as <code>@*.name</code>, are not supported.
*
* <p>Without <code>filter.from</code>, the endpoint searches only the last 15 minutes. Widen the
* time window before concluding that no event exists. Each event's own fields are under <code>
* data[].attributes.attributes</code>, for example <code>evt.integration_id</code>, <code>
* evt.category</code>, <code>title</code>, and <code>service</code>. To fetch one event with
* <code>GetEvent</code>, use its <code>evt.id</code> or <code>evt.uid</code>, not the top-level
* <code>data[].id</code>.
*
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;EventsListResponse&gt;
* @throws ApiException if fails to make API call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ public EventsListRequest sort(EventsSort sort) {
}

/**
* The sort parameters when querying events.
* The sort order of events. <code>-timestamp</code> (the default) returns the newest events
* first, and <code>timestamp</code> returns the oldest first. The client libraries reject any
* other value.
*
* @return sort
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public EventsQueryFilter from(String from) {
}

/**
* The minimum time for the requested events. Supports date math and regular timestamps in
* milliseconds.
* The minimum time for the requested events. Supports date math, ISO 8601, and timestamps in
* milliseconds. Set an earlier time than the default to search beyond the last 15 minutes.
*
* @return from
*/
Expand All @@ -63,7 +63,8 @@ public EventsQueryFilter query(String query) {
}

/**
* The search query following the event search syntax.
* The search query following the event search syntax. Attributes take <code>@</code> (<code>
* @evt.category:alert</code>); tags and reserved fields don't (<code>service:web</code>).
*
* @return query
*/
Expand All @@ -84,7 +85,7 @@ public EventsQueryFilter to(String to) {
}

/**
* The maximum time for the requested events. Supports date math and regular timestamps in
* The maximum time for the requested events. Supports date math, ISO 8601, and timestamps in
* milliseconds.
*
* @return to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
import java.util.HashSet;
import java.util.Set;

/** The sort parameters when querying events. */
/**
* The sort order of events. <code>-timestamp</code> (the default) returns the newest events first,
* and <code>timestamp</code> returns the oldest first. The client libraries reject any other value.
*/
@JsonSerialize(using = EventsSort.EventsSortSerializer.class)
public class EventsSort extends ModelEnum<String> {

Expand Down
Loading