From 7e5abb9e62eb7f90ce42e171f97d6c32cc5f2a19 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 9 Apr 2026 18:46:10 +0000 Subject: [PATCH] Regenerate client from commit 00d36b7 of spec repo --- .generator/schemas/v2/openapi.yaml | 581 ++++++++++++++++++ ...ats-data-source-returns-OK-response.frozen | 1 + ...-stats-data-source-returns-OK-response.yml | 29 + ...ics-data-source-returns-OK-response.frozen | 1 + ...etrics-data-source-returns-OK-response.yml | 24 + ...ats-data-source-returns-OK-response.frozen | 1 + ...-stats-data-source-returns-OK-response.yml | 24 + ...ner-data-source-returns-OK-response.frozen | 1 + ...tainer-data-source-returns-OK-response.yml | 24 + ...ess-data-source-returns-OK-response.frozen | 1 + ...rocess-data-source-returns-OK-response.yml | 24 + ...slo-data-source-returns-OK-response.frozen | 1 + ...th-slo-data-source-returns-OK-response.yml | 24 + ...ats-data-source-returns-OK-response.frozen | 1 + ...-stats-data-source-returns-OK-response.yml | 28 + ...ics-data-source-returns-OK-response.frozen | 1 + ...etrics-data-source-returns-OK-response.yml | 26 + ...ats-data-source-returns-OK-response.frozen | 1 + ...-stats-data-source-returns-OK-response.yml | 26 + ...ner-data-source-returns-OK-response.frozen | 1 + ...tainer-data-source-returns-OK-response.yml | 26 + ...ess-data-source-returns-OK-response.frozen | 1 + ...rocess-data-source-returns-OK-response.yml | 26 + ...slo-data-source-returns-OK-response.frozen | 1 + ...th-slo-data-source-returns-OK-response.yml | 26 + .../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_779493885.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_3535807425.rb | 38 ++ .../metrics/QueryTimeseriesData_4028506518.rb | 40 ++ .../metrics/QueryTimeseriesData_4246412951.rb | 37 ++ .../metrics/QueryTimeseriesData_847716941.rb | 38 ++ features/v2/metrics.feature | 126 ++++ lib/datadog_api_client/inflector.rb | 21 + .../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_span_kind.rb | 30 + .../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 +- 65 files changed, 3865 insertions(+), 2 deletions(-) create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.yml 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_779493885.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_3535807425.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_span_kind.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 26e1246c4497..8099b4ced82a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3859,6 +3859,290 @@ 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: "GET /api/v2/users" + 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: + $ref: "#/components/schemas/ApmMetricsSpanKind" + stat: + $ref: "#/components/schemas/ApmMetricsStat" + required: + - data_source + - name + - stat + type: object + ApmMetricsSpanKind: + description: Describes the relationship between the span, its parents, and its children in a trace. + enum: + - consumer + - server + - client + - producer + - internal + example: server + type: string + x-enum-varnames: + - CONSUMER + - SERVER + - CLIENT + - PRODUCER + - INTERNAL + 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. @@ -13947,6 +14231,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: @@ -14358,6 +14651,82 @@ components: type: string x-enum-varnames: - CURSOR_LIMIT + ContainerScalarQuery: + description: An individual scalar container query. + properties: + aggregator: + $ref: "#/components/schemas/MetricsAggregator" + 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 results to return. + format: int64 + type: integer + metric: + description: The container metric to query. + example: process.stat.container.cpu.total_pct + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + $ref: "#/components/schemas/QuerySortOrder" + 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 results to return. + format: int64 + type: integer + metric: + description: The container metric to query. + example: process.stat.container.cpu.total_pct + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + $ref: "#/components/schemas/QuerySortOrder" + 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. @@ -24967,13 +25336,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. @@ -50734,6 +51125,54 @@ 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: + $ref: "#/components/schemas/MetricsAggregator" + 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 results to return. + format: int64 + type: integer + metric: + description: The process metric to query. + example: process.stat.cpu.total_pct + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + $ref: "#/components/schemas/QuerySortOrder" + 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: @@ -50820,6 +51259,43 @@ 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 results to return. + format: int64 + type: integer + metric: + description: The process metric to query. + example: process.stat.cpu.total_pct + type: string + name: + description: The variable name for use in formulas. + example: query1 + type: string + sort: + $ref: "#/components/schemas/QuerySortOrder" + 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: @@ -57023,6 +57499,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: @@ -64397,6 +64879,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: @@ -64504,6 +65031,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: @@ -71284,6 +71859,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/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..a290b6c8ad4e --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:29.994Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..4d0953426f11 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml @@ -0,0 +1,29 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:29 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658329000,"queries":[{"data_source":"apm_dependency_stats","env":"ci","name":"a","operation_name":"cassandra.query","primary_tag_name":"datacenter","primary_tag_value":"edge-eu1.prod.dog","resource_name":"DELETE + FROM monitor_history.monitor_state_change_history WHERE org_id = ? AND monitor_id + IN ? AND group = ?","service":"cassandra","stat":"avg_duration"}],"to":1775661929000},"type":"scalar_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/scalar + response: + body: + encoding: UTF-8 + string: "{\"data\":{\"id\":\"0\",\"type\":\"scalar_response\",\"attributes\"\ + :{\"columns\":[{\"name\":\"a\",\"values\":[],\"type\":\"number\",\"meta\"\ + :{\"unit\":[{\"family\":\"time\",\"name\":\"microsecond\",\"plural\":\"microseconds\"\ + ,\"scale_factor\":0.000001,\"short_name\":\"\u03BCs\",\"id\":9},null]}}]}}}" + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..936f63368973 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:31.055Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..6e9f254e6f14 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658331000,"queries":[{"data_source":"apm_metrics","group_by":["resource_name"],"name":"a","query_filter":"env:prod","service":"web-store","stat":"hits"}],"to":1775661931000},"type":"scalar_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/scalar + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"scalar_response","attributes":{"columns":[{"name":"a","values":[],"type":"number","meta":{"unit":null}}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..35a011fa28c9 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:31.243Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..109a1061c0ce --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658331000,"queries":[{"data_source":"apm_resource_stats","env":"staging","group_by":["resource_name"],"name":"a","operation_name":"cassandra.query","primary_tag_name":"datacenter","primary_tag_value":"*","service":"azure-bill-import","stat":"hits"}],"to":1775661931000},"type":"scalar_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/scalar + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"scalar_response","attributes":{"columns":[{"name":"a","values":[],"type":"number","meta":{"unit":null}}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..5a73cccc2870 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:31.666Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..aaed1e0ba5a0 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-container-data-source-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658331000,"queries":[{"aggregator":"avg","data_source":"container","limit":10,"metric":"process.stat.container.cpu.system_pct","name":"a","sort":"desc","tag_filters":[]}],"to":1775661931000},"type":"scalar_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/scalar + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"scalar_response","attributes":{"columns":[{"name":"a","values":[],"type":"number","meta":{"unit":[{"family":"percentage","name":"percent","plural":"percent","scale_factor":1.0,"short_name":"%","id":17},null]}}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..aeb3bb6c4b5d --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:31.838Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..017baaf5affa --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-process-data-source-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658331000,"queries":[{"aggregator":"avg","data_source":"process","is_normalized_cpu":false,"limit":10,"metric":"process.stat.cpu.total_pct","name":"a","sort":"desc","tag_filters":[],"text_filter":""}],"to":1775661931000},"type":"scalar_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/scalar + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"scalar_response","attributes":{"columns":[{"name":"a","values":[],"type":"number","meta":{"unit":[{"family":"percentage","name":"percent","plural":"percent","scale_factor":1.0,"short_name":"%","id":17},null]}}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..1271a7e2cd8f --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:32.018Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..5b00b1212c71 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-with-slo-data-source-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658332000,"queries":[{"additional_query_filters":"*","data_source":"slo","group_mode":"overall","measure":"slo_status","name":"a","slo_id":"12345678910","slo_query_type":"metric"}],"to":1775661932000},"type":"scalar_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/scalar + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"scalar_response","attributes":{"columns":[{"name":"a","values":[],"type":"number","meta":{"unit":[{"family":"percentage","name":"percent","plural":"percent","scale_factor":1.0,"short_name":"%","id":17},null]}}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..8d85e07f104a --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:32.147Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..d666d3bc885b --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-dependency-stats-data-source-returns-OK-response.yml @@ -0,0 +1,28 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658332000,"interval":5000,"queries":[{"data_source":"apm_dependency_stats","env":"ci","name":"a","operation_name":"cassandra.query","primary_tag_name":"datacenter","primary_tag_value":"edge-eu1.prod.dog","resource_name":"DELETE + FROM monitor_history.monitor_state_change_history WHERE org_id = ? AND monitor_id + IN ? AND group = ?","service":"cassandra","stat":"avg_duration"}],"to":1775661932000},"type":"timeseries_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/timeseries + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"timeseries_response","attributes":{"series":[],"times":[],"values":[]}}} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..316785c3cfc9 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:32.363Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..402fa8fc3155 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-metrics-data-source-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658332000,"interval":5000,"queries":[{"data_source":"apm_metrics","group_by":["resource_name"],"name":"a","query_filter":"env:prod","service":"web-store","stat":"hits"}],"to":1775661932000},"type":"timeseries_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/timeseries + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"timeseries_response","attributes":{"series":[],"times":[],"values":[]}}} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..c4bed5aa5b3b --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:32.570Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..0d01b8e059d3 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-apm-resource-stats-data-source-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658332000,"interval":5000,"queries":[{"data_source":"apm_resource_stats","env":"staging","group_by":["resource_name"],"name":"a","operation_name":"cassandra.query","primary_tag_name":"datacenter","primary_tag_value":"*","service":"azure-bill-import","stat":"hits"}],"to":1775661932000},"type":"timeseries_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/timeseries + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"timeseries_response","attributes":{"series":[],"times":[],"values":[]}}} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..0b3ec0189461 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:32.715Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..125307d5b69b --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-container-data-source-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658332000,"interval":5000,"queries":[{"data_source":"container","limit":10,"metric":"process.stat.container.cpu.system_pct","name":"a","sort":"desc","tag_filters":[]}],"to":1775661932000},"type":"timeseries_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/timeseries + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"timeseries_response","attributes":{"series":[],"times":[],"values":[]}}} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..1ef87ffbe14c --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:32.912Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..d08e4d0c8512 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-process-data-source-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:32 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658332000,"interval":5000,"queries":[{"data_source":"process","is_normalized_cpu":false,"limit":10,"metric":"process.stat.cpu.total_pct","name":"a","sort":"desc","tag_filters":[],"text_filter":""}],"to":1775661932000},"type":"timeseries_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/timeseries + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"timeseries_response","attributes":{"series":[],"times":[],"values":[]}}} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.frozen new file mode 100644 index 000000000000..03ed54b79c27 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-08T15:25:33.123Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.yml new file mode 100644 index 000000000000..f89a79616641 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-with-slo-data-source-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 08 Apr 2026 15:25:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1775658333000,"interval":5000,"queries":[{"additional_query_filters":"*","data_source":"slo","group_mode":"overall","measure":"slo_status","name":"a","slo_id":"12345678910","slo_query_type":"metric"}],"to":1775661933000},"type":"timeseries_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/query/timeseries + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0","type":"timeseries_response","attributes":{"series":[],"times":[],"values":[]}}} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 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..9a3a1544120b --- /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: DatadogAPIClient::V2::MetricsAggregator::AVG, + text_filter: "", + tag_filters: [], + limit: 10, + sort: DatadogAPIClient::V2::QuerySortOrder::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_779493885.rb b/examples/v2/metrics/QueryScalarData_779493885.rb new file mode 100644 index 000000000000..f4b555f1de4b --- /dev/null +++ b/examples/v2/metrics/QueryScalarData_779493885.rb @@ -0,0 +1,37 @@ +# Scalar cross product query with apm_metrics data source and span_kind 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", + span_kind: DatadogAPIClient::V2::ApmMetricsSpanKind::SERVER, + 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_891952130.rb b/examples/v2/metrics/QueryScalarData_891952130.rb new file mode 100644 index 000000000000..30aae1eb90c0 --- /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: "process.stat.container.cpu.system_pct", + aggregator: DatadogAPIClient::V2::MetricsAggregator::AVG, + tag_filters: [], + limit: 10, + sort: DatadogAPIClient::V2::QuerySortOrder::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..08ebb10eaa0e --- /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: DatadogAPIClient::V2::QuerySortOrder::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..f6bfd4897d8d --- /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: "process.stat.container.cpu.system_pct", + tag_filters: [], + limit: 10, + sort: DatadogAPIClient::V2::QuerySortOrder::DESC, + }), + ], + to: 1636629071000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData_3535807425.rb b/examples/v2/metrics/QueryTimeseriesData_3535807425.rb new file mode 100644 index 000000000000..5d9a671444b2 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData_3535807425.rb @@ -0,0 +1,38 @@ +# Timeseries cross product query with apm_metrics data source and span_kind 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", + span_kind: DatadogAPIClient::V2::ApmMetricsSpanKind::SERVER, + 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_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..99f1714d9c8e 100644 --- a/features/v2/metrics.feature +++ b/features/v2/metrics.feature @@ -344,6 +344,69 @@ 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 and span_kind 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", "span_kind": "server", "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_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": "process.stat.container.cpu.system_pct", "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 +478,69 @@ 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 and span_kind 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", "span_kind": "server", "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_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": "process.stat.container.cpu.system_pct", "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 c304ad90f333..ec465150fbcc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1118,6 +1118,16 @@ 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_span_kind" => "ApmMetricsSpanKind", + "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", @@ -1838,6 +1848,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", @@ -1865,8 +1876,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", @@ -4249,12 +4262,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", @@ -5134,6 +5150,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", @@ -5144,6 +5162,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..87d2d6a082cc --- /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. + 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' => :'ApmMetricsSpanKind', + :'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_span_kind.rb b/lib/datadog_api_client/v2/models/apm_metrics_span_kind.rb new file mode 100644 index 000000000000..3750e70d1f5e --- /dev/null +++ b/lib/datadog_api_client/v2/models/apm_metrics_span_kind.rb @@ -0,0 +1,30 @@ +=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 + # Describes the relationship between the span, its parents, and its children in a trace. + class ApmMetricsSpanKind + include BaseEnumModel + + CONSUMER = "consumer".freeze + SERVER = "server".freeze + CLIENT = "client".freeze + PRODUCER = "producer".freeze + INTERNAL = "internal".freeze + 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..a1e170994a49 --- /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 type of aggregation that can be performed on metrics-based queries. + 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 results to return. + attr_accessor :limit + + # The container metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Direction of sort. + 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' => :'MetricsAggregator', + :'data_source' => :'ContainerDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'QuerySortOrder', + :'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..7f63ad23af54 --- /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 results to return. + attr_accessor :limit + + # The container metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Direction of sort. + 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' => :'QuerySortOrder', + :'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..c4fc397c10da --- /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 type of aggregation that can be performed on metrics-based queries. + 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 results to return. + attr_accessor :limit + + # The process metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Direction of sort. + 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' => :'MetricsAggregator', + :'data_source' => :'ProcessDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'QuerySortOrder', + :'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..1c775eef096a --- /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 results to return. + attr_accessor :limit + + # The process metric to query. + attr_reader :metric + + # The variable name for use in formulas. + attr_reader :name + + # Direction of sort. + 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' => :'QuerySortOrder', + :'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