From 2e6f1b8cdf8e859db7a68ae678b99629f5fbb34c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 3 Apr 2026 20:58:51 +0000 Subject: [PATCH] Regenerate client from commit 8d710f7 of spec repo --- .generator/schemas/v2/openapi.yaml | 575 ++++++++++++++++++ .../v2/metrics/QueryScalarData_1479548882.rb | 39 ++ .../v2/metrics/QueryScalarData_1904811219.rb | 36 ++ .../v2/metrics/QueryScalarData_2298288525.rb | 35 ++ .../v2/metrics/QueryScalarData_2533499017.rb | 37 ++ .../v2/metrics/QueryScalarData_4230617918.rb | 37 ++ .../v2/metrics/QueryScalarData_891952130.rb | 35 ++ .../metrics/QueryTimeseriesData_108927825.rb | 36 ++ .../metrics/QueryTimeseriesData_2159746306.rb | 37 ++ .../metrics/QueryTimeseriesData_3174309318.rb | 35 ++ .../metrics/QueryTimeseriesData_4028506518.rb | 40 ++ .../metrics/QueryTimeseriesData_4246412951.rb | 37 ++ .../metrics/QueryTimeseriesData_847716941.rb | 38 ++ features/v2/metrics.feature | 108 ++++ lib/datadog_api_client/inflector.rb | 20 + .../v2/models/apm_dependency_stat_name.rb | 32 + .../apm_dependency_stats_data_source.rb | 26 + .../v2/models/apm_dependency_stats_query.rb | 279 +++++++++ .../v2/models/apm_metrics_data_source.rb | 26 + .../v2/models/apm_metrics_query.rb | 259 ++++++++ .../v2/models/apm_metrics_stat.rb | 41 ++ .../v2/models/apm_resource_stat_name.rb | 37 ++ .../models/apm_resource_stats_data_source.rb | 26 + .../v2/models/apm_resource_stats_query.rb | 259 ++++++++ .../v2/models/container_data_source.rb | 26 + .../v2/models/container_scalar_query.rb | 227 +++++++ .../v2/models/container_timeseries_query.rb | 217 +++++++ .../v2/models/events_data_source.rb | 11 + .../v2/models/process_data_source.rb | 26 + .../v2/models/process_scalar_query.rb | 227 +++++++ .../v2/models/process_timeseries_query.rb | 217 +++++++ .../v2/models/scalar_query.rb | 8 +- .../v2/models/slo_data_source.rb | 26 + lib/datadog_api_client/v2/models/slo_query.rb | 205 +++++++ .../v2/models/slos_group_mode.rb | 27 + .../v2/models/slos_measure.rb | 35 ++ .../v2/models/slos_query_type.rb | 28 + .../v2/models/timeseries_query.rb | 8 +- 38 files changed, 3416 insertions(+), 2 deletions(-) create mode 100644 examples/v2/metrics/QueryScalarData_1479548882.rb create mode 100644 examples/v2/metrics/QueryScalarData_1904811219.rb create mode 100644 examples/v2/metrics/QueryScalarData_2298288525.rb create mode 100644 examples/v2/metrics/QueryScalarData_2533499017.rb create mode 100644 examples/v2/metrics/QueryScalarData_4230617918.rb create mode 100644 examples/v2/metrics/QueryScalarData_891952130.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData_108927825.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData_2159746306.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData_3174309318.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData_4028506518.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData_4246412951.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData_847716941.rb create mode 100644 lib/datadog_api_client/v2/models/apm_dependency_stat_name.rb create mode 100644 lib/datadog_api_client/v2/models/apm_dependency_stats_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/apm_dependency_stats_query.rb create mode 100644 lib/datadog_api_client/v2/models/apm_metrics_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/apm_metrics_query.rb create mode 100644 lib/datadog_api_client/v2/models/apm_metrics_stat.rb create mode 100644 lib/datadog_api_client/v2/models/apm_resource_stat_name.rb create mode 100644 lib/datadog_api_client/v2/models/apm_resource_stats_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/apm_resource_stats_query.rb create mode 100644 lib/datadog_api_client/v2/models/container_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/container_scalar_query.rb create mode 100644 lib/datadog_api_client/v2/models/container_timeseries_query.rb create mode 100644 lib/datadog_api_client/v2/models/process_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/process_scalar_query.rb create mode 100644 lib/datadog_api_client/v2/models/process_timeseries_query.rb create mode 100644 lib/datadog_api_client/v2/models/slo_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/slo_query.rb create mode 100644 lib/datadog_api_client/v2/models/slos_group_mode.rb create mode 100644 lib/datadog_api_client/v2/models/slos_measure.rb create mode 100644 lib/datadog_api_client/v2/models/slos_query_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 45672b441bd8..2b33a7ca71bd 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3507,6 +3507,276 @@ components: example: "90646597-5fdb-4a17-a240-647003f8c028" format: uuid type: string + ApmDependencyStatName: + description: The APM dependency statistic to query. + enum: + - avg_duration + - avg_root_duration + - avg_spans_per_trace + - error_rate + - pct_exec_time + - pct_of_traces + - total_traces_count + example: avg_duration + type: string + x-enum-varnames: + - AVG_DURATION + - AVG_ROOT_DURATION + - AVG_SPANS_PER_TRACE + - ERROR_RATE + - PCT_EXEC_TIME + - PCT_OF_TRACES + - TOTAL_TRACES_COUNT + ApmDependencyStatsDataSource: + default: apm_dependency_stats + description: A data source for APM dependency statistics queries. + enum: + - apm_dependency_stats + example: apm_dependency_stats + type: string + x-enum-varnames: + - APM_DEPENDENCY_STATS + ApmDependencyStatsQuery: + description: An individual APM dependency stats query. + properties: + data_source: + $ref: "#/components/schemas/ApmDependencyStatsDataSource" + env: + description: The environment to query. + example: prod + type: string + is_upstream: + description: Determines whether stats for upstream or downstream dependencies should be queried. + example: true + type: boolean + name: + description: The variable name for use in formulas. + example: query1 + type: string + operation_name: + description: The APM operation name. + example: web.request + type: string + primary_tag_name: + description: The name of the second primary tag used within APM; required when `primary_tag_value` is specified. See https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope/#add-a-second-primary-tag-in-datadog. + example: datacenter + type: string + primary_tag_value: + description: Filter APM data by the second primary tag. `primary_tag_name` must also be specified. + example: us-east-1 + type: string + resource_name: + description: The resource name to filter by. + example: "" + type: string + service: + description: The service name to filter by. + example: web-store + type: string + stat: + $ref: "#/components/schemas/ApmDependencyStatName" + required: + - data_source + - name + - env + - operation_name + - resource_name + - service + - stat + type: object + ApmMetricsDataSource: + default: apm_metrics + description: A data source for APM metrics queries. + enum: + - apm_metrics + example: apm_metrics + type: string + x-enum-varnames: + - APM_METRICS + ApmMetricsQuery: + description: An individual APM metrics query. + properties: + data_source: + $ref: "#/components/schemas/ApmMetricsDataSource" + group_by: + description: Optional fields to group the query results by. + items: + description: A field to group results by. + example: service + type: string + type: array + name: + description: The variable name for use in formulas. + example: query1 + type: string + operation_mode: + description: Optional operation mode to aggregate across operation names. + example: "primary" + type: string + operation_name: + description: Name of operation on service. If not provided, the primary operation name is used. + example: web.request + type: string + peer_tags: + description: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.). + items: + description: A peer tag value. + example: "peer.service:my-service" + type: string + type: array + query_filter: + description: Additional filters for the query using metrics query syntax (e.g., env, primary_tag). + example: "env:prod" + type: string + resource_hash: + description: The resource hash for exact matching. + example: "abc123" + type: string + resource_name: + description: The full name of a specific resource to filter by. + example: "GET /api/v1/users" + type: string + service: + description: The service name to filter by. + example: web-store + type: string + span_kind: + description: Describes the relationship between the span, its parents, and its children in a trace. Known values include consumer, server, client, producer, internal. + example: server + type: string + stat: + $ref: "#/components/schemas/ApmMetricsStat" + required: + - data_source + - name + - stat + type: object + ApmMetricsStat: + description: The APM metric statistic to query. + enum: + - error_rate + - errors + - errors_per_second + - hits + - hits_per_second + - apdex + - latency_avg + - latency_max + - latency_p50 + - latency_p75 + - latency_p90 + - latency_p95 + - latency_p99 + - latency_p999 + - latency_distribution + - total_time + example: latency_p99 + type: string + x-enum-varnames: + - ERROR_RATE + - ERRORS + - ERRORS_PER_SECOND + - HITS + - HITS_PER_SECOND + - APDEX + - LATENCY_AVG + - LATENCY_MAX + - LATENCY_P50 + - LATENCY_P75 + - LATENCY_P90 + - LATENCY_P95 + - LATENCY_P99 + - LATENCY_P999 + - LATENCY_DISTRIBUTION + - TOTAL_TIME + ApmResourceStatName: + description: The APM resource statistic to query. + enum: + - error_rate + - errors + - hits + - latency_avg + - latency_max + - latency_p50 + - latency_p75 + - latency_p90 + - latency_p95 + - latency_p99 + - latency_distribution + - total_time + example: latency_p95 + type: string + x-enum-varnames: + - ERROR_RATE + - ERRORS + - HITS + - LATENCY_AVG + - LATENCY_MAX + - LATENCY_P50 + - LATENCY_P75 + - LATENCY_P90 + - LATENCY_P95 + - LATENCY_P99 + - LATENCY_DISTRIBUTION + - TOTAL_TIME + ApmResourceStatsDataSource: + default: apm_resource_stats + description: A data source for APM resource statistics queries. + enum: + - apm_resource_stats + example: apm_resource_stats + type: string + x-enum-varnames: + - APM_RESOURCE_STATS + ApmResourceStatsQuery: + description: An individual APM resource stats query. + properties: + data_source: + $ref: "#/components/schemas/ApmResourceStatsDataSource" + env: + description: The environment to query. + example: prod + type: string + group_by: + description: Tag keys to group results by. + items: + description: A tag key to group by. + example: resource_name + type: string + type: array + name: + description: The variable name for use in formulas. + example: query1 + type: string + operation_name: + description: The APM operation name. + example: web.request + type: string + primary_tag_name: + description: Name of the second primary tag used within APM. Required when `primary_tag_value` is specified. See https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope/#add-a-second-primary-tag-in-datadog + example: datacenter + type: string + primary_tag_value: + description: Value of the second primary tag by which to filter APM data. `primary_tag_name` must also be specified. + example: us-east-1 + type: string + resource_name: + description: The resource name to filter by. + example: "Admin::ProductsController#create" + type: string + service: + description: The service name to filter by. + example: web-store + type: string + stat: + $ref: "#/components/schemas/ApmResourceStatName" + required: + - data_source + - name + - env + - service + - stat + type: object ApmRetentionFilterType: default: apm_retention_filter description: The type of the resource. @@ -13405,6 +13675,15 @@ components: type: string type: array type: object + ContainerDataSource: + default: container + description: A data source for container-level infrastructure metrics. + enum: + - container + example: container + type: string + x-enum-varnames: + - CONTAINER ContainerGroup: description: Container group object. properties: @@ -13816,6 +14095,86 @@ components: type: string x-enum-varnames: - CURSOR_LIMIT + ContainerScalarQuery: + description: An individual scalar container query. + properties: + aggregator: + description: The temporal reduction function to apply. + example: avg + type: string + data_source: + $ref: "#/components/schemas/ContainerDataSource" + is_normalized_cpu: + description: Whether CPU metrics should be normalized by core count. + type: boolean + limit: + description: Maximum number of timeseries to return. + format: int64 + type: integer + metric: + description: The container metric to query. + example: container.cpu.user + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + description: Sort order for the results. + type: string + tag_filters: + description: Tag filters to narrow down containers. + items: + description: A tag filter value. + example: "env:prod" + type: string + type: array + text_filter: + description: A full-text search filter to match container names. + type: string + required: + - data_source + - name + - metric + type: object + ContainerTimeseriesQuery: + description: An individual timeseries container query. + properties: + data_source: + $ref: "#/components/schemas/ContainerDataSource" + is_normalized_cpu: + description: Whether CPU metrics should be normalized by core count. + type: boolean + limit: + description: Maximum number of timeseries to return. + format: int64 + type: integer + metric: + description: The container metric to query. + example: container.cpu.user + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + description: Sort order for the results. + type: string + tag_filters: + description: Tag filters to narrow down containers. + items: + description: A tag filter value. + example: "env:prod" + type: string + type: array + text_filter: + description: A full-text search filter to match container names. + type: string + required: + - data_source + - name + - metric + type: object ContainerType: default: container description: Type of container. @@ -24345,13 +24704,35 @@ components: description: A data source that is powered by the Events Platform. enum: - logs + - spans + - network - rum + - security_signals + - profiles + - audit + - events + - ci_tests + - ci_pipelines + - incident_analytics + - product_analytics + - on_call_events - dora example: logs type: string x-enum-varnames: - LOGS + - SPANS + - NETWORK - RUM + - SECURITY_SIGNALS + - PROFILES + - AUDIT + - EVENTS + - CI_TESTS + - CI_PIPELINES + - INCIDENT_ANALYTICS + - PRODUCT_ANALYTICS + - ON_CALL_EVENTS - DORA EventsGroupBy: description: A dimension on which to split a query's results. @@ -49380,6 +49761,57 @@ components: required: - type type: object + ProcessDataSource: + default: process + description: A data source for process-level infrastructure metrics. + enum: + - process + example: process + type: string + x-enum-varnames: + - PROCESS + ProcessScalarQuery: + description: An individual scalar process query. + properties: + aggregator: + description: The temporal reduction function to apply. + example: avg + type: string + data_source: + $ref: "#/components/schemas/ProcessDataSource" + is_normalized_cpu: + description: Whether CPU metrics should be normalized by core count. + type: boolean + limit: + description: Maximum number of timeseries to return. + format: int64 + type: integer + metric: + description: The process metric to query. + example: process.cpu.user + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + description: Sort order for the results. + type: string + tag_filters: + description: Tag filters to narrow down processes. + items: + description: A tag filter value. + example: "env:prod" + type: string + type: array + text_filter: + description: A full-text search filter to match process names or commands. + type: string + required: + - data_source + - name + - metric + type: object ProcessSummariesMeta: description: Response metadata object. properties: @@ -49466,6 +49898,44 @@ components: type: string x-enum-varnames: - PROCESS + ProcessTimeseriesQuery: + description: An individual timeseries process query. + properties: + data_source: + $ref: "#/components/schemas/ProcessDataSource" + is_normalized_cpu: + description: Whether CPU metrics should be normalized by core count. + type: boolean + limit: + description: Maximum number of timeseries to return. + format: int64 + type: integer + metric: + description: The process metric to query. + example: process.cpu.user + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + description: Sort order for the results. + type: string + tag_filters: + description: Tag filters to narrow down processes. + items: + description: A tag filter value. + example: "env:prod" + type: string + type: array + text_filter: + description: A full-text search filter to match process names or commands. + type: string + required: + - data_source + - name + - metric + type: object ProductAnalyticsAnalyticsQuery: description: The analytics query definition containing a base query, compute rule, and optional grouping. properties: @@ -55590,6 +56060,12 @@ components: oneOf: - $ref: "#/components/schemas/MetricsScalarQuery" - $ref: "#/components/schemas/EventsScalarQuery" + - $ref: "#/components/schemas/ApmResourceStatsQuery" + - $ref: "#/components/schemas/ApmMetricsQuery" + - $ref: "#/components/schemas/ApmDependencyStatsQuery" + - $ref: "#/components/schemas/SloQuery" + - $ref: "#/components/schemas/ProcessScalarQuery" + - $ref: "#/components/schemas/ContainerScalarQuery" ScalarResponse: description: A message containing the response to a scalar query. properties: @@ -62793,6 +63269,51 @@ components: required: - slackTrigger type: object + SloDataSource: + default: slo + description: A data source for SLO queries. + enum: + - slo + example: slo + type: string + x-enum-varnames: + - SLO + SloQuery: + description: An individual SLO query. + example: + additional_query_filters: "*" + data_source: "slo" + group_mode: "overall" + measure: "good_events" + name: "my_slo" + slo_id: "12345678910" + slo_query_type: "metric" + properties: + additional_query_filters: + description: Additional filters applied to the SLO query. + example: "host:host_a,env:prod" + type: string + data_source: + $ref: "#/components/schemas/SloDataSource" + group_mode: + $ref: "#/components/schemas/SlosGroupMode" + measure: + $ref: "#/components/schemas/SlosMeasure" + name: + description: The variable name for use in formulas. + example: query1 + type: string + slo_id: + description: The unique identifier of the SLO to query. + example: "a]b123c45de6f78g90h" + type: string + slo_query_type: + $ref: "#/components/schemas/SlosQueryType" + required: + - data_source + - slo_id + - measure + type: object SloReportCreateRequest: description: The SLO report request body. properties: @@ -62900,6 +63421,54 @@ components: type: string x-enum-varnames: - SLO_STATUS + SlosGroupMode: + description: How SLO results are grouped in the response. + enum: + - overall + - components + example: overall + type: string + x-enum-varnames: + - OVERALL + - COMPONENTS + SlosMeasure: + description: The SLO measurement to retrieve. + enum: + - good_events + - bad_events + - slo_status + - error_budget_remaining + - error_budget_remaining_history + - error_budget_burndown + - burn_rate + - slo_status_history + - good_minutes + - bad_minutes + example: slo_status + type: string + x-enum-varnames: + - GOOD_EVENTS + - BAD_EVENTS + - SLO_STATUS + - ERROR_BUDGET_REMAINING + - ERROR_BUDGET_REMAINING_HISTORY + - ERROR_BUDGET_BURNDOWN + - BURN_RATE + - SLO_STATUS_HISTORY + - GOOD_MINUTES + - BAD_MINUTES + SlosQueryType: + description: The type of SLO definition being queried. + enum: + - metric + - time_slice + - monitor + example: metric + type: string + x-enum-varnames: + - METRIC + - TIME_SLICE + - MONITOR Snapshot: description: A single heatmap snapshot resource returned by create or update operations. properties: @@ -69639,6 +70208,12 @@ components: oneOf: - $ref: "#/components/schemas/MetricsTimeseriesQuery" - $ref: "#/components/schemas/EventsTimeseriesQuery" + - $ref: "#/components/schemas/ApmResourceStatsQuery" + - $ref: "#/components/schemas/ApmMetricsQuery" + - $ref: "#/components/schemas/ApmDependencyStatsQuery" + - $ref: "#/components/schemas/SloQuery" + - $ref: "#/components/schemas/ProcessTimeseriesQuery" + - $ref: "#/components/schemas/ContainerTimeseriesQuery" TimeseriesResponse: description: A message containing the response to a timeseries query. properties: diff --git a/examples/v2/metrics/QueryScalarData_1479548882.rb b/examples/v2/metrics/QueryScalarData_1479548882.rb new file mode 100644 index 000000000000..ad75f61dd445 --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_1479548882.rb @@ -0,0 +1,39 @@ +# Scalar cross product query with apm_resource_stats data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::ScalarFormulaRequest.new({ + attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + queries: [ + DatadogAPIClient::V2::ApmResourceStatsQuery.new({ + data_source: DatadogAPIClient::V2::ApmResourceStatsDataSource::APM_RESOURCE_STATS, + name: "a", + env: "staging", + service: "azure-bill-import", + stat: DatadogAPIClient::V2::ApmResourceStatName::HITS, + operation_name: "cassandra.query", + group_by: [ + "resource_name", + ], + primary_tag_name: "datacenter", + primary_tag_value: "*", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryScalarData_1904811219.rb b/examples/v2/metrics/QueryScalarData_1904811219.rb new file mode 100644 index 000000000000..a41ec8acac18 --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_1904811219.rb @@ -0,0 +1,36 @@ +# Scalar cross product query with apm_metrics data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::ScalarFormulaRequest.new({ + attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + queries: [ + DatadogAPIClient::V2::ApmMetricsQuery.new({ + data_source: DatadogAPIClient::V2::ApmMetricsDataSource::APM_METRICS, + name: "a", + stat: DatadogAPIClient::V2::ApmMetricsStat::HITS, + service: "web-store", + query_filter: "env:prod", + group_by: [ + "resource_name", + ], + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryScalarData_2298288525.rb b/examples/v2/metrics/QueryScalarData_2298288525.rb new file mode 100644 index 000000000000..ad17f10d82df --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_2298288525.rb @@ -0,0 +1,35 @@ +# Scalar cross product query with slo data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::ScalarFormulaRequest.new({ + attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + queries: [ + DatadogAPIClient::V2::SloQuery.new({ + data_source: DatadogAPIClient::V2::SloDataSource::SLO, + name: "a", + slo_id: "12345678910", + measure: DatadogAPIClient::V2::SlosMeasure::SLO_STATUS, + slo_query_type: DatadogAPIClient::V2::SlosQueryType::METRIC, + group_mode: DatadogAPIClient::V2::SlosGroupMode::OVERALL, + additional_query_filters: "*", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryScalarData_2533499017.rb b/examples/v2/metrics/QueryScalarData_2533499017.rb new file mode 100644 index 000000000000..fdd682c140ba --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_2533499017.rb @@ -0,0 +1,37 @@ +# Scalar cross product query with apm_dependency_stats data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::ScalarFormulaRequest.new({ + attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + queries: [ + DatadogAPIClient::V2::ApmDependencyStatsQuery.new({ + data_source: DatadogAPIClient::V2::ApmDependencyStatsDataSource::APM_DEPENDENCY_STATS, + name: "a", + env: "ci", + service: "cassandra", + stat: DatadogAPIClient::V2::ApmDependencyStatName::AVG_DURATION, + operation_name: "cassandra.query", + resource_name: "DELETE FROM monitor_history.monitor_state_change_history WHERE org_id = ? AND monitor_id IN ? AND group = ?", + primary_tag_name: "datacenter", + primary_tag_value: "edge-eu1.prod.dog", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryScalarData_4230617918.rb b/examples/v2/metrics/QueryScalarData_4230617918.rb new file mode 100644 index 000000000000..2ccdaff6daee --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_4230617918.rb @@ -0,0 +1,37 @@ +# Scalar cross product query with process data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::ScalarFormulaRequest.new({ + attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + queries: [ + DatadogAPIClient::V2::ProcessScalarQuery.new({ + data_source: DatadogAPIClient::V2::ProcessDataSource::PROCESS, + name: "a", + metric: "process.stat.cpu.total_pct", + aggregator: "avg", + text_filter: "", + tag_filters: [], + limit: 10, + sort: "desc", + is_normalized_cpu: false, + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryScalarData_891952130.rb b/examples/v2/metrics/QueryScalarData_891952130.rb new file mode 100644 index 000000000000..b8de33886606 --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_891952130.rb @@ -0,0 +1,35 @@ +# Scalar cross product query with container data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::ScalarFormulaRequest.new({ + attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + queries: [ + DatadogAPIClient::V2::ContainerScalarQuery.new({ + data_source: DatadogAPIClient::V2::ContainerDataSource::CONTAINER, + name: "a", + metric: "container.cpu.usage", + aggregator: "avg", + tag_filters: [], + limit: 10, + sort: "desc", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_108927825.rb b/examples/v2/metrics/QueryTimeseriesData_108927825.rb new file mode 100644 index 000000000000..fc3e070232f4 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_108927825.rb @@ -0,0 +1,36 @@ +# Timeseries cross product query with slo data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({ + attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::SloQuery.new({ + data_source: DatadogAPIClient::V2::SloDataSource::SLO, + name: "a", + slo_id: "12345678910", + measure: DatadogAPIClient::V2::SlosMeasure::SLO_STATUS, + slo_query_type: DatadogAPIClient::V2::SlosQueryType::METRIC, + group_mode: DatadogAPIClient::V2::SlosGroupMode::OVERALL, + additional_query_filters: "*", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_2159746306.rb b/examples/v2/metrics/QueryTimeseriesData_2159746306.rb new file mode 100644 index 000000000000..963036e1b3c0 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_2159746306.rb @@ -0,0 +1,37 @@ +# Timeseries cross product query with process data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({ + attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::ProcessTimeseriesQuery.new({ + data_source: DatadogAPIClient::V2::ProcessDataSource::PROCESS, + name: "a", + metric: "process.stat.cpu.total_pct", + text_filter: "", + tag_filters: [], + limit: 10, + sort: "desc", + is_normalized_cpu: false, + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_3174309318.rb b/examples/v2/metrics/QueryTimeseriesData_3174309318.rb new file mode 100644 index 000000000000..f7f27285708a --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_3174309318.rb @@ -0,0 +1,35 @@ +# Timeseries cross product query with container data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({ + attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::ContainerTimeseriesQuery.new({ + data_source: DatadogAPIClient::V2::ContainerDataSource::CONTAINER, + name: "a", + metric: "container.cpu.usage", + tag_filters: [], + limit: 10, + sort: "desc", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_4028506518.rb b/examples/v2/metrics/QueryTimeseriesData_4028506518.rb new file mode 100644 index 000000000000..4778273e3b47 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_4028506518.rb @@ -0,0 +1,40 @@ +# Timeseries cross product query with apm_resource_stats data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({ + attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::ApmResourceStatsQuery.new({ + data_source: DatadogAPIClient::V2::ApmResourceStatsDataSource::APM_RESOURCE_STATS, + name: "a", + env: "staging", + service: "azure-bill-import", + stat: DatadogAPIClient::V2::ApmResourceStatName::HITS, + operation_name: "cassandra.query", + group_by: [ + "resource_name", + ], + primary_tag_name: "datacenter", + primary_tag_value: "*", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_4246412951.rb b/examples/v2/metrics/QueryTimeseriesData_4246412951.rb new file mode 100644 index 000000000000..6ebd045780a1 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_4246412951.rb @@ -0,0 +1,37 @@ +# Timeseries cross product query with apm_metrics data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({ + attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::ApmMetricsQuery.new({ + data_source: DatadogAPIClient::V2::ApmMetricsDataSource::APM_METRICS, + name: "a", + stat: DatadogAPIClient::V2::ApmMetricsStat::HITS, + service: "web-store", + query_filter: "env:prod", + group_by: [ + "resource_name", + ], + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_847716941.rb b/examples/v2/metrics/QueryTimeseriesData_847716941.rb new file mode 100644 index 000000000000..0da1ab729885 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_847716941.rb @@ -0,0 +1,38 @@ +# Timeseries cross product query with apm_dependency_stats data source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({ + data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({ + attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({ + formulas: [ + DatadogAPIClient::V2::QueryFormula.new({ + formula: "a", + limit: DatadogAPIClient::V2::FormulaLimit.new({ + count: 10, + order: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + }), + ], + from: 1636625471000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::ApmDependencyStatsQuery.new({ + data_source: DatadogAPIClient::V2::ApmDependencyStatsDataSource::APM_DEPENDENCY_STATS, + name: "a", + env: "ci", + service: "cassandra", + stat: DatadogAPIClient::V2::ApmDependencyStatName::AVG_DURATION, + operation_name: "cassandra.query", + resource_name: "DELETE FROM monitor_history.monitor_state_change_history WHERE org_id = ? AND monitor_id IN ? AND group = ?", + primary_tag_name: "datacenter", + primary_tag_value: "edge-eu1.prod.dog", + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/features/v2/metrics.feature b/features/v2/metrics.feature index 41e753dfb3f1..b78005e01291 100644 --- a/features/v2/metrics.feature +++ b/features/v2/metrics.feature @@ -344,6 +344,60 @@ Feature: Metrics And the response "data.type" is equal to "scalar_response" And the response "data.attributes.columns[0].name" is equal to "a" + @skip-validation @team:Datadog/timeseries-query + Scenario: Scalar cross product query with apm_dependency_stats data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"data_source": "apm_dependency_stats", "name": "a", "env": "ci", "service": "cassandra", "stat": "avg_duration", "operation_name": "cassandra.query", "resource_name": "DELETE FROM monitor_history.monitor_state_change_history WHERE org_id = ? AND monitor_id IN ? AND group = ?", "primary_tag_name": "datacenter", "primary_tag_value": "edge-eu1.prod.dog"}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "scalar_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Scalar cross product query with apm_metrics data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"data_source": "apm_metrics", "name": "a", "stat": "hits", "service": "web-store", "query_filter": "env:prod", "group_by": ["resource_name"]}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "scalar_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Scalar cross product query with apm_resource_stats data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"data_source": "apm_resource_stats", "name": "a", "env": "staging", "service": "azure-bill-import", "stat": "hits", "operation_name": "cassandra.query", "group_by": ["resource_name"], "primary_tag_name": "datacenter", "primary_tag_value": "*"}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "scalar_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Scalar cross product query with container data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"data_source": "container", "name": "a", "metric": "container.cpu.usage", "aggregator": "avg", "tag_filters": [], "limit": 10, "sort": "desc"}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "scalar_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Scalar cross product query with process data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"data_source": "process", "name": "a", "metric": "process.stat.cpu.total_pct", "aggregator": "avg", "text_filter": "", "tag_filters": [], "limit": 10, "sort": "desc", "is_normalized_cpu": false}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "scalar_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Scalar cross product query with slo data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"data_source": "slo", "name": "a", "slo_id": "12345678910", "measure": "slo_status", "slo_query_type": "metric", "group_mode": "overall", "additional_query_filters": "*"}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "scalar_response" + @generated @skip @team:DataDog/metrics-intake Scenario: Submit metrics returns "Bad Request" response Given new "SubmitMetrics" request @@ -415,6 +469,60 @@ Feature: Metrics Then the response status is 200 OK And the response "data.type" is equal to "timeseries_response" + @skip-validation @team:Datadog/timeseries-query + Scenario: Timeseries cross product query with apm_dependency_stats data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "apm_dependency_stats", "name": "a", "env": "ci", "service": "cassandra", "stat": "avg_duration", "operation_name": "cassandra.query", "resource_name": "DELETE FROM monitor_history.monitor_state_change_history WHERE org_id = ? AND monitor_id IN ? AND group = ?", "primary_tag_name": "datacenter", "primary_tag_value": "edge-eu1.prod.dog"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "timeseries_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Timeseries cross product query with apm_metrics data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "apm_metrics", "name": "a", "stat": "hits", "service": "web-store", "query_filter": "env:prod", "group_by": ["resource_name"]}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "timeseries_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Timeseries cross product query with apm_resource_stats data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "apm_resource_stats", "name": "a", "env": "staging", "service": "azure-bill-import", "stat": "hits", "operation_name": "cassandra.query", "group_by": ["resource_name"], "primary_tag_name": "datacenter", "primary_tag_value": "*"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "timeseries_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Timeseries cross product query with container data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "container", "name": "a", "metric": "container.cpu.usage", "tag_filters": [], "limit": 10, "sort": "desc"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "timeseries_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Timeseries cross product query with process data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "process", "name": "a", "metric": "process.stat.cpu.total_pct", "text_filter": "", "tag_filters": [], "limit": 10, "sort": "desc", "is_normalized_cpu": false}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "timeseries_response" + + @skip-validation @team:Datadog/timeseries-query + Scenario: Timeseries cross product query with slo data source returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "slo", "name": "a", "slo_id": "12345678910", "measure": "slo_status", "slo_query_type": "metric", "group_mode": "overall", "additional_query_filters": "*"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "timeseries_response" + @generated @skip @team:DataDog/metrics-experience Scenario: Update a tag configuration returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 2ef96f9dbe3b..37921e755303 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1106,6 +1106,15 @@ def overrides "v2.api_key_update_request" => "APIKeyUpdateRequest", "v2.api_trigger" => "APITrigger", "v2.api_trigger_wrapper" => "APITriggerWrapper", + "v2.apm_dependency_stat_name" => "ApmDependencyStatName", + "v2.apm_dependency_stats_data_source" => "ApmDependencyStatsDataSource", + "v2.apm_dependency_stats_query" => "ApmDependencyStatsQuery", + "v2.apm_metrics_data_source" => "ApmMetricsDataSource", + "v2.apm_metrics_query" => "ApmMetricsQuery", + "v2.apm_metrics_stat" => "ApmMetricsStat", + "v2.apm_resource_stat_name" => "ApmResourceStatName", + "v2.apm_resource_stats_data_source" => "ApmResourceStatsDataSource", + "v2.apm_resource_stats_query" => "ApmResourceStatsQuery", "v2.apm_retention_filter_type" => "ApmRetentionFilterType", "v2.app_builder_event" => "AppBuilderEvent", "v2.app_builder_event_name" => "AppBuilderEventName", @@ -1818,6 +1827,7 @@ def overrides "v2.connections_response_meta" => "ConnectionsResponseMeta", "v2.container" => "Container", "v2.container_attributes" => "ContainerAttributes", + "v2.container_data_source" => "ContainerDataSource", "v2.container_group" => "ContainerGroup", "v2.container_group_attributes" => "ContainerGroupAttributes", "v2.container_group_relationships" => "ContainerGroupRelationships", @@ -1845,8 +1855,10 @@ def overrides "v2.container_meta" => "ContainerMeta", "v2.container_meta_page" => "ContainerMetaPage", "v2.container_meta_page_type" => "ContainerMetaPageType", + "v2.container_scalar_query" => "ContainerScalarQuery", "v2.containers_response" => "ContainersResponse", "v2.containers_response_links" => "ContainersResponseLinks", + "v2.container_timeseries_query" => "ContainerTimeseriesQuery", "v2.container_type" => "ContainerType", "v2.content_encoding" => "ContentEncoding", "v2.convert_job_results_to_signals_attributes" => "ConvertJobResultsToSignalsAttributes", @@ -4182,12 +4194,15 @@ def overrides "v2.powerpacks_response_meta_pagination" => "PowerpacksResponseMetaPagination", "v2.powerpack_template_variable" => "PowerpackTemplateVariable", "v2.preview_entity_response_data" => "PreviewEntityResponseData", + "v2.process_data_source" => "ProcessDataSource", + "v2.process_scalar_query" => "ProcessScalarQuery", "v2.process_summaries_meta" => "ProcessSummariesMeta", "v2.process_summaries_meta_page" => "ProcessSummariesMetaPage", "v2.process_summaries_response" => "ProcessSummariesResponse", "v2.process_summary" => "ProcessSummary", "v2.process_summary_attributes" => "ProcessSummaryAttributes", "v2.process_summary_type" => "ProcessSummaryType", + "v2.process_timeseries_query" => "ProcessTimeseriesQuery", "v2.product_analytics_analytics_query" => "ProductAnalyticsAnalyticsQuery", "v2.product_analytics_analytics_request" => "ProductAnalyticsAnalyticsRequest", "v2.product_analytics_analytics_request_attributes" => "ProductAnalyticsAnalyticsRequestAttributes", @@ -5056,6 +5071,8 @@ def overrides "v2.slack_integration_metadata" => "SlackIntegrationMetadata", "v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem", "v2.slack_trigger_wrapper" => "SlackTriggerWrapper", + "v2.slo_data_source" => "SloDataSource", + "v2.slo_query" => "SloQuery", "v2.slo_report_create_request" => "SloReportCreateRequest", "v2.slo_report_create_request_attributes" => "SloReportCreateRequestAttributes", "v2.slo_report_create_request_data" => "SloReportCreateRequestData", @@ -5066,6 +5083,9 @@ def overrides "v2.slo_report_status_get_response" => "SLOReportStatusGetResponse", "v2.slo_report_status_get_response_attributes" => "SLOReportStatusGetResponseAttributes", "v2.slo_report_status_get_response_data" => "SLOReportStatusGetResponseData", + "v2.slos_group_mode" => "SlosGroupMode", + "v2.slos_measure" => "SlosMeasure", + "v2.slos_query_type" => "SlosQueryType", "v2.slo_status_data" => "SloStatusData", "v2.slo_status_data_attributes" => "SloStatusDataAttributes", "v2.slo_status_response" => "SloStatusResponse", diff --git a/lib/datadog_api_client/v2/models/apm_dependency_stat_name.rb b/lib/datadog_api_client/v2/models/apm_dependency_stat_name.rb new file mode 100644 index 000000000000..630184174bb8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_dependency_stat_name.rb @@ -0,0 +1,32 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The APM dependency statistic to query. + class ApmDependencyStatName + include BaseEnumModel + + AVG_DURATION = "avg_duration".freeze + AVG_ROOT_DURATION = "avg_root_duration".freeze + AVG_SPANS_PER_TRACE = "avg_spans_per_trace".freeze + ERROR_RATE = "error_rate".freeze + PCT_EXEC_TIME = "pct_exec_time".freeze + PCT_OF_TRACES = "pct_of_traces".freeze + TOTAL_TRACES_COUNT = "total_traces_count".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_dependency_stats_data_source.rb b/lib/datadog_api_client/v2/models/apm_dependency_stats_data_source.rb new file mode 100644 index 000000000000..47df3186df71 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_dependency_stats_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A data source for APM dependency statistics queries. + class ApmDependencyStatsDataSource + include BaseEnumModel + + APM_DEPENDENCY_STATS = "apm_dependency_stats".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_dependency_stats_query.rb b/lib/datadog_api_client/v2/models/apm_dependency_stats_query.rb new file mode 100644 index 000000000000..27519215ebaa --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_dependency_stats_query.rb @@ -0,0 +1,279 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual APM dependency stats query. + class ApmDependencyStatsQuery + include BaseGenericModel + + # A data source for APM dependency statistics queries. + attr_reader :data_source + + # The environment to query. + attr_reader :env + + # Determines whether stats for upstream or downstream dependencies should be queried. + attr_accessor :is_upstream + + # The variable name for use in formulas. + attr_reader :name + + # The APM operation name. + attr_reader :operation_name + + # The name of the second primary tag used within APM; required when `primary_tag_value` is specified. See https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope/#add-a-second-primary-tag-in-datadog. + attr_accessor :primary_tag_name + + # Filter APM data by the second primary tag. `primary_tag_name` must also be specified. + attr_accessor :primary_tag_value + + # The resource name to filter by. + attr_reader :resource_name + + # The service name to filter by. + attr_reader :service + + # The APM dependency statistic to query. + attr_reader :stat + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'env' => :'env', + :'is_upstream' => :'is_upstream', + :'name' => :'name', + :'operation_name' => :'operation_name', + :'primary_tag_name' => :'primary_tag_name', + :'primary_tag_value' => :'primary_tag_value', + :'resource_name' => :'resource_name', + :'service' => :'service', + :'stat' => :'stat' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ApmDependencyStatsDataSource', + :'env' => :'String', + :'is_upstream' => :'Boolean', + :'name' => :'String', + :'operation_name' => :'String', + :'primary_tag_name' => :'String', + :'primary_tag_value' => :'String', + :'resource_name' => :'String', + :'service' => :'String', + :'stat' => :'ApmDependencyStatName' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApmDependencyStatsQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'is_upstream') + self.is_upstream = attributes[:'is_upstream'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'operation_name') + self.operation_name = attributes[:'operation_name'] + end + + if attributes.key?(:'primary_tag_name') + self.primary_tag_name = attributes[:'primary_tag_name'] + end + + if attributes.key?(:'primary_tag_value') + self.primary_tag_value = attributes[:'primary_tag_value'] + end + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'stat') + self.stat = attributes[:'stat'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @env.nil? + return false if @name.nil? + return false if @operation_name.nil? + return false if @resource_name.nil? + return false if @service.nil? + return false if @stat.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param env [Object] Object to be assigned + # @!visibility private + def env=(env) + if env.nil? + fail ArgumentError, 'invalid value for "env", env cannot be nil.' + end + @env = env + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param operation_name [Object] Object to be assigned + # @!visibility private + def operation_name=(operation_name) + if operation_name.nil? + fail ArgumentError, 'invalid value for "operation_name", operation_name cannot be nil.' + end + @operation_name = operation_name + end + + # Custom attribute writer method with validation + # @param resource_name [Object] Object to be assigned + # @!visibility private + def resource_name=(resource_name) + if resource_name.nil? + fail ArgumentError, 'invalid value for "resource_name", resource_name cannot be nil.' + end + @resource_name = resource_name + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param stat [Object] Object to be assigned + # @!visibility private + def stat=(stat) + if stat.nil? + fail ArgumentError, 'invalid value for "stat", stat cannot be nil.' + end + @stat = stat + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + env == o.env && + is_upstream == o.is_upstream && + name == o.name && + operation_name == o.operation_name && + primary_tag_name == o.primary_tag_name && + primary_tag_value == o.primary_tag_value && + resource_name == o.resource_name && + service == o.service && + stat == o.stat && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, env, is_upstream, name, operation_name, primary_tag_name, primary_tag_value, resource_name, service, stat, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/apm_metrics_data_source.rb b/lib/datadog_api_client/v2/models/apm_metrics_data_source.rb new file mode 100644 index 000000000000..892160104e2e --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_metrics_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A data source for APM metrics queries. + class ApmMetricsDataSource + include BaseEnumModel + + APM_METRICS = "apm_metrics".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_metrics_query.rb b/lib/datadog_api_client/v2/models/apm_metrics_query.rb new file mode 100644 index 000000000000..3d4fec049e7f --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_metrics_query.rb @@ -0,0 +1,259 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual APM metrics query. + class ApmMetricsQuery + include BaseGenericModel + + # A data source for APM metrics queries. + attr_reader :data_source + + # Optional fields to group the query results by. + attr_accessor :group_by + + # The variable name for use in formulas. + attr_reader :name + + # Optional operation mode to aggregate across operation names. + attr_accessor :operation_mode + + # Name of operation on service. If not provided, the primary operation name is used. + attr_accessor :operation_name + + # Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.). + attr_accessor :peer_tags + + # Additional filters for the query using metrics query syntax (e.g., env, primary_tag). + attr_accessor :query_filter + + # The resource hash for exact matching. + attr_accessor :resource_hash + + # The full name of a specific resource to filter by. + attr_accessor :resource_name + + # The service name to filter by. + attr_accessor :service + + # Describes the relationship between the span, its parents, and its children in a trace. Known values include consumer, server, client, producer, internal. + attr_accessor :span_kind + + # The APM metric statistic to query. + attr_reader :stat + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'group_by' => :'group_by', + :'name' => :'name', + :'operation_mode' => :'operation_mode', + :'operation_name' => :'operation_name', + :'peer_tags' => :'peer_tags', + :'query_filter' => :'query_filter', + :'resource_hash' => :'resource_hash', + :'resource_name' => :'resource_name', + :'service' => :'service', + :'span_kind' => :'span_kind', + :'stat' => :'stat' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ApmMetricsDataSource', + :'group_by' => :'Array', + :'name' => :'String', + :'operation_mode' => :'String', + :'operation_name' => :'String', + :'peer_tags' => :'Array', + :'query_filter' => :'String', + :'resource_hash' => :'String', + :'resource_name' => :'String', + :'service' => :'String', + :'span_kind' => :'String', + :'stat' => :'ApmMetricsStat' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApmMetricsQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'operation_mode') + self.operation_mode = attributes[:'operation_mode'] + end + + if attributes.key?(:'operation_name') + self.operation_name = attributes[:'operation_name'] + end + + if attributes.key?(:'peer_tags') + if (value = attributes[:'peer_tags']).is_a?(Array) + self.peer_tags = value + end + end + + if attributes.key?(:'query_filter') + self.query_filter = attributes[:'query_filter'] + end + + if attributes.key?(:'resource_hash') + self.resource_hash = attributes[:'resource_hash'] + end + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'span_kind') + self.span_kind = attributes[:'span_kind'] + end + + if attributes.key?(:'stat') + self.stat = attributes[:'stat'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @name.nil? + return false if @stat.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param stat [Object] Object to be assigned + # @!visibility private + def stat=(stat) + if stat.nil? + fail ArgumentError, 'invalid value for "stat", stat cannot be nil.' + end + @stat = stat + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + group_by == o.group_by && + name == o.name && + operation_mode == o.operation_mode && + operation_name == o.operation_name && + peer_tags == o.peer_tags && + query_filter == o.query_filter && + resource_hash == o.resource_hash && + resource_name == o.resource_name && + service == o.service && + span_kind == o.span_kind && + stat == o.stat && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, group_by, name, operation_mode, operation_name, peer_tags, query_filter, resource_hash, resource_name, service, span_kind, stat, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/apm_metrics_stat.rb b/lib/datadog_api_client/v2/models/apm_metrics_stat.rb new file mode 100644 index 000000000000..0ab715b55253 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_metrics_stat.rb @@ -0,0 +1,41 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The APM metric statistic to query. + class ApmMetricsStat + include BaseEnumModel + + ERROR_RATE = "error_rate".freeze + ERRORS = "errors".freeze + ERRORS_PER_SECOND = "errors_per_second".freeze + HITS = "hits".freeze + HITS_PER_SECOND = "hits_per_second".freeze + APDEX = "apdex".freeze + LATENCY_AVG = "latency_avg".freeze + LATENCY_MAX = "latency_max".freeze + LATENCY_P50 = "latency_p50".freeze + LATENCY_P75 = "latency_p75".freeze + LATENCY_P90 = "latency_p90".freeze + LATENCY_P95 = "latency_p95".freeze + LATENCY_P99 = "latency_p99".freeze + LATENCY_P999 = "latency_p999".freeze + LATENCY_DISTRIBUTION = "latency_distribution".freeze + TOTAL_TIME = "total_time".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_resource_stat_name.rb b/lib/datadog_api_client/v2/models/apm_resource_stat_name.rb new file mode 100644 index 000000000000..cc938d033a88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_resource_stat_name.rb @@ -0,0 +1,37 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The APM resource statistic to query. + class ApmResourceStatName + include BaseEnumModel + + ERROR_RATE = "error_rate".freeze + ERRORS = "errors".freeze + HITS = "hits".freeze + LATENCY_AVG = "latency_avg".freeze + LATENCY_MAX = "latency_max".freeze + LATENCY_P50 = "latency_p50".freeze + LATENCY_P75 = "latency_p75".freeze + LATENCY_P90 = "latency_p90".freeze + LATENCY_P95 = "latency_p95".freeze + LATENCY_P99 = "latency_p99".freeze + LATENCY_DISTRIBUTION = "latency_distribution".freeze + TOTAL_TIME = "total_time".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_resource_stats_data_source.rb b/lib/datadog_api_client/v2/models/apm_resource_stats_data_source.rb new file mode 100644 index 000000000000..516f9e334ac5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_resource_stats_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A data source for APM resource statistics queries. + class ApmResourceStatsDataSource + include BaseEnumModel + + APM_RESOURCE_STATS = "apm_resource_stats".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/apm_resource_stats_query.rb b/lib/datadog_api_client/v2/models/apm_resource_stats_query.rb new file mode 100644 index 000000000000..a7d0920fce08 --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_resource_stats_query.rb @@ -0,0 +1,259 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual APM resource stats query. + class ApmResourceStatsQuery + include BaseGenericModel + + # A data source for APM resource statistics queries. + attr_reader :data_source + + # The environment to query. + attr_reader :env + + # Tag keys to group results by. + attr_accessor :group_by + + # The variable name for use in formulas. + attr_reader :name + + # The APM operation name. + attr_accessor :operation_name + + # Name of the second primary tag used within APM. Required when `primary_tag_value` is specified. See https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope/#add-a-second-primary-tag-in-datadog + attr_accessor :primary_tag_name + + # Value of the second primary tag by which to filter APM data. `primary_tag_name` must also be specified. + attr_accessor :primary_tag_value + + # The resource name to filter by. + attr_accessor :resource_name + + # The service name to filter by. + attr_reader :service + + # The APM resource statistic to query. + attr_reader :stat + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'env' => :'env', + :'group_by' => :'group_by', + :'name' => :'name', + :'operation_name' => :'operation_name', + :'primary_tag_name' => :'primary_tag_name', + :'primary_tag_value' => :'primary_tag_value', + :'resource_name' => :'resource_name', + :'service' => :'service', + :'stat' => :'stat' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ApmResourceStatsDataSource', + :'env' => :'String', + :'group_by' => :'Array', + :'name' => :'String', + :'operation_name' => :'String', + :'primary_tag_name' => :'String', + :'primary_tag_value' => :'String', + :'resource_name' => :'String', + :'service' => :'String', + :'stat' => :'ApmResourceStatName' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApmResourceStatsQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'operation_name') + self.operation_name = attributes[:'operation_name'] + end + + if attributes.key?(:'primary_tag_name') + self.primary_tag_name = attributes[:'primary_tag_name'] + end + + if attributes.key?(:'primary_tag_value') + self.primary_tag_value = attributes[:'primary_tag_value'] + end + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'stat') + self.stat = attributes[:'stat'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @env.nil? + return false if @name.nil? + return false if @service.nil? + return false if @stat.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param env [Object] Object to be assigned + # @!visibility private + def env=(env) + if env.nil? + fail ArgumentError, 'invalid value for "env", env cannot be nil.' + end + @env = env + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Custom attribute writer method with validation + # @param stat [Object] Object to be assigned + # @!visibility private + def stat=(stat) + if stat.nil? + fail ArgumentError, 'invalid value for "stat", stat cannot be nil.' + end + @stat = stat + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + env == o.env && + group_by == o.group_by && + name == o.name && + operation_name == o.operation_name && + primary_tag_name == o.primary_tag_name && + primary_tag_value == o.primary_tag_value && + resource_name == o.resource_name && + service == o.service && + stat == o.stat && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, env, group_by, name, operation_name, primary_tag_name, primary_tag_value, resource_name, service, stat, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/container_data_source.rb b/lib/datadog_api_client/v2/models/container_data_source.rb new file mode 100644 index 000000000000..dc4f286d9f3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/container_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A data source for container-level infrastructure metrics. + class ContainerDataSource + include BaseEnumModel + + CONTAINER = "container".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/container_scalar_query.rb b/lib/datadog_api_client/v2/models/container_scalar_query.rb new file mode 100644 index 000000000000..05122e705bcb --- /dev/null +++ b/lib/datadog_api_client/v2/models/container_scalar_query.rb @@ -0,0 +1,227 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual scalar container query. + class ContainerScalarQuery + include BaseGenericModel + + # The temporal reduction function to apply. + attr_accessor :aggregator + + # A data source for container-level infrastructure metrics. + attr_reader :data_source + + # Whether CPU metrics should be normalized by core count. + attr_accessor :is_normalized_cpu + + # Maximum number of timeseries to return. + attr_accessor :limit + + # The container metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Sort order for the results. + attr_accessor :sort + + # Tag filters to narrow down containers. + attr_accessor :tag_filters + + # A full-text search filter to match container names. + attr_accessor :text_filter + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregator' => :'aggregator', + :'data_source' => :'data_source', + :'is_normalized_cpu' => :'is_normalized_cpu', + :'limit' => :'limit', + :'metric' => :'metric', + :'name' => :'name', + :'sort' => :'sort', + :'tag_filters' => :'tag_filters', + :'text_filter' => :'text_filter' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregator' => :'String', + :'data_source' => :'ContainerDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'String', + :'tag_filters' => :'Array', + :'text_filter' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ContainerScalarQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aggregator') + self.aggregator = attributes[:'aggregator'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'is_normalized_cpu') + self.is_normalized_cpu = attributes[:'is_normalized_cpu'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = value + end + end + + if attributes.key?(:'text_filter') + self.text_filter = attributes[:'text_filter'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @metric.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param metric [Object] Object to be assigned + # @!visibility private + def metric=(metric) + if metric.nil? + fail ArgumentError, 'invalid value for "metric", metric cannot be nil.' + end + @metric = metric + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregator == o.aggregator && + data_source == o.data_source && + is_normalized_cpu == o.is_normalized_cpu && + limit == o.limit && + metric == o.metric && + name == o.name && + sort == o.sort && + tag_filters == o.tag_filters && + text_filter == o.text_filter && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregator, data_source, is_normalized_cpu, limit, metric, name, sort, tag_filters, text_filter, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/container_timeseries_query.rb b/lib/datadog_api_client/v2/models/container_timeseries_query.rb new file mode 100644 index 000000000000..84e63860dd3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/container_timeseries_query.rb @@ -0,0 +1,217 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual timeseries container query. + class ContainerTimeseriesQuery + include BaseGenericModel + + # A data source for container-level infrastructure metrics. + attr_reader :data_source + + # Whether CPU metrics should be normalized by core count. + attr_accessor :is_normalized_cpu + + # Maximum number of timeseries to return. + attr_accessor :limit + + # The container metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Sort order for the results. + attr_accessor :sort + + # Tag filters to narrow down containers. + attr_accessor :tag_filters + + # A full-text search filter to match container names. + attr_accessor :text_filter + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'is_normalized_cpu' => :'is_normalized_cpu', + :'limit' => :'limit', + :'metric' => :'metric', + :'name' => :'name', + :'sort' => :'sort', + :'tag_filters' => :'tag_filters', + :'text_filter' => :'text_filter' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ContainerDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'String', + :'tag_filters' => :'Array', + :'text_filter' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ContainerTimeseriesQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'is_normalized_cpu') + self.is_normalized_cpu = attributes[:'is_normalized_cpu'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = value + end + end + + if attributes.key?(:'text_filter') + self.text_filter = attributes[:'text_filter'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @metric.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param metric [Object] Object to be assigned + # @!visibility private + def metric=(metric) + if metric.nil? + fail ArgumentError, 'invalid value for "metric", metric cannot be nil.' + end + @metric = metric + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + is_normalized_cpu == o.is_normalized_cpu && + limit == o.limit && + metric == o.metric && + name == o.name && + sort == o.sort && + tag_filters == o.tag_filters && + text_filter == o.text_filter && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, is_normalized_cpu, limit, metric, name, sort, tag_filters, text_filter, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/events_data_source.rb b/lib/datadog_api_client/v2/models/events_data_source.rb index cbf84d1ac604..f3c5a2a573e2 100644 --- a/lib/datadog_api_client/v2/models/events_data_source.rb +++ b/lib/datadog_api_client/v2/models/events_data_source.rb @@ -22,7 +22,18 @@ class EventsDataSource include BaseEnumModel LOGS = "logs".freeze + SPANS = "spans".freeze + NETWORK = "network".freeze RUM = "rum".freeze + SECURITY_SIGNALS = "security_signals".freeze + PROFILES = "profiles".freeze + AUDIT = "audit".freeze + EVENTS = "events".freeze + CI_TESTS = "ci_tests".freeze + CI_PIPELINES = "ci_pipelines".freeze + INCIDENT_ANALYTICS = "incident_analytics".freeze + PRODUCT_ANALYTICS = "product_analytics".freeze + ON_CALL_EVENTS = "on_call_events".freeze DORA = "dora".freeze end end diff --git a/lib/datadog_api_client/v2/models/process_data_source.rb b/lib/datadog_api_client/v2/models/process_data_source.rb new file mode 100644 index 000000000000..1930d365a879 --- /dev/null +++ b/lib/datadog_api_client/v2/models/process_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A data source for process-level infrastructure metrics. + class ProcessDataSource + include BaseEnumModel + + PROCESS = "process".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/process_scalar_query.rb b/lib/datadog_api_client/v2/models/process_scalar_query.rb new file mode 100644 index 000000000000..bec19d0b5e95 --- /dev/null +++ b/lib/datadog_api_client/v2/models/process_scalar_query.rb @@ -0,0 +1,227 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual scalar process query. + class ProcessScalarQuery + include BaseGenericModel + + # The temporal reduction function to apply. + attr_accessor :aggregator + + # A data source for process-level infrastructure metrics. + attr_reader :data_source + + # Whether CPU metrics should be normalized by core count. + attr_accessor :is_normalized_cpu + + # Maximum number of timeseries to return. + attr_accessor :limit + + # The process metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Sort order for the results. + attr_accessor :sort + + # Tag filters to narrow down processes. + attr_accessor :tag_filters + + # A full-text search filter to match process names or commands. + attr_accessor :text_filter + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregator' => :'aggregator', + :'data_source' => :'data_source', + :'is_normalized_cpu' => :'is_normalized_cpu', + :'limit' => :'limit', + :'metric' => :'metric', + :'name' => :'name', + :'sort' => :'sort', + :'tag_filters' => :'tag_filters', + :'text_filter' => :'text_filter' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregator' => :'String', + :'data_source' => :'ProcessDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'String', + :'tag_filters' => :'Array', + :'text_filter' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProcessScalarQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aggregator') + self.aggregator = attributes[:'aggregator'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'is_normalized_cpu') + self.is_normalized_cpu = attributes[:'is_normalized_cpu'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = value + end + end + + if attributes.key?(:'text_filter') + self.text_filter = attributes[:'text_filter'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @metric.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param metric [Object] Object to be assigned + # @!visibility private + def metric=(metric) + if metric.nil? + fail ArgumentError, 'invalid value for "metric", metric cannot be nil.' + end + @metric = metric + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregator == o.aggregator && + data_source == o.data_source && + is_normalized_cpu == o.is_normalized_cpu && + limit == o.limit && + metric == o.metric && + name == o.name && + sort == o.sort && + tag_filters == o.tag_filters && + text_filter == o.text_filter && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregator, data_source, is_normalized_cpu, limit, metric, name, sort, tag_filters, text_filter, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/process_timeseries_query.rb b/lib/datadog_api_client/v2/models/process_timeseries_query.rb new file mode 100644 index 000000000000..6bd3e098d3db --- /dev/null +++ b/lib/datadog_api_client/v2/models/process_timeseries_query.rb @@ -0,0 +1,217 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual timeseries process query. + class ProcessTimeseriesQuery + include BaseGenericModel + + # A data source for process-level infrastructure metrics. + attr_reader :data_source + + # Whether CPU metrics should be normalized by core count. + attr_accessor :is_normalized_cpu + + # Maximum number of timeseries to return. + attr_accessor :limit + + # The process metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Sort order for the results. + attr_accessor :sort + + # Tag filters to narrow down processes. + attr_accessor :tag_filters + + # A full-text search filter to match process names or commands. + attr_accessor :text_filter + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'is_normalized_cpu' => :'is_normalized_cpu', + :'limit' => :'limit', + :'metric' => :'metric', + :'name' => :'name', + :'sort' => :'sort', + :'tag_filters' => :'tag_filters', + :'text_filter' => :'text_filter' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ProcessDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'String', + :'tag_filters' => :'Array', + :'text_filter' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProcessTimeseriesQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'is_normalized_cpu') + self.is_normalized_cpu = attributes[:'is_normalized_cpu'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = value + end + end + + if attributes.key?(:'text_filter') + self.text_filter = attributes[:'text_filter'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @metric.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param metric [Object] Object to be assigned + # @!visibility private + def metric=(metric) + if metric.nil? + fail ArgumentError, 'invalid value for "metric", metric cannot be nil.' + end + @metric = metric + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + is_normalized_cpu == o.is_normalized_cpu && + limit == o.limit && + metric == o.metric && + name == o.name && + sort == o.sort && + tag_filters == o.tag_filters && + text_filter == o.text_filter && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, is_normalized_cpu, limit, metric, name, sort, tag_filters, text_filter, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_query.rb b/lib/datadog_api_client/v2/models/scalar_query.rb index 0222ff45bc86..ef240532bc6e 100644 --- a/lib/datadog_api_client/v2/models/scalar_query.rb +++ b/lib/datadog_api_client/v2/models/scalar_query.rb @@ -27,7 +27,13 @@ class << self def openapi_one_of [ :'MetricsScalarQuery', - :'EventsScalarQuery' + :'EventsScalarQuery', + :'ApmResourceStatsQuery', + :'ApmMetricsQuery', + :'ApmDependencyStatsQuery', + :'SloQuery', + :'ProcessScalarQuery', + :'ContainerScalarQuery' ] end # Builds the object diff --git a/lib/datadog_api_client/v2/models/slo_data_source.rb b/lib/datadog_api_client/v2/models/slo_data_source.rb new file mode 100644 index 000000000000..d9a808061141 --- /dev/null +++ b/lib/datadog_api_client/v2/models/slo_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A data source for SLO queries. + class SloDataSource + include BaseEnumModel + + SLO = "slo".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/slo_query.rb b/lib/datadog_api_client/v2/models/slo_query.rb new file mode 100644 index 000000000000..9050b27d3fe3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/slo_query.rb @@ -0,0 +1,205 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An individual SLO query. + class SloQuery + include BaseGenericModel + + # Additional filters applied to the SLO query. + attr_accessor :additional_query_filters + + # A data source for SLO queries. + attr_reader :data_source + + # How SLO results are grouped in the response. + attr_accessor :group_mode + + # The SLO measurement to retrieve. + attr_reader :measure + + # The variable name for use in formulas. + attr_accessor :name + + # The unique identifier of the SLO to query. + attr_reader :slo_id + + # The type of SLO definition being queried. + attr_accessor :slo_query_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'additional_query_filters' => :'additional_query_filters', + :'data_source' => :'data_source', + :'group_mode' => :'group_mode', + :'measure' => :'measure', + :'name' => :'name', + :'slo_id' => :'slo_id', + :'slo_query_type' => :'slo_query_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'additional_query_filters' => :'String', + :'data_source' => :'SloDataSource', + :'group_mode' => :'SlosGroupMode', + :'measure' => :'SlosMeasure', + :'name' => :'String', + :'slo_id' => :'String', + :'slo_query_type' => :'SlosQueryType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SloQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'additional_query_filters') + self.additional_query_filters = attributes[:'additional_query_filters'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'group_mode') + self.group_mode = attributes[:'group_mode'] + end + + if attributes.key?(:'measure') + self.measure = attributes[:'measure'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'slo_id') + self.slo_id = attributes[:'slo_id'] + end + + if attributes.key?(:'slo_query_type') + self.slo_query_type = attributes[:'slo_query_type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @measure.nil? + return false if @slo_id.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param measure [Object] Object to be assigned + # @!visibility private + def measure=(measure) + if measure.nil? + fail ArgumentError, 'invalid value for "measure", measure cannot be nil.' + end + @measure = measure + end + + # Custom attribute writer method with validation + # @param slo_id [Object] Object to be assigned + # @!visibility private + def slo_id=(slo_id) + if slo_id.nil? + fail ArgumentError, 'invalid value for "slo_id", slo_id cannot be nil.' + end + @slo_id = slo_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + additional_query_filters == o.additional_query_filters && + data_source == o.data_source && + group_mode == o.group_mode && + measure == o.measure && + name == o.name && + slo_id == o.slo_id && + slo_query_type == o.slo_query_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [additional_query_filters, data_source, group_mode, measure, name, slo_id, slo_query_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/slos_group_mode.rb b/lib/datadog_api_client/v2/models/slos_group_mode.rb new file mode 100644 index 000000000000..24411af89a2b --- /dev/null +++ b/lib/datadog_api_client/v2/models/slos_group_mode.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # How SLO results are grouped in the response. + class SlosGroupMode + include BaseEnumModel + + OVERALL = "overall".freeze + COMPONENTS = "components".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/slos_measure.rb b/lib/datadog_api_client/v2/models/slos_measure.rb new file mode 100644 index 000000000000..dc1c9b171438 --- /dev/null +++ b/lib/datadog_api_client/v2/models/slos_measure.rb @@ -0,0 +1,35 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The SLO measurement to retrieve. + class SlosMeasure + include BaseEnumModel + + GOOD_EVENTS = "good_events".freeze + BAD_EVENTS = "bad_events".freeze + SLO_STATUS = "slo_status".freeze + ERROR_BUDGET_REMAINING = "error_budget_remaining".freeze + ERROR_BUDGET_REMAINING_HISTORY = "error_budget_remaining_history".freeze + ERROR_BUDGET_BURNDOWN = "error_budget_burndown".freeze + BURN_RATE = "burn_rate".freeze + SLO_STATUS_HISTORY = "slo_status_history".freeze + GOOD_MINUTES = "good_minutes".freeze + BAD_MINUTES = "bad_minutes".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/slos_query_type.rb b/lib/datadog_api_client/v2/models/slos_query_type.rb new file mode 100644 index 000000000000..5d46bae7d349 --- /dev/null +++ b/lib/datadog_api_client/v2/models/slos_query_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of SLO definition being queried. + class SlosQueryType + include BaseEnumModel + + METRIC = "metric".freeze + TIME_SLICE = "time_slice".freeze + MONITOR = "monitor".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_query.rb b/lib/datadog_api_client/v2/models/timeseries_query.rb index 78b26764df33..50ba3ec801ff 100644 --- a/lib/datadog_api_client/v2/models/timeseries_query.rb +++ b/lib/datadog_api_client/v2/models/timeseries_query.rb @@ -27,7 +27,13 @@ class << self def openapi_one_of [ :'MetricsTimeseriesQuery', - :'EventsTimeseriesQuery' + :'EventsTimeseriesQuery', + :'ApmResourceStatsQuery', + :'ApmMetricsQuery', + :'ApmDependencyStatsQuery', + :'SloQuery', + :'ProcessTimeseriesQuery', + :'ContainerTimeseriesQuery' ] end # Builds the object