|
40 | 40 | from datadog_api_client.v2.model.gcp_uc_config_response import GcpUcConfigResponse |
41 | 41 | from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request import GCPUsageCostConfigPatchRequest |
42 | 42 | from datadog_api_client.v2.model.oci_configs_response import OCIConfigsResponse |
| 43 | +from datadog_api_client.v2.model.cost_tag_keys_response import CostTagKeysResponse |
| 44 | +from datadog_api_client.v2.model.cost_tag_key_response import CostTagKeyResponse |
| 45 | +from datadog_api_client.v2.model.cost_tags_response import CostTagsResponse |
43 | 46 | from datadog_api_client.v2.model.ruleset_resp_array import RulesetRespArray |
44 | 47 | from datadog_api_client.v2.model.ruleset_resp import RulesetResp |
45 | 48 | from datadog_api_client.v2.model.create_ruleset_request import CreateRulesetRequest |
@@ -413,6 +416,42 @@ def __init__(self, api_client=None): |
413 | 416 | api_client=api_client, |
414 | 417 | ) |
415 | 418 |
|
| 419 | + self._get_cost_tag_key_endpoint = _Endpoint( |
| 420 | + settings={ |
| 421 | + "response_type": (CostTagKeyResponse,), |
| 422 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 423 | + "endpoint_path": "/api/v2/cost/tag_keys/{tag_key}", |
| 424 | + "operation_id": "get_cost_tag_key", |
| 425 | + "http_method": "GET", |
| 426 | + "version": "v2", |
| 427 | + }, |
| 428 | + params_map={ |
| 429 | + "tag_key": { |
| 430 | + "required": True, |
| 431 | + "openapi_types": (str,), |
| 432 | + "attribute": "tag_key", |
| 433 | + "location": "path", |
| 434 | + }, |
| 435 | + "filter_metric": { |
| 436 | + "openapi_types": (str,), |
| 437 | + "attribute": "filter[metric]", |
| 438 | + "location": "query", |
| 439 | + }, |
| 440 | + "page_size": { |
| 441 | + "validation": { |
| 442 | + "inclusive_maximum": 10000, |
| 443 | + }, |
| 444 | + "openapi_types": (int,), |
| 445 | + "attribute": "page[size]", |
| 446 | + "location": "query", |
| 447 | + }, |
| 448 | + }, |
| 449 | + headers_map={ |
| 450 | + "accept": ["application/json"], |
| 451 | + }, |
| 452 | + api_client=api_client, |
| 453 | + ) |
| 454 | + |
416 | 455 | self._get_custom_allocation_rule_endpoint = _Endpoint( |
417 | 456 | settings={ |
418 | 457 | "response_type": (ArbitraryRuleResponse,), |
@@ -562,6 +601,81 @@ def __init__(self, api_client=None): |
562 | 601 | api_client=api_client, |
563 | 602 | ) |
564 | 603 |
|
| 604 | + self._list_cost_tag_keys_endpoint = _Endpoint( |
| 605 | + settings={ |
| 606 | + "response_type": (CostTagKeysResponse,), |
| 607 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 608 | + "endpoint_path": "/api/v2/cost/tag_keys", |
| 609 | + "operation_id": "list_cost_tag_keys", |
| 610 | + "http_method": "GET", |
| 611 | + "version": "v2", |
| 612 | + }, |
| 613 | + params_map={ |
| 614 | + "filter_metric": { |
| 615 | + "openapi_types": (str,), |
| 616 | + "attribute": "filter[metric]", |
| 617 | + "location": "query", |
| 618 | + }, |
| 619 | + "filter_tags": { |
| 620 | + "openapi_types": ([str],), |
| 621 | + "attribute": "filter[tags]", |
| 622 | + "location": "query", |
| 623 | + "collection_format": "multi", |
| 624 | + }, |
| 625 | + }, |
| 626 | + headers_map={ |
| 627 | + "accept": ["application/json"], |
| 628 | + }, |
| 629 | + api_client=api_client, |
| 630 | + ) |
| 631 | + |
| 632 | + self._list_cost_tags_endpoint = _Endpoint( |
| 633 | + settings={ |
| 634 | + "response_type": (CostTagsResponse,), |
| 635 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 636 | + "endpoint_path": "/api/v2/cost/tags", |
| 637 | + "operation_id": "list_cost_tags", |
| 638 | + "http_method": "GET", |
| 639 | + "version": "v2", |
| 640 | + }, |
| 641 | + params_map={ |
| 642 | + "filter_metric": { |
| 643 | + "openapi_types": (str,), |
| 644 | + "attribute": "filter[metric]", |
| 645 | + "location": "query", |
| 646 | + }, |
| 647 | + "filter_match": { |
| 648 | + "openapi_types": (str,), |
| 649 | + "attribute": "filter[match]", |
| 650 | + "location": "query", |
| 651 | + }, |
| 652 | + "filter_tags": { |
| 653 | + "openapi_types": ([str],), |
| 654 | + "attribute": "filter[tags]", |
| 655 | + "location": "query", |
| 656 | + "collection_format": "multi", |
| 657 | + }, |
| 658 | + "filter_tag_keys": { |
| 659 | + "openapi_types": ([str],), |
| 660 | + "attribute": "filter[tag_keys]", |
| 661 | + "location": "query", |
| 662 | + "collection_format": "multi", |
| 663 | + }, |
| 664 | + "page_size": { |
| 665 | + "validation": { |
| 666 | + "inclusive_maximum": 10000, |
| 667 | + }, |
| 668 | + "openapi_types": (int,), |
| 669 | + "attribute": "page[size]", |
| 670 | + "location": "query", |
| 671 | + }, |
| 672 | + }, |
| 673 | + headers_map={ |
| 674 | + "accept": ["application/json"], |
| 675 | + }, |
| 676 | + api_client=api_client, |
| 677 | + ) |
| 678 | + |
565 | 679 | self._list_custom_allocation_rules_endpoint = _Endpoint( |
566 | 680 | settings={ |
567 | 681 | "response_type": (ArbitraryRuleResponseArray,), |
@@ -1222,6 +1336,36 @@ def get_cost_gcp_usage_cost_config( |
1222 | 1336 |
|
1223 | 1337 | return self._get_cost_gcp_usage_cost_config_endpoint.call_with_http_info(**kwargs) |
1224 | 1338 |
|
| 1339 | + def get_cost_tag_key( |
| 1340 | + self, |
| 1341 | + tag_key: str, |
| 1342 | + *, |
| 1343 | + filter_metric: Union[str, UnsetType] = unset, |
| 1344 | + page_size: Union[int, UnsetType] = unset, |
| 1345 | + ) -> CostTagKeyResponse: |
| 1346 | + """Get a Cloud Cost Management tag key. |
| 1347 | +
|
| 1348 | + Get details for a specific Cloud Cost Management tag key, including example tag values and description. |
| 1349 | +
|
| 1350 | + :param tag_key: The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, ``kubernetes/instance`` ). |
| 1351 | + :type tag_key: str |
| 1352 | + :param filter_metric: The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. |
| 1353 | + :type filter_metric: str, optional |
| 1354 | + :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. |
| 1355 | + :type page_size: int, optional |
| 1356 | + :rtype: CostTagKeyResponse |
| 1357 | + """ |
| 1358 | + kwargs: Dict[str, Any] = {} |
| 1359 | + kwargs["tag_key"] = tag_key |
| 1360 | + |
| 1361 | + if filter_metric is not unset: |
| 1362 | + kwargs["filter_metric"] = filter_metric |
| 1363 | + |
| 1364 | + if page_size is not unset: |
| 1365 | + kwargs["page_size"] = page_size |
| 1366 | + |
| 1367 | + return self._get_cost_tag_key_endpoint.call_with_http_info(**kwargs) |
| 1368 | + |
1225 | 1369 | def get_custom_allocation_rule( |
1226 | 1370 | self, |
1227 | 1371 | rule_id: int, |
@@ -1333,6 +1477,74 @@ def list_cost_oci_configs( |
1333 | 1477 | kwargs: Dict[str, Any] = {} |
1334 | 1478 | return self._list_cost_oci_configs_endpoint.call_with_http_info(**kwargs) |
1335 | 1479 |
|
| 1480 | + def list_cost_tag_keys( |
| 1481 | + self, |
| 1482 | + *, |
| 1483 | + filter_metric: Union[str, UnsetType] = unset, |
| 1484 | + filter_tags: Union[List[str], UnsetType] = unset, |
| 1485 | + ) -> CostTagKeysResponse: |
| 1486 | + """List Cloud Cost Management tag keys. |
| 1487 | +
|
| 1488 | + List Cloud Cost Management tag keys. |
| 1489 | +
|
| 1490 | + :param filter_metric: The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. |
| 1491 | + :type filter_metric: str, optional |
| 1492 | + :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``. |
| 1493 | + :type filter_tags: [str], optional |
| 1494 | + :rtype: CostTagKeysResponse |
| 1495 | + """ |
| 1496 | + kwargs: Dict[str, Any] = {} |
| 1497 | + if filter_metric is not unset: |
| 1498 | + kwargs["filter_metric"] = filter_metric |
| 1499 | + |
| 1500 | + if filter_tags is not unset: |
| 1501 | + kwargs["filter_tags"] = filter_tags |
| 1502 | + |
| 1503 | + return self._list_cost_tag_keys_endpoint.call_with_http_info(**kwargs) |
| 1504 | + |
| 1505 | + def list_cost_tags( |
| 1506 | + self, |
| 1507 | + *, |
| 1508 | + filter_metric: Union[str, UnsetType] = unset, |
| 1509 | + filter_match: Union[str, UnsetType] = unset, |
| 1510 | + filter_tags: Union[List[str], UnsetType] = unset, |
| 1511 | + filter_tag_keys: Union[List[str], UnsetType] = unset, |
| 1512 | + page_size: Union[int, UnsetType] = unset, |
| 1513 | + ) -> CostTagsResponse: |
| 1514 | + """List Cloud Cost Management tags. |
| 1515 | +
|
| 1516 | + List Cloud Cost Management tags for a given metric. |
| 1517 | +
|
| 1518 | + :param filter_metric: The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics. |
| 1519 | + :type filter_metric: str, optional |
| 1520 | + :param filter_match: A substring used to filter the returned tags by name. |
| 1521 | + :type filter_match: str, optional |
| 1522 | + :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``. |
| 1523 | + :type filter_tags: [str], optional |
| 1524 | + :param filter_tag_keys: Restrict the returned tags to those whose key matches one of the given tag keys. |
| 1525 | + :type filter_tag_keys: [str], optional |
| 1526 | + :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. |
| 1527 | + :type page_size: int, optional |
| 1528 | + :rtype: CostTagsResponse |
| 1529 | + """ |
| 1530 | + kwargs: Dict[str, Any] = {} |
| 1531 | + if filter_metric is not unset: |
| 1532 | + kwargs["filter_metric"] = filter_metric |
| 1533 | + |
| 1534 | + if filter_match is not unset: |
| 1535 | + kwargs["filter_match"] = filter_match |
| 1536 | + |
| 1537 | + if filter_tags is not unset: |
| 1538 | + kwargs["filter_tags"] = filter_tags |
| 1539 | + |
| 1540 | + if filter_tag_keys is not unset: |
| 1541 | + kwargs["filter_tag_keys"] = filter_tag_keys |
| 1542 | + |
| 1543 | + if page_size is not unset: |
| 1544 | + kwargs["page_size"] = page_size |
| 1545 | + |
| 1546 | + return self._list_cost_tags_endpoint.call_with_http_info(**kwargs) |
| 1547 | + |
1336 | 1548 | def list_custom_allocation_rules( |
1337 | 1549 | self, |
1338 | 1550 | ) -> ArbitraryRuleResponseArray: |
|
0 commit comments