Skip to content

Commit a9b5774

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
[ECT-99] Add app key to post /api/v2/events (#2809)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 77d1fc8 commit a9b5774

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-11-26 13:36:08.732682",
8-
"spec_repo_commit": "cf1aa5ea"
7+
"regenerated": "2024-11-27 13:09:00.363837",
8+
"spec_repo_commit": "fd3dd4d0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-26 13:36:08.752592",
13-
"spec_repo_commit": "cf1aa5ea"
12+
"regenerated": "2024-11-27 13:09:00.383880",
13+
"spec_repo_commit": "fd3dd4d0"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -31492,6 +31492,7 @@ paths:
3149231492
$ref: '#/components/responses/TooManyRequestsResponse'
3149331493
security:
3149431494
- apiKeyAuth: []
31495+
appKeyAuth: []
3149531496
summary: Post an event
3149631497
tags:
3149731498
- Events

api/datadogV2/api_events.go

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func (a *EventsApi) CreateEvent(ctx _context.Context, body EventCreateRequestPay
4545
ctx,
4646
&localVarHeaderParams,
4747
[2]string{"apiKeyAuth", "DD-API-KEY"},
48+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
4849
)
4950
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
5051
if err != nil {

tests/scenarios/features/v2/events.feature

+8-14
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,24 @@ Feature: Events
77

88
Background:
99
Given a valid "apiKeyAuth" key in the system
10+
And a valid "appKeyAuth" key in the system
1011
And an instance of "Events" API
1112

1213
@generated @skip @team:DataDog/event-management
1314
Scenario: Get a list of events returns "Bad Request" response
14-
Given a valid "appKeyAuth" key in the system
15-
And new "ListEvents" request
15+
Given new "ListEvents" request
1616
When the request is sent
1717
Then the response status is 400 Bad Request
1818

1919
@skip-validation @team:DataDog/event-management
2020
Scenario: Get a list of events returns "OK" response
21-
Given a valid "appKeyAuth" key in the system
22-
And new "ListEvents" request
21+
Given new "ListEvents" request
2322
When the request is sent
2423
Then the response status is 200 OK
2524

2625
@replay-only @skip-validation @team:DataDog/event-management @with-pagination
2726
Scenario: Get a list of events returns "OK" response with pagination
28-
Given a valid "appKeyAuth" key in the system
29-
And new "ListEvents" request
27+
Given new "ListEvents" request
3028
And request contains "filter[from]" parameter with value "now-15m"
3129
And request contains "filter[to]" parameter with value "now"
3230
And request contains "page[limit]" parameter with value 2
@@ -36,8 +34,7 @@ Feature: Events
3634

3735
@team:DataDog/event-management
3836
Scenario: Get a quick list of events returns "OK" response
39-
Given a valid "appKeyAuth" key in the system
40-
And new "ListEvents" request
37+
Given new "ListEvents" request
4138
And request contains "filter[query]" parameter with value "datadog-agent"
4239
And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00"
4340
And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00"
@@ -62,25 +59,22 @@ Feature: Events
6259

6360
@team:DataDog/event-management
6461
Scenario: Search events returns "Bad Request" response
65-
Given a valid "appKeyAuth" key in the system
66-
And new "SearchEvents" request
62+
Given new "SearchEvents" request
6763
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"}
6864
When the request is sent
6965
Then the response status is 400 Bad Request
7066

7167
@team:DataDog/event-management
7268
Scenario: Search events returns "OK" response
73-
Given a valid "appKeyAuth" key in the system
74-
And new "SearchEvents" request
69+
Given new "SearchEvents" request
7570
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}}
7671
When the request is sent
7772
Then the response status is 200 OK
7873
And the response "data" has length 0
7974

8075
@replay-only @skip-validation @team:DataDog/event-management @with-pagination
8176
Scenario: Search events returns "OK" response with pagination
82-
Given a valid "appKeyAuth" key in the system
83-
And new "SearchEvents" request
77+
Given new "SearchEvents" request
8478
And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"}
8579
When the request with pagination is sent
8680
Then the response status is 200 OK

0 commit comments

Comments
 (0)