Skip to content

Commit 8d2640e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit f43ab25 of spec repo (#466)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent b7e8d43 commit 8d2640e

File tree

11 files changed

+179
-5
lines changed

11 files changed

+179
-5
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.5.1.dev2",
7-
"regenerated": "2022-01-11 16:18:48.666159",
8-
"spec_repo_commit": "cc7ebbe"
7+
"regenerated": "2022-01-11 17:17:44.666324",
8+
"spec_repo_commit": "f43ab25"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-11 16:18:48.699271",
13-
"spec_repo_commit": "cc7ebbe"
12+
"regenerated": "2022-01-11 17:17:44.703678",
13+
"spec_repo_commit": "f43ab25"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12349,6 +12349,11 @@ components:
1234912349
values:
1235012350
$ref: '#/components/schemas/UsageAttributionValues'
1235112351
type: object
12352+
UsageAttributionLimit:
12353+
default: 5000
12354+
description: Maximum number of records to be returned.
12355+
format: int64
12356+
type: integer
1235212357
UsageAttributionMetadata:
1235312358
description: The object containing document metadata.
1235412359
properties:
@@ -12357,6 +12362,11 @@ components:
1235712362
pagination:
1235812363
$ref: '#/components/schemas/UsageAttributionPagination'
1235912364
type: object
12365+
UsageAttributionOffset:
12366+
default: 0
12367+
description: Number of records to skip before beginning to return.
12368+
format: int64
12369+
type: integer
1236012370
UsageAttributionPagination:
1236112371
description: The metadata for the current pagination.
1236212372
properties:
@@ -24661,6 +24671,18 @@ paths:
2466124671
schema:
2466224672
default: false
2466324673
type: boolean
24674+
- description: Number of records to skip before beginning to return.
24675+
in: query
24676+
name: offset
24677+
required: false
24678+
schema:
24679+
$ref: '#/components/schemas/UsageAttributionOffset'
24680+
- description: Maximum number of records to be returned.
24681+
in: query
24682+
name: limit
24683+
required: false
24684+
schema:
24685+
$ref: '#/components/schemas/UsageAttributionLimit'
2466424686
responses:
2466524687
'200':
2466624688
content:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-01-11T15:18:06.776Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"log": {
3+
"_recordingName": "Usage Metering/Get Usage Attribution returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "5.1.1"
8+
},
9+
"entries": [
10+
{
11+
"_id": "d8bb74e675aed475b5fe019ac25a1e0d",
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": 526,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [
28+
{
29+
"name": "start_month",
30+
"value": "2022-01-08T15:18:06.776Z"
31+
},
32+
{
33+
"name": "fields",
34+
"value": "*"
35+
},
36+
{
37+
"name": "offset",
38+
"value": "0"
39+
},
40+
{
41+
"name": "limit",
42+
"value": "1"
43+
}
44+
],
45+
"url": "https://api.datadoghq.com/api/v1/usage/attribution?start_month=2022-01-08T15%3A18%3A06.776Z&fields=%2A&offset=0&limit=1"
46+
},
47+
"response": {
48+
"bodySize": 5198,
49+
"content": {
50+
"mimeType": "application/json",
51+
"size": 5198,
52+
"text": "{\"usage\":[{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":{\"project\":[]},\"updated_at\":\"2022-01-10T14\",\"month\":\"2022-01-01T00:00:00+00:00\",\"values\":{\"lambda_percentage\":0.0,\"apm_host_usage\":11,\"api_usage\":1524624,\"dbm_hosts_percentage\":0.0,\"custom_timeseries_percentage\":100.0,\"fargate_usage\":0.0,\"cws_containers_usage\":0.0,\"profiled_host_percentage\":0.0,\"cws_hosts_usage\":0,\"cspm_hosts_percentage\":0.0,\"cws_hosts_percentage\":0.0,\"lambda_invocations_percentage\":0.0,\"infra_host_usage\":5,\"infra_host_percentage\":27.78,\"cspm_hosts_usage\":0,\"container_percentage\":100.0,\"profiled_host_usage\":0,\"dbm_queries_usage\":0.0,\"browser_usage\":0,\"snmp_percentage\":0.0,\"profiled_container_usage\":0.0,\"lambda_functions_usage\":0.0,\"snmp_usage\":0,\"api_percentage\":100.0,\"dbm_hosts_usage\":0,\"container_usage\":1.02,\"lambda_usage\":0.0,\"cspm_containers_usage\":0.0,\"cspm_containers_percentage\":0.0,\"npm_host_usage\":0,\"apm_host_percentage\":100.0,\"lambda_functions_percentage\":0.0,\"dbm_queries_percentage\":0.0,\"profiled_container_percentage\":0.0,\"npm_host_percentage\":0.0,\"lambda_invocations_usage\":0,\"fargate_percentage\":0.0,\"browser_percentage\":0.0,\"cws_containers_percentage\":0.0,\"custom_timeseries_usage\":77.08}},{\"org_name\":\"DD Integration Tests (321813)\",\"public_id\":\"fasjyydbcgwwc2uc\",\"tag_config_source\":\"DD Integration Tests (321813):::project\",\"tags\":{\"project\":[\"datadog-integrations-lab\"]},\"updated_at\":\"2022-01-10T14\",\"month\":\"2022-01-01T00:00:00+00:00\",\"values\":{\"lambda_percentage\":0.0,\"apm_host_usage\":0,\"api_usage\":0,\"dbm_hosts_percentage\":0.0,\"custom_timeseries_percentage\":0.0,\"fargate_usage\":0.0,\"cws_containers_usage\":0.0,\"profiled_host_percentage\":0.0,\"cws_hosts_usage\":0,\"cspm_hosts_percentage\":0.0,\"cws_hosts_percentage\":0.0,\"lambda_invocations_percentage\":0.0,\"infra_host_usage\":13,\"infra_host_percentage\":72.22,\"cspm_hosts_usage\":0,\"container_percentage\":0.0,\"profiled_host_usage\":0,\"dbm_queries_usage\":0.0,\"browser_usage\":0,\"snmp_percentage\":0.0,\"profiled_container_usage\":0.0,\"lambda_functions_usage\":0.0,\"snmp_usage\":0,\"api_percentage\":0.0,\"dbm_hosts_usage\":0,\"container_usage\":0.0,\"lambda_usage\":0.0,\"cspm_containers_usage\":0.0,\"cspm_containers_percentage\":0.0,\"npm_host_usage\":0,\"apm_host_percentage\":0.0,\"lambda_functions_percentage\":0.0,\"dbm_queries_percentage\":0.0,\"profiled_container_percentage\":0.0,\"npm_host_percentage\":0.0,\"lambda_invocations_usage\":0,\"fargate_percentage\":0.0,\"browser_percentage\":0.0,\"cws_containers_percentage\":0.0,\"custom_timeseries_usage\":0.0}}],\"metadata\":{\"pagination\":{\"sort_direction\":\"DESC\",\"sort_name\":\"custom_timeseries_usage\",\"limit\":5000,\"total_number_of_records\":2,\"offset\":0},\"aggregates\":[{\"field\":\"custom_timeseries_usage\",\"value\":77.08,\"agg_type\":\"sum\"},{\"field\":\"container_usage\",\"value\":1.02,\"agg_type\":\"sum\"},{\"field\":\"snmp_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"apm_host_usage\",\"value\":11.0,\"agg_type\":\"sum\"},{\"field\":\"browser_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"npm_host_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"infra_host_usage\",\"value\":18.0,\"agg_type\":\"sum\"},{\"field\":\"custom_timeseries_percentage\",\"value\":100.0,\"agg_type\":\"sum\"},{\"field\":\"container_percentage\",\"value\":100.0,\"agg_type\":\"sum\"},{\"field\":\"lambda_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"api_usage\",\"value\":1524624.0,\"agg_type\":\"sum\"},{\"field\":\"apm_host_percentage\",\"value\":100.0,\"agg_type\":\"sum\"},{\"field\":\"infra_host_percentage\",\"value\":100.0,\"agg_type\":\"sum\"},{\"field\":\"snmp_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"browser_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"api_percentage\",\"value\":100.0,\"agg_type\":\"sum\"},{\"field\":\"lambda_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"npm_host_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"lambda_functions_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"lambda_functions_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"lambda_invocations_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"lambda_invocations_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"fargate_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"fargate_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"profiled_host_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"profiled_host_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"profiled_container_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"profiled_container_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cws_hosts_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cws_hosts_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cws_containers_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cws_containers_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cspm_hosts_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cspm_hosts_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cspm_containers_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"cspm_containers_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"dbm_hosts_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"dbm_hosts_percentage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"dbm_queries_usage\",\"value\":0.0,\"agg_type\":\"sum\"},{\"field\":\"dbm_queries_percentage\",\"value\":0.0,\"agg_type\":\"sum\"}]}}"
53+
},
54+
"cookies": [],
55+
"headers": [
56+
{
57+
"name": "content-type",
58+
"value": "application/json"
59+
}
60+
],
61+
"headersSize": 521,
62+
"httpVersion": "HTTP/1.1",
63+
"redirectURL": "",
64+
"status": 200,
65+
"statusText": "OK"
66+
},
67+
"startedDateTime": "2022-01-11T15:18:06.797Z",
68+
"time": 174
69+
}
70+
],
71+
"pages": [],
72+
"version": "1.2"
73+
}
74+
}

