|
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 | 43 | from datadog_api_client.v2.model.cost_tag_descriptions_response import CostTagDescriptionsResponse |
| 44 | +from datadog_api_client.v2.model.cost_tag_keys_response import CostTagKeysResponse |
| 45 | +from datadog_api_client.v2.model.cost_tag_key_response import CostTagKeyResponse |
| 46 | +from datadog_api_client.v2.model.cost_tags_response import CostTagsResponse |
44 | 47 | from datadog_api_client.v2.model.ruleset_resp_array import RulesetRespArray |
45 | 48 | from datadog_api_client.v2.model.ruleset_resp import RulesetResp |
46 | 49 | from datadog_api_client.v2.model.create_ruleset_request import CreateRulesetRequest |
@@ -414,6 +417,42 @@ def __init__(self, api_client=None): |
414 | 417 | api_client=api_client, |
415 | 418 | ) |
416 | 419 |
|
| 420 | + self._get_cost_tag_key_endpoint = _Endpoint( |
| 421 | + settings={ |
| 422 | + "response_type": (CostTagKeyResponse,), |
| 423 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 424 | + "endpoint_path": "/api/v2/cost/tag_keys/{tag_key}", |
| 425 | + "operation_id": "get_cost_tag_key", |
| 426 | + "http_method": "GET", |
| 427 | + "version": "v2", |
| 428 | + }, |
| 429 | + params_map={ |
| 430 | + "tag_key": { |
| 431 | + "required": True, |
| 432 | + "openapi_types": (str,), |
| 433 | + "attribute": "tag_key", |
| 434 | + "location": "path", |
| 435 | + }, |
| 436 | + "filter_metric": { |
| 437 | + "openapi_types": (str,), |
| 438 | + "attribute": "filter[metric]", |
| 439 | + "location": "query", |
| 440 | + }, |
| 441 | + "page_size": { |
| 442 | + "validation": { |
| 443 | + "inclusive_maximum": 10000, |
| 444 | + }, |
| 445 | + "openapi_types": (int,), |
| 446 | + "attribute": "page[size]", |
| 447 | + "location": "query", |
| 448 | + }, |
| 449 | + }, |
| 450 | + headers_map={ |
| 451 | + "accept": ["application/json"], |
| 452 | + }, |
| 453 | + api_client=api_client, |
| 454 | + ) |
| 455 | + |
417 | 456 | self._get_custom_allocation_rule_endpoint = _Endpoint( |
418 | 457 | settings={ |
419 | 458 | "response_type": (ArbitraryRuleResponse,), |
@@ -585,6 +624,81 @@ def __init__(self, api_client=None): |
585 | 624 | api_client=api_client, |
586 | 625 | ) |
587 | 626 |
|
| 627 | + self._list_cost_tag_keys_endpoint = _Endpoint( |
| 628 | + settings={ |
| 629 | + "response_type": (CostTagKeysResponse,), |
| 630 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 631 | + "endpoint_path": "/api/v2/cost/tag_keys", |
| 632 | + "operation_id": "list_cost_tag_keys", |
| 633 | + "http_method": "GET", |
| 634 | + "version": "v2", |
| 635 | + }, |
| 636 | + params_map={ |
| 637 | + "filter_metric": { |
| 638 | + "openapi_types": (str,), |
| 639 | + "attribute": "filter[metric]", |
| 640 | + "location": "query", |
| 641 | + }, |
| 642 | + "filter_tags": { |
| 643 | + "openapi_types": ([str],), |
| 644 | + "attribute": "filter[tags]", |
| 645 | + "location": "query", |
| 646 | + "collection_format": "multi", |
| 647 | + }, |
| 648 | + }, |
| 649 | + headers_map={ |
| 650 | + "accept": ["application/json"], |
| 651 | + }, |
| 652 | + api_client=api_client, |
| 653 | + ) |
| 654 | + |
| 655 | + self._list_cost_tags_endpoint = _Endpoint( |
| 656 | + settings={ |
| 657 | + "response_type": (CostTagsResponse,), |
| 658 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 659 | + "endpoint_path": "/api/v2/cost/tags", |
| 660 | + "operation_id": "list_cost_tags", |
| 661 | + "http_method": "GET", |
| 662 | + "version": "v2", |
| 663 | + }, |
| 664 | + params_map={ |
| 665 | + "filter_metric": { |
| 666 | + "openapi_types": (str,), |
| 667 | + "attribute": "filter[metric]", |
| 668 | + "location": "query", |
| 669 | + }, |
| 670 | + "filter_match": { |
| 671 | + "openapi_types": (str,), |
| 672 | + "attribute": "filter[match]", |
| 673 | + "location": "query", |
| 674 | + }, |
| 675 | + "filter_tags": { |
| 676 | + "openapi_types": ([str],), |
| 677 | + "attribute": "filter[tags]", |
| 678 | + "location": "query", |
| 679 | + "collection_format": "multi", |
| 680 | + }, |
| 681 | + "filter_tag_keys": { |
| 682 | + "openapi_types": ([str],), |
| 683 | + "attribute": "filter[tag_keys]", |
| 684 | + "location": "query", |
| 685 | + "collection_format": "multi", |
| 686 | + }, |
| 687 | + "page_size": { |
| 688 | + "validation": { |
| 689 | + "inclusive_maximum": 10000, |
| 690 | + }, |
| 691 | + "openapi_types": (int,), |
| 692 | + "attribute": "page[size]", |
| 693 | + "location": "query", |
| 694 | + }, |
| 695 | + }, |
| 696 | + headers_map={ |
| 697 | + "accept": ["application/json"], |
| 698 | + }, |
| 699 | + api_client=api_client, |
| 700 | + ) |
| 701 | + |
588 | 702 | self._list_custom_allocation_rules_endpoint = _Endpoint( |
589 | 703 | settings={ |
590 | 704 | "response_type": (ArbitraryRuleResponseArray,), |
@@ -1245,6 +1359,36 @@ def get_cost_gcp_usage_cost_config( |
1245 | 1359 |
|
1246 | 1360 | return self._get_cost_gcp_usage_cost_config_endpoint.call_with_http_info(**kwargs) |
1247 | 1361 |
|
| 1362 | + def get_cost_tag_key( |
| 1363 | + self, |
| 1364 | + tag_key: str, |
| 1365 | + *, |
| 1366 | + filter_metric: Union[str, UnsetType] = unset, |
| 1367 | + page_size: Union[int, UnsetType] = unset, |
| 1368 | + ) -> CostTagKeyResponse: |
| 1369 | + """Get a Cloud Cost Management tag key. |
| 1370 | +
|
| 1371 | + Get details for a specific Cloud Cost Management tag key, including example tag values and description. |
| 1372 | +
|
| 1373 | + :param tag_key: The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, ``kubernetes/instance`` ). |
| 1374 | + :type tag_key: str |
| 1375 | + :param filter_metric: The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. |
| 1376 | + :type filter_metric: str, optional |
| 1377 | + :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. |
| 1378 | + :type page_size: int, optional |
| 1379 | + :rtype: CostTagKeyResponse |
| 1380 | + """ |
| 1381 | + kwargs: Dict[str, Any] = {} |
| 1382 | + kwargs["tag_key"] = tag_key |
| 1383 | + |
| 1384 | + if filter_metric is not unset: |
| 1385 | + kwargs["filter_metric"] = filter_metric |
| 1386 | + |
| 1387 | + if page_size is not unset: |
| 1388 | + kwargs["page_size"] = page_size |
| 1389 | + |
| 1390 | + return self._get_cost_tag_key_endpoint.call_with_http_info(**kwargs) |
| 1391 | + |
1248 | 1392 | def get_custom_allocation_rule( |
1249 | 1393 | self, |
1250 | 1394 | rule_id: int, |
@@ -1375,6 +1519,74 @@ def list_cost_tag_descriptions( |
1375 | 1519 |
|
1376 | 1520 | return self._list_cost_tag_descriptions_endpoint.call_with_http_info(**kwargs) |
1377 | 1521 |
|
| 1522 | + def list_cost_tag_keys( |
| 1523 | + self, |
| 1524 | + *, |
| 1525 | + filter_metric: Union[str, UnsetType] = unset, |
| 1526 | + filter_tags: Union[List[str], UnsetType] = unset, |
| 1527 | + ) -> CostTagKeysResponse: |
| 1528 | + """List Cloud Cost Management tag keys. |
| 1529 | +
|
| 1530 | + List Cloud Cost Management tag keys. |
| 1531 | +
|
| 1532 | + :param filter_metric: The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. |
| 1533 | + :type filter_metric: str, optional |
| 1534 | + :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``. |
| 1535 | + :type filter_tags: [str], optional |
| 1536 | + :rtype: CostTagKeysResponse |
| 1537 | + """ |
| 1538 | + kwargs: Dict[str, Any] = {} |
| 1539 | + if filter_metric is not unset: |
| 1540 | + kwargs["filter_metric"] = filter_metric |
| 1541 | + |
| 1542 | + if filter_tags is not unset: |
| 1543 | + kwargs["filter_tags"] = filter_tags |
| 1544 | + |
| 1545 | + return self._list_cost_tag_keys_endpoint.call_with_http_info(**kwargs) |
| 1546 | + |
| 1547 | + def list_cost_tags( |
| 1548 | + self, |
| 1549 | + *, |
| 1550 | + filter_metric: Union[str, UnsetType] = unset, |
| 1551 | + filter_match: Union[str, UnsetType] = unset, |
| 1552 | + filter_tags: Union[List[str], UnsetType] = unset, |
| 1553 | + filter_tag_keys: Union[List[str], UnsetType] = unset, |
| 1554 | + page_size: Union[int, UnsetType] = unset, |
| 1555 | + ) -> CostTagsResponse: |
| 1556 | + """List Cloud Cost Management tags. |
| 1557 | +
|
| 1558 | + List Cloud Cost Management tags for a given metric. |
| 1559 | +
|
| 1560 | + :param filter_metric: The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics. |
| 1561 | + :type filter_metric: str, optional |
| 1562 | + :param filter_match: A substring used to filter the returned tags by name. |
| 1563 | + :type filter_match: str, optional |
| 1564 | + :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``. |
| 1565 | + :type filter_tags: [str], optional |
| 1566 | + :param filter_tag_keys: Restrict the returned tags to those whose key matches one of the given tag keys. |
| 1567 | + :type filter_tag_keys: [str], optional |
| 1568 | + :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. |
| 1569 | + :type page_size: int, optional |
| 1570 | + :rtype: CostTagsResponse |
| 1571 | + """ |
| 1572 | + kwargs: Dict[str, Any] = {} |
| 1573 | + if filter_metric is not unset: |
| 1574 | + kwargs["filter_metric"] = filter_metric |
| 1575 | + |
| 1576 | + if filter_match is not unset: |
| 1577 | + kwargs["filter_match"] = filter_match |
| 1578 | + |
| 1579 | + if filter_tags is not unset: |
| 1580 | + kwargs["filter_tags"] = filter_tags |
| 1581 | + |
| 1582 | + if filter_tag_keys is not unset: |
| 1583 | + kwargs["filter_tag_keys"] = filter_tag_keys |
| 1584 | + |
| 1585 | + if page_size is not unset: |
| 1586 | + kwargs["page_size"] = page_size |
| 1587 | + |
| 1588 | + return self._list_cost_tags_endpoint.call_with_http_info(**kwargs) |
| 1589 | + |
1378 | 1590 | def list_custom_allocation_rules( |
1379 | 1591 | self, |
1380 | 1592 | ) -> ArbitraryRuleResponseArray: |
|
0 commit comments