Skip to content

Commit e25bb26

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update example for GetEstimatedCostByOrg (#897)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f81a34c commit e25bb26

File tree

10 files changed

+87
-47
lines changed

10 files changed

+87
-47
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": "2022-11-02 20:10:44.572413",
8-
"spec_repo_commit": "7c5579df"
7+
"regenerated": "2022-11-04 18:42:23.483568",
8+
"spec_repo_commit": "af3f11fc"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-11-02 20:10:44.593267",
13-
"spec_repo_commit": "7c5579df"
12+
"regenerated": "2022-11-04 18:42:23.501734",
13+
"spec_repo_commit": "af3f11fc"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16461,7 +16461,9 @@ paths:
1646116461
get:
1646216462
description: 'Get estimated cost across multi-org and single root-org accounts.
1646316463

16464-
Estimated cost data is only available for the current month and previous month.
16464+
Estimated cost data is only available for the current month and previous month
16465+
16466+
and is delayed by up to 72 hours from when it was incurred.
1646516467

1646616468
To access historical costs prior to this, use the `/historical_cost` endpoint.'
1646716469
operationId: GetEstimatedCostByOrg
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-09-23T14:04:15.545Z"
1+
"2022-11-03T21:08:41.229Z"

cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/recording.har

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "6f83bc6b9f6d8855ab2010ced5adc5f0",
11+
"_id": "f0e71e06e09bdc333a8e4a09733b118a",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -21,7 +21,7 @@
2121
"value": "application/json;datetime-format=rfc3339"
2222
}
2323
],
24-
"headersSize": 640,
24+
"headersSize": 639,
2525
"httpVersion": "HTTP/1.1",
2626
"method": "GET",
2727
"queryString": [
@@ -31,14 +31,14 @@
3131
},
3232
{
3333
"name": "start_month",
34-
"value": "2022-09-20T14:04:15.545Z"
34+
"value": "2022-11-03T21:08:41.229Z"
3535
},
3636
{
3737
"name": "start_date",
38-
"value": "2022-09-20T14:04:15.545Z"
38+
"value": "2022-10-31T21:08:41.229Z"
3939
}
4040
],
41-
"url": "https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-09-20T14%3A04%3A15.545Z&start_date=2022-09-20T14%3A04%3A15.545Z"
41+
"url": "https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-11-03T21%3A08%3A41.229Z&start_date=2022-10-31T21%3A08%3A41.229Z"
4242
},
4343
"response": {
4444
"bodySize": 96,
@@ -60,8 +60,8 @@
6060
"status": 400,
6161
"statusText": "Bad Request"
6262
},
63-
"startedDateTime": "2022-09-23T14:04:15.571Z",
64-
"time": 624
63+
"startedDateTime": "2022-11-03T21:08:41.248Z",
64+
"time": 712
6565
}
6666
],
6767
"pages": [],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-11-04T18:40:14.021Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"log": {
3+
"_recordingName": "Usage Metering/GetEstimatedCostByOrg with start_month returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.4"
8+
},
9+
"entries": [
10+
{
11+
"_id": "4ad0a8d9835df4c06695ca3d93866e34",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json;datetime-format=rfc3339"
22+
}
23+
],
24+
"headersSize": 600,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [
28+
{
29+
"name": "view",
30+
"value": "sub-org"
31+
},
32+
{
33+
"name": "start_month",
34+
"value": "2022-11-04T18:40:14.021Z"
35+
}
36+
],
37+
"url": "https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-11-04T18%3A40%3A14.021Z"
38+
},
39+
"response": {
40+
"bodySize": 12,
41+
"content": {
42+
"mimeType": "application/json",
43+
"size": 12,
44+
"text": "{\"data\":[]}\n"
45+
},
46+
"cookies": [],
47+
"headers": [
48+
{
49+
"name": "content-type",
50+
"value": "application/json"
51+
}
52+
],
53+
"headersSize": 596,
54+
"httpVersion": "HTTP/1.1",
55+
"redirectURL": "",
56+
"status": 200,
57+
"statusText": "OK"
58+
},
59+
"startedDateTime": "2022-11-04T18:40:14.030Z",
60+
"time": 241
61+
}
62+
],
63+
"pages": [],
64+
"version": "1.2"
65+
}
66+
}

examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const apiInstance = new v2.UsageMeteringApi(configuration);
99

1010
const params: v2.UsageMeteringApiGetEstimatedCostByOrgRequest = {
1111
view: "sub-org",
12-
startMonth: new Date(new Date().getTime() + -5 * 86400 * 1000),
12+
startMonth: new Date(),
1313
};
1414

1515
apiInstance

features/v2/usage_metering.feature

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,15 @@ Feature: Usage Metering
166166
Scenario: GetEstimatedCostByOrg with both start_month and start_date returns "Bad Request" response
167167
Given new "GetEstimatedCostByOrg" request
168168
And request contains "view" parameter with value "sub-org"
169-
And request contains "start_month" parameter with value "{{ timeISO('now - 3d') }}"
169+
And request contains "start_month" parameter with value "{{ timeISO('now') }}"
170170
And request contains "start_date" parameter with value "{{ timeISO('now - 3d') }}"
171171
When the request is sent
172172
Then the response status is 400 Bad Request
173173

174174
@replay-only @team:DataDog/red-zone-revenue-query
175-
Scenario: GetEstimatedCostByOrg with start_date returns "OK" response
176-
Given new "GetEstimatedCostByOrg" request
177-
And request contains "view" parameter with value "sub-org"
178-
And request contains "start_date" parameter with value "{{ timeISO('now - 5d') }}"
179-
When the request is sent
180-
Then the response status is 200 OK
181-
182-
@skip @team:DataDog/red-zone-revenue-query
183175
Scenario: GetEstimatedCostByOrg with start_month returns "OK" response
184176
Given new "GetEstimatedCostByOrg" request
185177
And request contains "view" parameter with value "sub-org"
186-
And request contains "start_month" parameter with value "{{ timeISO('now - 5d') }}"
178+
And request contains "start_month" parameter with value "{{ timeISO('now') }}"
187179
When the request is sent
188180
Then the response status is 200 OK

packages/datadog-api-client-v2/apis/UsageMeteringApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,8 @@ export class UsageMeteringApi {
10861086

10871087
/**
10881088
* Get estimated cost across multi-org and single root-org accounts.
1089-
* Estimated cost data is only available for the current month and previous month.
1089+
* Estimated cost data is only available for the current month and previous month
1090+
* and is delayed by up to 72 hours from when it was incurred.
10901091
* To access historical costs prior to this, use the `/historical_cost` endpoint.
10911092
* @param param The request object
10921093
*/

0 commit comments

Comments
 (0)