Skip to content

Commit 39d53e4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit f43ab25 of spec repo (#774)
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 1db60fa commit 39d53e4

File tree

8 files changed

+91
-6
lines changed

8 files changed

+91
-6
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:50.346217",
8-
"spec_repo_commit": "cc7ebbe"
7+
"regenerated": "2022-01-11 17:17:34.307434",
8+
"spec_repo_commit": "f43ab25"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-11 16:18:50.828535",
13-
"spec_repo_commit": "cc7ebbe"
12+
"regenerated": "2022-01-11 17:17:34.759846",
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:

docs/v1/UsageMeteringApi.md

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
Get Usage Attribution returns "OK" response
3+
"""
4+
5+
from datetime import datetime
6+
from dateutil.relativedelta import relativedelta
7+
from datadog_api_client.v1 import ApiClient, Configuration
8+
from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
9+
10+
configuration = Configuration()
11+
configuration.unstable_operations["get_usage_attribution"] = True
12+
with ApiClient(configuration) as api_client:
13+
api_instance = UsageMeteringApi(api_client)
14+
response = api_instance.get_usage_attribution(
15+
start_month=(datetime.now() + relativedelta(days=-3)).isoformat(timespec="seconds"),
16+
fields="*",
17+
offset=0,
18+
limit=1,
19+
)
20+
21+
print(response)

src/datadog_api_client/v1/api/usage_metering_api.py

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-01-11T15:18:06.776Z
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
accept:
6+
- application/json;datetime-format=rfc3339
7+
method: GET
8+
uri: https://api.datadoghq.com/api/v1/usage/attribution?start_month=2022-01-08T15%3A18%3A06.776Z&fields=%2A&offset=0&limit=1
9+
response:
10+
body:
11+
string: '{"usage":[{"org_name":"DD Integration Tests (321813)","public_id":"fasjyydbcgwwc2uc","tag_config_source":"DD
12+
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
13+
Integration Tests (321813)","public_id":"fasjyydbcgwwc2uc","tag_config_source":"DD
14+
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"}]}}'
15+
headers:
16+
content-type:
17+
- application/json
18+
status:
19+
code: 200
20+
message: OK
21+
version: 1

tests/v1/features/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

0 commit comments

Comments
 (0)