Skip to content

Commit c26bcc7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
datadog_integration_gcp_sts Add Support for IsPerProjectQuotaEnabled for GCP STS Service Accounts (#2521)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d83c1b8 commit c26bcc7

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-17 13:26:11.571880",
8-
"spec_repo_commit": "12ab5180"
7+
"regenerated": "2025-04-22 18:28:00.719806",
8+
"spec_repo_commit": "2b6fa951"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-17 13:26:11.587151",
13-
"spec_repo_commit": "12ab5180"
12+
"regenerated": "2025-04-22 18:28:00.750292",
13+
"spec_repo_commit": "2b6fa951"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -14676,6 +14676,13 @@ components:
1467614676
product for this service account. Note: This requires resource_collection_enabled
1467714677
to be set to true.'
1467814678
type: boolean
14679+
is_per_project_quota_enabled:
14680+
default: false
14681+
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
14682+
attributing Google Cloud billing and quota usage to the project being
14683+
monitored rather than the default service account project.
14684+
example: true
14685+
type: boolean
1467914686
is_resource_change_collection_enabled:
1468014687
default: false
1468114688
description: When enabled, Datadog scans for all resource change data in

src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def openapi_types(_):
2929
"cloud_run_revision_filters": ([str],),
3030
"host_filters": ([str],),
3131
"is_cspm_enabled": (bool,),
32+
"is_per_project_quota_enabled": (bool,),
3233
"is_resource_change_collection_enabled": (bool,),
3334
"is_security_command_center_enabled": (bool,),
3435
"metric_namespace_configs": ([GCPMetricNamespaceConfig],),
@@ -42,6 +43,7 @@ def openapi_types(_):
4243
"cloud_run_revision_filters": "cloud_run_revision_filters",
4344
"host_filters": "host_filters",
4445
"is_cspm_enabled": "is_cspm_enabled",
46+
"is_per_project_quota_enabled": "is_per_project_quota_enabled",
4547
"is_resource_change_collection_enabled": "is_resource_change_collection_enabled",
4648
"is_security_command_center_enabled": "is_security_command_center_enabled",
4749
"metric_namespace_configs": "metric_namespace_configs",
@@ -56,6 +58,7 @@ def __init__(
5658
cloud_run_revision_filters: Union[List[str], UnsetType] = unset,
5759
host_filters: Union[List[str], UnsetType] = unset,
5860
is_cspm_enabled: Union[bool, UnsetType] = unset,
61+
is_per_project_quota_enabled: Union[bool, UnsetType] = unset,
5962
is_resource_change_collection_enabled: Union[bool, UnsetType] = unset,
6063
is_security_command_center_enabled: Union[bool, UnsetType] = unset,
6164
metric_namespace_configs: Union[List[GCPMetricNamespaceConfig], UnsetType] = unset,
@@ -84,6 +87,9 @@ def __init__(
8487
:param is_cspm_enabled: 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.
8588
:type is_cspm_enabled: bool, optional
8689
90+
:param is_per_project_quota_enabled: 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.
91+
:type is_per_project_quota_enabled: bool, optional
92+
8793
:param is_resource_change_collection_enabled: When enabled, Datadog scans for all resource change data in your Google Cloud environment.
8894
:type is_resource_change_collection_enabled: bool, optional
8995
@@ -108,6 +114,8 @@ def __init__(
108114
kwargs["host_filters"] = host_filters
109115
if is_cspm_enabled is not unset:
110116
kwargs["is_cspm_enabled"] = is_cspm_enabled
117+
if is_per_project_quota_enabled is not unset:
118+
kwargs["is_per_project_quota_enabled"] = is_per_project_quota_enabled
111119
if is_resource_change_collection_enabled is not unset:
112120
kwargs["is_resource_change_collection_enabled"] = is_resource_change_collection_enabled
113121
if is_security_command_center_enabled is not unset:

tests/v2/features/gcp_integration.feature

+4-4
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": "[email protected]", "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"}}
37+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "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"}}
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": "[email protected]", "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"}}
44+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "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"}}
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": "[email protected]", "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"}}
154+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "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"}}
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": "[email protected]", "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"}}
162+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "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"}}
163163
When the request is sent
164164
Then the response status is 404 Not Found
165165

0 commit comments

Comments
 (0)