Skip to content

Commit dbc827b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 637fe58 of spec repo
1 parent d9e3090 commit dbc827b

6 files changed

Lines changed: 163 additions & 4 deletions

File tree

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61219,6 +61219,31 @@ components:
6121961219
- CLOUD_FUNCTION
6122061220
- CLOUD_RUN_REVISION
6122161221
- GCE_INSTANCE
61222+
GCPProjectFilterConfig:
61223+
description: Configuration for filtering the GCP projects that Datadog monitors, by project ID or by project label.
61224+
properties:
61225+
filters:
61226+
description: |-
61227+
List of filters matched against the project field set by `type`. Filters support the `*` and `?` wildcards, and a leading `!` makes a filter an exclusion.
61228+
A project is skipped if it matches any exclusion filter. When inclusion filters are set, a project must also match at least one of them.
61229+
For `project_id`, each filter is a project ID pattern, such as `prod-*`, with up to 15,000 filters.
61230+
For `project_label`, each filter is a label in the form `key:value`, such as `env:prod*`, with up to 100 filters. Keys are matched exactly and wildcards apply only to values, so `key:*` matches any value.
61231+
example: ["prod-*", "!prod-legacy"]
61232+
items:
61233+
description: A project filter
61234+
type: string
61235+
type: array
61236+
type:
61237+
$ref: "#/components/schemas/GCPProjectFilterConfigType"
61238+
type: object
61239+
GCPProjectFilterConfigType:
61240+
description: The GCP project field that the filters are matched against.
61241+
enum: ["project_id", "project_label"]
61242+
example: "project_id"
61243+
type: string
61244+
x-enum-varnames:
61245+
- PROJECT_ID
61246+
- PROJECT_LABEL
6122261247
GCPSTSDelegateAccount:
6122361248
description: Datadog principal service account info.
6122461249
properties:
@@ -61353,6 +61378,14 @@ components:
6135361378
items:
6135461379
$ref: "#/components/schemas/GCPMonitoredResourceConfig"
6135561380
type: array
61381+
project_filter_configs:
61382+
description: |-
61383+
Configurations for limiting which of the GCP projects this service account can access are monitored by Datadog, with at most one configuration per type. A project is monitored only if it passes the filters of every configured type. By default, Datadog monitors every project the service account can access.
61384+
When updating a service account, omit this field to keep the current filters, or send an empty list to remove them.
61385+
example: [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}]
61386+
items:
61387+
$ref: "#/components/schemas/GCPProjectFilterConfig"
61388+
type: array
6135661389
region_filter_configs:
6135761390
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.
6135861391
example: ["nam4", "europe-north1"]
@@ -200108,6 +200141,14 @@ paths:
200108200141
- filters:
200109200142
- $KEY:$VALUE
200110200143
type: gce_instance
200144+
project_filter_configs:
200145+
- filters:
200146+
- prod-*
200147+
- "!prod-legacy"
200148+
type: project_id
200149+
- filters:
200150+
- "env:prod*"
200151+
type: project_label
200111200152
region_filter_configs:
200112200153
- nam4
200113200154
- europe-north1
@@ -200206,6 +200247,14 @@ paths:
200206200247
- filters:
200207200248
- $KEY:$VALUE
200208200249
type: gce_instance
200250+
project_filter_configs:
200251+
- filters:
200252+
- prod-*
200253+
- "!prod-legacy"
200254+
type: project_id
200255+
- filters:
200256+
- "env:prod*"
200257+
type: project_label
200209200258
region_filter_configs:
200210200259
- nam4
200211200260
- europe-north1
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.gcp_project_filter_config_type import GCPProjectFilterConfigType
18+
19+
20+
class GCPProjectFilterConfig(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.gcp_project_filter_config_type import GCPProjectFilterConfigType
24+
25+
return {
26+
"filters": ([str],),
27+
"type": (GCPProjectFilterConfigType,),
28+
}
29+
30+
attribute_map = {
31+
"filters": "filters",
32+
"type": "type",
33+
}
34+
35+
def __init__(
36+
self_,
37+
filters: Union[List[str], UnsetType] = unset,
38+
type: Union[GCPProjectFilterConfigType, UnsetType] = unset,
39+
**kwargs,
40+
):
41+
"""
42+
Configuration for filtering the GCP projects that Datadog monitors, by project ID or by project label.
43+
44+
:param filters: List of filters matched against the project field set by ``type``. Filters support the ``*`` and ``?`` wildcards, and a leading ``!`` makes a filter an exclusion.
45+
A project is skipped if it matches any exclusion filter. When inclusion filters are set, a project must also match at least one of them.
46+
For ``project_id`` , each filter is a project ID pattern, such as ``prod-*`` , with up to 15,000 filters.
47+
For ``project_label`` , each filter is a label in the form ``key:value`` , such as ``env:prod*`` , with up to 100 filters. Keys are matched exactly and wildcards apply only to values, so ``key:*`` matches any value.
48+
:type filters: [str], optional
49+
50+
:param type: The GCP project field that the filters are matched against.
51+
:type type: GCPProjectFilterConfigType, optional
52+
"""
53+
if filters is not unset:
54+
kwargs["filters"] = filters
55+
if type is not unset:
56+
kwargs["type"] = type
57+
super().__init__(kwargs)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class GCPProjectFilterConfigType(ModelSimple):
16+
"""
17+
The GCP project field that the filters are matched against.
18+
19+
:param value: Must be one of ["project_id", "project_label"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"project_id",
25+
"project_label",
26+
}
27+
PROJECT_ID: ClassVar["GCPProjectFilterConfigType"]
28+
PROJECT_LABEL: ClassVar["GCPProjectFilterConfigType"]
29+
30+
@cached_property
31+
def openapi_types(_):
32+
return {
33+
"value": (str,),
34+
}
35+
36+
37+
GCPProjectFilterConfigType.PROJECT_ID = GCPProjectFilterConfigType("project_id")
38+
GCPProjectFilterConfigType.PROJECT_LABEL = GCPProjectFilterConfigType("project_label")

‎src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
if TYPE_CHECKING:
1717
from datadog_api_client.v2.model.gcp_metric_namespace_config import GCPMetricNamespaceConfig
1818
from datadog_api_client.v2.model.gcp_monitored_resource_config import GCPMonitoredResourceConfig
19+
from datadog_api_client.v2.model.gcp_project_filter_config import GCPProjectFilterConfig
1920

2021

2122
class GCPSTSServiceAccountAttributes(ModelNormal):
2223
@cached_property
2324
def openapi_types(_):
2425
from datadog_api_client.v2.model.gcp_metric_namespace_config import GCPMetricNamespaceConfig
2526
from datadog_api_client.v2.model.gcp_monitored_resource_config import GCPMonitoredResourceConfig
27+
from datadog_api_client.v2.model.gcp_project_filter_config import GCPProjectFilterConfig
2628

2729
return {
2830
"account_tags": ([str],),
@@ -38,6 +40,7 @@ def openapi_types(_):
3840
"is_security_command_center_enabled": (bool,),
3941
"metric_namespace_configs": ([GCPMetricNamespaceConfig],),
4042
"monitored_resource_configs": ([GCPMonitoredResourceConfig],),
43+
"project_filter_configs": ([GCPProjectFilterConfig],),
4144
"region_filter_configs": ([str],),
4245
"resource_collection_enabled": (bool,),
4346
}
@@ -56,6 +59,7 @@ def openapi_types(_):
5659
"is_security_command_center_enabled": "is_security_command_center_enabled",
5760
"metric_namespace_configs": "metric_namespace_configs",
5861
"monitored_resource_configs": "monitored_resource_configs",
62+
"project_filter_configs": "project_filter_configs",
5963
"region_filter_configs": "region_filter_configs",
6064
"resource_collection_enabled": "resource_collection_enabled",
6165
}
@@ -75,6 +79,7 @@ def __init__(
7579
is_security_command_center_enabled: Union[bool, UnsetType] = unset,
7680
metric_namespace_configs: Union[List[GCPMetricNamespaceConfig], UnsetType] = unset,
7781
monitored_resource_configs: Union[List[GCPMonitoredResourceConfig], UnsetType] = unset,
82+
project_filter_configs: Union[List[GCPProjectFilterConfig], UnsetType] = unset,
7883
region_filter_configs: Union[List[str], UnsetType] = unset,
7984
resource_collection_enabled: Union[bool, UnsetType] = unset,
8085
**kwargs,
@@ -126,6 +131,10 @@ def __init__(
126131
:param monitored_resource_configs: Configurations for GCP monitored resources.
127132
:type monitored_resource_configs: [GCPMonitoredResourceConfig], optional
128133
134+
:param project_filter_configs: Configurations for limiting which of the GCP projects this service account can access are monitored by Datadog, with at most one configuration per type. A project is monitored only if it passes the filters of every configured type. By default, Datadog monitors every project the service account can access.
135+
When updating a service account, omit this field to keep the current filters, or send an empty list to remove them.
136+
:type project_filter_configs: [GCPProjectFilterConfig], optional
137+
129138
:param region_filter_configs: 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.
130139
:type region_filter_configs: [str], optional
131140
@@ -158,6 +167,8 @@ def __init__(
158167
kwargs["metric_namespace_configs"] = metric_namespace_configs
159168
if monitored_resource_configs is not unset:
160169
kwargs["monitored_resource_configs"] = monitored_resource_configs
170+
if project_filter_configs is not unset:
171+
kwargs["project_filter_configs"] = project_filter_configs
161172
if region_filter_configs is not unset:
162173
kwargs["region_filter_configs"] = region_filter_configs
163174
if resource_collection_enabled is not unset:

‎src/datadog_api_client/v2/models/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,6 +4691,8 @@
46914691
from datadog_api_client.v2.model.gcp_metric_namespace_config import GCPMetricNamespaceConfig
46924692
from datadog_api_client.v2.model.gcp_monitored_resource_config import GCPMonitoredResourceConfig
46934693
from datadog_api_client.v2.model.gcp_monitored_resource_config_type import GCPMonitoredResourceConfigType
4694+
from datadog_api_client.v2.model.gcp_project_filter_config import GCPProjectFilterConfig
4695+
from datadog_api_client.v2.model.gcp_project_filter_config_type import GCPProjectFilterConfigType
46944696
from datadog_api_client.v2.model.gcpsts_delegate_account import GCPSTSDelegateAccount
46954697
from datadog_api_client.v2.model.gcpsts_delegate_account_attributes import GCPSTSDelegateAccountAttributes
46964698
from datadog_api_client.v2.model.gcpsts_delegate_account_response import GCPSTSDelegateAccountResponse
@@ -17171,6 +17173,8 @@
1717117173
"GCPMetricNamespaceConfig",
1717217174
"GCPMonitoredResourceConfig",
1717317175
"GCPMonitoredResourceConfigType",
17176+
"GCPProjectFilterConfig",
17177+
"GCPProjectFilterConfigType",
1717417178
"GCPSTSDelegateAccount",
1717517179
"GCPSTSDelegateAccountAttributes",
1717617180
"GCPSTSDelegateAccountResponse",

‎tests/v2/features/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:ddoghq/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_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "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"}}
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_org_folder_resource_collection_enabled": false, "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"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "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:ddoghq/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_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "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"}}
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_org_folder_resource_collection_enabled": false, "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"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "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

@@ -161,15 +161,15 @@ Feature: GCP Integration
161161
Scenario: Update STS Service Account returns "Bad Request" response
162162
Given new "UpdateGCPSTSAccount" request
163163
And request contains "account_id" parameter from "REPLACE.ME"
164-
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_org_folder_resource_collection_enabled": false, "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"}}
164+
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_org_folder_resource_collection_enabled": false, "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"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
165165
When the request is sent
166166
Then the response status is 400 Bad Request
167167

168168
@generated @skip @team:ddoghq/gcp-integrations
169169
Scenario: Update STS Service Account returns "Not Found" response
170170
Given new "UpdateGCPSTSAccount" request
171171
And request contains "account_id" parameter from "REPLACE.ME"
172-
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_org_folder_resource_collection_enabled": false, "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"}}
172+
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_org_folder_resource_collection_enabled": false, "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"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
173173
When the request is sent
174174
Then the response status is 404 Not Found
175175

0 commit comments

Comments
 (0)