Skip to content

Commit a0a2795

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spectherve
authored
Regenerate client from commit 7f08212f of spec repo (#967)
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> Co-authored-by: Thomas Hervé <[email protected]>
1 parent 3f5f66e commit a0a2795

15 files changed

+600
-7
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.2",
7-
"regenerated": "2022-04-22 12:33:55.351426",
8-
"spec_repo_commit": "4de29357"
7+
"regenerated": "2022-04-25 19:54:51.323794",
8+
"spec_repo_commit": "7f08212f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-04-22 12:33:55.363690",
13-
"spec_repo_commit": "4de29357"
12+
"regenerated": "2022-04-25 19:54:51.335844",
13+
"spec_repo_commit": "7f08212f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,23 @@ components:
10481048
type: string
10491049
x-enum-varnames:
10501050
- AUTHN_MAPPINGS
1051+
ChargebackBreakdown:
1052+
description: Charges breakdown.
1053+
properties:
1054+
charge_type:
1055+
description: The type of charge for a particular product.
1056+
example: on_demand
1057+
type: string
1058+
cost:
1059+
description: The cost for a particular product and charge type during a
1060+
given month.
1061+
format: double
1062+
type: number
1063+
product_name:
1064+
description: The product for which cost is being reported.
1065+
example: infra_host
1066+
type: string
1067+
type: object
10511068
CloudWorkloadSecurityAgentRuleAttributes:
10521069
description: A Cloud Workload Security Agent rule returned by the API.
10531070
properties:
@@ -1242,6 +1259,58 @@ components:
12421259
x-enum-varnames:
12431260
- GZIP
12441261
- DEFLATE
1262+
CostByOrg:
1263+
description: Cost data.
1264+
properties:
1265+
attributes:
1266+
$ref: '#/components/schemas/CostByOrgAttributes'
1267+
id:
1268+
description: Unique ID of the response.
1269+
type: string
1270+
type:
1271+
$ref: '#/components/schemas/CostByOrgType'
1272+
type: object
1273+
CostByOrgAttributes:
1274+
description: Cost attributes data.
1275+
properties:
1276+
charges:
1277+
description: List of charges data reported for the requested month.
1278+
items:
1279+
$ref: '#/components/schemas/ChargebackBreakdown'
1280+
type: array
1281+
date:
1282+
description: The month requested.
1283+
format: date-time
1284+
type: string
1285+
org_name:
1286+
description: The organization name.
1287+
type: string
1288+
public_id:
1289+
description: The organization public ID.
1290+
type: string
1291+
total_cost:
1292+
description: The total cost of products for the month.
1293+
format: double
1294+
type: number
1295+
type: object
1296+
CostByOrgResponse:
1297+
description: Chargeback Summary response.
1298+
properties:
1299+
data:
1300+
description: Response containing Chargeback Summary.
1301+
items:
1302+
$ref: '#/components/schemas/CostByOrg'
1303+
type: array
1304+
type: object
1305+
CostByOrgType:
1306+
default: cost_by_org
1307+
description: Type of cost data.
1308+
enum:
1309+
- cost_by_org
1310+
example: cost_by_org
1311+
type: string
1312+
x-enum-varnames:
1313+
- COST_BY_ORG
12451314
Creator:
12461315
description: Creator of the object.
12471316
properties:
@@ -12001,6 +12070,63 @@ paths:
1200112070
x-unstable: '**Note**: This endpoint is in public beta.
1200212071
1200312072
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
12073+
/api/v2/usage/cost_by_org:
12074+
get:
12075+
description: Get Cost Across Multi-Org Account.
12076+
operationId: GetCostByOrg
12077+
parameters:
12078+
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
12079+
for cost beginning this month.'
12080+
in: query
12081+
name: start_month
12082+
required: true
12083+
schema:
12084+
format: date-time
12085+
type: string
12086+
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
12087+
for cost ending this month.'
12088+
in: query
12089+
name: end_month
12090+
required: false
12091+
schema:
12092+
format: date-time
12093+
type: string
12094+
responses:
12095+
'200':
12096+
content:
12097+
application/json;datetime-format=rfc3339:
12098+
schema:
12099+
$ref: '#/components/schemas/CostByOrgResponse'
12100+
description: OK
12101+
'400':
12102+
content:
12103+
application/json;datetime-format=rfc3339:
12104+
schema:
12105+
$ref: '#/components/schemas/APIErrorResponse'
12106+
description: Bad Request
12107+
'403':
12108+
content:
12109+
application/json;datetime-format=rfc3339:
12110+
schema:
12111+
$ref: '#/components/schemas/APIErrorResponse'
12112+
description: Forbidden - User is not authorized
12113+
'429':
12114+
content:
12115+
application/json;datetime-format=rfc3339:
12116+
schema:
12117+
$ref: '#/components/schemas/APIErrorResponse'
12118+
description: Too many requests
12119+
security:
12120+
- apiKeyAuth: []
12121+
appKeyAuth: []
12122+
- AuthZ:
12123+
- usage_read
12124+
summary: Get Cost Across Multi-Org Account
12125+
tags:
12126+
- Usage Metering
12127+
x-menu-order: 39
12128+
x-undo:
12129+
type: safe
1200412130
/api/v2/usage/observability_pipelines:
1200512131
get:
1200612132
description: Get hourly usage for Observability Pipelines.

docs/datadog_api_client.v2.model.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,14 @@ authn\_mappings\_type
433433
:undoc-members:
434434
:show-inheritance:
435435

436+
chargeback\_breakdown
437+
---------------------
438+
439+
.. automodule:: datadog_api_client.v2.model.chargeback_breakdown
440+
:members:
441+
:undoc-members:
442+
:show-inheritance:
443+
436444
cloud\_workload\_security\_agent\_rule\_attributes
437445
--------------------------------------------------
438446

@@ -545,6 +553,38 @@ content\_encoding
545553
:undoc-members:
546554
:show-inheritance:
547555

556+
cost\_by\_org
557+
-------------
558+
559+
.. automodule:: datadog_api_client.v2.model.cost_by_org
560+
:members:
561+
:undoc-members:
562+
:show-inheritance:
563+
564+
cost\_by\_org\_attributes
565+
-------------------------
566+
567+
.. automodule:: datadog_api_client.v2.model.cost_by_org_attributes
568+
:members:
569+
:undoc-members:
570+
:show-inheritance:
571+
572+
cost\_by\_org\_response
573+
-----------------------
574+
575+
.. automodule:: datadog_api_client.v2.model.cost_by_org_response
576+
:members:
577+
:undoc-members:
578+
:show-inheritance:
579+
580+
cost\_by\_org\_type
581+
-------------------
582+
583+
.. automodule:: datadog_api_client.v2.model.cost_by_org_type
584+
:members:
585+
:undoc-members:
586+
:show-inheritance:
587+
548588
creator
549589
-------
550590

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Get Cost Across Multi-Org Account returns "OK" response
3+
"""
4+
5+
from datetime import datetime
6+
from dateutil.relativedelta import relativedelta
7+
from datadog_api_client.v2 import ApiClient, Configuration
8+
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi
9+
10+
configuration = Configuration()
11+
with ApiClient(configuration) as api_client:
12+
api_instance = UsageMeteringApi(api_client)
13+
response = api_instance.get_cost_by_org(
14+
start_month=(datetime.now() + relativedelta(days=-3)).isoformat(timespec="seconds"),
15+
)
16+
17+
print(response)

src/datadog_api_client/v2/api/usage_metering_api.py

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datadog_api_client/v2/model/chargeback_breakdown.py

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)