diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c9fb359c525b..dea42b6a3110 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -16267,6 +16267,224 @@ components: type: string x-enum-varnames: - GCP_SERVICE_ACCOUNT + GCPUsageCostConfig: + description: GCP Usage Cost config. + properties: + attributes: + $ref: '#/components/schemas/GCPUsageCostConfigAttributes' + id: + description: The ID of the GCP Usage Cost config. + type: string + type: + $ref: '#/components/schemas/GCPUsageCostConfigType' + required: + - attributes + - type + type: object + x-merge-override: + required: false + GCPUsageCostConfigAttributes: + description: Attributes for a GCP Usage Cost config. + properties: + account_id: + description: The GCP account ID. + example: 123456_A123BC_12AB34 + type: string + bucket_name: + description: The GCP bucket name used to store the Usage Cost export. + example: dd-cost-bucket + type: string + created_at: + description: The timestamp when the GCP Usage Cost config was created. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + x-merge-override: + format: false + dataset: + description: The export dataset name used for the GCP Usage Cost Report. + example: billing + type: string + error_messages: + description: The error messages for the GCP Usage Cost config. + items: + type: string + nullable: true + type: array + export_prefix: + description: The export prefix used for the GCP Usage Cost Report. + example: datadog_cloud_cost_usage_export + type: string + export_project_name: + description: The name of the GCP Usage Cost Report. + example: dd-cloud-cost-report + type: string + months: + deprecated: true + description: The number of months the report has been backfilled. + format: int32 + maximum: 36 + type: integer + project_id: + description: The `project_id` of the GCP Usage Cost report. + example: my-project-123 + type: string + service_account: + description: The unique GCP service account email. + example: dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com + type: string + status: + description: The status of the GCP Usage Cost config. + example: active + type: string + status_updated_at: + description: The timestamp when the GCP Usage Cost config status was updated. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + x-merge-override: + format: false + updated_at: + description: The timestamp when the GCP Usage Cost config status was updated. + pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}$ + type: string + x-merge-override: + format: false + required: + - account_id + - bucket_name + - dataset + - export_prefix + - export_project_name + - service_account + - status + type: object + x-merge-override: + required: false + GCPUsageCostConfigPatchData: + description: GCP Usage Cost config patch data. + properties: + attributes: + $ref: '#/components/schemas/GCPUsageCostConfigPatchRequestAttributes' + type: + $ref: '#/components/schemas/GCPUsageCostConfigPatchRequestType' + required: + - attributes + - type + type: object + x-merge-override: + required: false + GCPUsageCostConfigPatchRequest: + description: GCP Usage Cost config patch request. + properties: + data: + $ref: '#/components/schemas/GCPUsageCostConfigPatchData' + required: + - data + type: object + GCPUsageCostConfigPatchRequestAttributes: + description: Attributes for GCP Usage Cost config patch request. + properties: + is_enabled: + description: Whether or not the Cloud Cost Management account is enabled. + example: true + type: boolean + required: + - is_enabled + type: object + GCPUsageCostConfigPatchRequestType: + default: gcp_uc_config_patch_request + description: Type of GCP Usage Cost config patch request. + enum: + - gcp_uc_config_patch_request + example: gcp_uc_config_patch_request + type: string + x-enum-varnames: + - GCP_USAGE_COST_CONFIG_PATCH_REQUEST + GCPUsageCostConfigPostData: + description: GCP Usage Cost config post data. + properties: + attributes: + $ref: '#/components/schemas/GCPUsageCostConfigPostRequestAttributes' + type: + $ref: '#/components/schemas/GCPUsageCostConfigPostRequestType' + required: + - attributes + - type + type: object + GCPUsageCostConfigPostRequest: + description: GCP Usage Cost config post request. + properties: + data: + $ref: '#/components/schemas/GCPUsageCostConfigPostData' + required: + - data + type: object + GCPUsageCostConfigPostRequestAttributes: + description: Attributes for GCP Usage Cost config post request. + properties: + billing_account_id: + description: The GCP account ID. + example: 123456_A123BC_12AB34 + type: string + bucket_name: + description: The GCP bucket name used to store the Usage Cost export. + example: dd-cost-bucket + type: string + export_dataset_name: + description: The export dataset name used for the GCP Usage Cost report. + example: billing + type: string + export_prefix: + description: The export prefix used for the GCP Usage Cost report. + example: datadog_cloud_cost_usage_export + type: string + export_project_name: + description: The name of the GCP Usage Cost report. + example: dd-cloud-cost-report + type: string + service_account: + description: The unique GCP service account email. + example: dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com + type: string + required: + - billing_account_id + - bucket_name + - export_project_name + - export_dataset_name + - service_account + type: object + GCPUsageCostConfigPostRequestType: + default: gcp_uc_config_post_request + description: Type of GCP Usage Cost config post request. + enum: + - gcp_uc_config_post_request + example: gcp_usage_cost_config_post_request + type: string + x-enum-varnames: + - GCP_USAGE_COST_CONFIG_POST_REQUEST + GCPUsageCostConfigResponse: + description: Response of GCP Usage Cost config. + properties: + data: + $ref: '#/components/schemas/GCPUsageCostConfig' + type: object + GCPUsageCostConfigType: + default: gcp_uc_config + description: Type of GCP Usage Cost config. + enum: + - gcp_uc_config + example: gcp_uc_config + type: string + x-enum-varnames: + - GCP_UC_CONFIG + GCPUsageCostConfigsResponse: + description: List of GCP Usage Cost configs. + properties: + data: + description: A GCP Usage Cost config. + items: + $ref: '#/components/schemas/GCPUsageCostConfig' + type: array + type: object GetActionConnectionResponse: description: The response for found connection properties: @@ -47050,6 +47268,176 @@ paths: x-menu-order: 12 x-undo: type: safe + /api/v2/cost/gcp_uc_config: + get: + description: List the GCP Usage Cost configs. + operationId: ListCostGCPUsageCostConfigs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GCPUsageCostConfigsResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management GCP Usage Cost configs + tags: + - Cloud Cost Management + x-menu-order: 1 + x-permission: + operator: OR + permissions: + - cloud_cost_management_read + x-undo: + type: safe + post: + description: Create a Cloud Cost Management account for an GCP Usage Cost config. + operationId: CreateCostGCPUsageCostConfig + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GCPUsageCostConfigPostRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GCPUsageCostConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Create Cloud Cost Management GCP Usage Cost config + tags: + - Cloud Cost Management + x-menu-order: 3 + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + x-undo: + type: idempotent + /api/v2/cost/gcp_uc_config/{cloud_account_id}: + delete: + description: Archive a Cloud Cost Management account. + operationId: DeleteCostGCPUsageCostConfig + parameters: + - $ref: '#/components/parameters/CloudAccountID' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Delete Cloud Cost Management GCP Usage Cost config + tags: + - Cloud Cost Management + x-menu-order: 4 + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + x-undo: + type: idempotent + patch: + description: Update the status of an GCP Usage Cost config (active/archived). + operationId: UpdateCostGCPUsageCostConfig + parameters: + - $ref: '#/components/parameters/CloudAccountID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GCPUsageCostConfigPatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GCPUsageCostConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + 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: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Update Cloud Cost Management GCP Usage Cost config + tags: + - Cloud Cost Management + x-menu-order: 2 + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + x-undo: + type: idempotent /api/v2/cost_by_tag/active_billing_dimensions: get: description: Get active billing dimensions for cost attribution. Cost data for @@ -67465,8 +67853,8 @@ tags: for more information. name: Case Management - description: The Cloud Cost Management API allows you to set up, edit, and delete - Cloud Cost Management accounts for AWS and Azure. You can query your cost data - by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) + Cloud Cost Management accounts for AWS, Azure, and GCP. You can query your cost + data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). name: Cloud Cost Management diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2453429844/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2453429844/frozen.json new file mode 100644 index 000000000000..40596354e0a3 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2453429844/frozen.json @@ -0,0 +1 @@ +"2025-06-23T13:03:22.482Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2453429844/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2453429844/recording.har new file mode 100644 index 000000000000..67c760cb97c9 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2453429844/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Create Cloud Cost Management GCP Usage Cost config returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "bd40f832e95d6d57a92d0f313352a7eb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 305, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 581, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\":\"InvalidServiceAccount\"},\"type\":\"gcp_uc_config_post_request\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config" + }, + "response": { + "bodySize": 77, + "content": { + "mimeType": "application/vnd.api+json", + "size": 77, + "text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"not a valid service_account\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-23T13:03:22.487Z", + "time": 99 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_588652554/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_588652554/frozen.json new file mode 100644 index 000000000000..de04d7c36f92 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_588652554/frozen.json @@ -0,0 +1 @@ +"2025-06-16T17:46:53.205Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_588652554/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_588652554/recording.har new file mode 100644 index 000000000000..caa376de226e --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Create-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_588652554/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Create Cloud Cost Management GCP Usage Cost config returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "815ffd1456b78f077739a253f22dbd0f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 345, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 579, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"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\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config" + }, + "response": { + "bodySize": 760, + "content": { + "mimeType": "application/vnd.api+json", + "size": 760, + "text": "{\"data\":{\"id\":\"0\",\"type\":\"gcp_uc_config\",\"attributes\":{\"account_id\":\"123456_A123BC_12AB34\",\"bucket_name\":\"dd-cost-bucket\",\"created_at\":\"2025-03-24T21:00:03.851717\",\"dataset\":\"billing\",\"error_messages\":null,\"export_prefix\":\"datadog_cloud_cost_usage_export\",\"export_project_name\":\"dd-cloud-cost-report\",\"months\":15,\"project_id\":\"\",\"service_account\":\"dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com\",\"status\":\"active\",\"status_updated_at\":\"2025-05-09T21:01:48.748281\",\"updated_at\":\"2025-03-24T21:00:03.851717\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 667, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-16T17:46:53.208Z", + "time": 3037 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2104218417/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2104218417/frozen.json new file mode 100644 index 000000000000..a89f665fdb61 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2104218417/frozen.json @@ -0,0 +1 @@ +"2025-06-23T12:26:40.200Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2104218417/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2104218417/recording.har new file mode 100644 index 000000000000..7877eaeba964 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2104218417/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Delete Cloud Cost Management GCP Usage Cost config returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "656feb534e0db0d30b3e0a84fbf8ff9f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 523, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config/Invalid" + }, + "response": { + "bodySize": 142, + "content": { + "mimeType": "application/vnd.api+json", + "size": 142, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"cloudAccountId\\\" in \\\"path\\\"; expected type \\\"int64\\\"\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-23T12:26:40.203Z", + "time": 1036 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-No-Content-response_3926345349/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-No-Content-response_3926345349/frozen.json new file mode 100644 index 000000000000..90212fd9f5e1 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-No-Content-response_3926345349/frozen.json @@ -0,0 +1 @@ +"2025-06-13T20:58:16.900Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-No-Content-response_3926345349/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-No-Content-response_3926345349/recording.har new file mode 100644 index 000000000000..f87b8db3c4bc --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-No-Content-response_3926345349/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Delete Cloud Cost Management GCP Usage Cost config returns \"No Content\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "9794274f737cd4d0111e32f575e186ca", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 521, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config/100" + }, + "response": { + "bodySize": 49, + "content": { + "mimeType": "application/vnd.api+json", + "size": 50, + "text": "{\"errors\":[{\"status\":\"204\",\"title\":\"No Content\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-06-13T20:58:16.902Z", + "time": 84 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_909909786/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_909909786/frozen.json new file mode 100644 index 000000000000..2cefd71c0c93 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_909909786/frozen.json @@ -0,0 +1 @@ +"2025-06-23T13:06:22.086Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_909909786/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_909909786/recording.har new file mode 100644 index 000000000000..fba814aa3913 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Delete-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_909909786/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Delete Cloud Cost Management GCP Usage Cost config returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "4e76b4948fb09c220fb12be79ab8e22a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config/123456" + }, + "response": { + "bodySize": 49, + "content": { + "mimeType": "application/vnd.api+json", + "size": 49, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-06-23T13:06:22.089Z", + "time": 102 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/List-Cloud-Cost-Management-GCP-Usage-Cost-configs-returns-OK-response_436501127/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/List-Cloud-Cost-Management-GCP-Usage-Cost-configs-returns-OK-response_436501127/frozen.json new file mode 100644 index 000000000000..69656b67bb43 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/List-Cloud-Cost-Management-GCP-Usage-Cost-configs-returns-OK-response_436501127/frozen.json @@ -0,0 +1 @@ +"2025-06-23T13:07:11.537Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/List-Cloud-Cost-Management-GCP-Usage-Cost-configs-returns-OK-response_436501127/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/List-Cloud-Cost-Management-GCP-Usage-Cost-configs-returns-OK-response_436501127/recording.har new file mode 100644 index 000000000000..7484c81b74fd --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/List-Cloud-Cost-Management-GCP-Usage-Cost-configs-returns-OK-response_436501127/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/List Cloud Cost Management GCP Usage Cost configs returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "95ae0db6cd9191b09f1a0075a418f650", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 526, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config" + }, + "response": { + "bodySize": 11, + "content": { + "mimeType": "application/vnd.api+json", + "size": 11, + "text": "{\"data\":[]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 664, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-23T13:07:11.540Z", + "time": 90 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2542521959/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2542521959/frozen.json new file mode 100644 index 000000000000..b9157db064db --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2542521959/frozen.json @@ -0,0 +1 @@ +"2025-06-23T12:09:03.300Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2542521959/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2542521959/recording.har new file mode 100644 index 000000000000..846fde336f7c --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Bad-Request-response_2542521959/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Update Cloud Cost Management GCP Usage Cost config returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "1da33032125b394ac6d64d533fec7e00", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 80, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true},\"type\":\"gcp_uc_config_patch_request\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config/InvalidValue" + }, + "response": { + "bodySize": 142, + "content": { + "mimeType": "application/vnd.api+json", + "size": 142, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"cloudAccountId\\\" in \\\"path\\\"; expected type \\\"int64\\\"\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-06-23T12:09:03.304Z", + "time": 1557 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_2127364288/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_2127364288/frozen.json new file mode 100644 index 000000000000..533d60336e47 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_2127364288/frozen.json @@ -0,0 +1 @@ +"2025-06-23T12:09:42.232Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_2127364288/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_2127364288/recording.har new file mode 100644 index 000000000000..179d584e68c4 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-Not-Found-response_2127364288/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Update Cloud Cost Management GCP Usage Cost config returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "cc4c02b9729a6fdb16b191ab02851fb7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 80, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 590, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true},\"type\":\"gcp_uc_config_patch_request\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config/12345678" + }, + "response": { + "bodySize": 113, + "content": { + "mimeType": "application/vnd.api+json", + "size": 113, + "text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"rpc error: code = NotFound desc = cloud account '\ufffd' not found\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-06-23T12:09:42.235Z", + "time": 380 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_4016210051/frozen.json b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_4016210051/frozen.json new file mode 100644 index 000000000000..c640deb2b76a --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_4016210051/frozen.json @@ -0,0 +1 @@ +"2025-06-16T19:07:00.082Z" diff --git a/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_4016210051/recording.har b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_4016210051/recording.har new file mode 100644 index 000000000000..7de540730b37 --- /dev/null +++ b/cassettes/v2/Cloud-Cost-Management_4135329986/Update-Cloud-Cost-Management-GCP-Usage-Cost-config-returns-OK-response_4016210051/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Cloud Cost Management/Update Cloud Cost Management GCP Usage Cost config returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "4791b2719a72d972c851305d33a4e62c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 80, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 585, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true},\"type\":\"gcp_uc_config_patch_request\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/cost/gcp_uc_config/100" + }, + "response": { + "bodySize": 569, + "content": { + "mimeType": "application/vnd.api+json", + "size": 569, + "text": "{\"data\":{\"id\":\"100\",\"type\":\"gcp_uc_config\",\"attributes\":{\"account_id\":\"123456_A123BC_12AB34\",\"bucket_name\":\"dd-cloud-cost-management\",\"created_at\":\"2024-04-29T13:10:37.514046\",\"dataset\":\"billing\",\"error_messages\":null,\"export_prefix\":\"datadog_cloud_cost\",\"export_project_name\":\"datadog-cloud-cost\",\"months\":15,\"project_id\":\"\",\"service_account\":\"test@datadoghq.com\",\"status\":\"active\",\"status_updated_at\":\"2025-06-14T00:50:28.556876\",\"updated_at\":\"2025-06-14T00:50:28.556873\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 666, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-06-16T19:07:00.086Z", + "time": 127 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 4c318851014b..dcd04d3b83af 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -1,8 +1,8 @@ @endpoint(cloud-cost-management) @endpoint(cloud-cost-management-v2) Feature: Cloud Cost Management The Cloud Cost Management API allows you to set up, edit, and delete Cloud - Cost Management accounts for AWS and Azure. You can query your cost data - by using the [Metrics + Cost Management accounts for AWS, Azure, and GCP. You can query your cost + data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries- data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management @@ -43,6 +43,21 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.configs[0].account_id" is equal to "1234abcd-1234-abcd-1234-1234abcd1234" + @team:Datadog/cloud-cost-management + Scenario: Create Cloud Cost Management GCP Usage Cost config returns "Bad Request" 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": "InvalidServiceAccount"}, "type": "gcp_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 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"}} + 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" + @generated @skip @team:Datadog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request @@ -106,6 +121,27 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found + @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" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @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" + 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" + 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 Given new "DeleteCustomCostsFile" request @@ -185,6 +221,12 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data[0].attributes.configs[0].export_name" is equal to "test_export_name" + @team:Datadog/cloud-cost-management + Scenario: List Cloud Cost Management GCP Usage Cost configs returns "OK" response + Given new "ListCostGCPUsageCostConfigs" request + When the request is sent + Then the response status is 200 OK + @replay-only @team:Datadog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" request @@ -230,6 +272,31 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.type" is equal to "azure_uc_configs" + @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 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 + + @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 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 + 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 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 Given new "UploadCustomCostsFile" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 94da85dc26c3..a67059cda875 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -730,6 +730,30 @@ "type": "safe" } }, + "ListCostGCPUsageCostConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "CreateCostGCPUsageCostConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "DeleteCostGCPUsageCostConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateCostGCPUsageCostConfig": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 4cf25c7c8cae..54c8111f54e9 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -4191,6 +4191,34 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "{}", }, + "CloudCostManagementApi.V2.ListCostGCPUsageCostConfigs": { + operationResponseType: "GCPUsageCostConfigsResponse", + }, + "CloudCostManagementApi.V2.CreateCostGCPUsageCostConfig": { + body: { + type: "GCPUsageCostConfigPostRequest", + format: "", + }, + operationResponseType: "GCPUsageCostConfigResponse", + }, + "CloudCostManagementApi.V2.DeleteCostGCPUsageCostConfig": { + cloudAccountId: { + type: "string", + format: "", + }, + operationResponseType: "{}", + }, + "CloudCostManagementApi.V2.UpdateCostGCPUsageCostConfig": { + cloudAccountId: { + type: "string", + format: "", + }, + body: { + type: "GCPUsageCostConfigPatchRequest", + format: "", + }, + operationResponseType: "GCPUsageCostConfigResponse", + }, "UsageMeteringApi.V2.GetActiveBillingDimensions": { operationResponseType: "ActiveBillingDimensionsResponse", }, diff --git a/services/cloud_cost_management/README.md b/services/cloud_cost_management/README.md index 3d292e8d06c9..474a95fa6266 100644 --- a/services/cloud_cost_management/README.md +++ b/services/cloud_cost_management/README.md @@ -2,7 +2,7 @@ ## Description -The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). +The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and GCP. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). ## Navigation diff --git a/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts b/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts index b2ee50cc57b0..480861cf3b17 100644 --- a/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts +++ b/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts @@ -37,6 +37,10 @@ import { CustomCostsFileGetResponse } from "./models/CustomCostsFileGetResponse" import { CustomCostsFileLineItem } from "./models/CustomCostsFileLineItem"; import { CustomCostsFileListResponse } from "./models/CustomCostsFileListResponse"; import { CustomCostsFileUploadResponse } from "./models/CustomCostsFileUploadResponse"; +import { GCPUsageCostConfigPatchRequest } from "./models/GCPUsageCostConfigPatchRequest"; +import { GCPUsageCostConfigPostRequest } from "./models/GCPUsageCostConfigPostRequest"; +import { GCPUsageCostConfigResponse } from "./models/GCPUsageCostConfigResponse"; +import { GCPUsageCostConfigsResponse } from "./models/GCPUsageCostConfigsResponse"; import { version } from "../version"; export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory { @@ -150,6 +154,57 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async createCostGCPUsageCostConfig( + body: GCPUsageCostConfigPostRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createCostGCPUsageCostConfig"); + } + + // Path Params + const localVarPath = "/api/v2/cost/gcp_uc_config"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CloudCostManagementApi.v2.createCostGCPUsageCostConfig", + CloudCostManagementApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "GCPUsageCostConfigPostRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteBudget( budgetId: string, _options?: Configuration, @@ -287,6 +342,52 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async deleteCostGCPUsageCostConfig( + cloudAccountId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'cloudAccountId' is not null or undefined + if (cloudAccountId === null || cloudAccountId === undefined) { + throw new RequiredError("cloudAccountId", "deleteCostGCPUsageCostConfig"); + } + + // Path Params + const localVarPath = + "/api/v2/cost/gcp_uc_config/{cloud_account_id}".replace( + "{cloud_account_id}", + encodeURIComponent(String(cloudAccountId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CloudCostManagementApi.v2.deleteCostGCPUsageCostConfig", + CloudCostManagementApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteCustomCostsFile( fileId: string, _options?: Configuration, @@ -528,6 +629,42 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async listCostGCPUsageCostConfigs( + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/cost/gcp_uc_config"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CloudCostManagementApi.v2.listCostGCPUsageCostConfigs", + CloudCostManagementApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listCustomCostsFiles( _options?: Configuration, ): Promise { @@ -686,6 +823,67 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async updateCostGCPUsageCostConfig( + cloudAccountId: string, + body: GCPUsageCostConfigPatchRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'cloudAccountId' is not null or undefined + if (cloudAccountId === null || cloudAccountId === undefined) { + throw new RequiredError("cloudAccountId", "updateCostGCPUsageCostConfig"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateCostGCPUsageCostConfig"); + } + + // Path Params + const localVarPath = + "/api/v2/cost/gcp_uc_config/{cloud_account_id}".replace( + "{cloud_account_id}", + encodeURIComponent(String(cloudAccountId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CloudCostManagementApi.v2.updateCostGCPUsageCostConfig", + CloudCostManagementApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PATCH, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "GCPUsageCostConfigPatchRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async uploadCustomCostsFile( body: Array, _options?: Configuration, @@ -910,6 +1108,66 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createCostGCPUsageCostConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async createCostGCPUsageCostConfig( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GCPUsageCostConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GCPUsageCostConfigResponse", + ) as GCPUsageCostConfigResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GCPUsageCostConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GCPUsageCostConfigResponse", + "", + ) as GCPUsageCostConfigResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1051,6 +1309,55 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteCostGCPUsageCostConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteCostGCPUsageCostConfig( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1376,6 +1683,62 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listCostGCPUsageCostConfigs + * @throws ApiException if the response code was not in [200, 299] + */ + public async listCostGCPUsageCostConfigs( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GCPUsageCostConfigsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GCPUsageCostConfigsResponse", + ) as GCPUsageCostConfigsResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GCPUsageCostConfigsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GCPUsageCostConfigsResponse", + "", + ) as GCPUsageCostConfigsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1548,6 +1911,67 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateCostGCPUsageCostConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateCostGCPUsageCostConfig( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GCPUsageCostConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GCPUsageCostConfigResponse", + ) as GCPUsageCostConfigResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GCPUsageCostConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GCPUsageCostConfigResponse", + "", + ) as GCPUsageCostConfigResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1679,6 +2103,13 @@ export interface CloudCostManagementApiCreateCostAzureUCConfigsRequest { body: AzureUCConfigPostRequest; } +export interface CloudCostManagementApiCreateCostGCPUsageCostConfigRequest { + /** + * @type GCPUsageCostConfigPostRequest + */ + body: GCPUsageCostConfigPostRequest; +} + export interface CloudCostManagementApiDeleteBudgetRequest { /** * Budget id. @@ -1703,6 +2134,14 @@ export interface CloudCostManagementApiDeleteCostAzureUCConfigRequest { cloudAccountId: string; } +export interface CloudCostManagementApiDeleteCostGCPUsageCostConfigRequest { + /** + * Cloud Account id. + * @type string + */ + cloudAccountId: string; +} + export interface CloudCostManagementApiDeleteCustomCostsFileRequest { /** * File ID. @@ -1751,6 +2190,18 @@ export interface CloudCostManagementApiUpdateCostAzureUCConfigsRequest { body: AzureUCConfigPatchRequest; } +export interface CloudCostManagementApiUpdateCostGCPUsageCostConfigRequest { + /** + * Cloud Account id. + * @type string + */ + cloudAccountId: string; + /** + * @type GCPUsageCostConfigPatchRequest + */ + body: GCPUsageCostConfigPatchRequest; +} + export interface CloudCostManagementApiUploadCustomCostsFileRequest { /** * @type Array @@ -1829,6 +2280,27 @@ export class CloudCostManagementApi { }); } + /** + * Create a Cloud Cost Management account for an GCP Usage Cost config. + * @param param The request object + */ + public createCostGCPUsageCostConfig( + param: CloudCostManagementApiCreateCostGCPUsageCostConfigRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.createCostGCPUsageCostConfig(param.body, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createCostGCPUsageCostConfig( + responseContext, + ); + }); + }); + } + /** * Delete a budget. * @param param The request object @@ -1894,6 +2366,30 @@ export class CloudCostManagementApi { }); } + /** + * Archive a Cloud Cost Management account. + * @param param The request object + */ + public deleteCostGCPUsageCostConfig( + param: CloudCostManagementApiDeleteCostGCPUsageCostConfigRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.deleteCostGCPUsageCostConfig( + param.cloudAccountId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteCostGCPUsageCostConfig( + responseContext, + ); + }); + }); + } + /** * Delete the specified Custom Costs file. * @param param The request object @@ -2008,6 +2504,26 @@ export class CloudCostManagementApi { }); } + /** + * List the GCP Usage Cost configs. + * @param param The request object + */ + public listCostGCPUsageCostConfigs( + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.listCostGCPUsageCostConfigs(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listCostGCPUsageCostConfigs( + responseContext, + ); + }); + }); + } + /** * List the Custom Costs files. * @param param The request object @@ -2072,6 +2588,31 @@ export class CloudCostManagementApi { }); } + /** + * Update the status of an GCP Usage Cost config (active/archived). + * @param param The request object + */ + public updateCostGCPUsageCostConfig( + param: CloudCostManagementApiUpdateCostGCPUsageCostConfigRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.updateCostGCPUsageCostConfig( + param.cloudAccountId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateCostGCPUsageCostConfig( + responseContext, + ); + }); + }); + } + /** * Upload a Custom Costs file. * @param param The request object diff --git a/services/cloud_cost_management/src/v2/index.ts b/services/cloud_cost_management/src/v2/index.ts index 0c56b8ceb488..e0f6680ddd0b 100644 --- a/services/cloud_cost_management/src/v2/index.ts +++ b/services/cloud_cost_management/src/v2/index.ts @@ -1,14 +1,17 @@ export { CloudCostManagementApiCreateCostAWSCURConfigRequest, CloudCostManagementApiCreateCostAzureUCConfigsRequest, + CloudCostManagementApiCreateCostGCPUsageCostConfigRequest, CloudCostManagementApiDeleteBudgetRequest, CloudCostManagementApiDeleteCostAWSCURConfigRequest, CloudCostManagementApiDeleteCostAzureUCConfigRequest, + CloudCostManagementApiDeleteCostGCPUsageCostConfigRequest, CloudCostManagementApiDeleteCustomCostsFileRequest, CloudCostManagementApiGetBudgetRequest, CloudCostManagementApiGetCustomCostsFileRequest, CloudCostManagementApiUpdateCostAWSCURConfigRequest, CloudCostManagementApiUpdateCostAzureUCConfigsRequest, + CloudCostManagementApiUpdateCostGCPUsageCostConfigRequest, CloudCostManagementApiUploadCustomCostsFileRequest, CloudCostManagementApiUpsertBudgetRequest, CloudCostManagementApi, @@ -63,4 +66,17 @@ export { CustomCostsFileUploadResponse } from "./models/CustomCostsFileUploadRes export { CustomCostsFileUsageChargePeriod } from "./models/CustomCostsFileUsageChargePeriod"; export { CustomCostsUser } from "./models/CustomCostsUser"; export { CustomCostUploadResponseMeta } from "./models/CustomCostUploadResponseMeta"; +export { GCPUsageCostConfig } from "./models/GCPUsageCostConfig"; +export { GCPUsageCostConfigAttributes } from "./models/GCPUsageCostConfigAttributes"; +export { GCPUsageCostConfigPatchData } from "./models/GCPUsageCostConfigPatchData"; +export { GCPUsageCostConfigPatchRequest } from "./models/GCPUsageCostConfigPatchRequest"; +export { GCPUsageCostConfigPatchRequestAttributes } from "./models/GCPUsageCostConfigPatchRequestAttributes"; +export { GCPUsageCostConfigPatchRequestType } from "./models/GCPUsageCostConfigPatchRequestType"; +export { GCPUsageCostConfigPostData } from "./models/GCPUsageCostConfigPostData"; +export { GCPUsageCostConfigPostRequest } from "./models/GCPUsageCostConfigPostRequest"; +export { GCPUsageCostConfigPostRequestAttributes } from "./models/GCPUsageCostConfigPostRequestAttributes"; +export { GCPUsageCostConfigPostRequestType } from "./models/GCPUsageCostConfigPostRequestType"; +export { GCPUsageCostConfigResponse } from "./models/GCPUsageCostConfigResponse"; +export { GCPUsageCostConfigsResponse } from "./models/GCPUsageCostConfigsResponse"; +export { GCPUsageCostConfigType } from "./models/GCPUsageCostConfigType"; export { TagFilter } from "./models/TagFilter"; diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfig.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfig.ts new file mode 100644 index 000000000000..2f3ec7381073 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfig.ts @@ -0,0 +1,65 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfigAttributes } from "./GCPUsageCostConfigAttributes"; +import { GCPUsageCostConfigType } from "./GCPUsageCostConfigType"; + +/** + * GCP Usage Cost config. + */ +export class GCPUsageCostConfig { + /** + * Attributes for a GCP Usage Cost config. + */ + "attributes": GCPUsageCostConfigAttributes; + /** + * The ID of the GCP Usage Cost config. + */ + "id"?: string; + /** + * Type of GCP Usage Cost config. + */ + "type": GCPUsageCostConfigType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GCPUsageCostConfigAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GCPUsageCostConfigType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfig.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigAttributes.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigAttributes.ts new file mode 100644 index 000000000000..ed91c86841ed --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigAttributes.ts @@ -0,0 +1,148 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes for a GCP Usage Cost config. + */ +export class GCPUsageCostConfigAttributes { + /** + * The GCP account ID. + */ + "accountId": string; + /** + * The GCP bucket name used to store the Usage Cost export. + */ + "bucketName": string; + /** + * The timestamp when the GCP Usage Cost config was created. + */ + "createdAt"?: string; + /** + * The export dataset name used for the GCP Usage Cost Report. + */ + "dataset": string; + /** + * The error messages for the GCP Usage Cost config. + */ + "errorMessages"?: Array; + /** + * The export prefix used for the GCP Usage Cost Report. + */ + "exportPrefix": string; + /** + * The name of the GCP Usage Cost Report. + */ + "exportProjectName": string; + /** + * The number of months the report has been backfilled. + */ + "months"?: number; + /** + * The `project_id` of the GCP Usage Cost report. + */ + "projectId"?: string; + /** + * The unique GCP service account email. + */ + "serviceAccount": string; + /** + * The status of the GCP Usage Cost config. + */ + "status": string; + /** + * The timestamp when the GCP Usage Cost config status was updated. + */ + "statusUpdatedAt"?: string; + /** + * The timestamp when the GCP Usage Cost config status was updated. + */ + "updatedAt"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + accountId: { + baseName: "account_id", + type: "string", + required: true, + }, + bucketName: { + baseName: "bucket_name", + type: "string", + required: true, + }, + createdAt: { + baseName: "created_at", + type: "string", + }, + dataset: { + baseName: "dataset", + type: "string", + required: true, + }, + errorMessages: { + baseName: "error_messages", + type: "Array", + }, + exportPrefix: { + baseName: "export_prefix", + type: "string", + required: true, + }, + exportProjectName: { + baseName: "export_project_name", + type: "string", + required: true, + }, + months: { + baseName: "months", + type: "number", + format: "int32", + }, + projectId: { + baseName: "project_id", + type: "string", + }, + serviceAccount: { + baseName: "service_account", + type: "string", + required: true, + }, + status: { + baseName: "status", + type: "string", + required: true, + }, + statusUpdatedAt: { + baseName: "status_updated_at", + type: "string", + }, + updatedAt: { + baseName: "updated_at", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchData.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchData.ts new file mode 100644 index 000000000000..d6713124590b --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfigPatchRequestAttributes } from "./GCPUsageCostConfigPatchRequestAttributes"; +import { GCPUsageCostConfigPatchRequestType } from "./GCPUsageCostConfigPatchRequestType"; + +/** + * GCP Usage Cost config patch data. + */ +export class GCPUsageCostConfigPatchData { + /** + * Attributes for GCP Usage Cost config patch request. + */ + "attributes": GCPUsageCostConfigPatchRequestAttributes; + /** + * Type of GCP Usage Cost config patch request. + */ + "type": GCPUsageCostConfigPatchRequestType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GCPUsageCostConfigPatchRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "GCPUsageCostConfigPatchRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigPatchData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequest.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequest.ts new file mode 100644 index 000000000000..2907522e20aa --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfigPatchData } from "./GCPUsageCostConfigPatchData"; + +/** + * GCP Usage Cost config patch request. + */ +export class GCPUsageCostConfigPatchRequest { + /** + * GCP Usage Cost config patch data. + */ + "data": GCPUsageCostConfigPatchData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GCPUsageCostConfigPatchData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigPatchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequestAttributes.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequestAttributes.ts new file mode 100644 index 000000000000..5341c32c3957 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequestAttributes.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes for GCP Usage Cost config patch request. + */ +export class GCPUsageCostConfigPatchRequestAttributes { + /** + * Whether or not the Cloud Cost Management account is enabled. + */ + "isEnabled": boolean; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + isEnabled: { + baseName: "is_enabled", + type: "boolean", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigPatchRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequestType.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequestType.ts new file mode 100644 index 000000000000..d0e9d1d245fa --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPatchRequestType.ts @@ -0,0 +1,10 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of GCP Usage Cost config patch request. + */ +export type GCPUsageCostConfigPatchRequestType = + | typeof GCP_USAGE_COST_CONFIG_PATCH_REQUEST + | UnparsedObject; +export const GCP_USAGE_COST_CONFIG_PATCH_REQUEST = + "gcp_uc_config_patch_request"; diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostData.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostData.ts new file mode 100644 index 000000000000..7ed44b627d77 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfigPostRequestAttributes } from "./GCPUsageCostConfigPostRequestAttributes"; +import { GCPUsageCostConfigPostRequestType } from "./GCPUsageCostConfigPostRequestType"; + +/** + * GCP Usage Cost config post data. + */ +export class GCPUsageCostConfigPostData { + /** + * Attributes for GCP Usage Cost config post request. + */ + "attributes": GCPUsageCostConfigPostRequestAttributes; + /** + * Type of GCP Usage Cost config post request. + */ + "type": GCPUsageCostConfigPostRequestType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GCPUsageCostConfigPostRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "GCPUsageCostConfigPostRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigPostData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequest.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequest.ts new file mode 100644 index 000000000000..8be70275f586 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfigPostData } from "./GCPUsageCostConfigPostData"; + +/** + * GCP Usage Cost config post request. + */ +export class GCPUsageCostConfigPostRequest { + /** + * GCP Usage Cost config post data. + */ + "data": GCPUsageCostConfigPostData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GCPUsageCostConfigPostData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigPostRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequestAttributes.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequestAttributes.ts new file mode 100644 index 000000000000..9f4de2466199 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequestAttributes.ts @@ -0,0 +1,89 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes for GCP Usage Cost config post request. + */ +export class GCPUsageCostConfigPostRequestAttributes { + /** + * The GCP account ID. + */ + "billingAccountId": string; + /** + * The GCP bucket name used to store the Usage Cost export. + */ + "bucketName": string; + /** + * The export dataset name used for the GCP Usage Cost report. + */ + "exportDatasetName": string; + /** + * The export prefix used for the GCP Usage Cost report. + */ + "exportPrefix"?: string; + /** + * The name of the GCP Usage Cost report. + */ + "exportProjectName": string; + /** + * The unique GCP service account email. + */ + "serviceAccount": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + billingAccountId: { + baseName: "billing_account_id", + type: "string", + required: true, + }, + bucketName: { + baseName: "bucket_name", + type: "string", + required: true, + }, + exportDatasetName: { + baseName: "export_dataset_name", + type: "string", + required: true, + }, + exportPrefix: { + baseName: "export_prefix", + type: "string", + }, + exportProjectName: { + baseName: "export_project_name", + type: "string", + required: true, + }, + serviceAccount: { + baseName: "service_account", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigPostRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequestType.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequestType.ts new file mode 100644 index 000000000000..b275465cd4e2 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigPostRequestType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of GCP Usage Cost config post request. + */ +export type GCPUsageCostConfigPostRequestType = + | typeof GCP_USAGE_COST_CONFIG_POST_REQUEST + | UnparsedObject; +export const GCP_USAGE_COST_CONFIG_POST_REQUEST = "gcp_uc_config_post_request"; diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigResponse.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigResponse.ts new file mode 100644 index 000000000000..5cbcf698f83b --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfig } from "./GCPUsageCostConfig"; + +/** + * Response of GCP Usage Cost config. + */ +export class GCPUsageCostConfigResponse { + /** + * GCP Usage Cost config. + */ + "data"?: GCPUsageCostConfig; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GCPUsageCostConfig", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigType.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigType.ts new file mode 100644 index 000000000000..090461b2ed88 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of GCP Usage Cost config. + */ +export type GCPUsageCostConfigType = typeof GCP_UC_CONFIG | UnparsedObject; +export const GCP_UC_CONFIG = "gcp_uc_config"; diff --git a/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigsResponse.ts b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigsResponse.ts new file mode 100644 index 000000000000..11e539758486 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/GCPUsageCostConfigsResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPUsageCostConfig } from "./GCPUsageCostConfig"; + +/** + * List of GCP Usage Cost configs. + */ +export class GCPUsageCostConfigsResponse { + /** + * A GCP Usage Cost config. + */ + "data"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPUsageCostConfigsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/TypingInfo.ts b/services/cloud_cost_management/src/v2/models/TypingInfo.ts index d8d93ff87dc8..3af84ba5b4d5 100644 --- a/services/cloud_cost_management/src/v2/models/TypingInfo.ts +++ b/services/cloud_cost_management/src/v2/models/TypingInfo.ts @@ -43,6 +43,16 @@ import { CustomCostsFileMetadataWithContentHighLevel } from "./CustomCostsFileMe import { CustomCostsFileUploadResponse } from "./CustomCostsFileUploadResponse"; import { CustomCostsFileUsageChargePeriod } from "./CustomCostsFileUsageChargePeriod"; import { CustomCostsUser } from "./CustomCostsUser"; +import { GCPUsageCostConfig } from "./GCPUsageCostConfig"; +import { GCPUsageCostConfigAttributes } from "./GCPUsageCostConfigAttributes"; +import { GCPUsageCostConfigPatchData } from "./GCPUsageCostConfigPatchData"; +import { GCPUsageCostConfigPatchRequest } from "./GCPUsageCostConfigPatchRequest"; +import { GCPUsageCostConfigPatchRequestAttributes } from "./GCPUsageCostConfigPatchRequestAttributes"; +import { GCPUsageCostConfigPostData } from "./GCPUsageCostConfigPostData"; +import { GCPUsageCostConfigPostRequest } from "./GCPUsageCostConfigPostRequest"; +import { GCPUsageCostConfigPostRequestAttributes } from "./GCPUsageCostConfigPostRequestAttributes"; +import { GCPUsageCostConfigResponse } from "./GCPUsageCostConfigResponse"; +import { GCPUsageCostConfigsResponse } from "./GCPUsageCostConfigsResponse"; import { TagFilter } from "./TagFilter"; export const TypingInfo: ModelTypingInfo = { @@ -53,6 +63,9 @@ export const TypingInfo: ModelTypingInfo = { AzureUCConfigPairType: ["azure_uc_configs"], AzureUCConfigPatchRequestType: ["azure_uc_config_patch_request"], AzureUCConfigPostRequestType: ["azure_uc_config_post_request"], + GCPUsageCostConfigPatchRequestType: ["gcp_uc_config_patch_request"], + GCPUsageCostConfigPostRequestType: ["gcp_uc_config_post_request"], + GCPUsageCostConfigType: ["gcp_uc_config"], }, oneOfMap: {}, typeMap: { @@ -100,6 +113,18 @@ export const TypingInfo: ModelTypingInfo = { CustomCostsFileUploadResponse: CustomCostsFileUploadResponse, CustomCostsFileUsageChargePeriod: CustomCostsFileUsageChargePeriod, CustomCostsUser: CustomCostsUser, + GCPUsageCostConfig: GCPUsageCostConfig, + GCPUsageCostConfigAttributes: GCPUsageCostConfigAttributes, + GCPUsageCostConfigPatchData: GCPUsageCostConfigPatchData, + GCPUsageCostConfigPatchRequest: GCPUsageCostConfigPatchRequest, + GCPUsageCostConfigPatchRequestAttributes: + GCPUsageCostConfigPatchRequestAttributes, + GCPUsageCostConfigPostData: GCPUsageCostConfigPostData, + GCPUsageCostConfigPostRequest: GCPUsageCostConfigPostRequest, + GCPUsageCostConfigPostRequestAttributes: + GCPUsageCostConfigPostRequestAttributes, + GCPUsageCostConfigResponse: GCPUsageCostConfigResponse, + GCPUsageCostConfigsResponse: GCPUsageCostConfigsResponse, TagFilter: TagFilter, }, };