Skip to content
Merged
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
143 changes: 143 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15600,6 +15600,98 @@ components:
type: string
x-enum-varnames:
- COST_BY_ORG
CostTagDescription:
description: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider.
properties:
attributes:
$ref: "#/components/schemas/CostTagDescriptionAttributes"
id:
description: Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific.
example: account_id
type: string
type:
$ref: "#/components/schemas/CostTagDescriptionType"
required:
- attributes
- id
- type
type: object
CostTagDescriptionAttributes:
description: Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider.
properties:
cloud:
description: Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key.
example: aws
type: string
created_at:
description: Timestamp when the description was created, in RFC 3339 format.
example: "2026-01-01T12:00:00Z"
type: string
description:
description: The human-readable description for the tag key.
example: AWS account that owns this cost.
type: string
source:
$ref: "#/components/schemas/CostTagDescriptionSource"
tag_key:
description: The tag key this description applies to.
example: account_id
type: string
updated_at:
description: Timestamp when the description was last updated, in RFC 3339 format.
example: "2026-01-01T12:00:00Z"
type: string
required:
- cloud
- created_at
- description
- source
- tag_key
- updated_at
type: object
CostTagDescriptionSource:
description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog.
enum:
- human
- ai_generated
- datadog
example: human
type: string
x-enum-varnames:
- HUMAN
- AI_GENERATED
- DATADOG
CostTagDescriptionType:
default: cost_tag_description
description: Type of the Cloud Cost Management tag description resource.
enum:
- cost_tag_description
example: cost_tag_description
type: string
x-enum-varnames:
- COST_TAG_DESCRIPTION
CostTagDescriptionsResponse:
description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider.
example:
data:
- attributes:
cloud: aws
created_at: "2026-01-01T12:00:00Z"
description: AWS account that owns this cost.
source: human
tag_key: account_id
updated_at: "2026-01-01T12:00:00Z"
id: account_id
type: cost_tag_description
properties:
data:
description: List of tag key descriptions.
items:
$ref: "#/components/schemas/CostTagDescription"
type: array
required:
- data
type: object
CoverageSummaryAttributes:
description: Attributes object for code coverage summary response.
properties:
Expand Down Expand Up @@ -96749,6 +96841,57 @@ paths:
operator: OR
permissions:
- cloud_cost_management_read
/api/v2/cost/tag_descriptions:
get:
description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned.
operationId: ListCostTagDescriptions
parameters:
- description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds.
in: query
name: filter[cloud]
required: false
schema:
type: string
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
cloud: aws
created_at: "2026-01-01T12:00:00Z"
description: AWS account that owns this cost.
source: human
tag_key: account_id
updated_at: "2026-01-01T12:00:00Z"
id: account_id
type: cost_tag_description
schema:
$ref: "#/components/schemas/CostTagDescriptionsResponse"
description: OK
"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 descriptions
tags:
- Cloud Cost Management
"x-permission":
operator: OR
permissions:
- cloud_cost_management_read
/api/v2/cost_by_tag/active_billing_dimensions:
get:
description: |-
Expand Down
35 changes: 35 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6220,6 +6220,41 @@ datadog\_api\_client.v2.model.cost\_by\_org\_type module
:members:
:show-inheritance:

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

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

datadog\_api\_client.v2.model.cost\_tag\_description\_attributes module
-----------------------------------------------------------------------

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

datadog\_api\_client.v2.model.cost\_tag\_description\_source module
-------------------------------------------------------------------

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

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

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

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

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

datadog\_api\_client.v2.model.coverage\_summary\_attributes module
------------------------------------------------------------------

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

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

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_cost_tag_descriptions()

print(response)
42 changes: 42 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 @@ -40,6 +40,7 @@
from datadog_api_client.v2.model.gcp_uc_config_response import GcpUcConfigResponse
from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request import GCPUsageCostConfigPatchRequest
from datadog_api_client.v2.model.oci_configs_response import OCIConfigsResponse
from datadog_api_client.v2.model.cost_tag_descriptions_response import CostTagDescriptionsResponse
from datadog_api_client.v2.model.ruleset_resp_array import RulesetRespArray
from datadog_api_client.v2.model.ruleset_resp import RulesetResp
from datadog_api_client.v2.model.create_ruleset_request import CreateRulesetRequest
Expand Down Expand Up @@ -562,6 +563,28 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._list_cost_tag_descriptions_endpoint = _Endpoint(
settings={
"response_type": (CostTagDescriptionsResponse,),
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v2/cost/tag_descriptions",
"operation_id": "list_cost_tag_descriptions",
"http_method": "GET",
"version": "v2",
},
params_map={
"filter_cloud": {
"openapi_types": (str,),
"attribute": "filter[cloud]",
"location": "query",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._list_custom_allocation_rules_endpoint = _Endpoint(
settings={
"response_type": (ArbitraryRuleResponseArray,),
Expand Down Expand Up @@ -1333,6 +1356,25 @@ def list_cost_oci_configs(
kwargs: Dict[str, Any] = {}
return self._list_cost_oci_configs_endpoint.call_with_http_info(**kwargs)

def list_cost_tag_descriptions(
self,
*,
filter_cloud: Union[str, UnsetType] = unset,
) -> CostTagDescriptionsResponse:
"""List Cloud Cost Management tag descriptions.

List Cloud Cost Management tag key descriptions for the organization. Use ``filter[cloud]`` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned.

:param filter_cloud: Filter descriptions to a specific cloud provider (for example, ``aws`` ). Omit to return descriptions across all clouds.
:type filter_cloud: str, optional
:rtype: CostTagDescriptionsResponse
"""
kwargs: Dict[str, Any] = {}
if filter_cloud is not unset:
kwargs["filter_cloud"] = filter_cloud

return self._list_cost_tag_descriptions_endpoint.call_with_http_info(**kwargs)

def list_custom_allocation_rules(
self,
) -> ArbitraryRuleResponseArray:
Expand Down
54 changes: 54 additions & 0 deletions src/datadog_api_client/v2/model/cost_tag_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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_description_attributes import CostTagDescriptionAttributes
from datadog_api_client.v2.model.cost_tag_description_type import CostTagDescriptionType


class CostTagDescription(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.cost_tag_description_attributes import CostTagDescriptionAttributes
from datadog_api_client.v2.model.cost_tag_description_type import CostTagDescriptionType

return {
"attributes": (CostTagDescriptionAttributes,),
"id": (str,),
"type": (CostTagDescriptionType,),
}

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

def __init__(self_, attributes: CostTagDescriptionAttributes, id: str, type: CostTagDescriptionType, **kwargs):
"""
A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider.

:param attributes: Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider.
:type attributes: CostTagDescriptionAttributes

:param id: Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific.
:type id: str

:param type: Type of the Cloud Cost Management tag description resource.
:type type: CostTagDescriptionType
"""
super().__init__(kwargs)

self_.attributes = attributes
self_.id = id
self_.type = type
Loading
Loading