Skip to content

Commit 82b011c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add asserts to v2 endpoints (#1043)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e218d47 commit 82b011c

31 files changed

+317
-29
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2023-02-28 10:12:57.158285",
8-
"spec_repo_commit": "c16e3609"
7+
"regenerated": "2023-03-01 15:45:34.929706",
8+
"spec_repo_commit": "8905444b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-02-28 10:12:57.177148",
13-
"spec_repo_commit": "c16e3609"
12+
"regenerated": "2023-03-01 15:45:34.943206",
13+
"spec_repo_commit": "8905444b"
1414
}
1515
}
1616
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-11-21T15:36:05.545Z"
1+
"2023-02-24T19:02:01.538Z"

cassettes/v2/Logs-Metrics_3185148095/Create-a-log-based-metric-returns-OK-response_2853166544/recording.har

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"entries": [
1010
{
11-
"_id": "f98bd5930d6046a011a332616cfb250b",
11+
"_id": "ac3bc5409b2023605878ba38f943df2e",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
15-
"bodySize": 208,
15+
"bodySize": 199,
1616
"cookies": [],
1717
"headers": [
1818
{
@@ -32,17 +32,17 @@
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":true,\"path\":\"@duration\"}},\"id\":\"Test-Create_a_log_based_metric_returns_OK_response-1669044965\",\"type\":\"logs_metrics\"}}"
35+
"text": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":true,\"path\":\"@duration\"}},\"id\":\"TestCreatealogbasedmetricreturnsOKresponse1677265321\",\"type\":\"logs_metrics\"}}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v2/logs/config/metrics"
3939
},
4040
"response": {
41-
"bodySize": 246,
41+
"bodySize": 237,
4242
"content": {
4343
"mimeType": "application/json",
44-
"size": 246,
45-
"text": "{\"data\":{\"attributes\":{\"filter\":{\"query\":\"*\"},\"group_by\":[],\"compute\":{\"path\":\"@duration\",\"include_percentiles\":true,\"aggregation_type\":\"distribution\"}},\"type\":\"logs_metrics\",\"id\":\"Test_Create_a_log_based_metric_returns_OK_response_1669044965\"}}\n"
44+
"size": 237,
45+
"text": "{\"data\":{\"id\":\"TestCreatealogbasedmetricreturnsOKresponse1677265321\",\"attributes\":{\"filter\":{\"query\":\"*\"},\"group_by\":[],\"compute\":{\"aggregation_type\":\"distribution\",\"path\":\"@duration\",\"include_percentiles\":true}},\"type\":\"logs_metrics\"}}\n"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -57,11 +57,11 @@
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2022-11-21T15:36:05.555Z",
61-
"time": 272
60+
"startedDateTime": "2023-02-24T19:02:01.546Z",
61+
"time": 487
6262
},
6363
{
64-
"_id": "12c1ae70ac1d021e801d57f41265ad38",
64+
"_id": "4f554b9aa0083e95d132404e1b4748b1",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
@@ -74,11 +74,11 @@
7474
"value": "*/*"
7575
}
7676
],
77-
"headersSize": 568,
77+
"headersSize": 559,
7878
"httpVersion": "HTTP/1.1",
7979
"method": "DELETE",
8080
"queryString": [],
81-
"url": "https://api.datadoghq.com/api/v2/logs/config/metrics/Test_Create_a_log_based_metric_returns_OK_response_1669044965"
81+
"url": "https://api.datadoghq.com/api/v2/logs/config/metrics/TestCreatealogbasedmetricreturnsOKresponse1677265321"
8282
},
8383
"response": {
8484
"bodySize": 3,
@@ -100,8 +100,8 @@
100100
"status": 200,
101101
"statusText": "OK"
102102
},
103-
"startedDateTime": "2022-11-21T15:36:05.838Z",
104-
"time": 141
103+
"startedDateTime": "2023-02-24T19:02:02.048Z",
104+
"time": 148
105105
}
106106
],
107107
"pages": [],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2023-01-19T19:59:42.355Z"
1+
"2023-02-27T21:53:03.795Z"

cassettes/v2/Monitors_4022238206/Get-all-monitor-configuration-policies-returns-OK-response_3880633912/recording.har

