diff --git a/.generated-info b/.generated-info index 7267d84800..9a2cdcfc7f 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "3a6cb30", - "generated": "2025-08-12 15:41:29.674" + "spec_repo_commit": "e8d04a0", + "generated": "2025-08-12 23:00:14.639" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e9356a61f4..d7cdb4a8d3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -221,7 +221,8 @@ components: name: cloud_account_id required: true schema: - type: string + format: int64 + type: integer CloudWorkloadSecurityAgentRuleID: description: The ID of the Agent rule example: 3b5-v82-ns6 @@ -4500,8 +4501,7 @@ components: $ref: '#/components/schemas/AwsCURConfigAttributes' id: description: The ID of the AWS CUR config. - format: int64 - type: integer + type: string type: $ref: '#/components/schemas/AwsCURConfigType' required: @@ -4642,9 +4642,6 @@ components: description: The region the bucket is located in. example: us-east-1 type: string - is_enabled: - description: Whether or not the Cloud Cost Management account is enabled. - type: boolean months: description: The month of the report. format: int32 @@ -5136,8 +5133,7 @@ components: type: string id: description: The ID of the Azure config. - format: int64 - type: integer + type: string months: deprecated: true description: The number of months the report has been backfilled. @@ -5187,8 +5183,7 @@ components: $ref: '#/components/schemas/AzureUCConfigPairAttributes' id: description: The ID of Cloud Cost Management account. - format: int64 - type: integer + type: string type: $ref: '#/components/schemas/AzureUCConfigPairType' required: @@ -5205,8 +5200,7 @@ components: type: array id: description: The ID of the Azure config pair. - format: int64 - type: integer + type: string required: - configs type: object @@ -49173,6 +49167,31 @@ paths: get: description: List the Custom Costs files. operationId: ListCustomCostsFiles + parameters: + - description: Page number for pagination + in: query + name: page[number] + schema: + format: int64 + type: integer + - description: Page size for pagination + in: query + name: page[size] + schema: + default: 100 + format: int64 + type: integer + - description: Filter by file status + in: query + name: filter[status] + schema: + type: string + - description: Sort key with optional descending prefix + in: query + name: sort + schema: + default: created_at + type: string responses: '200': content: @@ -49180,6 +49199,12 @@ paths: schema: $ref: '#/components/schemas/CustomCostsFileListResponse' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': content: application/json: @@ -49212,6 +49237,12 @@ paths: schema: $ref: '#/components/schemas/CustomCostsFileUploadResponse' description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': content: application/json: @@ -49243,6 +49274,12 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' security: @@ -49271,6 +49308,12 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' security: diff --git a/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py b/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py index dfa3347504..aec6d68585 100644 --- a/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py +++ b/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.py @@ -9,5 +9,5 @@ with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) api_instance.delete_cost_awscur_config( - cloud_account_id="100", + cloud_account_id=100, ) diff --git a/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py b/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py index 3e2932197c..d5379a7ca2 100644 --- a/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py +++ b/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.py @@ -9,5 +9,5 @@ with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) api_instance.delete_cost_azure_uc_config( - cloud_account_id="100", + cloud_account_id=100, ) diff --git a/examples/v2/cloud-cost-management/DeleteCostGCPUsageCostConfig.py b/examples/v2/cloud-cost-management/DeleteCostGCPUsageCostConfig.py index 69d2f75eff..37784a9f2d 100644 --- a/examples/v2/cloud-cost-management/DeleteCostGCPUsageCostConfig.py +++ b/examples/v2/cloud-cost-management/DeleteCostGCPUsageCostConfig.py @@ -9,5 +9,5 @@ with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) api_instance.delete_cost_gcp_usage_cost_config( - cloud_account_id="100", + cloud_account_id=100, ) diff --git a/examples/v2/cloud-cost-management/DeleteCustomCostsFile.py b/examples/v2/cloud-cost-management/DeleteCustomCostsFile.py index d3c6f666cd..bd240f83d4 100644 --- a/examples/v2/cloud-cost-management/DeleteCustomCostsFile.py +++ b/examples/v2/cloud-cost-management/DeleteCustomCostsFile.py @@ -9,5 +9,5 @@ with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) api_instance.delete_custom_costs_file( - file_id="file_id", + file_id="9ed1a245-8291-44de-9f59-1dc87975ca4a", ) diff --git a/examples/v2/cloud-cost-management/DeleteCustomCostsFile_372970393.py b/examples/v2/cloud-cost-management/DeleteCustomCostsFile_372970393.py deleted file mode 100644 index e99401e18b..0000000000 --- a/examples/v2/cloud-cost-management/DeleteCustomCostsFile_372970393.py +++ /dev/null @@ -1,13 +0,0 @@ -""" -Delete Custom Costs File returns "No Content" 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) - api_instance.delete_custom_costs_file( - file_id="9d055d22-a838-4e9f-bc34-a4f9ab66280c", - ) diff --git a/examples/v2/cloud-cost-management/GetCustomCostsFile.py b/examples/v2/cloud-cost-management/GetCustomCostsFile.py index 88ebf65c79..12504582b0 100644 --- a/examples/v2/cloud-cost-management/GetCustomCostsFile.py +++ b/examples/v2/cloud-cost-management/GetCustomCostsFile.py @@ -9,7 +9,7 @@ with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) response = api_instance.get_custom_costs_file( - file_id="file_id", + file_id="9ed1a245-8291-44de-9f59-1dc87975ca4a", ) print(response) diff --git a/examples/v2/cloud-cost-management/ListCustomCostsFiles_1968771127.py b/examples/v2/cloud-cost-management/ListCustomCostsFiles_1968771127.py deleted file mode 100644 index d8dd9a56c8..0000000000 --- a/examples/v2/cloud-cost-management/ListCustomCostsFiles_1968771127.py +++ /dev/null @@ -1,13 +0,0 @@ -""" -List Custom Costs Files 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_custom_costs_files() - - print(response) diff --git a/examples/v2/cloud-cost-management/GetCustomCostsFile_1307381576.py b/examples/v2/cloud-cost-management/ListCustomCostsFiles_3567917777.py similarity index 60% rename from examples/v2/cloud-cost-management/GetCustomCostsFile_1307381576.py rename to examples/v2/cloud-cost-management/ListCustomCostsFiles_3567917777.py index 8d8cd9c3da..ca3b831d6f 100644 --- a/examples/v2/cloud-cost-management/GetCustomCostsFile_1307381576.py +++ b/examples/v2/cloud-cost-management/ListCustomCostsFiles_3567917777.py @@ -1,5 +1,5 @@ """ -Get Custom Costs File returns "OK" response +List Custom Costs files with pagination parameters returns "OK" response """ from datadog_api_client import ApiClient, Configuration @@ -8,8 +8,10 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) - response = api_instance.get_custom_costs_file( - file_id="9d055d22-a838-4e9f-bc34-a4f9ab66280c", + response = api_instance.list_custom_costs_files( + page_number=1, + page_size=10, + sort="-created_at", ) print(response) diff --git a/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py b/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py index b84af2bf49..54647696b5 100644 --- a/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py +++ b/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.py @@ -21,6 +21,6 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) - response = api_instance.update_cost_awscur_config(cloud_account_id="100", body=body) + response = api_instance.update_cost_awscur_config(cloud_account_id=100, body=body) print(response) diff --git a/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py b/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py index 78257b9c5f..b7b9d85dde 100644 --- a/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py +++ b/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.py @@ -21,6 +21,6 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) - response = api_instance.update_cost_azure_uc_configs(cloud_account_id="100", body=body) + response = api_instance.update_cost_azure_uc_configs(cloud_account_id=100, body=body) print(response) diff --git a/examples/v2/cloud-cost-management/UpdateCostGCPUsageCostConfig.py b/examples/v2/cloud-cost-management/UpdateCostGCPUsageCostConfig.py index 6816d9afea..99e9f4e048 100644 --- a/examples/v2/cloud-cost-management/UpdateCostGCPUsageCostConfig.py +++ b/examples/v2/cloud-cost-management/UpdateCostGCPUsageCostConfig.py @@ -23,6 +23,6 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = CloudCostManagementApi(api_client) - response = api_instance.update_cost_gcp_usage_cost_config(cloud_account_id="100", body=body) + response = api_instance.update_cost_gcp_usage_cost_config(cloud_account_id=100, body=body) print(response) diff --git a/examples/v2/cloud-cost-management/UploadCustomCostsFile.py b/examples/v2/cloud-cost-management/UploadCustomCostsFile.py index 3f0d5c2510..3bdff8bf74 100644 --- a/examples/v2/cloud-cost-management/UploadCustomCostsFile.py +++ b/examples/v2/cloud-cost-management/UploadCustomCostsFile.py @@ -8,11 +8,15 @@ body = [ CustomCostsFileLineItem( - billed_cost=100.5, + provider_name="my_provider", + charge_period_start="2023-05-06", + charge_period_end="2023-06-06", + charge_description="my_description", + billed_cost=250.0, billing_currency="USD", - charge_description="Monthly usage charge for my service", - charge_period_end="2023-02-28", - charge_period_start="2023-02-01", + tags=dict( + key="value", + ), ), ] diff --git a/examples/v2/cloud-cost-management/UploadCustomCostsFile_4125168396.py b/examples/v2/cloud-cost-management/UploadCustomCostsFile_4125168396.py deleted file mode 100644 index 95935e54bd..0000000000 --- a/examples/v2/cloud-cost-management/UploadCustomCostsFile_4125168396.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -Upload Custom Costs File returns "Accepted" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi -from datadog_api_client.v2.model.custom_costs_file_line_item import CustomCostsFileLineItem - -body = [ - CustomCostsFileLineItem( - provider_name="my_provider", - charge_period_start="2023-05-06", - charge_period_end="2023-06-06", - charge_description="my_description", - billed_cost=250.0, - billing_currency="USD", - tags=dict( - key="value", - ), - ), -] - -configuration = Configuration() -with ApiClient(configuration) as api_client: - api_instance = CloudCostManagementApi(api_client) - response = api_instance.upload_custom_costs_file(body=body) - - print(response) diff --git a/src/datadog_api_client/v2/api/cloud_cost_management_api.py b/src/datadog_api_client/v2/api/cloud_cost_management_api.py index 803958176f..bf28d92a03 100644 --- a/src/datadog_api_client/v2/api/cloud_cost_management_api.py +++ b/src/datadog_api_client/v2/api/cloud_cost_management_api.py @@ -3,10 +3,14 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict, List +from typing import Any, Dict, List, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) from datadog_api_client.v2.model.aws_cur_configs_response import AwsCURConfigsResponse from datadog_api_client.v2.model.aws_cur_config_response import AwsCURConfigResponse from datadog_api_client.v2.model.aws_cur_config_post_request import AwsCURConfigPostRequest @@ -132,7 +136,7 @@ def __init__(self, api_client=None): params_map={ "cloud_account_id": { "required": True, - "openapi_types": (str,), + "openapi_types": (int,), "attribute": "cloud_account_id", "location": "path", }, @@ -155,7 +159,7 @@ def __init__(self, api_client=None): params_map={ "cloud_account_id": { "required": True, - "openapi_types": (str,), + "openapi_types": (int,), "attribute": "cloud_account_id", "location": "path", }, @@ -178,7 +182,7 @@ def __init__(self, api_client=None): params_map={ "cloud_account_id": { "required": True, - "openapi_types": (str,), + "openapi_types": (int,), "attribute": "cloud_account_id", "location": "path", }, @@ -331,7 +335,28 @@ def __init__(self, api_client=None): "http_method": "GET", "version": "v2", }, - params_map={}, + params_map={ + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "filter_status": { + "openapi_types": (str,), + "attribute": "filter[status]", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + }, headers_map={ "accept": ["application/json"], }, @@ -350,7 +375,7 @@ def __init__(self, api_client=None): params_map={ "cloud_account_id": { "required": True, - "openapi_types": (str,), + "openapi_types": (int,), "attribute": "cloud_account_id", "location": "path", }, @@ -376,7 +401,7 @@ def __init__(self, api_client=None): params_map={ "cloud_account_id": { "required": True, - "openapi_types": (str,), + "openapi_types": (int,), "attribute": "cloud_account_id", "location": "path", }, @@ -402,7 +427,7 @@ def __init__(self, api_client=None): params_map={ "cloud_account_id": { "required": True, - "openapi_types": (str,), + "openapi_types": (int,), "attribute": "cloud_account_id", "location": "path", }, @@ -524,14 +549,14 @@ def delete_budget( def delete_cost_awscur_config( self, - cloud_account_id: str, + cloud_account_id: int, ) -> None: """Delete Cloud Cost Management AWS CUR config. Archive a Cloud Cost Management Account. :param cloud_account_id: Cloud Account id. - :type cloud_account_id: str + :type cloud_account_id: int :rtype: None """ kwargs: Dict[str, Any] = {} @@ -541,14 +566,14 @@ def delete_cost_awscur_config( def delete_cost_azure_uc_config( self, - cloud_account_id: str, + cloud_account_id: int, ) -> None: """Delete Cloud Cost Management Azure config. Archive a Cloud Cost Management Account. :param cloud_account_id: Cloud Account id. - :type cloud_account_id: str + :type cloud_account_id: int :rtype: None """ kwargs: Dict[str, Any] = {} @@ -558,14 +583,14 @@ def delete_cost_azure_uc_config( def delete_cost_gcp_usage_cost_config( self, - cloud_account_id: str, + cloud_account_id: int, ) -> None: """Delete Cloud Cost Management GCP Usage Cost config. Archive a Cloud Cost Management account. :param cloud_account_id: Cloud Account id. - :type cloud_account_id: str + :type cloud_account_id: int :rtype: None """ kwargs: Dict[str, Any] = {} @@ -674,19 +699,44 @@ def list_cost_gcp_usage_cost_configs( def list_custom_costs_files( self, + *, + page_number: Union[int, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + filter_status: Union[str, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, ) -> CustomCostsFileListResponse: """List Custom Costs files. List the Custom Costs files. + :param page_number: Page number for pagination + :type page_number: int, optional + :param page_size: Page size for pagination + :type page_size: int, optional + :param filter_status: Filter by file status + :type filter_status: str, optional + :param sort: Sort key with optional descending prefix + :type sort: str, optional :rtype: CustomCostsFileListResponse """ kwargs: Dict[str, Any] = {} + if page_number is not unset: + kwargs["page_number"] = page_number + + if page_size is not unset: + kwargs["page_size"] = page_size + + if filter_status is not unset: + kwargs["filter_status"] = filter_status + + if sort is not unset: + kwargs["sort"] = sort + return self._list_custom_costs_files_endpoint.call_with_http_info(**kwargs) def update_cost_awscur_config( self, - cloud_account_id: str, + cloud_account_id: int, body: AwsCURConfigPatchRequest, ) -> AwsCURConfigsResponse: """Update Cloud Cost Management AWS CUR config. @@ -694,7 +744,7 @@ def update_cost_awscur_config( Update the status (active/archived) and/or account filtering configuration of an AWS CUR config. :param cloud_account_id: Cloud Account id. - :type cloud_account_id: str + :type cloud_account_id: int :type body: AwsCURConfigPatchRequest :rtype: AwsCURConfigsResponse """ @@ -707,7 +757,7 @@ def update_cost_awscur_config( def update_cost_azure_uc_configs( self, - cloud_account_id: str, + cloud_account_id: int, body: AzureUCConfigPatchRequest, ) -> AzureUCConfigPairsResponse: """Update Cloud Cost Management Azure config. @@ -715,7 +765,7 @@ def update_cost_azure_uc_configs( Update the status of an Azure config (active/archived). :param cloud_account_id: Cloud Account id. - :type cloud_account_id: str + :type cloud_account_id: int :type body: AzureUCConfigPatchRequest :rtype: AzureUCConfigPairsResponse """ @@ -728,7 +778,7 @@ def update_cost_azure_uc_configs( def update_cost_gcp_usage_cost_config( self, - cloud_account_id: str, + cloud_account_id: int, body: GCPUsageCostConfigPatchRequest, ) -> GCPUsageCostConfigResponse: """Update Cloud Cost Management GCP Usage Cost config. @@ -736,7 +786,7 @@ def update_cost_gcp_usage_cost_config( Update the status of an GCP Usage Cost config (active/archived). :param cloud_account_id: Cloud Account id. - :type cloud_account_id: str + :type cloud_account_id: int :type body: GCPUsageCostConfigPatchRequest :rtype: GCPUsageCostConfigResponse """ diff --git a/src/datadog_api_client/v2/model/aws_cur_config.py b/src/datadog_api_client/v2/model/aws_cur_config.py index 9c93da4b95..eb5580de88 100644 --- a/src/datadog_api_client/v2/model/aws_cur_config.py +++ b/src/datadog_api_client/v2/model/aws_cur_config.py @@ -26,7 +26,7 @@ def openapi_types(_): return { "attributes": (AwsCURConfigAttributes,), - "id": (int,), + "id": (str,), "type": (AwsCURConfigType,), } @@ -37,7 +37,7 @@ def openapi_types(_): } def __init__( - self_, attributes: AwsCURConfigAttributes, type: AwsCURConfigType, id: Union[int, UnsetType] = unset, **kwargs + self_, attributes: AwsCURConfigAttributes, type: AwsCURConfigType, id: Union[str, UnsetType] = unset, **kwargs ): """ AWS CUR config. @@ -46,7 +46,7 @@ def __init__( :type attributes: AwsCURConfigAttributes :param id: The ID of the AWS CUR config. - :type id: int, optional + :type id: str, optional :param type: Type of AWS CUR config. :type type: AwsCURConfigType diff --git a/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py b/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py index 94091cbb85..b05afaa12c 100644 --- a/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py +++ b/src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py @@ -33,7 +33,6 @@ def openapi_types(_): "account_id": (str,), "bucket_name": (str,), "bucket_region": (str,), - "is_enabled": (bool,), "months": (int,), "report_name": (str,), "report_prefix": (str,), @@ -44,7 +43,6 @@ def openapi_types(_): "account_id": "account_id", "bucket_name": "bucket_name", "bucket_region": "bucket_region", - "is_enabled": "is_enabled", "months": "months", "report_name": "report_name", "report_prefix": "report_prefix", @@ -58,7 +56,6 @@ def __init__( report_prefix: str, account_filters: Union[AccountFilteringConfig, UnsetType] = unset, bucket_region: Union[str, UnsetType] = unset, - is_enabled: Union[bool, UnsetType] = unset, months: Union[int, UnsetType] = unset, **kwargs, ): @@ -77,9 +74,6 @@ def __init__( :param bucket_region: The region the bucket is located in. :type bucket_region: str, optional - :param is_enabled: Whether or not the Cloud Cost Management account is enabled. - :type is_enabled: bool, optional - :param months: The month of the report. :type months: int, optional @@ -93,8 +87,6 @@ def __init__( kwargs["account_filters"] = account_filters if bucket_region is not unset: kwargs["bucket_region"] = bucket_region - if is_enabled is not unset: - kwargs["is_enabled"] = is_enabled if months is not unset: kwargs["months"] = months super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/azure_uc_config.py b/src/datadog_api_client/v2/model/azure_uc_config.py index 45c8318d47..91ef8af76e 100644 --- a/src/datadog_api_client/v2/model/azure_uc_config.py +++ b/src/datadog_api_client/v2/model/azure_uc_config.py @@ -33,7 +33,7 @@ def openapi_types(_): "error_messages": ([str],), "export_name": (str,), "export_path": (str,), - "id": (int,), + "id": (str,), "months": (int,), "scope": (str,), "status": (str,), @@ -74,7 +74,7 @@ def __init__( storage_container: str, created_at: Union[str, UnsetType] = unset, error_messages: Union[List[str], UnsetType] = unset, - id: Union[int, UnsetType] = unset, + id: Union[str, UnsetType] = unset, months: Union[int, UnsetType] = unset, status_updated_at: Union[str, UnsetType] = unset, updated_at: Union[str, UnsetType] = unset, @@ -105,7 +105,7 @@ def __init__( :type export_path: str :param id: The ID of the Azure config. - :type id: int, optional + :type id: str, optional :param months: The number of months the report has been backfilled. **Deprecated**. :type months: int, optional diff --git a/src/datadog_api_client/v2/model/azure_uc_config_pair.py b/src/datadog_api_client/v2/model/azure_uc_config_pair.py index f17681c1f0..11dbc1585b 100644 --- a/src/datadog_api_client/v2/model/azure_uc_config_pair.py +++ b/src/datadog_api_client/v2/model/azure_uc_config_pair.py @@ -26,7 +26,7 @@ def openapi_types(_): return { "attributes": (AzureUCConfigPairAttributes,), - "id": (int,), + "id": (str,), "type": (AzureUCConfigPairType,), } @@ -40,7 +40,7 @@ def __init__( self_, attributes: AzureUCConfigPairAttributes, type: AzureUCConfigPairType, - id: Union[int, UnsetType] = unset, + id: Union[str, UnsetType] = unset, **kwargs, ): """ @@ -50,7 +50,7 @@ def __init__( :type attributes: AzureUCConfigPairAttributes :param id: The ID of Cloud Cost Management account. - :type id: int, optional + :type id: str, optional :param type: Type of Azure config pair. :type type: AzureUCConfigPairType diff --git a/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py b/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py index e3819f9107..661ad1aa34 100644 --- a/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py +++ b/src/datadog_api_client/v2/model/azure_uc_config_pair_attributes.py @@ -24,7 +24,7 @@ def openapi_types(_): return { "configs": ([AzureUCConfig],), - "id": (int,), + "id": (str,), } attribute_map = { @@ -32,7 +32,7 @@ def openapi_types(_): "id": "id", } - def __init__(self_, configs: List[AzureUCConfig], id: Union[int, UnsetType] = unset, **kwargs): + def __init__(self_, configs: List[AzureUCConfig], id: Union[str, UnsetType] = unset, **kwargs): """ Attributes for Azure config pair. @@ -40,7 +40,7 @@ def __init__(self_, configs: List[AzureUCConfig], id: Union[int, UnsetType] = un :type configs: [AzureUCConfig] :param id: The ID of the Azure config pair. - :type id: int, optional + :type id: str, optional """ if id is not unset: kwargs["id"] = id diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response.frozen new file mode 100644 index 0000000000..c3c938fb3d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-08T19:35:42.191Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response.yaml new file mode 100644 index 0000000000..9d59e8029e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: '{"data":{"attributes":{"account_filters":{"excluded_accounts":["123456789123","123456789143"],"include_new_accounts":true,"included_accounts":["123456789123","123456789143"]},"account_id":"123456789123","bucket_name":"dd-cost-bucket","bucket_region":"us-east-1","report_name":"dd-report-name","report_prefix":"dd-report-prefix"},"type":"aws_cur_config_post_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config + response: + body: + string: '{"errors":[{"title":"Validation Error","detail":"[key=BUCKET_ACCESS] + Amazon Web Services integration for account ''123456789123'' is currently + disabled or misconfigured. Please double check your configuration on the Integrations + page."}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response_missing_bucket_name.frozen b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response_missing_bucket_name.frozen new file mode 100644 index 0000000000..8d3cc19152 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response_missing_bucket_name.frozen @@ -0,0 +1 @@ +2025-08-11T16:52:12.935Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response_missing_bucket_name.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response_missing_bucket_name.yaml new file mode 100644 index 0000000000..cc7860cb7e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_bad_request_response_missing_bucket_name.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"account_id":"123456789123","bucket_region":"us-east-1","report_name":"dd-report-name","report_prefix":"dd-report-prefix"},"type":"aws_cur_config_post_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"bucket_name\" is required"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml index 504e78f395..b635f34a06 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_aws_cur_config_returns_ok_response.yaml @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config response: body: - string: '{"data":{"type":"aws_cur_config","id":177,"attributes":{"account_id":"123456789123","bucket_name":"dd-cost-bucket","bucket_region":"us-east-1","report_prefix":"dd-report-prefix","report_name":"dd-report-name","months":15,"updated_at":"2023-12-12T14:24:30.907264","created_at":"2023-12-12T14:24:30.907264","status":"active","status_updated_at":"2023-12-12T14:24:30.904602","error_messages":[]}}} + string: '{"data":{"type":"aws_cur_config","id":"1234","attributes":{"account_id":"123456789123","bucket_name":"dd-cost-bucket","bucket_region":"us-east-1","report_prefix":"dd-report-prefix","report_name":"dd-report-name","months":15,"updated_at":"2023-12-12T14:24:30.907264","created_at":"2023-12-12T14:24:30.907264","status":"active","status_updated_at":"2023-12-12T14:24:30.904602","error_messages":[]}}} ' headers: diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response.frozen new file mode 100644 index 0000000000..77de7b6115 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-08T19:35:57.749Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response.yaml new file mode 100644 index 0000000000..358b3f91bd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response.yaml @@ -0,0 +1,28 @@ +interactions: +- request: + body: '{"data":{"attributes":{"account_id":"1234abcd-1234-abcd-1234-1234abcd1234","actual_bill_config":{"export_name":"dd-actual-export","export_path":"dd-export-path","storage_account":"dd-storage-account","storage_container":"dd-storage-container"},"amortized_bill_config":{"export_name":"dd-actual-export","export_path":"dd-export-path","storage_account":"dd-storage-account","storage_container":"dd-storage-container"},"client_id":"1234abcd-1234-abcd-1234-1234abcd1234","scope":"/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"},"type":"azure_uc_config_post_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config + response: + body: + string: '{"errors":[{"title":"Validation Error","detail":"[key=DUPLICATE_SETUP] + You can not setup multiple exports with the same export name in the same container + path. This will cause Azure to overwrite them. A cost export with storage_account + ''dd-storage-account'', storage_container ''dd-storage-container'', storage_directory + ''dd-export-path'' and export_name ''dd-actual-export'' already exists."},{"title":"Validation + Error","detail":"[key=MISSING_AZURE_INTEGRATION] Could not find any valid + integrations for tenant ''1234abcd-1234-abcd-1234-1234abcd1234'' and app registration + ''1234abcd-1234-abcd-1234-1234abcd1234''. Please check the Azure Integrations + UI."}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response_invalid_scope_format.frozen b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response_invalid_scope_format.frozen new file mode 100644 index 0000000000..d95cda0ce1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response_invalid_scope_format.frozen @@ -0,0 +1 @@ +2025-08-12T22:53:21.227Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response_invalid_scope_format.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response_invalid_scope_format.yaml new file mode 100644 index 0000000000..0d2774e7b0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_bad_request_response_invalid_scope_format.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"account_id":"1234abcd-1234-abcd-1234-1234abcd1234","actual_bill_config":{"export_name":"dd-actual-export","export_path":"dd-export-path","storage_account":"dd-storage-account","storage_container":"dd-storage-container"},"amortized_bill_config":{"export_name":"dd-actual-export","export_path":"dd-export-path","storage_account":"dd-storage-account","storage_container":"dd-storage-container"},"client_id":"1234abcd-1234-abcd-1234-1234abcd1234","is_enabled":true,"scope":"invalid-scope-format"},"type":"azure_uc_config_post_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"scope\" does not match the required format"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml index bd9036f0cc..209544f68c 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_cloud_cost_management_azure_configs_returns_ok_response.yaml @@ -17,14 +17,14 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config response: body: - string: '{"data": {"type": "azure_uc_configs", "id": 1, "attributes": {"configs": - [{"id": 1, "storage_container": "test_storage_container", "scope": "test_scope", + string: '{"data": {"type": "azure_uc_configs", "id": "1234", "attributes": {"configs": + [{"id": "1234", "storage_container": "test_storage_container", "scope": "test_scope", "status": "active", "account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "client_id": "test_client_id", "storage_account": "test_storage_account", "months": 15, "error_messages": [], "dataset_type": "actual", "status_updated_at": "2023-12-12T17:11:56.855669", "created_at": "2023-12-12T17:11:56.860554", "updated_at": "2023-12-12T17:11:56.860554", "export_name": "test_export_name", - "export_path": "test_export_path"}, {"id": 1, "storage_container": "test_storage_container", + "export_path": "test_export_path"}, {"id": "1234", "storage_container": "test_storage_container", "scope": "test_scope", "status": "active", "account_id": "test_account_id", "client_id": "test_client_id", "storage_account": "test_storage_account", "months": 15, "error_messages": [], "dataset_type": "amortized", "status_updated_at": diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_bad_request_response.frozen new file mode 100644 index 0000000000..3b6ecd6b5d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-08T20:08:03.980Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_bad_request_response.yaml similarity index 59% rename from tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.yaml rename to tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_bad_request_response.yaml index 6d9c89b95c..09b602e8fc 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_bad_request_response.yaml @@ -1,13 +1,11 @@ interactions: - request: - body: '{"data":{"attributes":{"is_enabled":true},"type":"gcp_uc_config_patch_request"}}' + body: null headers: accept: - - application/json - content-type: - - application/json - method: PATCH - uri: https://api.datadoghq.com/api/v2/cost/gcp_uc_config/InvalidValue + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config/invalid response: body: string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..63c0a5681d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-08T20:08:17.363Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..7777164ff0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_aws_cur_config_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config/123456 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_bad_request_response.frozen new file mode 100644 index 0000000000..03a8304542 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-08T20:08:41.632Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_bad_request_response.yaml new file mode 100644 index 0000000000..56d97b22a1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config/invalid + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"cloudAccountId\" in \"path\"; expected type \"int64\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..4ba064ec86 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-08T20:09:03.940Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..9bd55fb9b5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_azure_config_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config/123456 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen index b32e1196f0..00436a3427 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen @@ -1 +1 @@ -2025-06-23T12:26:40.200Z \ No newline at end of file +2025-08-08T20:09:25.227Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_not_found_response.frozen index 41c71ad9f7..1d78c70616 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_not_found_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_delete_cloud_cost_management_gcp_usage_cost_config_returns_not_found_response.frozen @@ -1 +1 @@ -2025-06-23T13:06:22.086Z \ No newline at end of file +2025-08-08T20:09:38.350Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.frozen index 0d8912bb1d..b2fdab5429 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.frozen @@ -1 +1 @@ -2024-07-22T12:40:43.508Z \ No newline at end of file +2025-08-08T20:21:03.815Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.yaml index 537ab6b133..4ca827ec21 100644 --- a/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_no_content_response.yaml @@ -5,13 +5,11 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/cost/custom_costs/9d055d22-a838-4e9f-bc34-a4f9ab66280c + uri: https://api.datadoghq.com/api/v2/cost/custom_costs/1234abcd-1234-abcd-1234-1234abcd1234 response: body: string: '' - headers: - content-type: - - application/vnd.api+json + headers: {} status: code: 204 message: No Content diff --git a/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_not_found_response.frozen new file mode 100644 index 0000000000..7c77ff6cb4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-11T17:51:40.995Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_not_found_response.yaml new file mode 100644 index 0000000000..f4013d3d3e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_custom_costs_file_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/cost/custom_costs/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_not_found_response.frozen new file mode 100644 index 0000000000..7765b26852 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-12T17:46:12.617Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_not_found_response.yaml new file mode 100644 index 0000000000..89b3560f8a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/custom_costs/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"metadata not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.frozen index 198bbdbc3d..1ec346b06f 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.frozen @@ -1 +1 @@ -2024-07-22T12:06:05.860Z \ No newline at end of file +2025-08-08T20:20:45.183Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.yaml index 4092ee9950..ceb11e2a3f 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_custom_costs_file_returns_ok_response.yaml @@ -5,11 +5,10 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/cost/custom_costs/9d055d22-a838-4e9f-bc34-a4f9ab66280c + uri: https://api.datadoghq.com/api/v2/cost/custom_costs/1234abcd-1234-abcd-1234-1234abcd1234 response: body: - string: '{"data":{"id":"9d055d22-a838-4e9f-bc34-a4f9ab66280c","type":"cost_metadata","attributes":{"billed_cost":250,"billing_currency":"USD","charge_period":{"start":1683331200000,"end":1686009600000},"content":[{"BilledCost":250,"BillingCurrency":"USD","ChargeDescription":"my_description","Tags":{"key":"value"},"ProviderName":"my_provider","ChargePeriodStart":"2023-05-06","ChargePeriodEnd":"2023-06-06"}],"name":"data.json","provider_names":["my_provider"],"status":"ACTIVE","uploaded_at":1721322924169,"uploaded_by":{"name":"Julien - Hemery","icon":"https://secure.gravatar.com/avatar/f12684c6ebe1bdd70c36789c5270aac0?d=retro\u0026s=48","email":"julien.hemery@datadoghq.com"}}},"meta":{"version":"1.0"}}' + string: '{"data":{"id":"1234abcd-1234-abcd-1234-1234abcd1234","type":"cost_metadata","attributes":{"billed_cost":250,"billing_currency":"USD","charge_period":{"start":1683331200000,"end":1686009600000},"content":[{"BilledCost":250,"BillingCurrency":"USD","ChargeDescription":"my_description","Tags":{"key":"value"},"ProviderName":"my_provider","ChargePeriodStart":"2023-05-06","ChargePeriodEnd":"2023-06-06"}],"name":"data.json","provider_names":["my_provider"],"status":"PROCESSING","uploaded_at":1754684414611,"uploaded_by":{"name":"frog","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?d=retro\u0026s=48","email":"frog@datadoghq.com"}}},"meta":{"version":"1.0"}}' headers: content-type: - application/vnd.api+json diff --git a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml index 8597b27b1c..0da51a89a5 100644 --- a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_aws_cur_configs_returns_ok_response.yaml @@ -8,7 +8,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config response: body: - string: '{"data": [{"type": "aws_cur_config", "id": 100, "attributes": {"account_id": + string: '{"data": [{"type": "aws_cur_config", "id": "100", "attributes": {"account_id": "000000000000", "bucket_name": "test_bucket_name", "bucket_region": "us-east-1", "report_prefix": "cur-hourly", "report_name": "billing-conductor-cur", "months": 15, "updated_at": "2023-10-27T12:38:39.585408", "created_at": "2023-10-10T13:53:28.774143", diff --git a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml index f21b5e95d3..75d53550d0 100644 --- a/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_list_cloud_cost_management_azure_configs_returns_ok_response.yaml @@ -8,43 +8,43 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config response: body: - string: '{"data": [{"type": "azure_uc_configs", "id": 1, "attributes": {"configs": - [{"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": - "2023-06-29T12:43:36.569819", "storage_container": "test_storage_container", + string: '{"data": [{"type": "azure_uc_configs", "id": "1234", "attributes": + {"configs": [{"id": "1234", "export_name": "test_export_name", "scope": "test_scope", + "created_at": "2023-06-29T12:43:36.569819", "storage_container": "test_storage_container", "status": "active", "updated_at": "2023-06-29T12:43:36.569819", "account_id": "test_account_id", "client_id": "test_client_id", "dataset_type": "actual", "status_updated_at": "2023-11-03T13:48:16.827724", "error_messages": [], "storage_account": "test_storage_account", "months": 15, "export_path": "test_export_path"}, - {"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": + {"id": "1234", "export_name": "test_export_name", "scope": "test_scope", "created_at": "2023-06-29T12:43:36.569819", "storage_container": "test_storage_container", "status": "active", "updated_at": "2023-06-29T12:43:36.569819", "account_id": "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", "status_updated_at": "2023-11-03T13:48:16.827724", "error_messages": [], "storage_account": "test_storage_account", "months": 15, "export_path": "test_export_path"}]}}, - {"type": "azure_uc_configs", "id": 1, "attributes": {"configs": [{"id": 1, - "export_name": "test_export_name", "scope": "test_scope", "created_at": "2023-11-09T16:26:33.859447", - "storage_container": "test_storage_container", "status": "active", "updated_at": - "2023-11-09T16:26:33.859447", "account_id": "test_account_id", "client_id": - "test_client_id", "dataset_type": "actual", "status_updated_at": "2023-11-09T16:26:33.849153", - "storage_account": "test_storage_account", "months": 15, "export_path": "test_export_path"}, - {"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": - "2023-11-09T16:26:33.862026", "storage_container": "test_storage_container", - "status": "active", "updated_at": "2023-11-09T16:26:33.862026", "account_id": - "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", + {"type": "azure_uc_configs", "id": "1234", "attributes": {"configs": [{"id": + "1234", "export_name": "test_export_name", "scope": "test_scope", "created_at": + "2023-11-09T16:26:33.859447", "storage_container": "test_storage_container", + "status": "active", "updated_at": "2023-11-09T16:26:33.859447", "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "actual", "status_updated_at": "2023-11-09T16:26:33.849153", "storage_account": "test_storage_account", - "months": 15, "export_path": "test_export_path"}]}}, {"type": "azure_uc_configs", - "id": 1, "attributes": {"configs": [{"id": 1, "export_name": "test_export_name", - "scope": "test_scope", "created_at": "2023-11-09T20:20:35.959808", "storage_container": - "test_storage_container", "status": "active", "updated_at": "2023-11-09T20:20:35.959808", - "account_id": "test_account_id", "client_id": "test_client_id", "dataset_type": - "actual", "status_updated_at": "2023-11-09T20:20:35.956202", "storage_account": - "test_storage_account", "months": 15, "export_path": "test_export_path"}, - {"id": 1, "export_name": "test_export_name", "scope": "test_scope", "created_at": - "2023-11-09T20:20:35.960815", "storage_container": "test_storage_container", - "status": "active", "updated_at": "2023-11-09T20:20:35.960815", "account_id": - "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", + "months": 15, "export_path": "test_export_path"}, {"id": "1234", "export_name": + "test_export_name", "scope": "test_scope", "created_at": "2023-11-09T16:26:33.862026", + "storage_container": "test_storage_container", "status": "active", "updated_at": + "2023-11-09T16:26:33.862026", "account_id": "test_account_id", "client_id": + "test_client_id", "dataset_type": "amortized", "status_updated_at": "2023-11-09T16:26:33.849153", + "storage_account": "test_storage_account", "months": 15, "export_path": "test_export_path"}]}}, + {"type": "azure_uc_configs", "id": "1234", "attributes": {"configs": [{"id": + "1234", "export_name": "test_export_name", "scope": "test_scope", "created_at": + "2023-11-09T20:20:35.959808", "storage_container": "test_storage_container", + "status": "active", "updated_at": "2023-11-09T20:20:35.959808", "account_id": + "test_account_id", "client_id": "test_client_id", "dataset_type": "actual", "status_updated_at": "2023-11-09T20:20:35.956202", "storage_account": "test_storage_account", - "months": 15, "export_path": "test_export_path"}]}}]}' + "months": 15, "export_path": "test_export_path"}, {"id": "1234", "export_name": + "test_export_name", "scope": "test_scope", "created_at": "2023-11-09T20:20:35.960815", + "storage_container": "test_storage_container", "status": "active", "updated_at": + "2023-11-09T20:20:35.960815", "account_id": "test_account_id", "client_id": + "test_client_id", "dataset_type": "amortized", "status_updated_at": "2023-11-09T20:20:35.956202", + "storage_account": "test_storage_account", "months": 15, "export_path": "test_export_path"}]}}]}' headers: content-type: - application/json diff --git a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_bad_request_response.frozen new file mode 100644 index 0000000000..d9ae1e5225 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T14:33:07.474Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_bad_request_response.yaml new file mode 100644 index 0000000000..fa04016056 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/custom_costs?filter%5Bstatus%5D=not_a_real_filter + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"unknown + status, got not_a_real_filter"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.frozen index 14e85f57fe..a3755f2bd1 100644 --- a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.frozen @@ -1 +1 @@ -2024-07-22T12:06:38.368Z \ No newline at end of file +2025-08-11T14:09:16.499Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.yaml index 66560a55b9..892888c290 100644 --- a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_returns_ok_response.yaml @@ -8,8 +8,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/custom_costs response: body: - string: '{"data":[{"id":"9d055d22-a838-4e9f-bc34-a4f9ab66280c","type":"cost_metadata","attributes":{"billed_cost":250,"billing_currency":"USD","charge_period":{"start":1683331200000,"end":1686009600000},"name":"data.json","provider_names":["my_provider"],"status":"ACTIVE","uploaded_at":1721322924169,"uploaded_by":{"name":"Julien - Hemery","icon":"https://secure.gravatar.com/avatar/f12684c6ebe1bdd70c36789c5270aac0?d=retro\u0026s=48","email":"julien.hemery@datadoghq.com"}}}],"meta":{"version":"1.0","total_filtered_count":766}}' + string: '{"data":[{"id":"1234abcd-1234-abcd-1234-1234abcd1234","type":"cost_metadata","attributes":{"billed_cost":250,"billing_currency":"USD","charge_period":{"start":1683331200000,"end":1686009600000},"name":"data.json","provider_names":["my_provider"],"status":"ACTIVE","uploaded_at":1749848306621,"uploaded_by":{"name":"frog","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?d=retro\u0026s=48","email":"frog@datadoghq.com"}}}],"meta":{"version":"1.0","total_filtered_count":1}}' headers: content-type: - application/vnd.api+json diff --git a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_with_pagination_parameters_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_with_pagination_parameters_returns_ok_response.frozen new file mode 100644 index 0000000000..f24f072fed --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_with_pagination_parameters_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-08T20:11:43.302Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_with_pagination_parameters_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_with_pagination_parameters_returns_ok_response.yaml new file mode 100644 index 0000000000..d950efe428 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_custom_costs_files_with_pagination_parameters_returns_ok_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cost/custom_costs?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=-created_at + response: + body: + string: '{"data":[],"meta":{"version":"1.0","total_filtered_count":1}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml index 50439f6496..63965bbeba 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_aws_cur_config_returns_ok_response.yaml @@ -10,7 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/aws_cur_config/100 response: body: - string: '{"data": [{"type": "aws_cur_config", "id": 100, "attributes": {"account_id": + string: '{"data": [{"type": "aws_cur_config", "id": "100", "attributes": {"account_id": "000000000000", "bucket_name": "test_bucket_name", "bucket_region": "us-east-1", "report_prefix": "cur-report-hourly", "report_name": "cur-hourly", "months": 15, "updated_at": "2023-10-18T08:15:45.265597", "created_at": "2022-07-25T17:19:47.190482", diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml index c0d2005eae..63b506dc9b 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_azure_config_returns_ok_response.yaml @@ -10,14 +10,14 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/azure_uc_config/100 response: body: - string: '{"data": {"type": "azure_uc_configs", "id": 100, "attributes": {"configs": + string: '{"data": {"type": "azure_uc_configs", "id": "100", "attributes": {"configs": [{"updated_at": "2023-06-29T12:43:36.569819", "export_path": "/amortized-cost", - "status": "active", "id": 56, "account_id": "test_account_id", "client_id": + "status": "active", "id": "56", "account_id": "test_account_id", "client_id": "test_client_id", "dataset_type": "amortized", "created_at": "2023-06-29T12:43:36.569819", "export_name": "test_export_name", "scope": "test_scope", "storage_account": "test_storage_account", "storage_container": "test_storage_container", "status_updated_at": "2023-12-13T13:29:24.462039", "months": 15}, {"updated_at": "2023-06-29T12:43:36.569819", - "export_path": "/actual-cost", "status": "active", "id": 55, "account_id": + "export_path": "/actual-cost", "status": "active", "id": "55", "account_id": "test_account_id", "client_id": "test_client_id", "dataset_type": "actual", "created_at": "2023-06-29T12:43:36.569819", "export_name": "test_export_name", "scope": "test_scope", "storage_account": "test_storage_account", "storage_container": diff --git a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen deleted file mode 100644 index 48069d8a58..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_update_cloud_cost_management_gcp_usage_cost_config_returns_bad_request_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-06-23T12:09:03.300Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.frozen b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.frozen index 1a10998b74..b0b4f862ed 100644 --- a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.frozen @@ -1 +1 @@ -2024-07-18T17:15:23.344Z \ No newline at end of file +2025-08-08T20:20:13.698Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.yaml b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.yaml index 91f0b54b28..16a5657bb5 100644 --- a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_accepted_response.yaml @@ -10,8 +10,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/cost/custom_costs response: body: - string: '{"data":{"id":"9d055d22-a838-4e9f-bc34-a4f9ab66280c","type":"cost_metadata","attributes":{"billed_cost":250,"billing_currency":"USD","charge_period":{"start":1683331200000,"end":1686009600000},"name":"data.json","provider_names":["my_provider"],"status":"UPLOADING","uploaded_at":1721322923888,"uploaded_by":{"name":"Julien - Hemery","icon":"https://secure.gravatar.com/avatar/f12684c6ebe1bdd70c36789c5270aac0?d=retro\u0026s=48","email":"julien.hemery@datadoghq.com"}}},"meta":{"version":"1.0"}}' + string: '{"data":{"id":"1234abcd-1234-abcd-1234-1234abcd1234","type":"cost_metadata","attributes":{"billed_cost":250,"billing_currency":"USD","charge_period":{"start":1683331200000,"end":1686009600000},"name":"data.json","provider_names":["my_provider"],"status":"UPLOADING","uploaded_at":1754684413888,"uploaded_by":{"name":"frog","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?d=retro\u0026s=48","email":"frog@datadoghq.com"}}},"meta":{"version":"1.0"}}' headers: content-type: - application/vnd.api+json diff --git a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response.frozen new file mode 100644 index 0000000000..0bd457ff60 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-08T19:58:28.694Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response.yaml new file mode 100644 index 0000000000..4664f65389 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '[{"BilledCost":100.5,"BillingCurrency":"USD","ChargeDescription":"Monthly + usage charge for my service","ChargePeriodEnd":"2023-02-28","ChargePeriodStart":"2023-02-01"}]' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/cost/custom_costs + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"errors in + object 0:\nTags is a required field\nProviderName is a required field","meta":{"end":167,"obj":0,"start":1}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response_empty_file.frozen b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response_empty_file.frozen new file mode 100644 index 0000000000..b3e3041c44 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response_empty_file.frozen @@ -0,0 +1 @@ +2025-08-11T18:38:59.614Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response_empty_file.yaml b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response_empty_file.yaml new file mode 100644 index 0000000000..faa7b48204 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_upload_custom_costs_file_returns_bad_request_response_empty_file.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '[]' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/cost/custom_costs + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Custom cost + file cannot be empty"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index dcd04d3b83..787277d9a4 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/cloud_cost_management.feature @@ -13,14 +13,14 @@ Feature: Cloud Cost Management And a valid "appKeyAuth" key in the system And an instance of "CloudCostManagement" API - @generated @skip @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Create Cloud Cost Management AWS CUR config returns "Bad Request" response Given new "CreateCostAWSCURConfig" request And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}, "account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}} When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Create Cloud Cost Management AWS CUR config returns "OK" response Given new "CreateCostAWSCURConfig" request And body with value {"data": {"attributes": {"account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}} @@ -28,14 +28,21 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.account_id" is equal to "123456789123" - @generated @skip @team:Datadog/cloud-cost-management + @replay-only @team:Datadog/cloud-cost-management Scenario: Create Cloud Cost Management Azure configs returns "Bad Request" response Given new "CreateCostAzureUCConfigs" request - And body with value {"data": {"attributes": {"account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "actual_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "amortized_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "client_id": "1234abcd-1234-abcd-1234-1234abcd1234", "scope": "/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, "type": "azure_uc_config_post_request"}} + And body with value {"data": {"attributes": {"account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "actual_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "amortized_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "client_id": "1234abcd-1234-abcd-1234-1234abcd1234", "is_enabled": true, "scope": "invalid-scope-format"}, "type": "azure_uc_config_post_request"}} When the request is sent Then the response status is 400 Bad Request @replay-only @team:Datadog/cloud-cost-management + Scenario: Create Cloud Cost Management Azure configs returns "Bad Request" response missing required is_enabled field + Given new "CreateCostAzureUCConfigs" request + And body with value {"data": {"attributes": {"account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "actual_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "amortized_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "client_id": "1234abcd-1234-abcd-1234-1234abcd1234", "scope": "/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, "type": "azure_uc_config_post_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/cloud-cost-management Scenario: Create Cloud Cost Management Azure configs returns "OK" response Given new "CreateCostAzureUCConfigs" request And body with value {"data": {"attributes": {"account_id": "1234abcd-1234-abcd-1234-1234abcd1234", "actual_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "amortized_bill_config": {"export_name": "dd-actual-export", "export_path": "dd-export-path", "storage_account": "dd-storage-account", "storage_container": "dd-storage-container"}, "client_id": "1234abcd-1234-abcd-1234-1234abcd1234", "is_enabled": true, "scope": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"}, "type": "azure_uc_config_post_request"}} @@ -50,7 +57,7 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Create Cloud Cost Management GCP Usage Cost config returns "OK" response Given new "CreateCostGCPUsageCostConfig" request And body with value {"data": {"attributes": {"billing_account_id": "123456_A123BC_12AB34", "bucket_name": "dd-cost-bucket", "export_dataset_name": "billing", "export_prefix": "datadog_cloud_cost_usage_export", "export_project_name": "dd-cloud-cost-report", "service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com"}, "type": "gcp_uc_config_post_request"}} @@ -86,17 +93,17 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management AWS CUR config returns "No Content" response Given new "DeleteCostAWSCURConfig" request - And request contains "cloud_account_id" parameter with value "100" + And request contains "cloud_account_id" parameter with value 100 When the request is sent Then the response status is 204 No Content - @generated @skip @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management AWS CUR config returns "Not Found" response Given new "DeleteCostAWSCURConfig" request - And request contains "cloud_account_id" parameter from "REPLACE.ME" + And request contains "cloud_account_id" parameter with value 123456 When the request is sent Then the response status is 404 Not Found @@ -107,54 +114,54 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management Azure config returns "No Content" response Given new "DeleteCostAzureUCConfig" request - And request contains "cloud_account_id" parameter with value "100" + And request contains "cloud_account_id" parameter with value 100 When the request is sent Then the response status is 204 No Content - @generated @skip @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management Azure config returns "Not Found" response Given new "DeleteCostAzureUCConfig" request - And request contains "cloud_account_id" parameter from "REPLACE.ME" + And request contains "cloud_account_id" parameter with value 123456 When the request is sent Then the response status is 404 Not Found - @team:Datadog/cloud-cost-management + @generated @skip @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management GCP Usage Cost config returns "Bad Request" response Given new "DeleteCostGCPUsageCostConfig" request - And request contains "cloud_account_id" parameter with value "Invalid" + And request contains "cloud_account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response Given new "DeleteCostGCPUsageCostConfig" request - And request contains "cloud_account_id" parameter with value "100" + And request contains "cloud_account_id" parameter with value 100 When the request is sent Then the response status is 204 No Content @team:Datadog/cloud-cost-management Scenario: Delete Cloud Cost Management GCP Usage Cost config returns "Not Found" response Given new "DeleteCostGCPUsageCostConfig" request - And request contains "cloud_account_id" parameter with value "123456" + And request contains "cloud_account_id" parameter with value 123456 When the request is sent Then the response status is 404 Not Found @replay-only @team:Datadog/cloud-cost-management - Scenario: Delete Custom Costs File returns "No Content" response + Scenario: Delete Custom Costs file returns "No Content" response Given new "DeleteCustomCostsFile" request - And request contains "file_id" parameter with value "9d055d22-a838-4e9f-bc34-a4f9ab66280c" + And request contains "file_id" parameter with value "9ed1a245-8291-44de-9f59-1dc87975ca4a" When the request is sent Then the response status is 204 No Content - @generated @skip @team:Datadog/cloud-cost-management - Scenario: Delete Custom Costs file returns "No Content" response + @team:Datadog/cloud-cost-management + Scenario: Delete Custom Costs file returns "Not Found" response Given new "DeleteCustomCostsFile" request - And request contains "file_id" parameter from "REPLACE.ME" + And request contains "file_id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent - Then the response status is 204 No Content + Then the response status is 404 Not Found @team:Datadog/cloud-cost-management Scenario: Delete a budget returns "Bad Request" response @@ -170,21 +177,21 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 No Content - @replay-only @team:Datadog/cloud-cost-management - Scenario: Get Custom Costs File returns "OK" response + @team:Datadog/cloud-cost-management + Scenario: Get Custom Costs file returns "Not Found" response Given new "GetCustomCostsFile" request - And request contains "file_id" parameter with value "9d055d22-a838-4e9f-bc34-a4f9ab66280c" + And request contains "file_id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent - Then the response status is 200 OK - And the response "data.attributes.name" is equal to "data.json" - And the response "data.attributes.content[0].ChargeDescription" is equal to "my_description" + Then the response status is 404 Not Found - @generated @skip @team:Datadog/cloud-cost-management + @replay-only @team:Datadog/cloud-cost-management Scenario: Get Custom Costs file returns "OK" response Given new "GetCustomCostsFile" request - And request contains "file_id" parameter from "REPLACE.ME" + And request contains "file_id" parameter with value "9ed1a245-8291-44de-9f59-1dc87975ca4a" When the request is sent Then the response status is 200 OK + And the response "data.attributes.name" is equal to "data.json" + And the response "data.attributes.content[0].ChargeDescription" is equal to "my_description" @generated @skip @team:Datadog/cloud-cost-management Scenario: Get a budget returns "Bad Request" response @@ -207,14 +214,14 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: List Cloud Cost Management AWS CUR configs returns "OK" response Given new "ListCostAWSCURConfigs" request When the request is sent Then the response status is 200 OK And the response "data[0].attributes.bucket_name" is equal to "test_bucket_name" - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: List Cloud Cost Management Azure configs returns "OK" response Given new "ListCostAzureUCConfigs" request When the request is sent @@ -226,17 +233,30 @@ Feature: Cloud Cost Management Given new "ListCostGCPUsageCostConfigs" request When the request is sent Then the response status is 200 OK + And the response "data" is equal to [] - @replay-only @team:Datadog/cloud-cost-management - Scenario: List Custom Costs Files returns "OK" response + @team:Datadog/cloud-cost-management + Scenario: List Custom Costs files returns "Bad Request" response + Given new "ListCustomCostsFiles" request + And request contains "filter[status]" parameter with value "not_a_real_filter" + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/cloud-cost-management + Scenario: List Custom Costs files returns "OK" response Given new "ListCustomCostsFiles" request When the request is sent Then the response status is 200 OK + And the response "data" has length 1 + And the response "meta.version" is equal to "1.0" And the response "data[0].attributes.name" is equal to "data.json" - @generated @skip @team:Datadog/cloud-cost-management - Scenario: List Custom Costs files returns "OK" response + @team:Datadog/cloud-cost-management + Scenario: List Custom Costs files with pagination parameters returns "OK" response Given new "ListCustomCostsFiles" request + And request contains "page[number]" parameter with value 1 + And request contains "page[size]" parameter with value 10 + And request contains "sort" parameter with value "-created_at" When the request is sent Then the response status is 200 OK @@ -246,10 +266,10 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "OK" response Given new "UpdateCostAWSCURConfig" request - And request contains "cloud_account_id" parameter with value "100" + And request contains "cloud_account_id" parameter with value 100 And body with value {"data": {"attributes": {"is_enabled": true}, "type": "aws_cur_config_patch_request"}} When the request is sent Then the response status is 200 OK @@ -263,19 +283,19 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management Azure config returns "OK" response Given new "UpdateCostAzureUCConfigs" request - And request contains "cloud_account_id" parameter with value "100" + And request contains "cloud_account_id" parameter with value 100 And body with value {"data": {"attributes": {"is_enabled": true}, "type": "azure_uc_config_patch_request"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "azure_uc_configs" - @team:Datadog/cloud-cost-management + @generated @skip @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management GCP Usage Cost config returns "Bad Request" response Given new "UpdateCostGCPUsageCostConfig" request - And request contains "cloud_account_id" parameter with value "InvalidValue" + And request contains "cloud_account_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"is_enabled": true}, "type": "gcp_uc_config_patch_request"}} When the request is sent Then the response status is 400 Bad Request @@ -283,31 +303,39 @@ Feature: Cloud Cost Management @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management GCP Usage Cost config returns "Not Found" response Given new "UpdateCostGCPUsageCostConfig" request - And request contains "cloud_account_id" parameter with value "12345678" + And request contains "cloud_account_id" parameter with value 12345678 And body with value {"data": {"attributes": {"is_enabled": true}, "type": "gcp_uc_config_patch_request"}} When the request is sent Then the response status is 404 Not Found - @replay-only @team:Datadog/cloud-cost-management + @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management GCP Usage Cost config returns "OK" response Given new "UpdateCostGCPUsageCostConfig" request - And request contains "cloud_account_id" parameter with value "100" + And request contains "cloud_account_id" parameter with value 100 And body with value {"data": {"attributes": {"is_enabled": true}, "type": "gcp_uc_config_patch_request"}} When the request is sent Then the response status is 200 OK And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34" - @replay-only @team:Datadog/cloud-cost-management - Scenario: Upload Custom Costs File returns "Accepted" response + @team:Datadog/cloud-cost-management + Scenario: Upload Custom Costs file returns "Accepted" response Given new "UploadCustomCostsFile" request And body with value [{ "ProviderName": "my_provider", "ChargePeriodStart": "2023-05-06", "ChargePeriodEnd": "2023-06-06","ChargeDescription": "my_description","BilledCost": 250,"BillingCurrency": "USD","Tags": {"key": "value"}}] When the request is sent Then the response status is 202 Accepted And the response "data.attributes.name" is equal to "data.json" + And the response "data.type" is equal to "cost_metadata" - @generated @skip @team:Datadog/cloud-cost-management - Scenario: Upload Custom Costs file returns "Accepted" response + @team:Datadog/cloud-cost-management + Scenario: Upload Custom Costs file returns "Bad Request" response Given new "UploadCustomCostsFile" request And body with value [{"BilledCost": 100.5, "BillingCurrency": "USD", "ChargeDescription": "Monthly usage charge for my service", "ChargePeriodEnd": "2023-02-28", "ChargePeriodStart": "2023-02-01"}] When the request is sent - Then the response status is 202 Accepted + Then the response status is 400 Bad Request + + @team:Datadog/cloud-cost-management + Scenario: Upload Custom Costs file returns "Bad Request" response, empty file + Given new "UploadCustomCostsFile" request + And body with value [] + When the request is sent + Then the response status is 400 Bad Request