Skip to content

Commit

Permalink
[ECT-99] Add app key to post /api/v2/events (#2589)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Nov 27, 2024
1 parent 60b8333 commit 61c4f92
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
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": "2024-11-26 13:36:15.509612",
"spec_repo_commit": "cf1aa5ea"
"regenerated": "2024-11-27 13:09:00.927359",
"spec_repo_commit": "fd3dd4d0"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-26 13:36:15.529715",
"spec_repo_commit": "cf1aa5ea"
"regenerated": "2024-11-27 13:09:00.946410",
"spec_repo_commit": "fd3dd4d0"
}
}
}
1 change: 1 addition & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31492,6 +31492,7 @@ paths:
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
summary: Post an event
tags:
- Events
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/datadog/api/client/v2/api/EventsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public ApiResponse<EventCreateResponsePayload> createEventWithHttpInfo(
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth"});
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"POST",
builder,
Expand Down Expand Up @@ -170,7 +170,7 @@ public CompletableFuture<ApiResponse<EventCreateResponsePayload>> createEventWit
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth"});
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<EventCreateResponsePayload>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
Expand Down
22 changes: 8 additions & 14 deletions src/test/resources/com/datadog/api/client/v2/api/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@ Feature: Events

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "Events" API

@generated @skip @team:DataDog/event-management
Scenario: Get a list of events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
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 a valid "appKeyAuth" key in the system
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 a valid "appKeyAuth" key in the system
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 @@ -36,8 +34,7 @@ Feature: Events

@team:DataDog/event-management
Scenario: Get a quick list of events returns "OK" response
Given a valid "appKeyAuth" key in the system
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 @@ -62,25 +59,22 @@ Feature: Events

@team:DataDog/event-management
Scenario: Search events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
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 a valid "appKeyAuth" key in the system
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 a valid "appKeyAuth" key in the system
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

0 comments on commit 61c4f92

Please sign in to comment.