Lines changed: 102 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,59 @@
77
"version": "6.0.5"
88
},
99
"entries": [
10+
{
11+
"_id": "13b530fd8b9117a8993069a27759db40",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 164,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 574,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"policy\":{\"tag_key\":\"dc\",\"tag_key_required\":true,\"valid_tag_values\":[\"prod\",\"staging\"]},\"policy_type\":\"tag\"},\"type\":\"monitor-config-policy\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/monitor/policy"
39+
},
40+
"response": {
41+
"bodySize": 209,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 209,
45+
"text": "{\"data\":{\"type\":\"monitor-config-policy\",\"id\":\"1c8a8eea-b6e9-11ed-a4ec-da7ad0900002\",\"attributes\":{\"policy_type\":\"tag\",\"policy\":{\"tag_key\":\"dc\",\"valid_tag_values\":[\"prod\",\"staging\"],\"tag_key_required\":true}}}}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 634,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2023-02-27T21:53:03.805Z",
61+
"time": 182
62+
},
1063
{
1164
"_id": "d1d9faecfa7d2feb2d28e24a04e24a01",
1265
"_order": 0,
@@ -21,18 +74,18 @@
2174
"value": "application/json"
2275
}
2376
],
24-
"headersSize": 522,
77+
"headersSize": 520,
2578
"httpVersion": "HTTP/1.1",
2679
"method": "GET",
2780
"queryString": [],
2881
"url": "https://api.datadoghq.com/api/v2/monitor/policy"
2982
},
3083
"response": {
31-
"bodySize": 12,
84+
"bodySize": 211,
3285
"content": {
3386
"mimeType": "application/json",
34-
"size": 12,
35-
"text": "{\"data\":[]}\n"
87+
"size": 211,
88+
"text": "{\"data\":[{\"type\":\"monitor-config-policy\",\"id\":\"1c8a8eea-b6e9-11ed-a4ec-da7ad0900002\",\"attributes\":{\"policy_type\":\"tag\",\"policy\":{\"tag_key_required\":true,\"valid_tag_values\":[\"prod\",\"staging\"],\"tag_key\":\"dc\"}}}]}\n"
3689
},
3790
"cookies": [],
3891
"headers": [
@@ -41,14 +94,56 @@
4194
"value": "application/json"
4295
}
4396
],
44-
"headersSize": 613,
97+
"headersSize": 637,
4598
"httpVersion": "HTTP/1.1",
4699
"redirectURL": "",
47100
"status": 200,
48101
"statusText": "OK"
49102
},
50-
"startedDateTime": "2023-01-19T19:59:42.357Z",
51-
"time": 97
103+
"startedDateTime": "2023-02-27T21:53:03.997Z",
104+
"time": 123
105+
},
106+
{
107+
"_id": "1e9f2d70210c48716ad8355a59e8e36e",
108+
"_order": 0,
109+
"cache": {},
110+
"request": {
111+
"bodySize": 0,
112+
"cookies": [],
113+
"headers": [
114+
{
115+
"_fromType": "array",
116+
"name": "accept",
117+
"value": "*/*"
118+
}
119+
],
120+
"headersSize": 547,
121+
"httpVersion": "HTTP/1.1",
122+
"method": "DELETE",
123+
"queryString": [],
124+
"url": "https://api.datadoghq.com/api/v2/monitor/policy/1c8a8eea-b6e9-11ed-a4ec-da7ad0900002"
125+
},
126+
"response": {
127+
"bodySize": 0,
128+
"content": {
129+
"mimeType": "text/html; charset=utf-8",
130+
"size": 0
131+
},
132+
"cookies": [],
133+
"headers": [
134+
{
135+
"name": "content-type",
136+
"value": "text/html; charset=utf-8"
137+
}
138+
],
139+
"headersSize": 623,
140+
"httpVersion": "HTTP/1.1",
141+
"redirectURL": "",
142+
"status": 204,
143+
"statusText": "No Content"
144+
},
145+
"startedDateTime": "2023-02-27T21:53:04.145Z",
146+
"time": 148
52147
}
53148
],
54149
"pages": [],

