Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18525,6 +18525,45 @@ components:
x-enum-varnames:
- "TRUE"
- "FALSE"
CostTagMetadataMonth:
description: A month that has Cloud Cost Management tag metadata available for a given provider.
properties:
id:
description: The month, in `YYYY-MM` format.
example: "2026-04"
type: string
type:
$ref: "#/components/schemas/CostTagMetadataMonthType"
required:
- id
- type
type: object
CostTagMetadataMonthType:
default: cost_tag_metadata_month
description: Type of the Cloud Cost Management tag metadata month resource.
enum:
- cost_tag_metadata_month
example: cost_tag_metadata_month
type: string
x-enum-varnames:
- COST_TAG_METADATA_MONTH
CostTagMetadataMonthsResponse:
description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months.
example:
data:
- id: "2026-04"
type: cost_tag_metadata_month
- id: "2026-03"
type: cost_tag_metadata_month
properties:
data:
description: List of months that have tag metadata available.
items:
$ref: "#/components/schemas/CostTagMetadataMonth"
type: array
required:
- data
type: object
CostTagType:
default: cost_tag
description: Type of the Cloud Cost Management tag resource.
Expand Down Expand Up @@ -109019,6 +109058,68 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/cost/tag_metadata/months:
get:
description: |-
List months that have Cloud Cost Management tag metadata for a given provider,
ordered most-recent first. The response is capped at 36 months.
operationId: ListCostTagMetadataMonths
parameters:
- description: |-
Provider to scope the query to. Use the value of the `providername` tag in CCM
(for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`).
For costs uploaded through the Custom Costs API, use `custom`.
Values are case-sensitive.
example: aws
in: query
name: filter[provider]
required: true
schema:
type: string
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- id: "2026-04"
type: cost_tag_metadata_month
- id: "2026-03"
type: cost_tag_metadata_month
schema:
$ref: "#/components/schemas/CostTagMetadataMonthsResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Bad Request
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cloud_cost_management_read
summary: List Cloud Cost Management tag metadata months
tags:
- Cloud Cost Management
"x-permission":
operator: OR
permissions:
- cloud_cost_management_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/cost/tag_metadata/orchestrators:
get:
description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period.
Expand Down
21 changes: 21 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7389,6 +7389,27 @@ datadog\_api\_client.v2.model.cost\_tag\_metadata\_daily\_filter module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.cost\_tag\_metadata\_month module
---------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.cost_tag_metadata_month
:members:
:show-inheritance:

datadog\_api\_client.v2.model.cost\_tag\_metadata\_month\_type module
---------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.cost_tag_metadata_month_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.cost\_tag\_metadata\_months\_response module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.cost_tag_metadata_months_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.cost\_tag\_type module
----------------------------------------------------

Expand Down
16 changes: 16 additions & 0 deletions examples/v2/cloud-cost-management/ListCostTagMetadataMonths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
List Cloud Cost Management tag metadata months returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi

configuration = Configuration()
configuration.unstable_operations["list_cost_tag_metadata_months"] = True
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_cost_tag_metadata_months(
filter_provider="filter[provider]",
)

print(response)
1 change: 1 addition & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def __init__(
"v2.list_cost_tag_key_sources": False,
"v2.list_cost_tag_metadata": False,
"v2.list_cost_tag_metadata_metrics": False,
"v2.list_cost_tag_metadata_months": False,
"v2.list_cost_tag_metadata_orchestrators": False,
"v2.search_cost_recommendations": False,
"v2.create_dashboard_secure_embed": False,
Expand Down
45 changes: 45 additions & 0 deletions src/datadog_api_client/v2/api/cloud_cost_management_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
from datadog_api_client.v2.model.cost_tag_metadata_daily_filter import CostTagMetadataDailyFilter
from datadog_api_client.v2.model.cost_currency_response import CostCurrencyResponse
from datadog_api_client.v2.model.cost_metrics_response import CostMetricsResponse
from datadog_api_client.v2.model.cost_tag_metadata_months_response import CostTagMetadataMonthsResponse
from datadog_api_client.v2.model.cost_orchestrators_response import CostOrchestratorsResponse
from datadog_api_client.v2.model.cost_tag_key_sources_response import CostTagKeySourcesResponse
from datadog_api_client.v2.model.cost_tags_response import CostTagsResponse
Expand Down Expand Up @@ -1282,6 +1283,29 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._list_cost_tag_metadata_months_endpoint = _Endpoint(
settings={
"response_type": (CostTagMetadataMonthsResponse,),
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v2/cost/tag_metadata/months",
"operation_id": "list_cost_tag_metadata_months",
"http_method": "GET",
"version": "v2",
},
params_map={
"filter_provider": {
"required": True,
"openapi_types": (str,),
"attribute": "filter[provider]",
"location": "query",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._list_cost_tag_metadata_orchestrators_endpoint = _Endpoint(
settings={
"response_type": (CostOrchestratorsResponse,),
Expand Down Expand Up @@ -2772,6 +2796,27 @@ def list_cost_tag_metadata_metrics(

return self._list_cost_tag_metadata_metrics_endpoint.call_with_http_info(**kwargs)

def list_cost_tag_metadata_months(
self,
filter_provider: str,
) -> CostTagMetadataMonthsResponse:
"""List Cloud Cost Management tag metadata months.

List months that have Cloud Cost Management tag metadata for a given provider,
ordered most-recent first. The response is capped at 36 months.

:param filter_provider: Provider to scope the query to. Use the value of the ``providername`` tag in CCM
(for example, ``aws`` , ``azure`` , ``gcp`` , ``Oracle`` , ``Confluent Cloud`` , ``Snowflake`` ).
For costs uploaded through the Custom Costs API, use ``custom``.
Values are case-sensitive.
:type filter_provider: str
:rtype: CostTagMetadataMonthsResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["filter_provider"] = filter_provider

return self._list_cost_tag_metadata_months_endpoint.call_with_http_info(**kwargs)

def list_cost_tag_metadata_orchestrators(
self,
filter_month: str,
Expand Down
46 changes: 46 additions & 0 deletions src/datadog_api_client/v2/model/cost_tag_metadata_month.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.cost_tag_metadata_month_type import CostTagMetadataMonthType


class CostTagMetadataMonth(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.cost_tag_metadata_month_type import CostTagMetadataMonthType

return {
"id": (str,),
"type": (CostTagMetadataMonthType,),
}

attribute_map = {
"id": "id",
"type": "type",
}

def __init__(self_, id: str, type: CostTagMetadataMonthType, **kwargs):
"""
A month that has Cloud Cost Management tag metadata available for a given provider.

:param id: The month, in ``YYYY-MM`` format.
:type id: str

:param type: Type of the Cloud Cost Management tag metadata month resource.
:type type: CostTagMetadataMonthType
"""
super().__init__(kwargs)

self_.id = id
self_.type = type
35 changes: 35 additions & 0 deletions src/datadog_api_client/v2/model/cost_tag_metadata_month_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class CostTagMetadataMonthType(ModelSimple):
"""
Type of the Cloud Cost Management tag metadata month resource.

:param value: If omitted defaults to "cost_tag_metadata_month". Must be one of ["cost_tag_metadata_month"].
:type value: str
"""

allowed_values = {
"cost_tag_metadata_month",
}
COST_TAG_METADATA_MONTH: ClassVar["CostTagMetadataMonthType"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


CostTagMetadataMonthType.COST_TAG_METADATA_MONTH = CostTagMetadataMonthType("cost_tag_metadata_month")
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.cost_tag_metadata_month import CostTagMetadataMonth


class CostTagMetadataMonthsResponse(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.cost_tag_metadata_month import CostTagMetadataMonth

return {
"data": ([CostTagMetadataMonth],),
}

attribute_map = {
"data": "data",
}

def __init__(self_, data: List[CostTagMetadataMonth], **kwargs):
"""
List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months.

:param data: List of months that have tag metadata available.
:type data: [CostTagMetadataMonth]
"""
super().__init__(kwargs)

self_.data = data
6 changes: 6 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,9 @@
from datadog_api_client.v2.model.cost_tag_key_type import CostTagKeyType
from datadog_api_client.v2.model.cost_tag_keys_response import CostTagKeysResponse
from datadog_api_client.v2.model.cost_tag_metadata_daily_filter import CostTagMetadataDailyFilter
from datadog_api_client.v2.model.cost_tag_metadata_month import CostTagMetadataMonth
from datadog_api_client.v2.model.cost_tag_metadata_month_type import CostTagMetadataMonthType
from datadog_api_client.v2.model.cost_tag_metadata_months_response import CostTagMetadataMonthsResponse
from datadog_api_client.v2.model.cost_tag_type import CostTagType
from datadog_api_client.v2.model.cost_tags_response import CostTagsResponse
from datadog_api_client.v2.model.coverage_summary_attributes import CoverageSummaryAttributes
Expand Down Expand Up @@ -9288,6 +9291,9 @@
"CostTagKeyType",
"CostTagKeysResponse",
"CostTagMetadataDailyFilter",
"CostTagMetadataMonth",
"CostTagMetadataMonthType",
"CostTagMetadataMonthsResponse",
"CostTagType",
"CostTagsResponse",
"CoverageSummaryAttributes",
Expand Down
Loading
Loading