Skip to content

Commit 5ff802a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing query parameter to CNM aggregated connections and DNS endpoints (#1683)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 00a9e66 commit 5ff802a

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138116,6 +138116,12 @@ paths:
138116138116
name: tags
138117138117
schema:
138118138118
type: string
138119+
- description: Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter.
138120+
example: "(client_team:networks OR client_team:platform) AND server_service:hucklebuck"
138121+
in: query
138122+
name: query
138123+
schema:
138124+
type: string
138119138125
- description: The number of connections to be returned. The maximum value is 7500. The default is 100.
138120138126
in: query
138121138127
name: limit
@@ -138177,6 +138183,12 @@ paths:
138177138183
name: tags
138178138184
schema:
138179138185
type: string
138186+
- description: Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter.
138187+
example: "(client_team:networks OR client_team:platform) AND server_service:hucklebuck"
138188+
in: query
138189+
name: query
138190+
schema:
138191+
type: string
138180138192
- description: The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100.
138181138193
in: query
138182138194
name: limit

src/datadogV2/api/api_cloud_network_monitoring.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub struct GetAggregatedConnectionsOptionalParams {
1717
pub group_by: Option<String>,
1818
/// Comma-separated list of tags to filter connections by.
1919
pub tags: Option<String>,
20+
/// Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter.
21+
pub query: Option<String>,
2022
/// The number of connections to be returned. The maximum value is 7500. The default is 100.
2123
pub limit: Option<i32>,
2224
}
@@ -42,6 +44,11 @@ impl GetAggregatedConnectionsOptionalParams {
4244
self.tags = Some(value);
4345
self
4446
}
47+
/// Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter.
48+
pub fn query(mut self, value: String) -> Self {
49+
self.query = Some(value);
50+
self
51+
}
4552
/// The number of connections to be returned. The maximum value is 7500. The default is 100.
4653
pub fn limit(mut self, value: i32) -> Self {
4754
self.limit = Some(value);
@@ -61,6 +68,8 @@ pub struct GetAggregatedDnsOptionalParams {
6168
pub group_by: Option<String>,
6269
/// Comma-separated list of tags to filter DNS traffic by.
6370
pub tags: Option<String>,
71+
/// Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter.
72+
pub query: Option<String>,
6473
/// The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100.
6574
pub limit: Option<i32>,
6675
}
@@ -86,6 +95,11 @@ impl GetAggregatedDnsOptionalParams {
8695
self.tags = Some(value);
8796
self
8897
}
98+
/// Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter.
99+
pub fn query(mut self, value: String) -> Self {
100+
self.query = Some(value);
101+
self
102+
}
89103
/// The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100.
90104
pub fn limit(mut self, value: i32) -> Self {
91105
self.limit = Some(value);
@@ -221,6 +235,7 @@ impl CloudNetworkMonitoringAPI {
221235
let to = params.to;
222236
let group_by = params.group_by;
223237
let tags = params.tags;
238+
let query = params.query;
224239
let limit = params.limit;
225240

226241
let local_client = &self.client;
@@ -247,6 +262,10 @@ impl CloudNetworkMonitoringAPI {
247262
local_req_builder =
248263
local_req_builder.query(&[("tags", &local_query_param.to_string())]);
249264
};
265+
if let Some(ref local_query_param) = query {
266+
local_req_builder =
267+
local_req_builder.query(&[("query", &local_query_param.to_string())]);
268+
};
250269
if let Some(ref local_query_param) = limit {
251270
local_req_builder =
252271
local_req_builder.query(&[("limit", &local_query_param.to_string())]);
@@ -357,6 +376,7 @@ impl CloudNetworkMonitoringAPI {
357376
let to = params.to;
358377
let group_by = params.group_by;
359378
let tags = params.tags;
379+
let query = params.query;
360380
let limit = params.limit;
361381

362382
let local_client = &self.client;
@@ -383,6 +403,10 @@ impl CloudNetworkMonitoringAPI {
383403
local_req_builder =
384404
local_req_builder.query(&[("tags", &local_query_param.to_string())]);
385405
};
406+
if let Some(ref local_query_param) = query {
407+
local_req_builder =
408+
local_req_builder.query(&[("query", &local_query_param.to_string())]);
409+
};
386410
if let Some(ref local_query_param) = limit {
387411
local_req_builder =
388412
local_req_builder.query(&[("limit", &local_query_param.to_string())]);

tests/scenarios/function_mappings.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42136,6 +42136,9 @@ fn test_v2_get_aggregated_connections(
4213642136
let tags = _parameters
4213742137
.get("tags")
4213842138
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
42139+
let query = _parameters
42140+
.get("query")
42141+
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
4213942142
let limit = _parameters
4214042143
.get("limit")
4214142144
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
@@ -42145,6 +42148,7 @@ fn test_v2_get_aggregated_connections(
4214542148
params.to = to;
4214642149
params.group_by = group_by;
4214742150
params.tags = tags;
42151+
params.query = query;
4214842152
params.limit = limit;
4214942153
let response = match block_on(api.get_aggregated_connections_with_http_info(params)) {
4215042154
Ok(response) => response,
@@ -42182,6 +42186,9 @@ fn test_v2_get_aggregated_dns(world: &mut DatadogWorld, _parameters: &HashMap<St
4218242186
let tags = _parameters
4218342187
.get("tags")
4218442188
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
42189+
let query = _parameters
42190+
.get("query")
42191+
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
4218542192
let limit = _parameters
4218642193
.get("limit")
4218742194
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
@@ -42191,6 +42198,7 @@ fn test_v2_get_aggregated_dns(world: &mut DatadogWorld, _parameters: &HashMap<St
4219142198
params.to = to;
4219242199
params.group_by = group_by;
4219342200
params.tags = tags;
42201+
params.query = query;
4219442202
params.limit = limit;
4219542203
let response = match block_on(api.get_aggregated_dns_with_http_info(params)) {
4219642204
Ok(response) => response,

0 commit comments

Comments
 (0)