Skip to content

Commit 004b61a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[query] rm note about unstable datasources (#364)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f79ec25 commit 004b61a

File tree

9 files changed

+8
-51
lines changed

9 files changed

+8
-51
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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": "2024-11-05 20:16:38.481419",
8-
"spec_repo_commit": "1a56bfda"
7+
"regenerated": "2024-11-05 21:07:09.415913",
8+
"spec_repo_commit": "6c0fa1b6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-05 20:16:38.500088",
13-
"spec_repo_commit": "1a56bfda"
12+
"regenerated": "2024-11-05 21:07:09.434355",
13+
"spec_repo_commit": "6c0fa1b6"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35699,12 +35699,6 @@ paths:
3569935699
operator: OR
3570035700
permissions:
3570135701
- timeseries_query
35702-
x-unstable: '**Note**: This endpoint is GA for Metrics, Real User Monitoring
35703-
(RUM), Cloud Cost Management, and Log Management data sources.
35704-
35705-
We are gradually onboarding support for more sources. If you have any
35706-
35707-
feedback, contact [Datadog Support](https://docs.datadoghq.com/help/).'
3570835702
/api/v2/query/timeseries:
3570935703
post:
3571035704
description: 'Query timeseries data across various data sources and
@@ -35745,12 +35739,6 @@ paths:
3574535739
operator: OR
3574635740
permissions:
3574735741
- timeseries_query
35748-
x-unstable: '**Note**: This endpoint is GA for Metrics, Real User Monitoring
35749-
(RUM), Cloud Cost Management, and Log Management data sources.
35750-
35751-
We are gradually onboarding support for more sources. If you have any
35752-
35753-
feedback, contact [Datadog Support](https://docs.datadoghq.com/help/).'
3575435742
/api/v2/remote_config/products/cws/agent_rules:
3575535743
get:
3575635744
description: Get the list of Cloud Security Management Threats Agent rules.

examples/v2_metrics_QueryScalarData.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ async fn main() {
3131
.limit(FormulaLimit::new().count(10).order(QuerySortOrder::DESC))]),
3232
ScalarFormulaRequestType::SCALAR_REQUEST,
3333
));
34-
let mut configuration = datadog::Configuration::new();
35-
configuration.set_unstable_operation_enabled("v2.QueryScalarData", true);
34+
let configuration = datadog::Configuration::new();
3635
let api = MetricsAPI::with_config(configuration);
3736
let resp = api.query_scalar_data(body).await;
3837
if let Ok(value) = resp {

examples/v2_metrics_QueryScalarData_3112571352.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ async fn main() {
3232
.limit(FormulaLimit::new().count(10).order(QuerySortOrder::DESC))]),
3333
ScalarFormulaRequestType::SCALAR_REQUEST,
3434
));
35-
let mut configuration = datadog::Configuration::new();
36-
configuration.set_unstable_operation_enabled("v2.QueryScalarData", true);
35+
let configuration = datadog::Configuration::new();
3736
let api = MetricsAPI::with_config(configuration);
3837
let resp = api.query_scalar_data(body).await;
3938
if let Ok(value) = resp {

examples/v2_metrics_QueryTimeseriesData.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ async fn main() {
3030
.interval(5000),
3131
TimeseriesFormulaRequestType::TIMESERIES_REQUEST,
3232
));
33-
let mut configuration = datadog::Configuration::new();
34-
configuration.set_unstable_operation_enabled("v2.QueryTimeseriesData", true);
33+
let configuration = datadog::Configuration::new();
3534
let api = MetricsAPI::with_config(configuration);
3635
let resp = api.query_timeseries_data(body).await;
3736
if let Ok(value) = resp {

examples/v2_metrics_QueryTimeseriesData_301142940.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ async fn main() {
3131
.interval(5000),
3232
TimeseriesFormulaRequestType::TIMESERIES_REQUEST,
3333
));
34-
let mut configuration = datadog::Configuration::new();
35-
configuration.set_unstable_operation_enabled("v2.QueryTimeseriesData", true);
34+
let configuration = datadog::Configuration::new();
3635
let api = MetricsAPI::with_config(configuration);
3736
let resp = api.query_timeseries_data(body).await;
3837
if let Ok(value) = resp {

src/datadog/configuration.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ impl Default for Configuration {
162162
("v2.update_incident_integration".to_owned(), false),
163163
("v2.update_incident_todo".to_owned(), false),
164164
("v2.update_incident_type".to_owned(), false),
165-
("v2.query_scalar_data".to_owned(), false),
166-
("v2.query_timeseries_data".to_owned(), false),
167165
("v2.get_finding".to_owned(), false),
168166
("v2.list_findings".to_owned(), false),
169167
("v2.mute_findings".to_owned(), false),

src/datadogV2/api/api_metrics.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use flate2::{
66
write::{GzEncoder, ZlibEncoder},
77
Compression,
88
};
9-
use log::warn;
109
use reqwest::header::{HeaderMap, HeaderValue};
1110
use serde::{Deserialize, Serialize};
1211
use std::io::Write;
@@ -1855,14 +1854,6 @@ impl MetricsAPI {
18551854
> {
18561855
let local_configuration = &self.config;
18571856
let operation_id = "v2.query_scalar_data";
1858-
if local_configuration.is_unstable_operation_enabled(operation_id) {
1859-
warn!("Using unstable operation {operation_id}");
1860-
} else {
1861-
let local_error = datadog::UnstableOperationDisabledError {
1862-
msg: "Operation 'v2.query_scalar_data' is not enabled".to_string(),
1863-
};
1864-
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
1865-
}
18661857

18671858
let local_client = &self.client;
18681859

@@ -2019,14 +2010,6 @@ impl MetricsAPI {
20192010
> {
20202011
let local_configuration = &self.config;
20212012
let operation_id = "v2.query_timeseries_data";
2022-
if local_configuration.is_unstable_operation_enabled(operation_id) {
2023-
warn!("Using unstable operation {operation_id}");
2024-
} else {
2025-
let local_error = datadog::UnstableOperationDisabledError {
2026-
msg: "Operation 'v2.query_timeseries_data' is not enabled".to_string(),
2027-
};
2028-
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
2029-
}
20302013

20312014
let local_client = &self.client;
20322015

tests/scenarios/features/v2/metrics.feature

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ Feature: Metrics
246246
@generated @skip @team:Datadog/timeseries-query
247247
Scenario: Query scalar data across multiple products returns "Bad Request" response
248248
Given a valid "appKeyAuth" key in the system
249-
And operation "QueryScalarData" enabled
250249
And new "QueryScalarData" request
251250
And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": 1568899800000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*} by {env}"}], "to": 1568923200000}, "type": "scalar_request"}}
252251
When the request is sent
@@ -255,7 +254,6 @@ Feature: Metrics
255254
@generated @skip @team:Datadog/timeseries-query
256255
Scenario: Query scalar data across multiple products returns "OK" response
257256
Given a valid "appKeyAuth" key in the system
258-
And operation "QueryScalarData" enabled
259257
And new "QueryScalarData" request
260258
And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": 1568899800000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*} by {env}"}], "to": 1568923200000}, "type": "scalar_request"}}
261259
When the request is sent
@@ -264,7 +262,6 @@ Feature: Metrics
264262
@generated @skip @team:Datadog/timeseries-query
265263
Scenario: Query timeseries data across multiple products returns "Bad Request" response
266264
Given a valid "appKeyAuth" key in the system
267-
And operation "QueryTimeseriesData" enabled
268265
And new "QueryTimeseriesData" request
269266
And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": 1568899800000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*} by {env}"}], "to": 1568923200000}, "type": "timeseries_request"}}
270267
When the request is sent
@@ -273,7 +270,6 @@ Feature: Metrics
273270
@generated @skip @team:Datadog/timeseries-query
274271
Scenario: Query timeseries data across multiple products returns "OK" response
275272
Given a valid "appKeyAuth" key in the system
276-
And operation "QueryTimeseriesData" enabled
277273
And new "QueryTimeseriesData" request
278274
And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": 1568899800000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*} by {env}"}], "to": 1568923200000}, "type": "timeseries_request"}}
279275
When the request is sent
@@ -300,7 +296,6 @@ Feature: Metrics
300296
@team:Datadog/timeseries-query
301297
Scenario: Scalar cross product query returns "Bad Request" response
302298
Given a valid "appKeyAuth" key in the system
303-
And operation "QueryScalarData" enabled
304299
And new "QueryScalarData" request
305300
And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": 1568899800000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": 1568923200000}, "type": "scalar_request"}}
306301
When the request is sent
@@ -309,7 +304,6 @@ Feature: Metrics
309304
@team:Datadog/timeseries-query
310305
Scenario: Scalar cross product query returns "OK" response
311306
Given a valid "appKeyAuth" key in the system
312-
And operation "QueryScalarData" enabled
313307
And new "QueryScalarData" request
314308
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}}
315309
When the request is sent
@@ -374,7 +368,6 @@ Feature: Metrics
374368
@skip @team:Datadog/timeseries-query
375369
Scenario: Timeseries cross product query returns "Bad Request" response
376370
Given a valid "appKeyAuth" key in the system
377-
And operation "QueryTimeseriesData" enabled
378371
And new "QueryTimeseriesData" request
379372
And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*}"}], "to": {{ timestamp('now') }}}, "type": "timeseries_rquest"}}
380373
When the request is sent
@@ -383,7 +376,6 @@ Feature: Metrics
383376
@team:Datadog/timeseries-query
384377
Scenario: Timeseries cross product query returns "OK" response
385378
Given a valid "appKeyAuth" key in the system
386-
And operation "QueryTimeseriesData" enabled
387379
And new "QueryTimeseriesData" request
388380
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:datadog.estimated_usage.metrics.custom{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}}
389381
When the request is sent

0 commit comments

Comments
 (0)