diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7c9668ae428..d526b0a4ebb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23536,6 +23536,13 @@ components: product for this service account. Note: This requires resource_collection_enabled to be set to true.' type: boolean + is_global_location_enabled: + default: true + description: When enabled, Datadog collects metrics where location is explicitly + stated as "global" or where location information cannot be deduced from + GCP labels. + example: true + type: boolean is_per_project_quota_enabled: default: false description: When enabled, Datadog applies the `X-Goog-User-Project` header, @@ -23577,6 +23584,18 @@ components: items: $ref: '#/components/schemas/GCPMonitoredResourceConfig' type: array + region_filter_configs: + description: Configurations for GCP location filtering, such as region, + multi-region, or zone. Only monitored resources that match the specified + regions are imported into Datadog. By default, Datadog collects from all + locations. + example: + - nam4 + - europe-north1 + items: + description: Region Filter Configs + type: string + type: array resource_collection_enabled: description: When enabled, Datadog scans for all resources in your GCP environment. type: boolean diff --git a/src/main/java/com/datadog/api/client/v2/model/GCPSTSServiceAccountAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GCPSTSServiceAccountAttributes.java index 0604f1629c2..6282a3c91d0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/GCPSTSServiceAccountAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/GCPSTSServiceAccountAttributes.java @@ -26,11 +26,13 @@ GCPSTSServiceAccountAttributes.JSON_PROPERTY_CLOUD_RUN_REVISION_FILTERS, GCPSTSServiceAccountAttributes.JSON_PROPERTY_HOST_FILTERS, GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_CSPM_ENABLED, + GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_GLOBAL_LOCATION_ENABLED, GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_PER_PROJECT_QUOTA_ENABLED, GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_RESOURCE_CHANGE_COLLECTION_ENABLED, GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_SECURITY_COMMAND_CENTER_ENABLED, GCPSTSServiceAccountAttributes.JSON_PROPERTY_METRIC_NAMESPACE_CONFIGS, GCPSTSServiceAccountAttributes.JSON_PROPERTY_MONITORED_RESOURCE_CONFIGS, + GCPSTSServiceAccountAttributes.JSON_PROPERTY_REGION_FILTER_CONFIGS, GCPSTSServiceAccountAttributes.JSON_PROPERTY_RESOURCE_COLLECTION_ENABLED }) @jakarta.annotation.Generated( @@ -56,6 +58,10 @@ public class GCPSTSServiceAccountAttributes { public static final String JSON_PROPERTY_IS_CSPM_ENABLED = "is_cspm_enabled"; private Boolean isCspmEnabled; + public static final String JSON_PROPERTY_IS_GLOBAL_LOCATION_ENABLED = + "is_global_location_enabled"; + private Boolean isGlobalLocationEnabled = true; + public static final String JSON_PROPERTY_IS_PER_PROJECT_QUOTA_ENABLED = "is_per_project_quota_enabled"; private Boolean isPerProjectQuotaEnabled = false; @@ -75,6 +81,9 @@ public class GCPSTSServiceAccountAttributes { "monitored_resource_configs"; private List monitoredResourceConfigs = null; + public static final String JSON_PROPERTY_REGION_FILTER_CONFIGS = "region_filter_configs"; + private List regionFilterConfigs = null; + public static final String JSON_PROPERTY_RESOURCE_COLLECTION_ENABLED = "resource_collection_enabled"; private Boolean resourceCollectionEnabled; @@ -244,6 +253,28 @@ public void setIsCspmEnabled(Boolean isCspmEnabled) { this.isCspmEnabled = isCspmEnabled; } + public GCPSTSServiceAccountAttributes isGlobalLocationEnabled(Boolean isGlobalLocationEnabled) { + this.isGlobalLocationEnabled = isGlobalLocationEnabled; + return this; + } + + /** + * When enabled, Datadog collects metrics where location is explicitly stated as "global" or where + * location information cannot be deduced from GCP labels. + * + * @return isGlobalLocationEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_GLOBAL_LOCATION_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsGlobalLocationEnabled() { + return isGlobalLocationEnabled; + } + + public void setIsGlobalLocationEnabled(Boolean isGlobalLocationEnabled) { + this.isGlobalLocationEnabled = isGlobalLocationEnabled; + } + public GCPSTSServiceAccountAttributes isPerProjectQuotaEnabled(Boolean isPerProjectQuotaEnabled) { this.isPerProjectQuotaEnabled = isPerProjectQuotaEnabled; return this; @@ -383,6 +414,37 @@ public void setMonitoredResourceConfigs( this.monitoredResourceConfigs = monitoredResourceConfigs; } + public GCPSTSServiceAccountAttributes regionFilterConfigs(List regionFilterConfigs) { + this.regionFilterConfigs = regionFilterConfigs; + return this; + } + + public GCPSTSServiceAccountAttributes addRegionFilterConfigsItem(String regionFilterConfigsItem) { + if (this.regionFilterConfigs == null) { + this.regionFilterConfigs = new ArrayList<>(); + } + this.regionFilterConfigs.add(regionFilterConfigsItem); + return this; + } + + /** + * Configurations for GCP location filtering, such as region, multi-region, or zone. Only + * monitored resources that match the specified regions are imported into Datadog. By default, + * Datadog collects from all locations. + * + * @return regionFilterConfigs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGION_FILTER_CONFIGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRegionFilterConfigs() { + return regionFilterConfigs; + } + + public void setRegionFilterConfigs(List regionFilterConfigs) { + this.regionFilterConfigs = regionFilterConfigs; + } + public GCPSTSServiceAccountAttributes resourceCollectionEnabled( Boolean resourceCollectionEnabled) { this.resourceCollectionEnabled = resourceCollectionEnabled; @@ -469,6 +531,8 @@ public boolean equals(Object o) { this.cloudRunRevisionFilters, gcpstsServiceAccountAttributes.cloudRunRevisionFilters) && Objects.equals(this.hostFilters, gcpstsServiceAccountAttributes.hostFilters) && Objects.equals(this.isCspmEnabled, gcpstsServiceAccountAttributes.isCspmEnabled) + && Objects.equals( + this.isGlobalLocationEnabled, gcpstsServiceAccountAttributes.isGlobalLocationEnabled) && Objects.equals( this.isPerProjectQuotaEnabled, gcpstsServiceAccountAttributes.isPerProjectQuotaEnabled) && Objects.equals( @@ -481,6 +545,8 @@ public boolean equals(Object o) { this.metricNamespaceConfigs, gcpstsServiceAccountAttributes.metricNamespaceConfigs) && Objects.equals( this.monitoredResourceConfigs, gcpstsServiceAccountAttributes.monitoredResourceConfigs) + && Objects.equals( + this.regionFilterConfigs, gcpstsServiceAccountAttributes.regionFilterConfigs) && Objects.equals( this.resourceCollectionEnabled, gcpstsServiceAccountAttributes.resourceCollectionEnabled) @@ -497,11 +563,13 @@ public int hashCode() { cloudRunRevisionFilters, hostFilters, isCspmEnabled, + isGlobalLocationEnabled, isPerProjectQuotaEnabled, isResourceChangeCollectionEnabled, isSecurityCommandCenterEnabled, metricNamespaceConfigs, monitoredResourceConfigs, + regionFilterConfigs, resourceCollectionEnabled, additionalProperties); } @@ -518,6 +586,9 @@ public String toString() { .append("\n"); sb.append(" hostFilters: ").append(toIndentedString(hostFilters)).append("\n"); sb.append(" isCspmEnabled: ").append(toIndentedString(isCspmEnabled)).append("\n"); + sb.append(" isGlobalLocationEnabled: ") + .append(toIndentedString(isGlobalLocationEnabled)) + .append("\n"); sb.append(" isPerProjectQuotaEnabled: ") .append(toIndentedString(isPerProjectQuotaEnabled)) .append("\n"); @@ -533,6 +604,9 @@ public String toString() { sb.append(" monitoredResourceConfigs: ") .append(toIndentedString(monitoredResourceConfigs)) .append("\n"); + sb.append(" regionFilterConfigs: ") + .append(toIndentedString(regionFilterConfigs)) + .append("\n"); sb.append(" resourceCollectionEnabled: ") .append(toIndentedString(resourceCollectionEnabled)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/gcp_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/gcp_integration.feature index 6d47a1508eb..6dcb271ec17 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/gcp_integration.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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": ["$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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_global_location_enabled": true, "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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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": ["$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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_global_location_enabled": true, "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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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": ["$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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_global_location_enabled": true, "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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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": ["$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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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_global_location_enabled": true, "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"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found