Sha256: a786f11cf78fc90b009d7dd727068d5291b7f1c9d294768aad1df65cdb02a45d

Contents?: true

Size: 717 Bytes

Versions: 10

Compression:

Stored size: 717 Bytes

Contents

# Search events returns "OK" response with pagination

require "datadog_api_client"
DatadogAPIClient::V2.configure do |config|
  config.unstable_operations["v2.search_events".to_sym] = true
end
api_instance = DatadogAPIClient::V2::EventsAPI.new

body = DatadogAPIClient::V2::EventsListRequest.new({
  filter: DatadogAPIClient::V2::EventsQueryFilter.new({
    from: "now-15m",
    to: "now",
  }),
  options: DatadogAPIClient::V2::EventsQueryOptions.new({
    timezone: "GMT",
  }),
  page: DatadogAPIClient::V2::EventsRequestPage.new({
    limit: 2,
  }),
  sort: DatadogAPIClient::V2::EventsSort::TIMESTAMP_ASCENDING,
})
opts = {
  body: body,
}
api_instance.search_events_with_pagination(opts) { |item| puts item }

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
datadog_api_client-2.9.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.8.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.7.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.6.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.5.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.4.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.3.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.2.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.1.0 examples/v2/events/SearchEvents_3856995058.rb
datadog_api_client-2.0.2 examples/v2/events/SearchEvents_3856995058.rb