docs/v1/UsageMeteringApi.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,10 @@ let params: v1.UsageMeteringApiGetUsageAttributionRequest = {
663663
sortName: "custom_timeseries_usage",
664664
// boolean | Include child org usage in the response. Defaults to false. (optional)
665665
includeDescendants: false,
666+
// number | Number of records to skip before beginning to return. (optional)
667+
offset: 0,
668+
// number | Maximum number of records to be returned. (optional)
669+
limit: 5000,
666670
};
667671

668672
apiInstance
@@ -685,6 +689,8 @@ apiInstance
685689
| **sortDirection** | **UsageSortDirection** | The direction to sort by: &#x60;[desc, asc]&#x60;. | (optional) defaults to undefined |
686690
| **sortName** | **UsageAttributionSort** | The field to sort by. | (optional) defaults to undefined |
687691
| **includeDescendants** | [**boolean**] | Include child org usage in the response. Defaults to false. | (optional) defaults to undefined |
692+
| **offset** | [**number**] | Number of records to skip before beginning to return. | (optional) defaults to 0 |
693+
| **limit** | [**number**] | Maximum number of records to be returned. | (optional) defaults to 5000 |
688694

689695
### Return type
690696

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Get Usage Attribution returns "OK" response
3+
*/
4+
5+
import { v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = v1.createConfiguration();
8+
configuration.unstableOperations["getUsageAttribution"] = true;
9+
const apiInstance = new v1.UsageMeteringApi(configuration);
10+
11+
let params: v1.UsageMeteringApiGetUsageAttributionRequest = {
12+
startMonth: new Date(new Date().getTime() / 1000 + -3 * 86400),
13+
fields: "*",
14+
offset: 0,
15+
limit: 1,
16+
};
17+
18+
apiInstance
19+
.getUsageAttribution(params)
20+
.then((data: any) => {
21+
console.log(
22+
"API called successfully. Returned data: " + JSON.stringify(data)
23+
);
24+
})
25+
.catch((error: any) => console.error(error));

features/v1/usage_metering.feature

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ Feature: Usage Metering
5050
When the request is sent
5151
Then the response status is 200 OK
5252

53-
@generated @skip @team:DataDog/red-zone-revenue-query
53+
@team:DataDog/red-zone-revenue-query
5454
Scenario: Get Usage Attribution returns "OK" response
5555
Given operation "GetUsageAttribution" enabled
5656
And new "GetUsageAttribution" request
57+
And request contains "start_month" parameter with value "{{ timeISO('now - 3d') }}"
58+
And request contains "fields" parameter with value "*"
59+
And request contains "offset" parameter with value 0
60+
And request contains "limit" parameter with value 1
5761
When the request is sent
5862
Then the response status is 200 OK
5963

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,8 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
776776
* @param sortDirection The direction to sort by: &#x60;[desc, asc]&#x60;.
777777
* @param sortName The field to sort by.
778778
* @param includeDescendants Include child org usage in the response. Defaults to false.
779+
* @param offset Number of records to skip before beginning to return.
780+
* @param limit Maximum number of records to be returned.
779781
*/
780782
public async getUsageAttribution(
781783
startMonth: Date,
@@ -784,6 +786,8 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
784786
sortDirection?: UsageSortDirection,
785787
sortName?: UsageAttributionSort,
786788
includeDescendants?: boolean,
789+
offset?: number,
790+
limit?: number,
787791
_options?: Configuration
788792
): Promise<RequestContext> {
789793
const _config = _options || this.configuration;
@@ -862,6 +866,18 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
862866
ObjectSerializer.serialize(includeDescendants, "boolean", "")
863867
);
864868
}
869+
if (offset !== undefined) {
870+
requestContext.setQueryParam(
871+
"offset",
872+
ObjectSerializer.serialize(offset, "number", "int64")
873+
);
874+
}
875+
if (limit !== undefined) {
876+
requestContext.setQueryParam(
877+
"limit",
878+
ObjectSerializer.serialize(limit, "number", "int64")
879+
);
880+
}
865881

