Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22330,6 +22330,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, metrics, events, and resources where location
is explicitly stated as \u201Cglobal\u201D or where location information
could not be deduced from GCP labels will be collected."
example: true
type: boolean
is_per_project_quota_enabled:
default: false
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
Expand Down Expand Up @@ -22371,6 +22378,16 @@ components:
items:
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
type: array
region_filter_configs:
description: Filters to limit metric collection by GCP region. By default
Datadog collects from all regions.
example:
- us-east1
- 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;
Expand All @@ -75,6 +81,9 @@ public class GCPSTSServiceAccountAttributes {
"monitored_resource_configs";
private List<GCPMonitoredResourceConfig> monitoredResourceConfigs = null;

public static final String JSON_PROPERTY_REGION_FILTER_CONFIGS = "region_filter_configs";
private List<String> regionFilterConfigs = null;

public static final String JSON_PROPERTY_RESOURCE_COLLECTION_ENABLED =
"resource_collection_enabled";
private Boolean resourceCollectionEnabled;
Expand Down Expand Up @@ -244,6 +253,28 @@ public void setIsCspmEnabled(Boolean isCspmEnabled) {
this.isCspmEnabled = isCspmEnabled;
}

public GCPSTSServiceAccountAttributes isGlobalLocationEnabled(Boolean isGlobalLocationEnabled) {
this.isGlobalLocationEnabled = isGlobalLocationEnabled;
return this;
}

/**
* When enabled, metrics, events, and resources where location is explicitly stated as “global” or
* where location information could not be deduced from GCP labels will be collected.
*
* @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;
Expand Down Expand Up @@ -383,6 +414,35 @@ public void setMonitoredResourceConfigs(
this.monitoredResourceConfigs = monitoredResourceConfigs;
}

public GCPSTSServiceAccountAttributes regionFilterConfigs(List<String> 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;
}

/**
* Filters to limit metric collection by GCP region. By default Datadog collects from all regions.
*
* @return regionFilterConfigs
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_REGION_FILTER_CONFIGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getRegionFilterConfigs() {
return regionFilterConfigs;
}

public void setRegionFilterConfigs(List<String> regionFilterConfigs) {
this.regionFilterConfigs = regionFilterConfigs;
}

public GCPSTSServiceAccountAttributes resourceCollectionEnabled(
Boolean resourceCollectionEnabled) {
this.resourceCollectionEnabled = resourceCollectionEnabled;
Expand Down Expand Up @@ -469,6 +529,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(
Expand All @@ -481,6 +543,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)
Expand All @@ -497,11 +561,13 @@ public int hashCode() {
cloudRunRevisionFilters,
hostFilters,
isCspmEnabled,
isGlobalLocationEnabled,
isPerProjectQuotaEnabled,
isResourceChangeCollectionEnabled,
isSecurityCommandCenterEnabled,
metricNamespaceConfigs,
monitoredResourceConfigs,
regionFilterConfigs,
resourceCollectionEnabled,
additionalProperties);
}
Expand All @@ -518,6 +584,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");
Expand All @@ -533,6 +602,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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": ["us-east1", "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": ["us-east1", "europe-north1"]}, "type": "gcp_service_account"}}
When the request is sent
Then the response status is 409 Conflict

Expand Down Expand Up @@ -151,15 +151,15 @@ 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": ["us-east1", "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

@generated @skip @team:DataDog/gcp-integrations
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": ["us-east1", "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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate-{{ unique_lower_alnum }}\",\n \"dry_run\": false\n }\n }\n}"
"value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate\",\n \"dry_run\": false\n }\n }\n}"
}
],
"step": "there is a valid \"deployment_gate\" in the system",
Expand Down
Loading