diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 0f6baca4241b..a1335722ca47 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3288,15 +3288,19 @@ components: example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL type: string cloud_run_revision_filters: - description: 'Limit the Cloud Run revisions that are pulled into Datadog - by using tags. + deprecated: true + description: 'List of filters to limit the Cloud Run revisions that are + pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are - imported into Datadog.' + imported into Datadog. + + **Note:** This field is deprecated. Instead, use `monitored_resource_configs` + with `type=cloud_run_revision`' example: - $KEY:$VALUE items: - description: Cloud Run Filters + description: Cloud Run revision filters type: string type: array errors: @@ -3309,11 +3313,16 @@ components: type: string type: array host_filters: - description: 'Limit the GCE instances that are pulled into Datadog by using - tags. + deprecated: true + description: 'A comma-separated list of filters to limit the VM instances + that are pulled into Datadog by using tags. - Only hosts that match one of the defined tags are imported into Datadog.' - example: key:value,filter:example + Only VM instance resources that apply to specified filters are imported + into Datadog. + + **Note:** This field is deprecated. Instead, use `monitored_resource_configs` + with `type=gce_instance`' + example: $KEY1:$VALUE1,$KEY2:$VALUE2 type: string is_cspm_enabled: description: 'When enabled, Datadog will activate the Cloud Security Monitoring @@ -3334,6 +3343,15 @@ components: account.' example: true type: boolean + monitored_resource_configs: + description: Configurations for GCP monitored resources. + example: + - filters: + - $KEY:$VALUE + type: gce_instance + items: + $ref: '#/components/schemas/GCPMonitoredResourceConfig' + type: array private_key: description: Your private key name found in your JSON service account key. example: private_key @@ -3366,6 +3384,37 @@ components: items: $ref: '#/components/schemas/GCPAccount' type: array + GCPMonitoredResourceConfig: + description: Configuration for a GCP monitored resource. + properties: + filters: + description: 'List of filters to limit the monitored resources that are + pulled into Datadog by using tags. + + Only monitored resources that apply to specified filters are imported + into Datadog.' + example: + - $KEY:$VALUE + items: + description: A monitored resource filter + type: string + type: array + type: + $ref: '#/components/schemas/GCPMonitoredResourceConfigType' + type: object + GCPMonitoredResourceConfigType: + description: The GCP monitored resource type. Only a subset of resource types + are supported. + enum: + - cloud_function + - cloud_run_revision + - gce_instance + example: gce_instance + type: string + x-enum-varnames: + - CLOUD_FUNCTION + - CLOUD_RUN_REVISION + - GCE_INSTANCE GeomapWidgetDefinition: description: This visualization displays a series of values by country on a world map. diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c22e59325667..085c5aa51a75 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17694,6 +17694,37 @@ components: example: aiplatform type: string type: object + GCPMonitoredResourceConfig: + description: Configuration for a GCP monitored resource. + properties: + filters: + description: 'List of filters to limit the monitored resources that are + pulled into Datadog by using tags. + + Only monitored resources that apply to specified filters are imported + into Datadog.' + example: + - $KEY:$VALUE + items: + description: A monitored resource filter + type: string + type: array + type: + $ref: '#/components/schemas/GCPMonitoredResourceConfigType' + type: object + GCPMonitoredResourceConfigType: + description: The GCP monitored resource type. Only a subset of resource types + are supported. + enum: + - cloud_function + - cloud_run_revision + - gce_instance + example: gce_instance + type: string + x-enum-varnames: + - CLOUD_FUNCTION + - CLOUD_RUN_REVISION + - GCE_INSTANCE GCPSTSDelegateAccount: description: Datadog principal service account info. properties: @@ -17761,21 +17792,35 @@ components: example: datadog-service-account@test-project.iam.gserviceaccount.com type: string cloud_run_revision_filters: + deprecated: true description: 'List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are - imported into Datadog.' + imported into Datadog. + + **Note:** This field is deprecated. Instead, use `monitored_resource_configs` + with `type=cloud_run_revision`' example: - $KEY:$VALUE items: - description: Cloud Run Filters + description: Cloud Run revision filters type: string type: array host_filters: - description: Your Host Filters. + deprecated: true + description: 'List of filters to limit the VM instances that are pulled + into Datadog by using tags. + + Only VM instance resources that apply to specified filters are imported + into Datadog. + + **Note:** This field is deprecated. Instead, use `monitored_resource_configs` + with `type=gce_instance`' + example: + - $KEY:$VALUE items: - description: Host Filters + description: VM instance filters type: string type: array is_cspm_enabled: @@ -17811,6 +17856,15 @@ components: items: $ref: '#/components/schemas/GCPMetricNamespaceConfig' type: array + monitored_resource_configs: + description: Configurations for GCP monitored resources. + example: + - filters: + - $KEY:$VALUE + type: gce_instance + items: + $ref: '#/components/schemas/GCPMonitoredResourceConfig' + type: array resource_collection_enabled: description: When enabled, Datadog scans for all resources in your GCP environment. type: boolean diff --git a/features/v1/gcp_integration.feature b/features/v1/gcp_integration.feature index 33a06d39fe92..5e6bccf3a7ce 100644 --- a/features/v1/gcp_integration.feature +++ b/features/v1/gcp_integration.feature @@ -13,7 +13,7 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a GCP integration returns "Bad Request" response Given new "CreateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "$KEY1:$VALUE1,$KEY2:$VALUE2", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request @@ -27,7 +27,7 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Delete a GCP integration returns "Bad Request" response Given new "DeleteGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "$KEY1:$VALUE1,$KEY2:$VALUE2", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request @@ -62,7 +62,7 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Update a GCP integration returns "Bad Request" response Given new "UpdateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "$KEY1:$VALUE1,$KEY2:$VALUE2", "is_cspm_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request diff --git a/features/v2/gcp_integration.feature b/features/v2/gcp_integration.feature index eecbb4747ec5..935adb2d93bf 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_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "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": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "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": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_per_project_quota_enabled": true, "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"}} + 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": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_per_project_quota_enabled": true, "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"}} + 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": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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/services/gcp_integration/src/v1/index.ts b/services/gcp_integration/src/v1/index.ts index 0c2a7c6367d0..618fd708b675 100644 --- a/services/gcp_integration/src/v1/index.ts +++ b/services/gcp_integration/src/v1/index.ts @@ -7,3 +7,5 @@ export { export { APIErrorResponse } from "./models/APIErrorResponse"; export { GCPAccount } from "./models/GCPAccount"; +export { GCPMonitoredResourceConfig } from "./models/GCPMonitoredResourceConfig"; +export { GCPMonitoredResourceConfigType } from "./models/GCPMonitoredResourceConfigType"; diff --git a/services/gcp_integration/src/v1/models/GCPAccount.ts b/services/gcp_integration/src/v1/models/GCPAccount.ts index ff39d8d04b9f..432382d47982 100644 --- a/services/gcp_integration/src/v1/models/GCPAccount.ts +++ b/services/gcp_integration/src/v1/models/GCPAccount.ts @@ -1,5 +1,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { GCPMonitoredResourceConfig } from "./GCPMonitoredResourceConfig"; + /** * Your Google Cloud Platform Account. */ @@ -30,8 +32,9 @@ export class GCPAccount { */ "clientX509CertUrl"?: string; /** - * Limit the Cloud Run revisions that are pulled into Datadog by using tags. + * List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. * Only Cloud Run revision resources that apply to specified filters are imported into Datadog. + * **Note:** This field is deprecated. Instead, use `monitored_resource_configs` with `type=cloud_run_revision` */ "cloudRunRevisionFilters"?: Array; /** @@ -39,8 +42,9 @@ export class GCPAccount { */ "errors"?: Array; /** - * Limit the GCE instances that are pulled into Datadog by using tags. - * Only hosts that match one of the defined tags are imported into Datadog. + * A comma-separated list of filters to limit the VM instances that are pulled into Datadog by using tags. + * Only VM instance resources that apply to specified filters are imported into Datadog. + * **Note:** This field is deprecated. Instead, use `monitored_resource_configs` with `type=gce_instance` */ "hostFilters"?: string; /** @@ -55,6 +59,10 @@ export class GCPAccount { * 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 monitored resources. + */ + "monitoredResourceConfigs"?: Array; /** * Your private key name found in your JSON service account key. */ @@ -142,6 +150,10 @@ export class GCPAccount { baseName: "is_security_command_center_enabled", type: "boolean", }, + monitoredResourceConfigs: { + baseName: "monitored_resource_configs", + type: "Array", + }, privateKey: { baseName: "private_key", type: "string", diff --git a/services/gcp_integration/src/v1/models/GCPMonitoredResourceConfig.ts b/services/gcp_integration/src/v1/models/GCPMonitoredResourceConfig.ts new file mode 100644 index 000000000000..66516e4866e2 --- /dev/null +++ b/services/gcp_integration/src/v1/models/GCPMonitoredResourceConfig.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPMonitoredResourceConfigType } from "./GCPMonitoredResourceConfigType"; + +/** + * Configuration for a GCP monitored resource. + */ +export class GCPMonitoredResourceConfig { + /** + * List of filters to limit the monitored resources that are pulled into Datadog by using tags. + * Only monitored resources that apply to specified filters are imported into Datadog. + */ + "filters"?: Array; + /** + * The GCP monitored resource type. Only a subset of resource types are supported. + */ + "type"?: GCPMonitoredResourceConfigType; + /** + * 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 = { + filters: { + baseName: "filters", + type: "Array", + }, + type: { + baseName: "type", + type: "GCPMonitoredResourceConfigType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPMonitoredResourceConfig.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/gcp_integration/src/v1/models/GCPMonitoredResourceConfigType.ts b/services/gcp_integration/src/v1/models/GCPMonitoredResourceConfigType.ts new file mode 100644 index 000000000000..0aa128a3d85e --- /dev/null +++ b/services/gcp_integration/src/v1/models/GCPMonitoredResourceConfigType.ts @@ -0,0 +1,13 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The GCP monitored resource type. Only a subset of resource types are supported. + */ +export type GCPMonitoredResourceConfigType = + | typeof CLOUD_FUNCTION + | typeof CLOUD_RUN_REVISION + | typeof GCE_INSTANCE + | UnparsedObject; +export const CLOUD_FUNCTION = "cloud_function"; +export const CLOUD_RUN_REVISION = "cloud_run_revision"; +export const GCE_INSTANCE = "gce_instance"; diff --git a/services/gcp_integration/src/v1/models/TypingInfo.ts b/services/gcp_integration/src/v1/models/TypingInfo.ts index bef820bd66b9..d5ea5872d092 100644 --- a/services/gcp_integration/src/v1/models/TypingInfo.ts +++ b/services/gcp_integration/src/v1/models/TypingInfo.ts @@ -2,12 +2,20 @@ import { ModelTypingInfo } from "@datadog/datadog-api-client"; import { APIErrorResponse } from "./APIErrorResponse"; import { GCPAccount } from "./GCPAccount"; +import { GCPMonitoredResourceConfig } from "./GCPMonitoredResourceConfig"; export const TypingInfo: ModelTypingInfo = { - enumsMap: {}, + enumsMap: { + GCPMonitoredResourceConfigType: [ + "cloud_function", + "cloud_run_revision", + "gce_instance", + ], + }, oneOfMap: {}, typeMap: { APIErrorResponse: APIErrorResponse, GCPAccount: GCPAccount, + GCPMonitoredResourceConfig: GCPMonitoredResourceConfig, }, }; diff --git a/services/gcp_integration/src/v2/index.ts b/services/gcp_integration/src/v2/index.ts index fff09649b56b..0afd333526b1 100644 --- a/services/gcp_integration/src/v2/index.ts +++ b/services/gcp_integration/src/v2/index.ts @@ -8,6 +8,8 @@ export { export { APIErrorResponse } from "./models/APIErrorResponse"; export { GCPMetricNamespaceConfig } from "./models/GCPMetricNamespaceConfig"; +export { GCPMonitoredResourceConfig } from "./models/GCPMonitoredResourceConfig"; +export { GCPMonitoredResourceConfigType } from "./models/GCPMonitoredResourceConfigType"; export { GCPServiceAccountMeta } from "./models/GCPServiceAccountMeta"; export { GCPServiceAccountType } from "./models/GCPServiceAccountType"; export { GCPSTSDelegateAccount } from "./models/GCPSTSDelegateAccount"; diff --git a/services/gcp_integration/src/v2/models/GCPMonitoredResourceConfig.ts b/services/gcp_integration/src/v2/models/GCPMonitoredResourceConfig.ts new file mode 100644 index 000000000000..66516e4866e2 --- /dev/null +++ b/services/gcp_integration/src/v2/models/GCPMonitoredResourceConfig.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GCPMonitoredResourceConfigType } from "./GCPMonitoredResourceConfigType"; + +/** + * Configuration for a GCP monitored resource. + */ +export class GCPMonitoredResourceConfig { + /** + * List of filters to limit the monitored resources that are pulled into Datadog by using tags. + * Only monitored resources that apply to specified filters are imported into Datadog. + */ + "filters"?: Array; + /** + * The GCP monitored resource type. Only a subset of resource types are supported. + */ + "type"?: GCPMonitoredResourceConfigType; + /** + * 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 = { + filters: { + baseName: "filters", + type: "Array", + }, + type: { + baseName: "type", + type: "GCPMonitoredResourceConfigType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GCPMonitoredResourceConfig.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/gcp_integration/src/v2/models/GCPMonitoredResourceConfigType.ts b/services/gcp_integration/src/v2/models/GCPMonitoredResourceConfigType.ts new file mode 100644 index 000000000000..0aa128a3d85e --- /dev/null +++ b/services/gcp_integration/src/v2/models/GCPMonitoredResourceConfigType.ts @@ -0,0 +1,13 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The GCP monitored resource type. Only a subset of resource types are supported. + */ +export type GCPMonitoredResourceConfigType = + | typeof CLOUD_FUNCTION + | typeof CLOUD_RUN_REVISION + | typeof GCE_INSTANCE + | UnparsedObject; +export const CLOUD_FUNCTION = "cloud_function"; +export const CLOUD_RUN_REVISION = "cloud_run_revision"; +export const GCE_INSTANCE = "gce_instance"; diff --git a/services/gcp_integration/src/v2/models/GCPSTSServiceAccountAttributes.ts b/services/gcp_integration/src/v2/models/GCPSTSServiceAccountAttributes.ts index 2a1c9d1d7730..818610c1e767 100644 --- a/services/gcp_integration/src/v2/models/GCPSTSServiceAccountAttributes.ts +++ b/services/gcp_integration/src/v2/models/GCPSTSServiceAccountAttributes.ts @@ -1,6 +1,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; import { GCPMetricNamespaceConfig } from "./GCPMetricNamespaceConfig"; +import { GCPMonitoredResourceConfig } from "./GCPMonitoredResourceConfig"; /** * Attributes associated with your service account. @@ -21,10 +22,13 @@ export class GCPSTSServiceAccountAttributes { /** * List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. * Only Cloud Run revision resources that apply to specified filters are imported into Datadog. + * **Note:** This field is deprecated. Instead, use `monitored_resource_configs` with `type=cloud_run_revision` */ "cloudRunRevisionFilters"?: Array; /** - * Your Host Filters. + * List of filters to limit the VM instances that are pulled into Datadog by using tags. + * Only VM instance resources that apply to specified filters are imported into Datadog. + * **Note:** This field is deprecated. Instead, use `monitored_resource_configs` with `type=gce_instance` */ "hostFilters"?: Array; /** @@ -47,6 +51,10 @@ export class GCPSTSServiceAccountAttributes { * Configurations for GCP metric namespaces. */ "metricNamespaceConfigs"?: Array; + /** + * Configurations for GCP monitored resources. + */ + "monitoredResourceConfigs"?: Array; /** * When enabled, Datadog scans for all resources in your GCP environment. */ @@ -106,6 +114,10 @@ export class GCPSTSServiceAccountAttributes { baseName: "metric_namespace_configs", type: "Array", }, + monitoredResourceConfigs: { + baseName: "monitored_resource_configs", + type: "Array", + }, resourceCollectionEnabled: { baseName: "resource_collection_enabled", type: "boolean", diff --git a/services/gcp_integration/src/v2/models/TypingInfo.ts b/services/gcp_integration/src/v2/models/TypingInfo.ts index a5102aab7957..d7b6edd9648e 100644 --- a/services/gcp_integration/src/v2/models/TypingInfo.ts +++ b/services/gcp_integration/src/v2/models/TypingInfo.ts @@ -2,6 +2,7 @@ import { ModelTypingInfo } from "@datadog/datadog-api-client"; import { APIErrorResponse } from "./APIErrorResponse"; import { GCPMetricNamespaceConfig } from "./GCPMetricNamespaceConfig"; +import { GCPMonitoredResourceConfig } from "./GCPMonitoredResourceConfig"; import { GCPSTSDelegateAccount } from "./GCPSTSDelegateAccount"; import { GCPSTSDelegateAccountAttributes } from "./GCPSTSDelegateAccountAttributes"; import { GCPSTSDelegateAccountResponse } from "./GCPSTSDelegateAccountResponse"; @@ -17,6 +18,11 @@ import { GCPServiceAccountMeta } from "./GCPServiceAccountMeta"; export const TypingInfo: ModelTypingInfo = { enumsMap: { + GCPMonitoredResourceConfigType: [ + "cloud_function", + "cloud_run_revision", + "gce_instance", + ], GCPSTSDelegateAccountType: ["gcp_sts_delegate"], GCPServiceAccountType: ["gcp_service_account"], }, @@ -24,6 +30,7 @@ export const TypingInfo: ModelTypingInfo = { typeMap: { APIErrorResponse: APIErrorResponse, GCPMetricNamespaceConfig: GCPMetricNamespaceConfig, + GCPMonitoredResourceConfig: GCPMonitoredResourceConfig, GCPSTSDelegateAccount: GCPSTSDelegateAccount, GCPSTSDelegateAccountAttributes: GCPSTSDelegateAccountAttributes, GCPSTSDelegateAccountResponse: GCPSTSDelegateAccountResponse,