diff --git a/.apigentools-info b/.apigentools-info index 7e042ad8eac..5727fe492d3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-05 21:07:10.843952", - "spec_repo_commit": "6c0fa1b6" + "regenerated": "2024-11-05 22:28:18.403817", + "spec_repo_commit": "2db17c21" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-05 21:07:10.862374", - "spec_repo_commit": "6c0fa1b6" + "regenerated": "2024-11-05 22:28:18.425193", + "spec_repo_commit": "2db17c21" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 925dfca233a..ce1fe2fc60d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9623,6 +9623,20 @@ components: nullable: true type: array type: object + GCPMetricNamespaceConfig: + description: Configuration for a GCP metric namespace. + properties: + disabled: + default: false + description: When disabled, Datadog does not collect metrics that are related + to this GCP metric namespace. + example: true + type: boolean + id: + description: The id of the GCP metric namespace. + example: aiplatform + type: string + type: object GCPSTSDelegateAccount: description: Datadog principal service account info. properties: @@ -9725,6 +9739,14 @@ components: account.' example: true type: boolean + metric_namespace_configs: + description: Configurations for GCP metric namespaces. + example: + - disabled: true + id: aiplatform + items: + $ref: '#/components/schemas/GCPMetricNamespaceConfig' + type: array resource_collection_enabled: description: When enabled, Datadog scans for all resources in your GCP environment. type: boolean diff --git a/features/v2/gcp_integration.feature b/features/v2/gcp_integration.feature index 7ab3ec0b0eb..18749b0a6d0 100644 --- a/features/v2/gcp_integration.feature +++ b/features/v2/gcp_integration.feature @@ -34,14 +34,14 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Bad Request" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Conflict" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 409 Conflict @@ -151,7 +151,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Bad Request" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @@ -159,7 +159,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Not Found" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index e2c941e4056..0ee84f37866 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1110,6 +1110,7 @@ export { FullAPIKey } from "./models/FullAPIKey"; export { FullAPIKeyAttributes } from "./models/FullAPIKeyAttributes"; export { FullApplicationKey } from "./models/FullApplicationKey"; export { FullApplicationKeyAttributes } from "./models/FullApplicationKeyAttributes"; +export { GCPMetricNamespaceConfig } from "./models/GCPMetricNamespaceConfig"; export { GCPServiceAccountMeta } from "./models/GCPServiceAccountMeta"; export { GCPServiceAccountType } from "./models/GCPServiceAccountType"; export { GCPSTSDelegateAccount } from "./models/GCPSTSDelegateAccount"; diff --git a/packages/datadog-api-client-v2/models/GCPMetricNamespaceConfig.ts b/packages/datadog-api-client-v2/models/GCPMetricNamespaceConfig.ts new file mode 100644 index 00000000000..1788ea239b6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/GCPMetricNamespaceConfig.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Configuration for a GCP metric namespace. + */ +export class GCPMetricNamespaceConfig { + /** + * When disabled, Datadog does not collect metrics that are related to this GCP metric namespace. + */ + "disabled"?: boolean; + /** + * The id of the GCP metric namespace. + */ + "id"?: 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 = { + disabled: { + baseName: "disabled", + type: "boolean", + }, + id: { + baseName: "id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPMetricNamespaceConfig.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/GCPSTSServiceAccountAttributes.ts b/packages/datadog-api-client-v2/models/GCPSTSServiceAccountAttributes.ts index fe869888c35..f16dcc46a52 100644 --- a/packages/datadog-api-client-v2/models/GCPSTSServiceAccountAttributes.ts +++ b/packages/datadog-api-client-v2/models/GCPSTSServiceAccountAttributes.ts @@ -3,6 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { GCPMetricNamespaceConfig } from "./GCPMetricNamespaceConfig"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -43,6 +44,10 @@ export class GCPSTSServiceAccountAttributes { * When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account. */ "isSecurityCommandCenterEnabled"?: boolean; + /** + * Configurations for GCP metric namespaces. + */ + "metricNamespaceConfigs"?: Array; /** * When enabled, Datadog scans for all resources in your GCP environment. */ @@ -96,6 +101,10 @@ export class GCPSTSServiceAccountAttributes { baseName: "is_security_command_center_enabled", type: "boolean", }, + metricNamespaceConfigs: { + baseName: "metric_namespace_configs", + type: "Array", + }, resourceCollectionEnabled: { baseName: "resource_collection_enabled", type: "boolean", diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 4a7bb0aac04..d71f0eb37e8 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -423,6 +423,7 @@ import { FullAPIKey } from "./FullAPIKey"; import { FullAPIKeyAttributes } from "./FullAPIKeyAttributes"; import { FullApplicationKey } from "./FullApplicationKey"; import { FullApplicationKeyAttributes } from "./FullApplicationKeyAttributes"; +import { GCPMetricNamespaceConfig } from "./GCPMetricNamespaceConfig"; import { GCPSTSDelegateAccount } from "./GCPSTSDelegateAccount"; import { GCPSTSDelegateAccountAttributes } from "./GCPSTSDelegateAccountAttributes"; import { GCPSTSDelegateAccountResponse } from "./GCPSTSDelegateAccountResponse"; @@ -2429,6 +2430,7 @@ const typeMap: { [index: string]: any } = { FullAPIKeyAttributes: FullAPIKeyAttributes, FullApplicationKey: FullApplicationKey, FullApplicationKeyAttributes: FullApplicationKeyAttributes, + GCPMetricNamespaceConfig: GCPMetricNamespaceConfig, GCPSTSDelegateAccount: GCPSTSDelegateAccount, GCPSTSDelegateAccountAttributes: GCPSTSDelegateAccountAttributes, GCPSTSDelegateAccountResponse: GCPSTSDelegateAccountResponse,