|
43 | 43 | from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request import GCPUsageCostConfigPatchRequest |
44 | 44 | from datadog_api_client.v2.model.oci_configs_response import OCIConfigsResponse |
45 | 45 | from datadog_api_client.v2.model.cost_tag_descriptions_response import CostTagDescriptionsResponse |
| 46 | +from datadog_api_client.v2.model.cost_tag_keys_response import CostTagKeysResponse |
| 47 | +from datadog_api_client.v2.model.cost_tag_key_response import CostTagKeyResponse |
| 48 | +from datadog_api_client.v2.model.cost_tags_response import CostTagsResponse |
46 | 49 | from datadog_api_client.v2.model.ruleset_resp_array import RulesetRespArray |
47 | 50 | from datadog_api_client.v2.model.ruleset_resp import RulesetResp |
48 | 51 | from datadog_api_client.v2.model.create_ruleset_request import CreateRulesetRequest |
@@ -439,6 +442,42 @@ def __init__(self, api_client=None): |
439 | 442 | api_client=api_client, |
440 | 443 | ) |
441 | 444 |
|
| 445 | + self._get_cost_tag_key_endpoint = _Endpoint( |
| 446 | + settings={ |
| 447 | + "response_type": (CostTagKeyResponse,), |
| 448 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 449 | + "endpoint_path": "/api/v2/cost/tag_keys/{tag_key}", |
| 450 | + "operation_id": "get_cost_tag_key", |
| 451 | + "http_method": "GET", |
| 452 | + "version": "v2", |
| 453 | + }, |
| 454 | + params_map={ |
| 455 | + "tag_key": { |
| 456 | + "required": True, |
| 457 | + "openapi_types": (str,), |
| 458 | + "attribute": "tag_key", |
| 459 | + "location": "path", |
| 460 | + }, |
| 461 | + "filter_metric": { |
| 462 | + "openapi_types": (str,), |
| 463 | + "attribute": "filter[metric]", |
| 464 | + "location": "query", |
| 465 | + }, |
| 466 | + "page_size": { |
| 467 | + "validation": { |
| 468 | + "inclusive_maximum": 10000, |
| 469 | + }, |
| 470 | + "openapi_types": (int,), |
| 471 | + "attribute": "page[size]", |
| 472 | + "location": "query", |
| 473 | + }, |
| 474 | + }, |
| 475 | + headers_map={ |
| 476 | + "accept": ["application/json"], |
| 477 | + }, |
| 478 | + api_client=api_client, |
| 479 | + ) |
| 480 | + |
442 | 481 | self._get_custom_allocation_rule_endpoint = _Endpoint( |
443 | 482 | settings={ |
444 | 483 | "response_type": (ArbitraryRuleResponse,), |
@@ -683,6 +722,81 @@ def __init__(self, api_client=None): |
683 | 722 | api_client=api_client, |
684 | 723 | ) |
685 | 724 |
|
| 725 | + self._list_cost_tag_keys_endpoint = _Endpoint( |
| 726 | + settings={ |
| 727 | + "response_type": (CostTagKeysResponse,), |
| 728 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 729 | + "endpoint_path": "/api/v2/cost/tag_keys", |
| 730 | + "operation_id": "list_cost_tag_keys", |
| 731 | + "http_method": "GET", |
| 732 | + "version": "v2", |
| 733 | + }, |
| 734 | + params_map={ |
| 735 | + "filter_metric": { |
| 736 | + "openapi_types": (str,), |
| 737 | + "attribute": "filter[metric]", |
| 738 | + "location": "query", |
| 739 | + }, |
| 740 | + "filter_tags": { |
| 741 | + "openapi_types": ([str],), |
| 742 | + "attribute": "filter[tags]", |
| 743 | + "location": "query", |
| 744 | + "collection_format": "multi", |
| 745 | + }, |
| 746 | + }, |
| 747 | + headers_map={ |
| 748 | + "accept": ["application/json"], |
| 749 | + }, |
| 750 | + api_client=api_client, |
| 751 | + ) |
| 752 | + |
| 753 | + self._list_cost_tags_endpoint = _Endpoint( |
| 754 | + settings={ |
| 755 | + "response_type": (CostTagsResponse,), |
| 756 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 757 | + "endpoint_path": "/api/v2/cost/tags", |
| 758 | + "operation_id": "list_cost_tags", |
| 759 | + "http_method": "GET", |
| 760 | + "version": "v2", |
| 761 | + }, |
| 762 | + params_map={ |
| 763 | + "filter_metric": { |
| 764 | + "openapi_types": (str,), |
| 765 | + "attribute": "filter[metric]", |
| 766 | + "location": "query", |
| 767 | + }, |
| 768 | + "filter_match": { |
| 769 | + "openapi_types": (str,), |
| 770 | + "attribute": "filter[match]", |
| 771 | + "location": "query", |
| 772 | + }, |
| 773 | + "filter_tags": { |
| 774 | + "openapi_types": ([str],), |
| 775 | + "attribute": "filter[tags]", |
| 776 | + "location": "query", |
| 777 | + "collection_format": "multi", |
| 778 | + }, |
| 779 | + "filter_tag_keys": { |
| 780 | + "openapi_types": ([str],), |
| 781 | + "attribute": "filter[tag_keys]", |
| 782 | + "location": "query", |
| 783 | + "collection_format": "multi", |
| 784 | + }, |
| 785 | + "page_size": { |
| 786 | + "validation": { |
| 787 | + "inclusive_maximum": 10000, |
| 788 | + }, |
| 789 | + "openapi_types": (int,), |
| 790 | + "attribute": "page[size]", |
| 791 | + "location": "query", |
| 792 | + }, |
| 793 | + }, |
| 794 | + headers_map={ |
| 795 | + "accept": ["application/json"], |
| 796 | + }, |
| 797 | + api_client=api_client, |
| 798 | + ) |
| 799 | + |
686 | 800 | self._list_custom_allocation_rules_endpoint = _Endpoint( |
687 | 801 | settings={ |
688 | 802 | "response_type": (ArbitraryRuleResponseArray,), |
@@ -1360,6 +1474,36 @@ def get_cost_gcp_usage_cost_config( |
1360 | 1474 |
|
1361 | 1475 | return self._get_cost_gcp_usage_cost_config_endpoint.call_with_http_info(**kwargs) |
1362 | 1476 |
|
| 1477 | + def get_cost_tag_key( |
| 1478 | + self, |
| 1479 | + tag_key: str, |
| 1480 | + *, |
| 1481 | + filter_metric: Union[str, UnsetType] = unset, |
| 1482 | + page_size: Union[int, UnsetType] = unset, |
| 1483 | + ) -> CostTagKeyResponse: |
| 1484 | + """Get a Cloud Cost Management tag key. |
| 1485 | +
|
| 1486 | + Get details for a specific Cloud Cost Management tag key, including example tag values and description. |
| 1487 | +
|
| 1488 | + :param tag_key: The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, ``kubernetes/instance`` ). |
| 1489 | + :type tag_key: str |
| 1490 | + :param filter_metric: The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. |
| 1491 | + :type filter_metric: str, optional |
| 1492 | + :param page_size: Controls the size of the internal tag value search scope. This does **not** restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000. |
| 1493 | + :type page_size: int, optional |
| 1494 | + :rtype: CostTagKeyResponse |
| 1495 | + """ |
| 1496 | + kwargs: Dict[str, Any] = {} |
| 1497 | + kwargs["tag_key"] = tag_key |
| 1498 | + |
| 1499 | + if filter_metric is not unset: |
| 1500 | + kwargs["filter_metric"] = filter_metric |
| 1501 | + |
| 1502 | + if page_size is not unset: |
| 1503 | + kwargs["page_size"] = page_size |
| 1504 | + |
| 1505 | + return self._get_cost_tag_key_endpoint.call_with_http_info(**kwargs) |
| 1506 | + |
1363 | 1507 | def get_custom_allocation_rule( |
1364 | 1508 | self, |
1365 | 1509 | rule_id: int, |
@@ -1569,6 +1713,74 @@ def list_cost_tag_descriptions( |
1569 | 1713 |
|
1570 | 1714 | return self._list_cost_tag_descriptions_endpoint.call_with_http_info(**kwargs) |
1571 | 1715 |
|
| 1716 | + def list_cost_tag_keys( |
| 1717 | + self, |
| 1718 | + *, |
| 1719 | + filter_metric: Union[str, UnsetType] = unset, |
| 1720 | + filter_tags: Union[List[str], UnsetType] = unset, |
| 1721 | + ) -> CostTagKeysResponse: |
| 1722 | + """List Cloud Cost Management tag keys. |
| 1723 | +
|
| 1724 | + List Cloud Cost Management tag keys. |
| 1725 | +
|
| 1726 | + :param filter_metric: The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. |
| 1727 | + :type filter_metric: str, optional |
| 1728 | + :param filter_tags: Filter to return only tag keys that appear with the given ``key:value`` tag values. For example, ``filter[tags]=providername:aws`` returns tag keys found on the same cost data, such as ``is_aws_ec2_compute`` and ``aws_instance_type``. |
| 1729 | + :type filter_tags: [str], optional |
| 1730 | + :rtype: CostTagKeysResponse |
| 1731 | + """ |
| 1732 | + kwargs: Dict[str, Any] = {} |
| 1733 | + if filter_metric is not unset: |
| 1734 | + kwargs["filter_metric"] = filter_metric |
| 1735 | + |
| 1736 | + if filter_tags is not unset: |
| 1737 | + kwargs["filter_tags"] = filter_tags |
| 1738 | + |
| 1739 | + return self._list_cost_tag_keys_endpoint.call_with_http_info(**kwargs) |
| 1740 | + |
| 1741 | + def list_cost_tags( |
| 1742 | + self, |
| 1743 | + *, |
| 1744 | + filter_metric: Union[str, UnsetType] = unset, |
| 1745 | + filter_match: Union[str, UnsetType] = unset, |
| 1746 | + filter_tags: Union[List[str], UnsetType] = unset, |
| 1747 | + filter_tag_keys: Union[List[str], UnsetType] = unset, |
| 1748 | + page_size: Union[int, UnsetType] = unset, |
| 1749 | + ) -> CostTagsResponse: |
| 1750 | + """List Cloud Cost Management tags. |
| 1751 | +
|
| 1752 | + List Cloud Cost Management tags for a given metric. |
| 1753 | +
|
| 1754 | + :param filter_metric: The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics. |
| 1755 | + :type filter_metric: str, optional |
| 1756 | + :param filter_match: A substring used to filter the returned tags by name. |
| 1757 | + :type filter_match: str, optional |
| 1758 | + :param filter_tags: Filter to return only tags that appear with the given ``key:value`` tag values. For example, ``filter[tags]=providername:aws`` returns tags found on the same cost data, such as ``aws_instance_type:t3.micro`` and ``aws_instance_type:m5.large``. |
| 1759 | + :type filter_tags: [str], optional |
| 1760 | + :param filter_tag_keys: Restrict the returned tags to those whose key matches one of the given tag keys. |
| 1761 | + :type filter_tag_keys: [str], optional |
| 1762 | + :param page_size: Controls the size of the internal tag search scope. This does **not** restrict the number of tags returned in the response. Defaults to 50, maximum 10000. |
| 1763 | + :type page_size: int, optional |
| 1764 | + :rtype: CostTagsResponse |
| 1765 | + """ |
| 1766 | + kwargs: Dict[str, Any] = {} |
| 1767 | + if filter_metric is not unset: |
| 1768 | + kwargs["filter_metric"] = filter_metric |
| 1769 | + |
| 1770 | + if filter_match is not unset: |
| 1771 | + kwargs["filter_match"] = filter_match |
| 1772 | + |
| 1773 | + if filter_tags is not unset: |
| 1774 | + kwargs["filter_tags"] = filter_tags |
| 1775 | + |
| 1776 | + if filter_tag_keys is not unset: |
| 1777 | + kwargs["filter_tag_keys"] = filter_tag_keys |
| 1778 | + |
| 1779 | + if page_size is not unset: |
| 1780 | + kwargs["page_size"] = page_size |
| 1781 | + |
| 1782 | + return self._list_cost_tags_endpoint.call_with_http_info(**kwargs) |
| 1783 | + |
1572 | 1784 | def list_custom_allocation_rules( |
1573 | 1785 | self, |
1574 | 1786 | ) -> ArbitraryRuleResponseArray: |
|
0 commit comments