Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-05 19:40:57.590898",
"spec_repo_commit": "334a5ac9"
"regenerated": "2023-12-06 19:00:59.270611",
"spec_repo_commit": "6ccf2a1f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-05 19:40:57.604681",
"spec_repo_commit": "334a5ac9"
"regenerated": "2023-12-06 19:00:59.291322",
"spec_repo_commit": "6ccf2a1f"
}
}
}
6 changes: 0 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22325,9 +22325,6 @@ paths:
cursorPath: meta.page.after
limitParam: page[limit]
resultsPath: data
x-unstable: '**Note**: This endpoint is in beta.

For access, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/events/search:
post:
description: 'List endpoint returns events that match an events search query.
Expand Down Expand Up @@ -22370,9 +22367,6 @@ paths:
cursorPath: meta.page.after
limitParam: body.page.limit
resultsPath: data
x-unstable: '**Note**: This endpoint is in beta.

For access, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/incidents:
get:
description: Get all incidents for the user's organization.
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/events/ListEvents.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Get a list of events returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_events".to_sym] = true
end
api_instance = DatadogAPIClient::V2::EventsAPI.new
p api_instance.list_events()
3 changes: 0 additions & 3 deletions examples/v2/events/ListEvents_1527584014.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Get a list of events returns "OK" response with pagination

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_events".to_sym] = true
end
api_instance = DatadogAPIClient::V2::EventsAPI.new
opts = {
filter_from: "now-15m",
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/events/ListEvents_2663715109.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Get a quick list of events returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_events".to_sym] = true
end
api_instance = DatadogAPIClient::V2::EventsAPI.new
opts = {
filter_query: "datadog-agent",
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/events/SearchEvents.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Search events returns "OK" response

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

body = DatadogAPIClient::V2::EventsListRequest.new({
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/events/SearchEvents_3856995058.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Search events returns "OK" response with pagination

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

body = DatadogAPIClient::V2::EventsListRequest.new({
Expand Down
21 changes: 7 additions & 14 deletions features/v2/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ Feature: Events

@generated @skip @team:DataDog/event-management
Scenario: Get a list of events returns "Bad Request" response
Given operation "ListEvents" enabled
And new "ListEvents" request
Given new "ListEvents" request
When the request is sent
Then the response status is 400 Bad Request

@skip-validation @team:DataDog/event-management
Scenario: Get a list of events returns "OK" response
Given operation "ListEvents" enabled
And new "ListEvents" request
Given new "ListEvents" request
When the request is sent
Then the response status is 200 OK

@replay-only @skip-validation @team:DataDog/event-management @with-pagination
Scenario: Get a list of events returns "OK" response with pagination
Given operation "ListEvents" enabled
And new "ListEvents" request
Given new "ListEvents" request
And request contains "filter[from]" parameter with value "now-15m"
And request contains "filter[to]" parameter with value "now"
And request contains "page[limit]" parameter with value 2
Expand All @@ -37,8 +34,7 @@ Feature: Events

@team:DataDog/event-management
Scenario: Get a quick list of events returns "OK" response
Given operation "ListEvents" enabled
And new "ListEvents" request
Given new "ListEvents" request
And request contains "filter[query]" parameter with value "datadog-agent"
And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00"
And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00"
Expand All @@ -49,25 +45,22 @@ Feature: Events

@team:DataDog/event-management
Scenario: Search events returns "Bad Request" response
Given operation "SearchEvents" enabled
And new "SearchEvents" request
Given new "SearchEvents" request
And body with value {"filter": {"from": "now-15m", "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/event-management
Scenario: Search events returns "OK" response
Given operation "SearchEvents" enabled
And new "SearchEvents" request
Given new "SearchEvents" request
And body with value {"filter": {"query": "datadog-agent", "from": "2020-09-17T11:48:36+01:00", "to": "2020-09-17T12:48:36+01:00"}, "sort": "timestamp", "page": {"limit": 5}}
When the request is sent
Then the response status is 200 OK
And the response "data" has length 0

@replay-only @skip-validation @team:DataDog/event-management @with-pagination
Scenario: Search events returns "OK" response with pagination
Given operation "SearchEvents" enabled
And new "SearchEvents" request
Given new "SearchEvents" request
And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"}
When the request with pagination is sent
Then the response status is 200 OK
Expand Down
2 changes: 0 additions & 2 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ def initialize
"v2.get_monthly_cost_attribution": false,
"v2.create_dora_deployment": false,
"v2.create_dora_incident": false,
"v2.list_events": false,
"v2.search_events": false,
"v2.create_incident": false,
"v2.create_incident_integration": false,
"v2.create_incident_todo": false,
Expand Down
12 changes: 0 additions & 12 deletions lib/datadog_api_client/v2/api/events_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ def list_events(opts = {})
# @option opts [Integer] :page_limit Maximum number of events in the response.
# @return [Array<(EventsListResponse, Integer, Hash)>] EventsListResponse data, response status code and response headers
def list_events_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.list_events".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_events")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_events"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EventsAPI.list_events ...'
Expand Down Expand Up @@ -151,12 +145,6 @@ def search_events(opts = {})
# @option opts [EventsListRequest] :body
# @return [Array<(EventsListResponse, Integer, Hash)>] EventsListResponse data, response status code and response headers
def search_events_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.search_events".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_events")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_events"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EventsAPI.search_events ...'
Expand Down