866882
let authMethod = null;
867883
// Apply auth methods

packages/datadog-api-client-v1/types/ObjectParamAPI.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5016,6 +5016,18 @@ export interface UsageMeteringApiGetUsageAttributionRequest {
50165016
* @memberof UsageMeteringApigetUsageAttribution
50175017
*/
50185018
includeDescendants?: boolean;
5019+
/**
5020+
* Number of records to skip before beginning to return.
5021+
* @type number
5022+
* @memberof UsageMeteringApigetUsageAttribution
5023+
*/
5024+
offset?: number;
5025+
/**
5026+
* Maximum number of records to be returned.
5027+
* @type number
5028+
* @memberof UsageMeteringApigetUsageAttribution
5029+
*/
5030+
limit?: number;
50195031
}
50205032

50215033
export interface UsageMeteringApiGetUsageAuditLogsRequest {
@@ -5624,6 +5636,8 @@ export class ObjectUsageMeteringApi {
56245636
param.sortDirection,
56255637
param.sortName,
56265638
param.includeDescendants,
5639+
param.offset,
5640+
param.limit,
56275641
options
56285642
)
56295643
.toPromise();

packages/datadog-api-client-v1/types/ObservableAPI.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8159,6 +8159,8 @@ export class ObservableUsageMeteringApi {
81598159
* @param sortDirection The direction to sort by: &#x60;[desc, asc]&#x60;.
81608160
* @param sortName The field to sort by.
81618161
* @param includeDescendants Include child org usage in the response. Defaults to false.
8162+
* @param offset Number of records to skip before beginning to return.
8163+
* @param limit Maximum number of records to be returned.
81628164
*/
81638165
public getUsageAttribution(
81648166
startMonth: Date,
@@ -8167,6 +8169,8 @@ export class ObservableUsageMeteringApi {
81678169
sortDirection?: UsageSortDirection,
81688170
sortName?: UsageAttributionSort,
81698171
includeDescendants?: boolean,
8172+
offset?: number,
8173+
limit?: number,
81708174
_options?: Configuration
81718175
): Observable<UsageAttributionResponse> {
81728176
const requestContextPromise = this.requestFactory.getUsageAttribution(
@@ -8176,6 +8180,8 @@ export class ObservableUsageMeteringApi {
81768180
sortDirection,
81778181
sortName,
81788182
includeDescendants,
8183+
offset,
8184+
limit,
81798185
_options
81808186
);
81818187

0 commit comments

Comments
 (0)