Skip to content

Commit 84384a4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add region_filter_configs and is_global_location_enabled to v2 GCP API (#3070)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 835074c commit 84384a4

3 files changed

Lines changed: 39 additions & 4 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23984,6 +23984,13 @@ components:
2398423984
product for this service account. Note: This requires resource_collection_enabled
2398523985
to be set to true.'
2398623986
type: boolean
23987+
is_global_location_enabled:
23988+
default: true
23989+
description: When enabled, Datadog collects metrics where location is explicitly
23990+
stated as "global" or where location information cannot be deduced from
23991+
GCP labels.
23992+
example: true
23993+
type: boolean
2398723994
is_per_project_quota_enabled:
2398823995
default: false
2398923996
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
@@ -24025,6 +24032,18 @@ components:
2402524032
items:
2402624033
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
2402724034
type: array
24035+
region_filter_configs:
24036+
description: Configurations for GCP location filtering, such as region,
24037+
multi-region, or zone. Only monitored resources that match the specified
24038+
regions are imported into Datadog. By default, Datadog collects from all
24039+
locations.
24040+
example:
24041+
- nam4
24042+
- europe-north1
24043+
items:
24044+
description: Region Filter Configs
24045+
type: string
24046+
type: array
2402824047
resource_collection_enabled:
2402924048
description: When enabled, Datadog scans for all resources in your GCP environment.
2403024049
type: boolean

features/v2/gcp_integration.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ Feature: GCP Integration
3434
@generated @skip @team:DataDog/gcp-integrations
3535
Scenario: Create a new entry for your service account returns "Bad Request" response
3636
Given new "CreateGCPSTSAccount" request
37-
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"}}
37+
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"}}
3838
When the request is sent
3939
Then the response status is 400 Bad Request
4040

4141
@generated @skip @team:DataDog/gcp-integrations
4242
Scenario: Create a new entry for your service account returns "Conflict" response
4343
Given new "CreateGCPSTSAccount" request
44-
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"}}
44+
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"}}
4545
When the request is sent
4646
Then the response status is 409 Conflict
4747

@@ -151,15 +151,15 @@ Feature: GCP Integration
151151
Scenario: Update STS Service Account returns "Bad Request" response
152152
Given new "UpdateGCPSTSAccount" request
153153
And request contains "account_id" parameter from "REPLACE.ME"
154-
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"}}
154+
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"}}
155155
When the request is sent
156156
Then the response status is 400 Bad Request
157157

158158
@generated @skip @team:DataDog/gcp-integrations
159159
Scenario: Update STS Service Account returns "Not Found" response
160160
Given new "UpdateGCPSTSAccount" request
161161
And request contains "account_id" parameter from "REPLACE.ME"
162-
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"}}
162+
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"}}
163163
When the request is sent
164164
Then the response status is 404 Not Found
165165

packages/datadog-api-client-v2/models/GCPSTSServiceAccountAttributes.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export class GCPSTSServiceAccountAttributes {
4040
* When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
4141
*/
4242
"isCspmEnabled"?: boolean;
43+
/**
44+
* When enabled, Datadog collects metrics where location is explicitly stated as "global" or where location information cannot be deduced from GCP labels.
45+
*/
46+
"isGlobalLocationEnabled"?: boolean;
4347
/**
4448
* When enabled, Datadog applies the `X-Goog-User-Project` header, attributing Google Cloud billing and quota usage to the project being monitored rather than the default service account project.
4549
*/
@@ -60,6 +64,10 @@ export class GCPSTSServiceAccountAttributes {
6064
* Configurations for GCP monitored resources.
6165
*/
6266
"monitoredResourceConfigs"?: Array<GCPMonitoredResourceConfig>;
67+
/**
68+
* 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.
69+
*/
70+
"regionFilterConfigs"?: Array<string>;
6371
/**
6472
* When enabled, Datadog scans for all resources in your GCP environment.
6573
*/
@@ -105,6 +113,10 @@ export class GCPSTSServiceAccountAttributes {
105113
baseName: "is_cspm_enabled",
106114
type: "boolean",
107115
},
116+
isGlobalLocationEnabled: {
117+
baseName: "is_global_location_enabled",
118+
type: "boolean",
119+
},
108120
isPerProjectQuotaEnabled: {
109121
baseName: "is_per_project_quota_enabled",
110122
type: "boolean",
@@ -125,6 +137,10 @@ export class GCPSTSServiceAccountAttributes {
125137
baseName: "monitored_resource_configs",
126138
type: "Array<GCPMonitoredResourceConfig>",
127139
},
140+
regionFilterConfigs: {
141+
baseName: "region_filter_configs",
142+
type: "Array<string>",
143+
},
128144
resourceCollectionEnabled: {
129145
baseName: "resource_collection_enabled",
130146
type: "boolean",

0 commit comments

Comments
 (0)