Skip to content

Commit d226e5d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 05ffea6 of spec repo
1 parent 995d156 commit d226e5d

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20406,9 +20406,20 @@ components:
2040620406
to this GCP metric namespace.
2040720407
example: true
2040820408
type: boolean
20409+
filters:
20410+
description: When enabled, Datadog applies these additional filters to limit
20411+
metric collection. A metric is collected only if it does not match all
20412+
exclusion filters and matches at least one allow filter.
20413+
example:
20414+
- snapshot.*
20415+
- '!*_by_region'
20416+
items:
20417+
description: A metric namespace filter
20418+
type: string
20419+
type: array
2040920420
id:
2041020421
description: The id of the GCP metric namespace.
20411-
example: aiplatform
20422+
example: pubsub
2041220423
type: string
2041320424
type: object
2041420425
GCPMonitoredResourceConfig:
@@ -20570,6 +20581,10 @@ components:
2057020581
example:
2057120582
- disabled: true
2057220583
id: aiplatform
20584+
- filters:
20585+
- snapshot.*
20586+
- '!*_by_region'
20587+
id: pubsub
2057320588
items:
2057420589
$ref: '#/components/schemas/GCPMetricNamespaceConfig'
2057520590
type: array

src/datadogV2/model/model_gcp_metric_namespace_config.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ pub struct GCPMetricNamespaceConfig {
1414
/// When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.
1515
#[serde(rename = "disabled")]
1616
pub disabled: Option<bool>,
17+
/// When enabled, Datadog applies these additional filters to limit metric collection. A metric is collected only if it does not match all exclusion filters and matches at least one allow filter.
18+
#[serde(rename = "filters")]
19+
pub filters: Option<Vec<String>>,
1720
/// The id of the GCP metric namespace.
1821
#[serde(rename = "id")]
1922
pub id: Option<String>,
@@ -28,6 +31,7 @@ impl GCPMetricNamespaceConfig {
2831
pub fn new() -> GCPMetricNamespaceConfig {
2932
GCPMetricNamespaceConfig {
3033
disabled: None,
34+
filters: None,
3135
id: None,
3236
additional_properties: std::collections::BTreeMap::new(),
3337
_unparsed: false,
@@ -39,6 +43,11 @@ impl GCPMetricNamespaceConfig {
3943
self
4044
}
4145

46+
pub fn filters(mut self, value: Vec<String>) -> Self {
47+
self.filters = Some(value);
48+
self
49+
}
50+
4251
pub fn id(mut self, value: String) -> Self {
4352
self.id = Some(value);
4453
self
@@ -77,6 +86,7 @@ impl<'de> Deserialize<'de> for GCPMetricNamespaceConfig {
7786
M: MapAccess<'a>,
7887
{
7988
let mut disabled: Option<bool> = None;
89+
let mut filters: Option<Vec<String>> = None;
8090
let mut id: Option<String> = None;
8191
let mut additional_properties: std::collections::BTreeMap<
8292
String,
@@ -92,6 +102,12 @@ impl<'de> Deserialize<'de> for GCPMetricNamespaceConfig {
92102
}
93103
disabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
94104
}
105+
"filters" => {
106+
if v.is_null() {
107+
continue;
108+
}
109+
filters = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
110+
}
95111
"id" => {
96112
if v.is_null() {
97113
continue;
@@ -108,6 +124,7 @@ impl<'de> Deserialize<'de> for GCPMetricNamespaceConfig {
108124

109125
let content = GCPMetricNamespaceConfig {
110126
disabled,
127+
filters,
111128
id,
112129
additional_properties,
113130
_unparsed,

tests/scenarios/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": "[email protected]", "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"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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": ["$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"}}
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": ["$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"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "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": ["$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"}}
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": ["$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"}], "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": "[email protected]", "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"}}
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": ["$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"}], "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": "[email protected]", "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"}}
163163
When the request is sent
164164
Then the response status is 404 Not Found
165165

0 commit comments

Comments
 (0)