examples/v2/logs-metrics/CreateLogsMetric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const apiInstance = new v2.LogsMetricsApi(configuration);
1010
const params: v2.LogsMetricsApiCreateLogsMetricRequest = {
1111
body: {
1212
data: {
13-
id: "Example-Create_a_log_based_metric_returns_OK_response",
13+
id: "ExampleCreatealogbasedmetricreturnsOKresponse",
1414
type: "logs_metrics",
1515
attributes: {
1616
compute: {

features/v2/authn_mappings.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Feature: AuthN Mappings
3030
And body with value {"data": {"attributes": {"attribute_key": "{{ unique_lower_alnum }}", "attribute_value": "{{ unique }}"}, "relationships": {"role": {"data": {"id": "{{ role.data.id }}", "type": "roles"}}}, "type": "authn_mappings"}}
3131
When the request is sent
3232
Then the response status is 200 OK
33+
And the response "data.attributes.attribute_key" is equal to "{{ unique_lower_alnum }}"
34+
And the response "data.attributes.attribute_value" is equal to "{{ unique }}"
35+
And the response "data.relationships.role.data.id" is equal to "{{ role.data.id }}"
3336

3437
@generated @skip @team:DataDog/team-aaa
3538
Scenario: Delete an AuthN Mapping returns "Not Found" response
@@ -80,6 +83,10 @@ Feature: AuthN Mappings
8083
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "id": "{{ authn_mapping.data.id }}", "relationships": {"role": {"data": {"id": "{{ role.data.id }}", "type": "roles"}}}, "type": "authn_mappings"}}
8184
When the request is sent
8285
Then the response status is 200 OK
86+
And the response "data.id" is equal to "{{ authn_mapping.data.id }}"
87+
And the response "data.attributes.attribute_key" is equal to "member-of"
88+
And the response "data.attributes.attribute_value" is equal to "Development"
89+
And the response "data.relationships.role.data.id" is equal to "{{ role.data.id }}"
8390

8491
@generated @skip @team:DataDog/team-aaa
8592
Scenario: Edit an AuthN Mapping returns "Unprocessable Entity" response
@@ -104,6 +111,10 @@ Feature: AuthN Mappings
104111
And request contains "authn_mapping_id" parameter from "authn_mapping.data.id"
105112
When the request is sent
106113
Then the response status is 200 OK
114+
And the response "data.id" is equal to "{{ authn_mapping.data.id }}"
115+
And the response "data.attributes.attribute_key" is equal to "{{ unique_lower_alnum }}"
116+
And the response "data.attributes.attribute_value" is equal to "{{ unique }}"
117+
And the response "data.relationships.role.data.id" is equal to "{{ role.data.id }}"
107118

108119
@team:DataDog/team-aaa
109120
Scenario: List all AuthN Mappings returns "OK" response
@@ -112,3 +123,4 @@ Feature: AuthN Mappings
112123
And new "ListAuthNMappings" request
113124
When the request is sent
114125
Then the response status is 200 OK
126+
And the response "data[0].type" is equal to "authn_mappings"

features/v2/ci_visibility_pipelines.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Feature: CI Visibility Pipelines
2020
And body with value {"compute": [{"aggregation": "pc90", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:(gitlab OR github)", "to": "now"}, "group_by": [{ "facet": "@ci.status", "limit": 10, "total": false}], "options": {"timezone": "GMT"}}
2121
When the request is sent
2222
Then the response status is 200 OK
23+
And the response "meta.status" is equal to "done"
2324

2425
@generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
2526
Scenario: Get a list of pipelines events returns "Bad Request" response

features/v2/ci_visibility_tests.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Feature: CI Visibility Tests
2020
And body with value {"compute": [{"aggregation": "count", "metric": "@test.is_flaky", "type": "total"}], "filter": {"from": "now-15m", "query": "@language:(python OR go)", "to": "now"}, "group_by": [{"facet": "@git.branch", "limit": 10, "sort": {"order": "asc"}, "total": false}], "options": {"timezone": "GMT"}}
2121
When the request is sent
2222
Then the response status is 200 OK
23+
And the response "meta.status" is equal to "done"
2324

2425
@generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
2526
Scenario: Get a list of tests events returns "Bad Request" response

features/v2/cloudflare_integration.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Feature: Cloudflare Integration
3535
And body with value {"data": {"attributes": {"api_key": "6Zm7WEgKzAlCnt_4exfEK0mSoeHHAaDf41O1AAfu", "email": "new@email", "name": "{{ unique_lower_alnum }}"}, "type": "cloudflare-accounts"}}
3636
When the request is sent
3737
Then the response status is 201 CREATED
38+
And the response "data.type" is equal to "cloudflare-accounts"
39+
And the response "data.attributes.email" is equal to "new@email"
40+
And the response "data.attributes.name" is equal to "{{ unique_lower_alnum }}"
3841

3942
@generated @skip @team:Datadog/web-integrations
4043
Scenario: Add Cloudflare account returns "Not Found" response
@@ -85,6 +88,9 @@ Feature: Cloudflare Integration
8588
And request contains "account_id" parameter from "cloudflare_account.data.id"
8689
When the request is sent
8790
Then the response status is 200 OK
91+
And the response "data.type" is equal to "cloudflare-accounts"
92+
And the response "data.attributes.email" is equal to "[email protected]"
93+
And the response "data.attributes.name" is equal to "{{ unique_lower_alnum }}"
8894

8995
@generated @skip @team:Datadog/web-integrations
9096
Scenario: List Cloudflare accounts returns "Bad Request" response
@@ -104,6 +110,7 @@ Feature: Cloudflare Integration
104110
And new "ListCloudflareAccounts" request
105111
When the request is sent
106112
Then the response status is 200 OK
113+
And the response "data[0].type" is equal to "cloudflare-accounts"
107114

108115
@generated @skip @team:Datadog/web-integrations
109116
Scenario: Update Cloudflare account returns "Bad Request" response

0 commit comments

Comments
 (0)