From 9a32fe1340e9ea0eb00d347980dae7ce20350990 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 21 Dec 2022 13:51:28 +0000 Subject: [PATCH] Regenerate client from commit 28490390 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 660 +++++++++++++++++- ...-query-returns-Bad-Request-response.frozen | 1 + ...uct-query-returns-Bad-Request-response.yml | 24 + ...s-product-query-returns-OK-response.frozen | 1 + ...ross-product-query-returns-OK-response.yml | 24 + ...-query-returns-Bad-Request-response.frozen | 1 + ...uct-query-returns-Bad-Request-response.yml | 24 + ...s-product-query-returns-OK-response.frozen | 1 + ...ross-product-query-returns-OK-response.yml | 24 + examples/v2/metrics/QueryScalarData.rb | 35 + examples/v2/metrics/QueryTimeseriesData.rb | 35 + features/scenarios_model_mapping.rb | 6 + features/v2/metrics.feature | 50 +- features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 36 + lib/datadog_api_client/v2/api/metrics_api.rb | 148 ++++ .../v2/models/events_aggregation.rb | 36 + .../v2/models/events_compute.rb | 129 ++++ .../v2/models/events_data_source.rb | 26 + .../v2/models/events_group_by.rb | 140 ++++ .../v2/models/events_scalar_query.rb | 174 +++++ .../v2/models/events_search.rb | 98 +++ .../v2/models/events_sort_field.rb | 139 ++++ .../v2/models/events_sort_type.rb | 27 + .../v2/models/events_timeseries_query.rb | 174 +++++ .../v2/models/formula_limit.rb | 119 ++++ .../v2/models/metrics_aggregator.rb | 30 + .../v2/models/metrics_data_source.rb | 26 + .../v2/models/metrics_scalar_query.rb | 161 +++++ .../v2/models/metrics_timeseries_query.rb | 140 ++++ .../v2/models/query_formula.rb | 119 ++++ .../v2/models/scalar_column.rb | 112 +++ .../v2/models/scalar_formula_query_request.rb | 109 +++ .../models/scalar_formula_query_response.rb | 108 +++ .../v2/models/scalar_formula_request.rb | 130 ++++ .../scalar_formula_request_attributes.rb | 165 +++++ .../v2/models/scalar_formula_request_type.rb | 26 + .../scalar_formula_response_atrributes.rb | 112 +++ .../v2/models/scalar_formula_response_type.rb | 26 + .../v2/models/scalar_query.rb | 63 ++ .../v2/models/scalar_response.rb | 108 +++ .../timeseries_formula_query_request.rb | 109 +++ .../timeseries_formula_query_response.rb | 108 +++ .../v2/models/timeseries_formula_request.rb | 130 ++++ .../timeseries_formula_request_attributes.rb | 178 +++++ .../models/timeseries_formula_request_type.rb | 26 + .../timeseries_formula_response_type.rb | 26 + .../v2/models/timeseries_query.rb | 63 ++ .../v2/models/timeseries_response.rb | 108 +++ .../models/timeseries_response_attributes.rb | 124 ++++ .../v2/models/timeseries_response_series.rb | 133 ++++ lib/datadog_api_client/v2/models/unit.rb | 138 ++++ 54 files changed, 4715 insertions(+), 17 deletions(-) create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.yml create mode 100644 examples/v2/metrics/QueryScalarData.rb create mode 100644 examples/v2/metrics/QueryTimeseriesData.rb create mode 100644 lib/datadog_api_client/v2/models/events_aggregation.rb create mode 100644 lib/datadog_api_client/v2/models/events_compute.rb create mode 100644 lib/datadog_api_client/v2/models/events_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/events_group_by.rb create mode 100644 lib/datadog_api_client/v2/models/events_scalar_query.rb create mode 100644 lib/datadog_api_client/v2/models/events_search.rb create mode 100644 lib/datadog_api_client/v2/models/events_sort_field.rb create mode 100644 lib/datadog_api_client/v2/models/events_sort_type.rb create mode 100644 lib/datadog_api_client/v2/models/events_timeseries_query.rb create mode 100644 lib/datadog_api_client/v2/models/formula_limit.rb create mode 100644 lib/datadog_api_client/v2/models/metrics_aggregator.rb create mode 100644 lib/datadog_api_client/v2/models/metrics_data_source.rb create mode 100644 lib/datadog_api_client/v2/models/metrics_scalar_query.rb create mode 100644 lib/datadog_api_client/v2/models/metrics_timeseries_query.rb create mode 100644 lib/datadog_api_client/v2/models/query_formula.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_column.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_query_request.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_query_response.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_request.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_request_type.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_response_atrributes.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_formula_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_query.rb create mode 100644 lib/datadog_api_client/v2/models/scalar_response.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_formula_query_request.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_formula_query_response.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_formula_request.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_formula_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_formula_request_type.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_formula_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_query.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_response.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/timeseries_response_series.rb create mode 100644 lib/datadog_api_client/v2/models/unit.rb diff --git a/.apigentools-info b/.apigentools-info index 93545770e48c..3edbe67f8306 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-12-20 16:45:02.679500", - "spec_repo_commit": "ec3c91a9" + "regenerated": "2022-12-21 13:51:03.981098", + "spec_repo_commit": "28490390" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-12-20 16:45:02.693404", - "spec_repo_commit": "ec3c91a9" + "regenerated": "2022-12-21 13:51:03.996139", + "spec_repo_commit": "28490390" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fb4e260e6fe6..0739f3366bef 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2825,6 +2825,78 @@ components: type: string x-enum-varnames: - EVENT + EventsAggregation: + default: count + description: The type of aggregation that can be performed on events-based queries. + enum: + - count + - cardinality + - pc75 + - pc90 + - pc95 + - pc98 + - pc99 + - sum + - min + - max + - avg + example: count + type: string + x-enum-varnames: + - COUNT + - CARDINALITY + - PC75 + - PC90 + - PC95 + - PC98 + - PC99 + - SUM + - MIN + - MAX + - AVG + EventsCompute: + description: The instructions for what to compute for this query. + properties: + aggregation: + $ref: '#/components/schemas/EventsAggregation' + interval: + description: Interval for compute in milliseconds. + example: 60000 + format: int64 + type: integer + metric: + description: The "measure" attribute on which to perform the computation. + type: string + required: + - aggregation + type: object + EventsDataSource: + default: logs + description: A data source that is powered by the Events Platform. + enum: + - logs + example: logs + type: string + x-enum-varnames: + - LOGS + EventsGroupBy: + description: A dimension on which to split a query's results. + properties: + facet: + description: The facet by which to split groups. + example: '@error.type' + type: string + limit: + description: The maximum number of groups to return. + example: 10 + format: int32 + maximum: 2147483647 + type: integer + sort: + $ref: '#/components/schemas/EventsSortField' + required: + - facet + type: object EventsListRequest: description: The object sent with the request to retrieve a list of events from your organization. @@ -2884,6 +2956,11 @@ components: example: now type: string type: object + EventsQueryGroupBys: + description: The list of facets on which to split results. + items: + $ref: '#/components/schemas/EventsGroupBy' + type: array EventsQueryOptions: description: 'The global query options that are used. Either provide a timezone or a time offset but not both, @@ -2950,6 +3027,39 @@ components: example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object + EventsScalarQuery: + description: An individual scalar events query. + properties: + compute: + $ref: '#/components/schemas/EventsCompute' + data_source: + $ref: '#/components/schemas/EventsDataSource' + group_by: + $ref: '#/components/schemas/EventsQueryGroupBys' + indexes: + description: The indexes in which to search. + items: + description: The unique index name. + example: main + type: string + type: array + name: + description: The variable name for use in formulas. + type: string + search: + $ref: '#/components/schemas/EventsSearch' + required: + - data_source + - compute + type: object + EventsSearch: + description: Configuration of the search/filter for an events query. + properties: + query: + description: The search/filter string for an events query. + example: status:warn service:foo + type: string + type: object EventsSort: description: The sort parameters when querying events. enum: @@ -2959,6 +3069,57 @@ components: x-enum-varnames: - TIMESTAMP_ASCENDING - TIMESTAMP_DESCENDING + EventsSortField: + description: The dimension by which to sort a query's results. + properties: + aggregation: + $ref: '#/components/schemas/EventsAggregation' + metric: + description: Metric whose calculated value should be used to define the + sort order of a query's results. + example: '@duration' + type: string + order: + $ref: '#/components/schemas/QuerySortOrder' + type: + $ref: '#/components/schemas/EventsSortType' + required: + - aggregation + type: object + EventsSortType: + description: The type of sort to use on the calculated value. + enum: + - alphabetical + - measure + type: string + x-enum-varnames: + - ALPHABETICAL + - MEASURE + EventsTimeseriesQuery: + description: An individual timeseries events query. + properties: + compute: + $ref: '#/components/schemas/EventsCompute' + data_source: + $ref: '#/components/schemas/EventsDataSource' + group_by: + $ref: '#/components/schemas/EventsQueryGroupBys' + indexes: + description: The indexes in which to search. + items: + description: The unique index name. + example: main + type: string + type: array + name: + description: The variable name for use in formulas. + type: string + search: + $ref: '#/components/schemas/EventsSearch' + required: + - data_source + - compute + type: object EventsWarning: description: A warning message indicating something is wrong with the query. properties: @@ -2976,6 +3137,19 @@ components: from the other indexes. type: string type: object + FormulaLimit: + description: Message for specifying limits to the number of values returned + by a query. + properties: + count: + description: The number of results to which to limit. + example: 10 + format: int32 + maximum: 2147483647 + type: integer + order: + $ref: '#/components/schemas/QuerySortOrder' + type: object FullAPIKey: description: Datadog API key. properties: @@ -3068,6 +3242,12 @@ components: nullable: true type: array type: object + GroupTags: + description: List of tags that apply to a single response value. + items: + description: A single tag that applies to a single response value. + type: string + type: array HTTPLog: description: Structured log message. items: @@ -6353,6 +6533,23 @@ components: $ref: '#/components/schemas/MetricVolumes' readOnly: true type: object + MetricsAggregator: + default: avg + description: The type of aggregation that can be performed on metrics queries. + enum: + - avg + - min + - max + - sum + - last + example: avg + type: string + x-enum-varnames: + - AVG + - MIN + - MAX + - SUM + - LAST MetricsAndMetricTagConfigurations: description: Object for a metrics and metric tag configurations. oneOf: @@ -6369,6 +6566,50 @@ components: type: array readOnly: true type: object + MetricsDataSource: + default: metrics + description: A data source that is powered by the Metrics backend. + enum: + - metrics + example: metrics + type: string + x-enum-varnames: + - METRICS + MetricsScalarQuery: + description: An individual scalar metrics query. + properties: + aggregator: + $ref: '#/components/schemas/MetricsAggregator' + data_source: + $ref: '#/components/schemas/MetricsDataSource' + name: + description: The variable name for use in formulas. + type: string + query: + description: A classic metrics query string. + example: avg:system.cpu.user{*} + type: string + required: + - data_source + - query + - aggregator + type: object + MetricsTimeseriesQuery: + description: An individual timeseries metrics query. + properties: + data_source: + $ref: '#/components/schemas/MetricsDataSource' + name: + description: The variable name for use in formulas. + type: string + query: + description: A classic metrics query string. + example: avg:system.cpu.user{*} + type: string + required: + - data_source + - query + type: object MonitorType: description: Attributes from the monitor that triggered the event. nullable: true @@ -6915,6 +7156,19 @@ components: type: string x-enum-varnames: - PROCESS + QueryFormula: + description: A formula for calculation based on one or more queries. + properties: + formula: + description: Formula string, referencing one or more queries with their + name property. + example: a+b + type: string + limit: + $ref: '#/components/schemas/FormulaLimit' + required: + - formula + type: object QuerySortOrder: default: desc description: Direction of sort. @@ -8207,6 +8461,134 @@ components: type: string x-enum-varnames: - SAML_ASSERTION_ATTRIBUTES + ScalarColumn: + description: A single column in a scalar query response. + properties: + unit: + description: List of units. + items: + $ref: '#/components/schemas/Unit' + type: array + values: + description: Array of values for each group-by combination that results + from one formula or query. + items: + description: An individual value for a given column and group-by. + format: double + type: number + type: array + type: object + ScalarFormulaQueryRequest: + description: A wrapper request around one scalar query to be executed. + properties: + data: + $ref: '#/components/schemas/ScalarFormulaRequest' + required: + - data + type: object + ScalarFormulaQueryResponse: + description: A message containing one or more responses to scalar queries. + properties: + data: + $ref: '#/components/schemas/ScalarResponse' + errors: + description: An error generated when processing a request. + type: string + type: object + ScalarFormulaRequest: + description: A single scalar query to be executed. + properties: + attributes: + $ref: '#/components/schemas/ScalarFormulaRequestAttributes' + type: + $ref: '#/components/schemas/ScalarFormulaRequestType' + required: + - type + - attributes + type: object + ScalarFormulaRequestAttributes: + description: The object describing a scalar formula request. + properties: + formulas: + description: List of formulas to be calculated and returned as responses. + items: + $ref: '#/components/schemas/QueryFormula' + type: array + from: + description: Start date (inclusive) of the query in milliseconds since the + Unix epoch. + example: 1568899800000 + format: int64 + type: integer + queries: + $ref: '#/components/schemas/ScalarFormulaRequestQueries' + to: + description: End date (exclusive) of the query in milliseconds since the + Unix epoch. + example: 1568923200000 + format: int64 + type: integer + required: + - to + - from + - queries + type: object + ScalarFormulaRequestQueries: + description: List of queries to be run and used as inputs to the formulas. + items: + $ref: '#/components/schemas/ScalarQuery' + type: array + ScalarFormulaRequestType: + default: scalar_request + description: The type of the resource. The value should always be scalar_request. + enum: + - scalar_request + example: scalar_request + type: string + x-enum-varnames: + - SCALAR_REQUEST + ScalarFormulaResponseAtrributes: + description: The object describing a scalar response. + properties: + columns: + description: List of response columns, each corresponding to an individual + formula or query in the request and with values in parallel arrays matching + the series list. + items: + $ref: '#/components/schemas/ScalarColumn' + type: array + series: + $ref: '#/components/schemas/ScalarResponseSeriesList' + type: object + ScalarFormulaResponseType: + default: scalar_response + description: The type of the resource. The value should always be scalar_response. + enum: + - scalar_response + example: scalar_response + type: string + x-enum-varnames: + - SCALAR_RESPONSE + ScalarQuery: + description: An individual scalar query to one of the basic Datadog data sources. + oneOf: + - $ref: '#/components/schemas/MetricsScalarQuery' + - $ref: '#/components/schemas/EventsScalarQuery' + type: object + ScalarResponse: + description: A message containing the response to a scalar query. + properties: + attributes: + $ref: '#/components/schemas/ScalarFormulaResponseAtrributes' + type: + $ref: '#/components/schemas/ScalarFormulaResponseType' + type: object + ScalarResponseSeriesList: + description: List of group-by tags for the response. Parallel array to the values + in each scalar column. + items: + $ref: '#/components/schemas/GroupTags' + type: array SecurityFilter: description: The security filter's properties. properties: @@ -10674,11 +11056,200 @@ components: description: Tag associated with your event. type: string type: array + TimeseriesFormulaQueryRequest: + description: A request wrapper around a single timeseries query to be executed. + properties: + data: + $ref: '#/components/schemas/TimeseriesFormulaRequest' + required: + - data + type: object + TimeseriesFormulaQueryResponse: + description: A message containing one response to a timeseries query made with + timeseries formula query request. + properties: + data: + $ref: '#/components/schemas/TimeseriesResponse' + errors: + description: The error generated by the request. + type: string + type: object + TimeseriesFormulaRequest: + description: A single timeseries query to be executed. + properties: + attributes: + $ref: '#/components/schemas/TimeseriesFormulaRequestAttributes' + type: + $ref: '#/components/schemas/TimeseriesFormulaRequestType' + required: + - type + - attributes + type: object + TimeseriesFormulaRequestAttributes: + description: The object describing a timeseries formula request. + properties: + formulas: + description: List of formulas to be calculated and returned as responses. + items: + $ref: '#/components/schemas/QueryFormula' + type: array + from: + description: Start date (inclusive) of the query in milliseconds since the + Unix epoch. + example: 1568899800000 + format: int64 + type: integer + interval: + description: 'A time interval in milliseconds. + + May be overridden by a larger interval if the query would result in + + too many points for the specified timeframe. + + Defaults to a reasonable interval for the given timeframe.' + example: 5000 + format: int64 + type: integer + queries: + $ref: '#/components/schemas/TimeseriesFormulaRequestQueries' + to: + description: End date (exclusive) of the query in milliseconds since the + Unix epoch. + example: 1568923200000 + format: int64 + type: integer + required: + - to + - from + - queries + type: object + TimeseriesFormulaRequestQueries: + description: List of queries to be run and used as inputs to the formulas. + items: + $ref: '#/components/schemas/TimeseriesQuery' + type: array + TimeseriesFormulaRequestType: + default: timeseries_request + description: The type of the resource. The value should always be timeseries_request. + enum: + - timeseries_request + example: timeseries_request + type: string + x-enum-varnames: + - TIMESERIES_REQUEST + TimeseriesFormulaResponseType: + default: timeseries_response + description: The type of the resource. The value should always be timeseries_response. + enum: + - timeseries_response + example: timeseries_response + type: string + x-enum-varnames: + - TIMESERIES_RESPONSE + TimeseriesQuery: + description: An individual timeseries query to one of the basic Datadog data + sources. + oneOf: + - $ref: '#/components/schemas/MetricsTimeseriesQuery' + - $ref: '#/components/schemas/EventsTimeseriesQuery' + type: object + TimeseriesResponse: + description: A message containing the response to a timeseries query. + properties: + attributes: + $ref: '#/components/schemas/TimeseriesResponseAttributes' + type: + $ref: '#/components/schemas/TimeseriesFormulaResponseType' + type: object + TimeseriesResponseAttributes: + description: The object describing a timeseries response. + properties: + series: + $ref: '#/components/schemas/TimeseriesResponseSeriesList' + times: + $ref: '#/components/schemas/TimeseriesResponseTimes' + values: + $ref: '#/components/schemas/TimeseriesResponseValuesList' + type: object + TimeseriesResponseSeries: + description: '' + properties: + group_tags: + $ref: '#/components/schemas/GroupTags' + query_index: + description: The index of the query in the "formulas" array (or "queries" + array if no "formulas" was specified). + example: 0 + format: int32 + maximum: 2147483647 + type: integer + unit: + description: List of units. + items: + $ref: '#/components/schemas/Unit' + type: array + type: object + TimeseriesResponseSeriesList: + description: Array of response series. The index here corresponds to the index + in the `formulas` or `queries` array from the request. + items: + $ref: '#/components/schemas/TimeseriesResponseSeries' + type: array + TimeseriesResponseTimes: + description: Array of times, 1-1 match with individual values arrays. + items: + description: Start date (inclusive) of the query in seconds since the Unix + epoch. + example: 1568899800000 + format: int64 + type: integer + type: array + TimeseriesResponseValues: + description: Array of values for an individual formula or query. + items: + description: An individual value for a given time. + format: double + type: number + type: array + TimeseriesResponseValuesList: + description: Array of value-arrays. The index here corresponds to the index + in the `formulas` or `queries` array from the request. + items: + $ref: '#/components/schemas/TimeseriesResponseValues' + type: array TimestampEventAttribute: description: Timestamp of your event. example: '2019-01-02T09:42:36.320Z' format: date-time type: string + Unit: + description: Object containing the metric unit family, scale factor, name, and + short name. + nullable: true + properties: + family: + description: Unit family, allows for conversion between units of the same + family, for scaling. + example: time + type: string + name: + description: Unit name + example: minute + type: string + plural: + description: Plural form of the unit name. + example: minutes + type: string + scale_factor: + description: Factor for scaling between units of the same family. + example: 60.0 + format: double + type: number + short_name: + description: Abbreviation of the unit. + example: min + type: string + type: object UsageApplicationSecurityMonitoringResponse: description: Application Security Monitoring usage response. properties: @@ -14871,6 +15442,82 @@ paths: cursorPath: meta.page.after limitParam: page[limit] resultsPath: data + /api/v2/query/scalar: + post: + description: 'The internal endpoint to query scalar/table data for multiple + data sources and + + process the data using formulas and functions.' + operationId: QueryScalarData + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScalarFormulaQueryRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ScalarFormulaQueryResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Scalar cross product query + tags: + - Metrics + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is GA for the metrics data source. Logs + is in beta. + + We are gradually onboarding support for more sources. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/query/timeseries: + post: + description: 'The internal endpoint to query timeseries data for multiple data + sources and + + process the data by applying formulas and functions.' + operationId: QueryTimeseriesData + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TimeseriesFormulaQueryRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TimeseriesFormulaQueryResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Timeseries cross product query + tags: + - Metrics + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is GA for the metrics data source. Logs + is in beta. + + We are gradually onboarding support for more sources. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/roles: get: description: Returns all roles, including their names and their unique identifiers. @@ -18562,12 +19209,13 @@ tags: url: https://docs.datadoghq.com/logs/logs_to_metrics/ name: Logs Metrics - description: "The metrics endpoint allows you to:\n\n- Post metrics data so it can - be graphed on Datadog\u2019s dashboards\n- Query metrics from any time period\n- - Modify tag configurations for metrics\n- View tags and volumes for metrics\n\n**Note**: - A graph can only contain a set number of points\nand as the timeframe over which - a metric is viewed increases,\naggregation between points occurs to stay below - that set number.\n\nThe Post, Patch, and Delete `manage_tags` API methods can - only be performed by\na user who has the `Manage Tags for Metrics` permission." + be graphed on Datadog\u2019s dashboards\n- Query metrics from any time period + (timeseries and scalar)\n- Modify tag configurations for metrics\n- View tags + and volumes for metrics\n\n**Note**: A graph can only contain a set number of + points\nand as the timeframe over which a metric is viewed increases,\naggregation + between points occurs to stay below that set number.\n\nThe Post, Patch, and Delete + `manage_tags` API methods can only be performed by\na user who has the `Manage + Tags for Metrics` permission." name: Metrics - description: 'Configure your [Datadog Opsgenie integration](https://docs.datadoghq.com/integrations/opsgenie/) diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..36050d7ebfe6 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2022-12-21T11:14:00.535Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..d9c1950f3a3c --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-Bad-Request-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 21 Dec 2022 11:14:00 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a+b","limit":{"count":10,"order":"desc"}}],"from":1568899800000,"queries":[{"aggregator":"avg","data_source":"metrics","name":"a","query":"avg:system.cpu.user{*}"}],"to":1568923200000},"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: '{"errors":["Queries ending outside the retention date are invalid"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.frozen b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.frozen new file mode 100644 index 000000000000..224b8d84abfc --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.frozen @@ -0,0 +1 @@ +2022-12-21T11:14:01.142Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.yml b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.yml new file mode 100644 index 000000000000..45d04b5ff791 --- /dev/null +++ b/cassettes/features/v2/metrics/Scalar-cross-product-query-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 21 Dec 2022 11:14:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1671612804000,"queries":[{"aggregator":"avg","data_source":"metrics","name":"a","query":"avg:system.cpu.user{*}"}],"to":1671620004000},"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":{"type":"scalar_response","attributes":{"columns":[{"name":"a","values":[5.173633659114822],"type":"number","meta":{"unit":[{"scale_factor":1.0,"id":17,"name":"percent","plural":"percent","family":"percentage","short_name":"%"},null]}}]}}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ae90f3a35087 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2022-12-21T11:14:01.584Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..e05542ca95af --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-Bad-Request-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 21 Dec 2022 11:14:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a+b","limit":{"count":10,"order":"desc"}}],"from":1671617641,"interval":5000,"queries":[{"data_source":"metrics","query":"avg:system.cpu.user{*}"}],"to":1671621241},"type":"timeseries_rquest"}}' + 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: '{"errors":["API input validation failed: Invalid type. Expected \"timeseries_request\"."]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.frozen b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.frozen new file mode 100644 index 000000000000..5bdb3c10fff1 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.frozen @@ -0,0 +1 @@ +2022-12-21T11:14:01.814Z \ No newline at end of file diff --git a/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.yml b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.yml new file mode 100644 index 000000000000..e4218785f802 --- /dev/null +++ b/cassettes/features/v2/metrics/Timeseries-cross-product-query-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 21 Dec 2022 11:14:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"formulas":[{"formula":"a","limit":{"count":10,"order":"desc"}}],"from":1671612804000,"interval":5000,"queries":[{"data_source":"metrics","name":"a","query":"avg:system.cpu.user{*}"}],"to":1671620004000},"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":{"type":"timeseries_response","attributes":{"values":[[4.511036,4.452697,4.412659,4.518245,4.687136,4.97308,5.192443,5.394637,5.340696,4.967064,4.986722,5.222986,5.654652,5.309001,5.166451,5.10007,5.363234,5.198181,4.985549,4.732672,4.596457,4.438161,4.440617,4.417017,4.460995,4.388007,4.407114,4.396247,4.463179,4.556415,4.706282,4.841254,4.834313,4.969147,5.022375,5.204864,4.885128,5.136058,5.385709,5.960689,5.565356,5.246903,4.899752,4.89686,4.872231,4.843359,5.013687,4.84587,4.641045,4.316564,4.259839,4.286675,4.351473,4.486833,4.577294,4.745868,4.705028,4.661034,4.471036,4.442686,4.648083,5.242174,5.852524,6.096846,5.89139,5.560238,5.280996,4.862933,4.709248,4.623006,4.860077,4.935585,5.022714,5.029523,4.788869,4.585691,4.341339,4.392719,4.404215,4.68485,4.762513,4.861116,4.615962,4.537305,4.396546,4.354968,4.328285,4.607015,5.543913,6.324773,6.792496,7.220547,6.606063,5.876218,5.871163,5.78849,5.905384,5.90785,6.120763,6.309492,6.454408,6.166451,5.863357,5.795657,5.884391,5.989054,5.812381,5.704644,5.556254,5.478115,5.505722,5.60674,6.059316,6.338839,6.711452,6.735411,6.865414,6.90191,6.756111,6.526661,6.100718,5.87628,5.748863,5.757181,5.722193,5.932041,6.204195,6.685102,6.549346,6.337531,5.916065,5.809077,5.712645,5.624461,5.609235,5.663688,5.853015,5.902995,5.914612,6.256064,6.687142,7.191397,6.847396,6.486767,6.206287,6.328331,6.46251,6.206348,5.929493,5.680556,5.661752,5.797259,6.048074,6.290369,6.501473,6.405154,6.309052,5.99345,5.866646,5.775236,5.92197,5.930556,5.906912,5.884151,6.011508,6.121853,6.39136,6.543824,6.756647,6.35429,6.0619,6.013092,6.279459,6.557457,6.311731,6.210523,5.947832,5.862253,5.738994,5.956962,6.252644,6.373787,6.300842,6.234464,6.376188,6.240802,6.092113,5.74307,5.68881,5.591538,6.218279,6.730657,7.310558,6.723645,6.249439,5.753847,5.758291,5.734797,5.933901,6.279562,6.520173,6.370642,6.201029,6.106782,6.112661,5.918345,5.965812,6.068902,6.358401,5.119474,5.134993,5.013521,4.778848,4.535078,4.507003,4.597434,4.656196,4.967201,5.331067,5.783775,5.319137,4.889232,4.395338,4.502716,4.490939,4.684735,4.821445,5.037191,5.007238,4.953504,4.945898,4.866694,4.819154,4.764052,4.819065,4.745362,4.831931,4.931988,5.21707,4.966855,4.702029,4.854507,5.347428,5.893627,5.386981,4.955269,4.470617,4.596507,4.521039,4.462105,4.346769,4.390456,4.519676,4.678632,4.852548,5.094638,5.299293,5.37353,5.054819,4.66616,4.420079,4.38882,4.519663,4.774763,5.069079,5.221413,4.927594,4.634475,4.909238,5.491882,6.046457,5.631336,5.062027,4.481505,4.341841,4.332686,4.364885,4.448851,4.572952,4.751025,4.902067,4.904094,5.054718,5.090399,5.254011,4.913755,4.751565,4.463131,4.463551,4.378909,4.649447,4.923694,5.6018,5.903531,6.186827,5.836629,5.377205,4.888724,4.536856,4.40555,4.363478,4.431734,4.545142,4.598567,4.695658,4.685236,4.679584,4.532542,4.445523,4.632351,4.974624,5.250778,5.07555,4.798842,4.620069,4.536116,4.457244,4.604563,4.840088,5.766038,6.303143,6.802655,6.091143,5.328086,4.642865,4.450604,4.476219,4.449314,4.629411,4.735648,4.865296,4.685488,4.51912,4.315168,4.350158,4.360299,4.571845,4.709814,4.902212,5.001238,5.028215,5.084393,4.820687,5.052605,5.28559,5.715299,5.603917,5.55135,5.576788,5.450727,5.078365,4.679194,4.674274,4.750762,4.798283,4.627874,4.535463,4.437021,4.466878,4.454509,4.491398,4.488202,4.494882,4.55218,4.543842,4.570604,4.697906,4.977783,5.215616,5.077405,5.413667,5.827774,6.409674,5.830352,5.430387,5.057747,5.445663,5.304086,5.155742,4.682481,4.497533,4.296956,4.310508,4.31634,4.375265,4.413491,4.458567,4.471268,4.39949,4.354437,4.342085,4.469582,4.563571,4.77724,5.132156,5.460429,5.638983,5.607113,5.687771,5.619198,5.360052,5.266902,5.285339,5.48854,5.203703,4.971474,4.666843,4.555747,4.40484,4.354661,4.353139,4.397763,4.369454,4.398596,4.43654,4.548555,4.556558,4.459109,4.368599,4.31658,4.492293,5.099936,5.773344,6.509406,6.340683,6.058546,5.237316,4.795722,4.701339,4.939245,5.249865,5.095241,4.927081,4.730854,4.643312,4.5614,4.439782,4.407931,4.405545,4.507572,4.545492,4.477086,4.380839,4.299001,4.341577,5.604058,5.766157,5.924093,6.431079,6.771484,7.294038,7.10321,7.014538,6.532796,6.284576,6.21839,6.226662,6.353135,6.177565,6.098286,5.951891,5.796254,5.661725,5.637161,5.689067,5.648374,5.564126,5.559261,5.662602,5.660762,5.650876,5.651624,6.41184,7.040154,7.567294,6.793774,6.159532,5.770742,6.113773,6.399101,6.543671,6.549843,6.707259,6.57199,6.418717,6.139889,6.142233,6.228013,6.106845,5.859366,5.618063,5.611779,5.729061,5.712502,5.660427,5.623323,5.807494,5.906427,5.905664,6.240026,6.689505,7.181008,6.755872,6.284999,5.894045,5.932816,5.963972,6.125965,6.264631,6.555714,6.41868,6.400609,6.342607,6.363507,6.368072,6.020383,6.116022,6.075169,6.304079,5.997817,5.926331,5.835736,5.891495,6.224173,6.571082,6.98461,6.704984,6.448813,6.206686,6.137743,5.95096,5.734213,5.579123,5.550976,5.84681,6.207702,6.46903,6.184917,5.960549,6.08436,6.368466,6.486024,6.146055,5.958414,5.985733,6.072375,6.015133,5.767673,5.64189,5.590981,6.234506,6.886698,7.54875,7.055817,6.521776,5.957623,5.813814,5.677685,5.602713,5.673723,5.745898,5.842411,5.957794,6.047446,6.123755,6.040006,6.257737,6.292998,6.548829,6.36445,6.243616,5.961898,5.768549,5.632522,5.800672,6.087605,6.397678,6.604807,6.72822,6.816733,6.330082,5.933997,5.614503,5.733362,5.767461,5.642726,5.566482,5.53098,5.69419,5.690981,5.74126,5.95255,6.364493,6.861884,6.769757,6.550781,6.22468,6.218283,6.221438,5.983002,5.777493,6.236155,6.917476,7.551833,6.874846,5.03724,4.431195,4.541074,4.577274,4.479928,4.413132,4.38909,4.489487,4.408067,4.381461,4.394746,4.636141,4.749196,5.006414,5.137766,5.463718,5.387333,5.3072,5.29074,5.3804,5.764801,5.838204,5.966061,5.967326,5.911563,5.945886,5.458721,5.137591,4.634298,4.542561,4.4042,4.421751,4.301151,4.328716,4.37357,4.63648,4.76866,4.788025,4.641315,4.548089,4.700453,4.909737,5.083664,5.063394,5.06239,5.222026,5.203851,5.766587,6.339293,7.148687,6.738301,6.094441,5.289414,5.141527,4.828282,4.65933,4.355831,4.35543,4.379142,4.59293,4.713009,4.713887,4.576071,4.482119,4.433541,4.413563,4.399436,4.526244,4.706011,4.884732,5.069787,5.325227,5.544574,5.43909,5.56328,5.789192,6.097385,5.646025,5.325857,5.145808,5.289327,5.302399,5.347059,5.557595,5.401509,5.109009,4.749572,4.642069,4.622322,4.570128,4.56531,4.554197,4.600152,4.614564,4.633111,4.669017,4.759874,5.144207,5.960851,6.683971,6.757185,5.874296,5.065982,4.596848,4.488963,4.410002,4.403799,4.641694,5.060071,5.335161,5.423871,5.331915,5.316386,5.358,5.093657,4.843664,4.62796,4.608533,4.525216,4.362327,4.319978,4.423956,4.692335,4.820373,4.980927,5.518366,6.163841,6.607748,5.936241,5.27836,4.616486,4.686,4.729623,4.818991,4.730467,4.586487,4.427772,4.325053,4.554597,4.875824,5.256654,5.209429,5.079156,4.835285,4.635874,4.535398,4.639349,4.813136,4.811499,5.057662,5.295994,5.837526,5.554467,5.34481,5.038404,5.181465,5.283583,5.033609,4.727632,4.436047,4.40415,4.400332,4.350948,4.314592,4.347252,4.535038,4.695051,4.738912,4.818852,4.961932,5.281096,5.172995,4.916344,4.518263,4.376344,4.374166,4.828422,5.339736,5.945168,5.679431,5.352809,5.038977,5.182376,5.350026,5.070155,4.736487,4.416676,4.416178,4.480411,4.515826,4.52491,4.474684,4.523715,4.643881,4.808741,5.119445,5.259779,5.527601,5.241716,5.084799,4.971889,5.232194,5.531652,6.685176,6.594271,6.378665,6.036106,5.749025,5.808157,6.080423,6.412563,6.294321,6.215258,6.025452,5.89444,5.693119,5.571756,5.603598,5.68151,5.692337,5.562277,5.55869,5.857507,6.29602,6.405064,6.114436,5.839327,6.396238,7.000285,7.477303,6.723237,6.070666,5.49394,5.519553,5.573955,5.82986,6.112589,6.354534,6.31873,6.196888,6.104198,5.999645,5.950351,5.829921,5.686605,5.681302,5.699959,5.846128,5.645393,5.755449,5.91268,6.662886,6.95588,7.11596,6.802511,6.591513,6.438332,6.099304,5.820275,5.568072,5.630495,5.694073,5.845307,5.912643,5.98479,6.082166,6.25045,6.398362,6.104982,5.823612,5.552764,5.622212,5.577602,5.622981,5.698252,5.900581,6.182465,6.322807,6.879799,7.188691,7.575777,6.944885,6.332597,5.738734,5.726838,5.731537,5.696529,5.585202,5.606314,5.76105,5.967555,6.023276,6.086462,6.190188,6.382263,6.231862,6.011573,5.81893,5.89358,6.005905,6.020039,5.924513,5.954029,6.218235,6.546941,6.86891,7.068611,7.290977,7.051559,6.550897,6.011635,5.76731,5.717968,5.721631,5.75174,5.780763,5.681889,5.629537,5.586623,5.930293,6.201426,6.514922,6.416912,6.369352,6.235789,6.073721,5.847272,5.686301,5.666934,6.20975,6.838556,7.481553,7.10064,6.74616,6.363331,6.426738,6.149344,5.933233,5.797128,5.764722,5.594668,5.453125,5.472548,5.625085,5.647283,5.639621,5.837096,6.222168,6.555405,6.567566,6.413279,6.259412,5.993273,5.836282,5.718845,5.876219,6.359873,6.913569,7.312316,6.855393,6.49938,6.249611,6.488738,6.220029,5.826509,5.468172,5.509878,5.668124,5.651684,5.55219,5.480868,5.776867,6.050206,6.320538,6.179636,4.832263,4.775748,4.913662,5.042063,4.886298,5.267017,5.664358,6.190853,5.599437,5.063675,4.609602,4.731749,4.929136,4.990367,5.075219,4.809662,4.699379,4.448029,4.453063,4.464069,4.778076,4.968893,5.026659,4.742275,4.509446,4.349922,4.318112,4.333597,4.712625,5.149869,5.538111,5.250051,5.430985,5.646023,6.171322,5.641228,5.005292,4.269737,4.127678,4.457571,4.924372,5.234745,4.960325,4.707864,4.7212,4.849351,4.856047,4.659763,4.515796,4.40401,4.28801,4.248618,4.343867,4.510173,4.653705,4.873166,5.475965,6.089268,6.458531,6.113302,5.659335,5.043469,4.646805,4.404469,4.426382,4.430821,4.625457,4.844742,5.305028,5.334793,5.238127,5.017317,4.845061,4.712686,4.480259,4.34903,4.303095,4.392626,4.520331,4.550567,4.490779,4.421446,4.612996,5.418715,6.130108,6.557769,5.906486,5.391859,4.76831,4.541351,4.300085,4.28724,4.507887,4.844942,5.067092,5.194992,5.148974,5.109309,4.936994,4.584296,4.385518,4.339996,4.555223,4.600138,4.552129,4.459152,4.490483,4.895494,5.176983,5.367816,5.214093,5.243578,5.553901,5.520566,5.466149,4.951061,4.903601,4.728387,4.690531,4.591224,4.694436,4.82881,4.816989,4.753052,4.823508,5.033822,5.009298,4.840712,4.586339,4.497735,4.521818,4.616727,4.592391,4.390049,4.754736,5.292695,5.990752,5.433798,4.874551,4.609329,6.273603,6.622937,6.406608,6.098107,5.859874,5.761692,5.699095,5.738033,5.928273,6.042024,6.212206,6.283889,6.348515,6.03773,5.856465,5.746708,5.760088,5.574866,5.629056,5.842481,6.212418,6.332498,6.486201,6.673879,6.637943,6.410638,6.228425,6.204078,6.251118,6.120688,6.104847,6.117011,6.128335,6.039968,6.024517,5.996286,5.954031,6.080514,6.325126,6.629632,6.330814,5.879413,5.487668,5.475292,5.606567,6.086079,6.551131,7.044473,6.717788,6.373728,5.90751,5.788284,5.637395,5.605675,5.691471,5.83554,6.151315,6.386746,6.631715,6.344835,6.018192,5.681254,5.689872,5.777793,6.025317,6.133933,6.277648,6.077327,5.987568,5.864989,5.897015,5.98555,6.432356,6.84112,7.113095,6.589542,6.094027,5.623514,5.522933,5.456934,5.553226,5.835291,6.116502,6.442473,6.487873,6.536535,6.249372,6.118733,5.884059,5.657973,5.46341,5.645555,6.014105,6.221535,6.082907,5.97792,6.605409,7.116229,7.513281,6.776364,6.196296,5.634951,5.539648,5.487374,5.53557,5.779974,6.000779,6.112113,5.928658,5.783382,5.959631,6.315152,6.542625,6.299304,6.056088,5.939025,5.911343,5.733488,5.715221,5.846496,6.276358,6.51246,6.639074,6.968599,7.038584,7.128989,6.333121,5.844307,5.497183,5.800551,6.030352,6.103949,5.898767,5.765905,5.739806,5.842296,5.810825,5.774666,5.799678,5.960618,6.175287,6.215175,6.210616,5.967476,5.942759,6.008709,6.133901,6.629062,7.094273,7.601003,7.124397,6.381531,5.775035,5.7209,4.618646,4.612236,4.580121,4.631924,4.788916,4.869726,4.725961,4.426403,4.237035,4.238751,4.471406,4.54099,4.569971,4.736883,5.111344,5.468716,5.242926,4.910903,4.614703,4.604205,5.102441,5.794475,6.579083,6.378665,5.659266,4.851441,4.604152,4.706479,4.903261,4.915074,4.758218,4.438578,4.282497,4.296713,4.442762,4.42422,4.385566,4.367747,4.581674,4.708094,5.002209,5.118579,5.276625,4.994579,5.199706,5.425813,5.857754,5.575338,5.553697,5.519307,5.695908,5.392566,5.153951,4.928129,4.781003,4.505271,4.340054,4.348453,4.475752,4.443477,4.347478,4.295168,4.46318,4.659531,4.704127,4.582243,4.42392,4.515223,4.646424,4.810829,4.866754,5.535652,6.181608,6.558875,6.119795,5.939606,6.024731,6.10155,5.729936,5.191755,4.855069,4.62908,4.539812,4.356187,4.290331,4.258751,4.495982,4.627023,4.629326,4.46164,4.345039,4.251476,4.158577,4.137362,4.384953,5.127785,5.811248,6.339538,6.152728,5.970296,5.531606,5.285539,5.13868,5.059199,4.957679,4.80036,4.814019,4.810097,4.646634,4.485126,4.562479,4.681973,4.686368,4.531101,4.45098,4.408121,4.303228,4.210933,4.199395,4.301117,4.404,4.451049,5.035731,5.597682,6.472714,6.319295,6.139632,5.306536,4.89893,4.676551,4.774042,4.779566,4.770472,4.846208,5.208855,5.144842,4.951127,4.499941,4.32453,4.165687,4.121568,4.111922,4.260117,4.414244,4.572062,4.55377,4.760701,4.939656,5.236439,5.326482,5.35259,5.469586,5.378005,5.429631,5.295584,5.132135,4.957289,4.726218,4.830203,5.014876,5.241954,5.275216,4.94524,4.624836,4.357895,4.32174,4.437574,4.585687,4.677603,4.605942,4.486562,4.446988,4.528397,5.148481,5.659672,6.001403,5.476604,5.043609,4.896314,4.843518,4.862955,4.859315,5.257259,5.43781,5.181337,4.718804,4.696636,4.893918,5.129713,4.867492,4.772701,4.730195,4.764529,4.633799,4.434671,4.385646,4.439964,4.737586,4.931165,4.992294,5.18201,5.429843,5.799209,5.203428,4.704732,4.292338,4.712125,4.914683,5.164046,5.13062,5.254577,6.20602,5.900201,5.838758,6.136142,6.539876,6.490473,6.320498,6.029799,5.849631,5.778629,5.792266,5.814994,5.671524,6.11667,6.634235,7.313299,6.785364,6.318054,5.851944,6.03558,6.030941,5.90854,5.67218,5.566682,5.763776,6.014838,6.306039,6.289419,6.315688,6.387644,6.371196,6.253278,6.054117,6.075445,6.191639,6.123509,5.884337,5.702941,5.645145,5.737004,6.137232,6.651602,7.18268,6.894427,6.427788,5.844523,5.630892,5.536274,5.460717,5.399471,5.384941,5.684967,6.076944,6.346145,6.300043,6.171566,6.270923,6.272039,6.331771,6.232373,6.17044,6.134211,5.890281,5.784696,6.129036,6.758892,7.419302,7.064726,6.499073,5.79491,5.597523,5.56562,5.57104,5.530379,5.483724,5.568086,5.757489,5.865048,5.904134,5.830992,5.84393,6.067724,6.376209,6.61588,6.245042,5.901773,5.832324,6.173587,6.410851,6.245492,6.097784,6.682907,7.287409,7.77155,6.909144,6.205196,5.524181,5.471934,5.425607,5.530089,5.717283,5.864346,5.833852,5.721153,5.648504,5.694641,5.802921,5.806947,5.936552,6.068029,6.303821,6.19461,5.977509,6.05355,6.274451,7.21223,7.568562,7.899143,7.156186,6.614372,6.072601,5.802854,5.645036,5.636112,5.830003,5.917967,5.864038,5.729806,5.70113,5.749439,5.841068,5.777667,5.583263,5.450398,5.449781,5.784586,5.938633,6.145093,6.134809,6.431945,6.731871,6.793005,7.092693,7.301103,7.672924,7.025567,6.260767,5.63989,5.668738,5.772637,5.738042,5.645429,5.666463,5.790594,4.649319,4.62785,4.439407]],"times":[1671612300000,1671612305000,1671612310000,1671612315000,1671612320000,1671612325000,1671612330000,1671612335000,1671612340000,1671612345000,1671612350000,1671612355000,1671612360000,1671612365000,1671612370000,1671612375000,1671612380000,1671612385000,1671612390000,1671612395000,1671612400000,1671612405000,1671612410000,1671612415000,1671612420000,1671612425000,1671612430000,1671612435000,1671612440000,1671612445000,1671612450000,1671612455000,1671612460000,1671612465000,1671612470000,1671612475000,1671612480000,1671612485000,1671612490000,1671612495000,1671612500000,1671612505000,1671612510000,1671612515000,1671612520000,1671612525000,1671612530000,1671612535000,1671612540000,1671612545000,1671612550000,1671612555000,1671612560000,1671612565000,1671612570000,1671612575000,1671612580000,1671612585000,1671612590000,1671612595000,1671612600000,1671612605000,1671612610000,1671612615000,1671612620000,1671612625000,1671612630000,1671612635000,1671612640000,1671612645000,1671612650000,1671612655000,1671612660000,1671612665000,1671612670000,1671612675000,1671612680000,1671612685000,1671612690000,1671612695000,1671612700000,1671612705000,1671612710000,1671612715000,1671612720000,1671612725000,1671612730000,1671612735000,1671612740000,1671612745000,1671612750000,1671612755000,1671612760000,1671612765000,1671612770000,1671612775000,1671612780000,1671612785000,1671612790000,1671612795000,1671612800000,1671612805000,1671612810000,1671612815000,1671612820000,1671612825000,1671612830000,1671612835000,1671612840000,1671612845000,1671612850000,1671612855000,1671612860000,1671612865000,1671612870000,1671612875000,1671612880000,1671612885000,1671612890000,1671612895000,1671612900000,1671612905000,1671612910000,1671612915000,1671612920000,1671612925000,1671612930000,1671612935000,1671612940000,1671612945000,1671612950000,1671612955000,1671612960000,1671612965000,1671612970000,1671612975000,1671612980000,1671612985000,1671612990000,1671612995000,1671613000000,1671613005000,1671613010000,1671613015000,1671613020000,1671613025000,1671613030000,1671613035000,1671613040000,1671613045000,1671613050000,1671613055000,1671613060000,1671613065000,1671613070000,1671613075000,1671613080000,1671613085000,1671613090000,1671613095000,1671613100000,1671613105000,1671613110000,1671613115000,1671613120000,1671613125000,1671613130000,1671613135000,1671613140000,1671613145000,1671613150000,1671613155000,1671613160000,1671613165000,1671613170000,1671613175000,1671613180000,1671613185000,1671613190000,1671613195000,1671613200000,1671613205000,1671613210000,1671613215000,1671613220000,1671613225000,1671613230000,1671613235000,1671613240000,1671613245000,1671613250000,1671613255000,1671613260000,1671613265000,1671613270000,1671613275000,1671613280000,1671613285000,1671613290000,1671613295000,1671613300000,1671613305000,1671613310000,1671613315000,1671613320000,1671613325000,1671613330000,1671613335000,1671613340000,1671613345000,1671613350000,1671613355000,1671613360000,1671613365000,1671613370000,1671613375000,1671613380000,1671613385000,1671613390000,1671613395000,1671613400000,1671613405000,1671613410000,1671613415000,1671613420000,1671613425000,1671613430000,1671613435000,1671613440000,1671613445000,1671613450000,1671613455000,1671613460000,1671613465000,1671613470000,1671613475000,1671613480000,1671613485000,1671613490000,1671613495000,1671613500000,1671613505000,1671613510000,1671613515000,1671613520000,1671613525000,1671613530000,1671613535000,1671613540000,1671613545000,1671613550000,1671613555000,1671613560000,1671613565000,1671613570000,1671613575000,1671613580000,1671613585000,1671613590000,1671613595000,1671613600000,1671613605000,1671613610000,1671613615000,1671613620000,1671613625000,1671613630000,1671613635000,1671613640000,1671613645000,1671613650000,1671613655000,1671613660000,1671613665000,1671613670000,1671613675000,1671613680000,1671613685000,1671613690000,1671613695000,1671613700000,1671613705000,1671613710000,1671613715000,1671613720000,1671613725000,1671613730000,1671613735000,1671613740000,1671613745000,1671613750000,1671613755000,1671613760000,1671613765000,1671613770000,1671613775000,1671613780000,1671613785000,1671613790000,1671613795000,1671613800000,1671613805000,1671613810000,1671613815000,1671613820000,1671613825000,1671613830000,1671613835000,1671613840000,1671613845000,1671613850000,1671613855000,1671613860000,1671613865000,1671613870000,1671613875000,1671613880000,1671613885000,1671613890000,1671613895000,1671613900000,1671613905000,1671613910000,1671613915000,1671613920000,1671613925000,1671613930000,1671613935000,1671613940000,1671613945000,1671613950000,1671613955000,1671613960000,1671613965000,1671613970000,1671613975000,1671613980000,1671613985000,1671613990000,1671613995000,1671614000000,1671614005000,1671614010000,1671614015000,1671614020000,1671614025000,1671614030000,1671614035000,1671614040000,1671614045000,1671614050000,1671614055000,1671614060000,1671614065000,1671614070000,1671614075000,1671614080000,1671614085000,1671614090000,1671614095000,1671614100000,1671614105000,1671614110000,1671614115000,1671614120000,1671614125000,1671614130000,1671614135000,1671614140000,1671614145000,1671614150000,1671614155000,1671614160000,1671614165000,1671614170000,1671614175000,1671614180000,1671614185000,1671614190000,1671614195000,1671614200000,1671614205000,1671614210000,1671614215000,1671614220000,1671614225000,1671614230000,1671614235000,1671614240000,1671614245000,1671614250000,1671614255000,1671614260000,1671614265000,1671614270000,1671614275000,1671614280000,1671614285000,1671614290000,1671614295000,1671614300000,1671614305000,1671614310000,1671614315000,1671614320000,1671614325000,1671614330000,1671614335000,1671614340000,1671614345000,1671614350000,1671614355000,1671614360000,1671614365000,1671614370000,1671614375000,1671614380000,1671614385000,1671614390000,1671614395000,1671614400000,1671614405000,1671614410000,1671614415000,1671614420000,1671614425000,1671614430000,1671614435000,1671614440000,1671614445000,1671614450000,1671614455000,1671614460000,1671614465000,1671614470000,1671614475000,1671614480000,1671614485000,1671614490000,1671614495000,1671614500000,1671614505000,1671614510000,1671614515000,1671614520000,1671614525000,1671614530000,1671614535000,1671614540000,1671614545000,1671614550000,1671614555000,1671614560000,1671614565000,1671614570000,1671614575000,1671614580000,1671614585000,1671614590000,1671614595000,1671614600000,1671614605000,1671614610000,1671614615000,1671614620000,1671614625000,1671614630000,1671614635000,1671614640000,1671614645000,1671614650000,1671614655000,1671614660000,1671614665000,1671614670000,1671614675000,1671614680000,1671614685000,1671614690000,1671614695000,1671614700000,1671614705000,1671614710000,1671614715000,1671614720000,1671614725000,1671614730000,1671614735000,1671614740000,1671614745000,1671614750000,1671614755000,1671614760000,1671614765000,1671614770000,1671614775000,1671614780000,1671614785000,1671614790000,1671614795000,1671614800000,1671614805000,1671614810000,1671614815000,1671614820000,1671614825000,1671614830000,1671614835000,1671614840000,1671614845000,1671614850000,1671614855000,1671614860000,1671614865000,1671614870000,1671614875000,1671614880000,1671614885000,1671614890000,1671614895000,1671614900000,1671614905000,1671614910000,1671614915000,1671614920000,1671614925000,1671614930000,1671614935000,1671614940000,1671614945000,1671614950000,1671614955000,1671614960000,1671614965000,1671614970000,1671614975000,1671614980000,1671614985000,1671614990000,1671614995000,1671615000000,1671615005000,1671615010000,1671615015000,1671615020000,1671615025000,1671615030000,1671615035000,1671615040000,1671615045000,1671615050000,1671615055000,1671615060000,1671615065000,1671615070000,1671615075000,1671615080000,1671615085000,1671615090000,1671615095000,1671615100000,1671615105000,1671615110000,1671615115000,1671615120000,1671615125000,1671615130000,1671615135000,1671615140000,1671615145000,1671615150000,1671615155000,1671615160000,1671615165000,1671615170000,1671615175000,1671615180000,1671615185000,1671615190000,1671615195000,1671615200000,1671615205000,1671615210000,1671615215000,1671615220000,1671615225000,1671615230000,1671615235000,1671615240000,1671615245000,1671615250000,1671615255000,1671615260000,1671615265000,1671615270000,1671615275000,1671615280000,1671615285000,1671615290000,1671615295000,1671615300000,1671615305000,1671615310000,1671615315000,1671615320000,1671615325000,1671615330000,1671615335000,1671615340000,1671615345000,1671615350000,1671615355000,1671615360000,1671615365000,1671615370000,1671615375000,1671615380000,1671615385000,1671615390000,1671615395000,1671615400000,1671615405000,1671615410000,1671615415000,1671615420000,1671615425000,1671615430000,1671615435000,1671615440000,1671615445000,1671615450000,1671615455000,1671615460000,1671615465000,1671615470000,1671615475000,1671615480000,1671615485000,1671615490000,1671615495000,1671615500000,1671615505000,1671615510000,1671615515000,1671615520000,1671615525000,1671615530000,1671615535000,1671615540000,1671615545000,1671615550000,1671615555000,1671615560000,1671615565000,1671615570000,1671615575000,1671615580000,1671615585000,1671615590000,1671615595000,1671615600000,1671615605000,1671615610000,1671615615000,1671615620000,1671615625000,1671615630000,1671615635000,1671615640000,1671615645000,1671615650000,1671615655000,1671615660000,1671615665000,1671615670000,1671615675000,1671615680000,1671615685000,1671615690000,1671615695000,1671615700000,1671615705000,1671615710000,1671615715000,1671615720000,1671615725000,1671615730000,1671615735000,1671615740000,1671615745000,1671615750000,1671615755000,1671615760000,1671615765000,1671615770000,1671615775000,1671615780000,1671615785000,1671615790000,1671615795000,1671615800000,1671615805000,1671615810000,1671615815000,1671615820000,1671615825000,1671615830000,1671615835000,1671615840000,1671615845000,1671615850000,1671615855000,1671615860000,1671615865000,1671615870000,1671615875000,1671615880000,1671615885000,1671615890000,1671615895000,1671615900000,1671615905000,1671615910000,1671615915000,1671615920000,1671615925000,1671615930000,1671615935000,1671615940000,1671615945000,1671615950000,1671615955000,1671615960000,1671615965000,1671615970000,1671615975000,1671615980000,1671615985000,1671615990000,1671615995000,1671616000000,1671616005000,1671616010000,1671616015000,1671616020000,1671616025000,1671616030000,1671616035000,1671616040000,1671616045000,1671616050000,1671616055000,1671616060000,1671616065000,1671616070000,1671616075000,1671616080000,1671616085000,1671616090000,1671616095000,1671616100000,1671616105000,1671616110000,1671616115000,1671616120000,1671616125000,1671616130000,1671616135000,1671616140000,1671616145000,1671616150000,1671616155000,1671616160000,1671616165000,1671616170000,1671616175000,1671616180000,1671616185000,1671616190000,1671616195000,1671616200000,1671616205000,1671616210000,1671616215000,1671616220000,1671616225000,1671616230000,1671616235000,1671616240000,1671616245000,1671616250000,1671616255000,1671616260000,1671616265000,1671616270000,1671616275000,1671616280000,1671616285000,1671616290000,1671616295000,1671616300000,1671616305000,1671616310000,1671616315000,1671616320000,1671616325000,1671616330000,1671616335000,1671616340000,1671616345000,1671616350000,1671616355000,1671616360000,1671616365000,1671616370000,1671616375000,1671616380000,1671616385000,1671616390000,1671616395000,1671616400000,1671616405000,1671616410000,1671616415000,1671616420000,1671616425000,1671616430000,1671616435000,1671616440000,1671616445000,1671616450000,1671616455000,1671616460000,1671616465000,1671616470000,1671616475000,1671616480000,1671616485000,1671616490000,1671616495000,1671616500000,1671616505000,1671616510000,1671616515000,1671616520000,1671616525000,1671616530000,1671616535000,1671616540000,1671616545000,1671616550000,1671616555000,1671616560000,1671616565000,1671616570000,1671616575000,1671616580000,1671616585000,1671616590000,1671616595000,1671616600000,1671616605000,1671616610000,1671616615000,1671616620000,1671616625000,1671616630000,1671616635000,1671616640000,1671616645000,1671616650000,1671616655000,1671616660000,1671616665000,1671616670000,1671616675000,1671616680000,1671616685000,1671616690000,1671616695000,1671616700000,1671616705000,1671616710000,1671616715000,1671616720000,1671616725000,1671616730000,1671616735000,1671616740000,1671616745000,1671616750000,1671616755000,1671616760000,1671616765000,1671616770000,1671616775000,1671616780000,1671616785000,1671616790000,1671616795000,1671616800000,1671616805000,1671616810000,1671616815000,1671616820000,1671616825000,1671616830000,1671616835000,1671616840000,1671616845000,1671616850000,1671616855000,1671616860000,1671616865000,1671616870000,1671616875000,1671616880000,1671616885000,1671616890000,1671616895000,1671616900000,1671616905000,1671616910000,1671616915000,1671616920000,1671616925000,1671616930000,1671616935000,1671616940000,1671616945000,1671616950000,1671616955000,1671616960000,1671616965000,1671616970000,1671616975000,1671616980000,1671616985000,1671616990000,1671616995000,1671617000000,1671617005000,1671617010000,1671617015000,1671617020000,1671617025000,1671617030000,1671617035000,1671617040000,1671617045000,1671617050000,1671617055000,1671617060000,1671617065000,1671617070000,1671617075000,1671617080000,1671617085000,1671617090000,1671617095000,1671617100000,1671617105000,1671617110000,1671617115000,1671617120000,1671617125000,1671617130000,1671617135000,1671617140000,1671617145000,1671617150000,1671617155000,1671617160000,1671617165000,1671617170000,1671617175000,1671617180000,1671617185000,1671617190000,1671617195000,1671617200000,1671617205000,1671617210000,1671617215000,1671617220000,1671617225000,1671617230000,1671617235000,1671617240000,1671617245000,1671617250000,1671617255000,1671617260000,1671617265000,1671617270000,1671617275000,1671617280000,1671617285000,1671617290000,1671617295000,1671617300000,1671617305000,1671617310000,1671617315000,1671617320000,1671617325000,1671617330000,1671617335000,1671617340000,1671617345000,1671617350000,1671617355000,1671617360000,1671617365000,1671617370000,1671617375000,1671617380000,1671617385000,1671617390000,1671617395000,1671617400000,1671617405000,1671617410000,1671617415000,1671617420000,1671617425000,1671617430000,1671617435000,1671617440000,1671617445000,1671617450000,1671617455000,1671617460000,1671617465000,1671617470000,1671617475000,1671617480000,1671617485000,1671617490000,1671617495000,1671617500000,1671617505000,1671617510000,1671617515000,1671617520000,1671617525000,1671617530000,1671617535000,1671617540000,1671617545000,1671617550000,1671617555000,1671617560000,1671617565000,1671617570000,1671617575000,1671617580000,1671617585000,1671617590000,1671617595000,1671617600000,1671617605000,1671617610000,1671617615000,1671617620000,1671617625000,1671617630000,1671617635000,1671617640000,1671617645000,1671617650000,1671617655000,1671617660000,1671617665000,1671617670000,1671617675000,1671617680000,1671617685000,1671617690000,1671617695000,1671617700000,1671617705000,1671617710000,1671617715000,1671617720000,1671617725000,1671617730000,1671617735000,1671617740000,1671617745000,1671617750000,1671617755000,1671617760000,1671617765000,1671617770000,1671617775000,1671617780000,1671617785000,1671617790000,1671617795000,1671617800000,1671617805000,1671617810000,1671617815000,1671617820000,1671617825000,1671617830000,1671617835000,1671617840000,1671617845000,1671617850000,1671617855000,1671617860000,1671617865000,1671617870000,1671617875000,1671617880000,1671617885000,1671617890000,1671617895000,1671617900000,1671617905000,1671617910000,1671617915000,1671617920000,1671617925000,1671617930000,1671617935000,1671617940000,1671617945000,1671617950000,1671617955000,1671617960000,1671617965000,1671617970000,1671617975000,1671617980000,1671617985000,1671617990000,1671617995000,1671618000000,1671618005000,1671618010000,1671618015000,1671618020000,1671618025000,1671618030000,1671618035000,1671618040000,1671618045000,1671618050000,1671618055000,1671618060000,1671618065000,1671618070000,1671618075000,1671618080000,1671618085000,1671618090000,1671618095000,1671618100000,1671618105000,1671618110000,1671618115000,1671618120000,1671618125000,1671618130000,1671618135000,1671618140000,1671618145000,1671618150000,1671618155000,1671618160000,1671618165000,1671618170000,1671618175000,1671618180000,1671618185000,1671618190000,1671618195000,1671618200000,1671618205000,1671618210000,1671618215000,1671618220000,1671618225000,1671618230000,1671618235000,1671618240000,1671618245000,1671618250000,1671618255000,1671618260000,1671618265000,1671618270000,1671618275000,1671618280000,1671618285000,1671618290000,1671618295000,1671618300000,1671618305000,1671618310000,1671618315000,1671618320000,1671618325000,1671618330000,1671618335000,1671618340000,1671618345000,1671618350000,1671618355000,1671618360000,1671618365000,1671618370000,1671618375000,1671618380000,1671618385000,1671618390000,1671618395000,1671618400000,1671618405000,1671618410000,1671618415000,1671618420000,1671618425000,1671618430000,1671618435000,1671618440000,1671618445000,1671618450000,1671618455000,1671618460000,1671618465000,1671618470000,1671618475000,1671618480000,1671618485000,1671618490000,1671618495000,1671618500000,1671618505000,1671618510000,1671618515000,1671618520000,1671618525000,1671618530000,1671618535000,1671618540000,1671618545000,1671618550000,1671618555000,1671618560000,1671618565000,1671618570000,1671618575000,1671618580000,1671618585000,1671618590000,1671618595000,1671618600000,1671618605000,1671618610000,1671618615000,1671618620000,1671618625000,1671618630000,1671618635000,1671618640000,1671618645000,1671618650000,1671618655000,1671618660000,1671618665000,1671618670000,1671618675000,1671618680000,1671618685000,1671618690000,1671618695000,1671618700000,1671618705000,1671618710000,1671618715000,1671618720000,1671618725000,1671618730000,1671618735000,1671618740000,1671618745000,1671618750000,1671618755000,1671618760000,1671618765000,1671618770000,1671618775000,1671618780000,1671618785000,1671618790000,1671618795000,1671618800000,1671618805000,1671618810000,1671618815000,1671618820000,1671618825000,1671618830000,1671618835000,1671618840000,1671618845000,1671618850000,1671618855000,1671618860000,1671618865000,1671618870000,1671618875000,1671618880000,1671618885000,1671618890000,1671618895000,1671618900000,1671618905000,1671618910000,1671618915000,1671618920000,1671618925000,1671618930000,1671618935000,1671618940000,1671618945000,1671618950000,1671618955000,1671618960000,1671618965000,1671618970000,1671618975000,1671618980000,1671618985000,1671618990000,1671618995000,1671619000000,1671619005000,1671619010000,1671619015000,1671619020000,1671619025000,1671619030000,1671619035000,1671619040000,1671619045000,1671619050000,1671619055000,1671619060000,1671619065000,1671619070000,1671619075000,1671619080000,1671619085000,1671619090000,1671619095000,1671619100000,1671619105000,1671619110000,1671619115000,1671619120000,1671619125000,1671619130000,1671619135000,1671619140000,1671619145000,1671619150000,1671619155000,1671619160000,1671619165000,1671619170000,1671619175000,1671619180000,1671619185000,1671619190000,1671619195000,1671619200000,1671619205000,1671619210000,1671619215000,1671619220000,1671619225000,1671619230000,1671619235000,1671619240000,1671619245000,1671619250000,1671619255000,1671619260000,1671619265000,1671619270000,1671619275000,1671619280000,1671619285000,1671619290000,1671619295000,1671619300000,1671619305000,1671619310000,1671619315000,1671619320000,1671619325000,1671619330000,1671619335000,1671619340000,1671619345000,1671619350000,1671619355000,1671619360000,1671619365000,1671619370000,1671619375000,1671619380000,1671619385000,1671619390000,1671619395000,1671619400000,1671619405000,1671619410000,1671619415000,1671619420000,1671619425000,1671619430000,1671619435000,1671619440000,1671619445000,1671619450000,1671619455000,1671619460000,1671619465000,1671619470000,1671619475000,1671619480000,1671619485000,1671619490000,1671619495000,1671619500000,1671619505000,1671619510000,1671619515000,1671619520000,1671619525000,1671619530000,1671619535000,1671619540000,1671619545000,1671619550000,1671619555000,1671619560000,1671619565000,1671619570000,1671619575000,1671619580000,1671619585000,1671619590000,1671619595000,1671619600000,1671619605000,1671619610000,1671619615000,1671619620000,1671619625000,1671619630000,1671619635000,1671619640000,1671619645000,1671619650000,1671619655000,1671619660000,1671619665000,1671619670000,1671619675000,1671619680000,1671619685000,1671619690000,1671619695000,1671619700000,1671619705000,1671619710000,1671619715000,1671619720000,1671619725000,1671619730000,1671619735000,1671619740000,1671619745000,1671619750000,1671619755000,1671619760000,1671619765000,1671619770000,1671619775000,1671619780000,1671619785000,1671619790000,1671619795000,1671619800000,1671619805000,1671619810000,1671619815000,1671619820000,1671619825000,1671619830000,1671619835000,1671619840000,1671619845000,1671619850000,1671619855000,1671619860000,1671619865000,1671619870000,1671619875000,1671619880000,1671619885000,1671619890000,1671619895000,1671619900000,1671619905000,1671619910000,1671619915000,1671619920000,1671619925000,1671619930000,1671619935000,1671619940000,1671619945000,1671619950000,1671619955000,1671619960000,1671619965000,1671619970000,1671619975000,1671619980000,1671619985000,1671619990000,1671619995000,1671620000000,1671620005000,1671620010000,1671620015000,1671620020000,1671620025000,1671620030000,1671620035000,1671620040000,1671620045000,1671620050000,1671620055000,1671620060000,1671620065000,1671620070000,1671620075000,1671620080000,1671620085000,1671620090000,1671620095000,1671620100000,1671620105000,1671620110000,1671620115000,1671620120000,1671620125000,1671620130000,1671620135000,1671620140000,1671620145000,1671620150000,1671620155000,1671620160000,1671620165000,1671620170000,1671620175000,1671620180000,1671620185000,1671620190000,1671620195000,1671620200000,1671620205000,1671620210000,1671620215000,1671620220000,1671620225000,1671620230000,1671620235000,1671620240000,1671620245000,1671620250000,1671620255000,1671620260000,1671620265000,1671620270000,1671620275000,1671620280000,1671620285000,1671620290000,1671620295000,1671620300000,1671620305000,1671620310000,1671620315000,1671620320000,1671620325000,1671620330000,1671620335000,1671620340000,1671620345000,1671620350000,1671620355000,1671620360000,1671620365000,1671620370000,1671620375000,1671620380000,1671620385000,1671620390000,1671620395000,1671620400000,1671620405000,1671620410000,1671620415000,1671620420000,1671620425000,1671620430000,1671620435000,1671620440000,1671620445000,1671620450000,1671620455000,1671620460000,1671620465000,1671620470000,1671620475000,1671620480000,1671620485000,1671620490000,1671620495000,1671620500000,1671620505000],"series":[{"query_index":0,"unit":[{"plural":"percent","scale_factor":1.0,"id":17,"short_name":"%","family":"percentage","name":"percent"},null],"group_tags":[]}]}}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/metrics/QueryScalarData.rb b/examples/v2/metrics/QueryScalarData.rb new file mode 100644 index 000000000000..647bb8e2520b --- /dev/null +++ b/examples/v2/metrics/QueryScalarData.rb @@ -0,0 +1,35 @@ +# Scalar cross product query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient::V2.configure do |config| + config.unstable_operations["v2.query_scalar_data".to_sym] = true +end +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: 1671612804000, + queries: [ + DatadogAPIClient::V2::MetricsScalarQuery.new({ + aggregator: DatadogAPIClient::V2::MetricsAggregator::AVG, + data_source: DatadogAPIClient::V2::MetricsDataSource::METRICS, + query: "avg:system.cpu.user{*}", + name: "a", + }), + ], + to: 1671620004000, + }), + type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST, + }), +}) +p api_instance.query_scalar_data(body) diff --git a/examples/v2/metrics/QueryTimeseriesData.rb b/examples/v2/metrics/QueryTimeseriesData.rb new file mode 100644 index 000000000000..84e5f93271a9 --- /dev/null +++ b/examples/v2/metrics/QueryTimeseriesData.rb @@ -0,0 +1,35 @@ +# Timeseries cross product query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient::V2.configure do |config| + config.unstable_operations["v2.query_timeseries_data".to_sym] = true +end +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: 1671612804000, + interval: 5000, + queries: [ + DatadogAPIClient::V2::MetricsTimeseriesQuery.new({ + data_source: DatadogAPIClient::V2::MetricsDataSource::METRICS, + query: "avg:system.cpu.user{*}", + name: "a", + }), + ], + to: 1671620004000, + }), + type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST, + }), +}) +p api_instance.query_timeseries_data(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 3ee98da69731..6107ccf90b48 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1115,6 +1115,12 @@ "v2.ListVolumesByMetricName" => { "metric_name" => "String", }, + "v2.QueryScalarData" => { + "body" => "ScalarFormulaQueryRequest", + }, + "v2.QueryTimeseriesData" => { + "body" => "TimeseriesFormulaQueryRequest", + }, "v2.SubmitMetrics" => { "content_encoding" => "MetricContentEncoding", "body" => "MetricPayload", diff --git a/features/v2/metrics.feature b/features/v2/metrics.feature index 0d46ae6b31f7..4fdbb5c9eca7 100644 --- a/features/v2/metrics.feature +++ b/features/v2/metrics.feature @@ -1,13 +1,13 @@ @endpoint(metrics) @endpoint(metrics-v2) Feature: Metrics The metrics endpoint allows you to: - Post metrics data so it can be - graphed on Datadog’s dashboards - Query metrics from any time period - - Modify tag configurations for metrics - View tags and volumes for metrics - **Note**: A graph can only contain a set number of points and as the - timeframe over which a metric is viewed increases, aggregation between - points occurs to stay below that set number. The Post, Patch, and Delete - `manage_tags` API methods can only be performed by a user who has the - `Manage Tags for Metrics` permission. + graphed on Datadog’s dashboards - Query metrics from any time period + (timeseries and scalar) - Modify tag configurations for metrics - View + tags and volumes for metrics **Note**: A graph can only contain a set + number of points and as the timeframe over which a metric is viewed + increases, aggregation between points occurs to stay below that set + number. The Post, Patch, and Delete `manage_tags` API methods can only be + performed by a user who has the `Manage Tags for Metrics` permission. Background: Given a valid "apiKeyAuth" key in the system @@ -214,6 +214,24 @@ Feature: Metrics Then the response status is 200 Success And the response "data.id" has the same value as "metric_tag_configuration.data.id" + @team:DataDog/metrics-query + Scenario: Scalar cross product query returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryScalarData" enabled + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": 1568899800000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": 1568923200000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/metrics-query + Scenario: Scalar cross product query returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryScalarData" enabled + And new "QueryScalarData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": 1671612804000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": 1671620004000}, "type": "scalar_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query Scenario: Submit metrics returns "Bad Request" response Given new "SubmitMetrics" request @@ -267,6 +285,24 @@ Feature: Metrics When the request is sent Then the response status is 200 Success + @team:DataDog/metrics-query + Scenario: Timeseries cross product query returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryTimeseriesData" enabled + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a+b", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*}"}], "to": {{ timestamp('now') }}}, "type": "timeseries_rquest"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/metrics-query + Scenario: Timeseries cross product query returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryTimeseriesData" enabled + And new "QueryTimeseriesData" request + And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": 1671612804000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": 1671620004000}, "type": "timeseries_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/points-aggregation Scenario: Update a tag configuration returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index a87c568fb74a..74c47a214c06 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -591,6 +591,18 @@ "type": "safe" } }, + "QueryScalarData": { + "tag": "Metrics", + "undo": { + "type": "idempotent" + } + }, + "QueryTimeseriesData": { + "tag": "Metrics", + "undo": { + "type": "idempotent" + } + }, "ListRoles": { "tag": "Roles", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index b9d6159e9730..cb4c089bbf42 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -185,6 +185,8 @@ def initialize "v2.list_incidents": false, "v2.update_incident": false, "v2.update_incident_attachments": false, + "v2.query_scalar_data": false, + "v2.query_timeseries_data": false, "v2.create_incident_service": false, "v2.delete_incident_service": false, "v2.get_incident_service": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 0965d122bb2b..b8386cfcc4e9 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -919,6 +919,10 @@ def overrides "v2.event_priority" => "EventPriority", "v2.event_response" => "EventResponse", "v2.event_response_attributes" => "EventResponseAttributes", + "v2.events_aggregation" => "EventsAggregation", + "v2.events_compute" => "EventsCompute", + "v2.events_data_source" => "EventsDataSource", + "v2.events_group_by" => "EventsGroupBy", "v2.events_list_request" => "EventsListRequest", "v2.events_list_response" => "EventsListResponse", "v2.events_list_response_links" => "EventsListResponseLinks", @@ -927,10 +931,16 @@ def overrides "v2.events_request_page" => "EventsRequestPage", "v2.events_response_metadata" => "EventsResponseMetadata", "v2.events_response_metadata_page" => "EventsResponseMetadataPage", + "v2.events_scalar_query" => "EventsScalarQuery", + "v2.events_search" => "EventsSearch", "v2.events_sort" => "EventsSort", + "v2.events_sort_field" => "EventsSortField", + "v2.events_sort_type" => "EventsSortType", "v2.event_status_type" => "EventStatusType", + "v2.events_timeseries_query" => "EventsTimeseriesQuery", "v2.events_warning" => "EventsWarning", "v2.event_type" => "EventType", + "v2.formula_limit" => "FormulaLimit", "v2.full_api_key" => "FullAPIKey", "v2.full_api_key_attributes" => "FullAPIKeyAttributes", "v2.full_application_key" => "FullApplicationKey", @@ -1133,9 +1143,13 @@ def overrides "v2.metric_payload" => "MetricPayload", "v2.metric_point" => "MetricPoint", "v2.metric_resource" => "MetricResource", + "v2.metrics_aggregator" => "MetricsAggregator", "v2.metrics_and_metric_tag_configurations" => "MetricsAndMetricTagConfigurations", "v2.metrics_and_metric_tag_configurations_response" => "MetricsAndMetricTagConfigurationsResponse", + "v2.metrics_data_source" => "MetricsDataSource", "v2.metric_series" => "MetricSeries", + "v2.metrics_scalar_query" => "MetricsScalarQuery", + "v2.metrics_timeseries_query" => "MetricsTimeseriesQuery", "v2.metric_suggested_tags_and_aggregations" => "MetricSuggestedTagsAndAggregations", "v2.metric_suggested_tags_and_aggregations_response" => "MetricSuggestedTagsAndAggregationsResponse", "v2.metric_suggested_tags_attributes" => "MetricSuggestedTagsAttributes", @@ -1187,6 +1201,7 @@ def overrides "v2.process_summary" => "ProcessSummary", "v2.process_summary_attributes" => "ProcessSummaryAttributes", "v2.process_summary_type" => "ProcessSummaryType", + "v2.query_formula" => "QueryFormula", "v2.query_sort_order" => "QuerySortOrder", "v2.relationship_to_incident_attachment" => "RelationshipToIncidentAttachment", "v2.relationship_to_incident_attachment_data" => "RelationshipToIncidentAttachmentData", @@ -1279,6 +1294,16 @@ def overrides "v2.saml_assertion_attribute" => "SAMLAssertionAttribute", "v2.saml_assertion_attribute_attributes" => "SAMLAssertionAttributeAttributes", "v2.saml_assertion_attributes_type" => "SAMLAssertionAttributesType", + "v2.scalar_column" => "ScalarColumn", + "v2.scalar_formula_query_request" => "ScalarFormulaQueryRequest", + "v2.scalar_formula_query_response" => "ScalarFormulaQueryResponse", + "v2.scalar_formula_request" => "ScalarFormulaRequest", + "v2.scalar_formula_request_attributes" => "ScalarFormulaRequestAttributes", + "v2.scalar_formula_request_type" => "ScalarFormulaRequestType", + "v2.scalar_formula_response_atrributes" => "ScalarFormulaResponseAtrributes", + "v2.scalar_formula_response_type" => "ScalarFormulaResponseType", + "v2.scalar_query" => "ScalarQuery", + "v2.scalar_response" => "ScalarResponse", "v2.security_filter" => "SecurityFilter", "v2.security_filter_attributes" => "SecurityFilterAttributes", "v2.security_filter_create_attributes" => "SecurityFilterCreateAttributes", @@ -1440,6 +1465,17 @@ def overrides "v2.service_definition_v2_slack" => "ServiceDefinitionV2Slack", "v2.service_definition_v2_slack_type" => "ServiceDefinitionV2SlackType", "v2.service_definition_v2_version" => "ServiceDefinitionV2Version", + "v2.timeseries_formula_query_request" => "TimeseriesFormulaQueryRequest", + "v2.timeseries_formula_query_response" => "TimeseriesFormulaQueryResponse", + "v2.timeseries_formula_request" => "TimeseriesFormulaRequest", + "v2.timeseries_formula_request_attributes" => "TimeseriesFormulaRequestAttributes", + "v2.timeseries_formula_request_type" => "TimeseriesFormulaRequestType", + "v2.timeseries_formula_response_type" => "TimeseriesFormulaResponseType", + "v2.timeseries_query" => "TimeseriesQuery", + "v2.timeseries_response" => "TimeseriesResponse", + "v2.timeseries_response_attributes" => "TimeseriesResponseAttributes", + "v2.timeseries_response_series" => "TimeseriesResponseSeries", + "v2.unit" => "Unit", "v2.usage_application_security_monitoring_response" => "UsageApplicationSecurityMonitoringResponse", "v2.usage_attributes_object" => "UsageAttributesObject", "v2.usage_data_object" => "UsageDataObject", diff --git a/lib/datadog_api_client/v2/api/metrics_api.rb b/lib/datadog_api_client/v2/api/metrics_api.rb index 92327859a410..4aa39d9642af 100644 --- a/lib/datadog_api_client/v2/api/metrics_api.rb +++ b/lib/datadog_api_client/v2/api/metrics_api.rb @@ -732,6 +732,154 @@ def list_volumes_by_metric_name_with_http_info(metric_name, opts = {}) return data, status_code, headers end + # Scalar cross product query. + # + # @see #query_scalar_data_with_http_info + def query_scalar_data(body, opts = {}) + data, _status_code, _headers = query_scalar_data_with_http_info(body, opts) + data + end + + # Scalar cross product query. + # + # The internal endpoint to query scalar/table data for multiple data sources and + # process the data using formulas and functions. + # + # @param body [ScalarFormulaQueryRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ScalarFormulaQueryResponse, Integer, Hash)>] ScalarFormulaQueryResponse data, response status code and response headers + def query_scalar_data_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.query_scalar_data".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_scalar_data") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_scalar_data")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsAPI.query_scalar_data ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.query_scalar_data" + end + # resource path + local_var_path = '/api/v2/query/scalar' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ScalarFormulaQueryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :query_scalar_data, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsAPI#query_scalar_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Timeseries cross product query. + # + # @see #query_timeseries_data_with_http_info + def query_timeseries_data(body, opts = {}) + data, _status_code, _headers = query_timeseries_data_with_http_info(body, opts) + data + end + + # Timeseries cross product query. + # + # The internal endpoint to query timeseries data for multiple data sources and + # process the data by applying formulas and functions. + # + # @param body [TimeseriesFormulaQueryRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TimeseriesFormulaQueryResponse, Integer, Hash)>] TimeseriesFormulaQueryResponse data, response status code and response headers + def query_timeseries_data_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.query_timeseries_data".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_timeseries_data") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_timeseries_data")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsAPI.query_timeseries_data ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MetricsAPI.query_timeseries_data" + end + # resource path + local_var_path = '/api/v2/query/timeseries' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TimeseriesFormulaQueryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :query_timeseries_data, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsAPI#query_timeseries_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Submit metrics. # # @see #submit_metrics_with_http_info diff --git a/lib/datadog_api_client/v2/models/events_aggregation.rb b/lib/datadog_api_client/v2/models/events_aggregation.rb new file mode 100644 index 000000000000..5e00c3d23fa9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_aggregation.rb @@ -0,0 +1,36 @@ +=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 aggregation that can be performed on events-based queries. + class EventsAggregation + include BaseEnumModel + + COUNT = "count".freeze + CARDINALITY = "cardinality".freeze + PC75 = "pc75".freeze + PC90 = "pc90".freeze + PC95 = "pc95".freeze + PC98 = "pc98".freeze + PC99 = "pc99".freeze + SUM = "sum".freeze + MIN = "min".freeze + MAX = "max".freeze + AVG = "avg".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/events_compute.rb b/lib/datadog_api_client/v2/models/events_compute.rb new file mode 100644 index 000000000000..901075104d93 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_compute.rb @@ -0,0 +1,129 @@ +=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 instructions for what to compute for this query. + class EventsCompute + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The type of aggregation that can be performed on events-based queries. + attr_reader :aggregation + + # Interval for compute in milliseconds. + attr_accessor :interval + + # The "measure" attribute on which to perform the computation. + attr_accessor :metric + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'interval' => :'interval', + :'metric' => :'metric' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'EventsAggregation', + :'interval' => :'Integer', + :'metric' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::EventsCompute` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EventsCompute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + 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 @aggregation.nil? + true + end + + # Custom attribute writer method with validation + # @param aggregation [Object] Object to be assigned + # @!visibility private + def aggregation=(aggregation) + if aggregation.nil? + fail ArgumentError, 'invalid value for "aggregation", aggregation cannot be nil.' + end + @aggregation = aggregation + 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 && + aggregation == o.aggregation && + interval == o.interval && + metric == o.metric + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, interval, metric].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 new file mode 100644 index 000000000000..f192cf4733b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_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 that is powered by the Events Platform. + class EventsDataSource + include BaseEnumModel + + LOGS = "logs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/events_group_by.rb b/lib/datadog_api_client/v2/models/events_group_by.rb new file mode 100644 index 000000000000..024cf1103ad2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_group_by.rb @@ -0,0 +1,140 @@ +=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 dimension on which to split a query's results. + class EventsGroupBy + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The facet by which to split groups. + attr_reader :facet + + # The maximum number of groups to return. + attr_reader :limit + + # The dimension by which to sort a query's results. + attr_accessor :sort + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'facet' => :'facet', + :'limit' => :'limit', + :'sort' => :'sort' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'facet' => :'String', + :'limit' => :'Integer', + :'sort' => :'EventsSortField' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::EventsGroupBy` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EventsGroupBy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'facet') + self.facet = attributes[:'facet'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + 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 @facet.nil? + return false if !@limit.nil? && @limit > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param facet [Object] Object to be assigned + # @!visibility private + def facet=(facet) + if facet.nil? + fail ArgumentError, 'invalid value for "facet", facet cannot be nil.' + end + @facet = facet + end + + # Custom attribute writer method with validation + # @param limit [Object] Object to be assigned + # @!visibility private + def limit=(limit) + if !limit.nil? && limit > 2147483647 + fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 2147483647.' + end + @limit = limit + 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 && + facet == o.facet && + limit == o.limit && + sort == o.sort + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [facet, limit, sort].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/events_scalar_query.rb b/lib/datadog_api_client/v2/models/events_scalar_query.rb new file mode 100644 index 000000000000..56bc46e6d508 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_scalar_query.rb @@ -0,0 +1,174 @@ +=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 events query. + class EventsScalarQuery + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The instructions for what to compute for this query. + attr_reader :compute + + # A data source that is powered by the Events Platform. + attr_reader :data_source + + # The list of facets on which to split results. + attr_accessor :group_by + + # The indexes in which to search. + attr_accessor :indexes + + # The variable name for use in formulas. + attr_accessor :name + + # Configuration of the search/filter for an events query. + attr_accessor :search + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compute' => :'compute', + :'data_source' => :'data_source', + :'group_by' => :'group_by', + :'indexes' => :'indexes', + :'name' => :'name', + :'search' => :'search' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compute' => :'EventsCompute', + :'data_source' => :'EventsDataSource', + :'group_by' => :'Array', + :'indexes' => :'Array', + :'name' => :'String', + :'search' => :'EventsSearch' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::EventsScalarQuery` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EventsScalarQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'compute') + self.compute = attributes[:'compute'] + 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?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + 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 @compute.nil? + return false if @data_source.nil? + true + end + + # Custom attribute writer method with validation + # @param compute [Object] Object to be assigned + # @!visibility private + def compute=(compute) + if compute.nil? + fail ArgumentError, 'invalid value for "compute", compute cannot be nil.' + end + @compute = compute + 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 + + # 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 && + compute == o.compute && + data_source == o.data_source && + group_by == o.group_by && + indexes == o.indexes && + name == o.name && + search == o.search + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compute, data_source, group_by, indexes, name, search].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/events_search.rb b/lib/datadog_api_client/v2/models/events_search.rb new file mode 100644 index 000000000000..74ca0d1de591 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_search.rb @@ -0,0 +1,98 @@ +=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 + # Configuration of the search/filter for an events query. + class EventsSearch + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The search/filter string for an events query. + attr_accessor :query + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::EventsSearch` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EventsSearch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'query') + self.query = attributes[:'query'] + 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? + true + 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 && + query == o.query + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/events_sort_field.rb b/lib/datadog_api_client/v2/models/events_sort_field.rb new file mode 100644 index 000000000000..b0117d0eba89 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_sort_field.rb @@ -0,0 +1,139 @@ +=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 dimension by which to sort a query's results. + class EventsSortField + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The type of aggregation that can be performed on events-based queries. + attr_reader :aggregation + + # Metric whose calculated value should be used to define the sort order of a query's results. + attr_accessor :metric + + # Direction of sort. + attr_accessor :order + + # The type of sort to use on the calculated value. + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'metric' => :'metric', + :'order' => :'order', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'EventsAggregation', + :'metric' => :'String', + :'order' => :'QuerySortOrder', + :'type' => :'EventsSortType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::EventsSortField` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EventsSortField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + end + + if attributes.key?(:'type') + self.type = attributes[:'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 @aggregation.nil? + true + end + + # Custom attribute writer method with validation + # @param aggregation [Object] Object to be assigned + # @!visibility private + def aggregation=(aggregation) + if aggregation.nil? + fail ArgumentError, 'invalid value for "aggregation", aggregation cannot be nil.' + end + @aggregation = aggregation + 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 && + aggregation == o.aggregation && + metric == o.metric && + order == o.order && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, metric, order, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/events_sort_type.rb b/lib/datadog_api_client/v2/models/events_sort_type.rb new file mode 100644 index 000000000000..de8fc05d8ec3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_sort_type.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 + # The type of sort to use on the calculated value. + class EventsSortType + include BaseEnumModel + + ALPHABETICAL = "alphabetical".freeze + MEASURE = "measure".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/events_timeseries_query.rb b/lib/datadog_api_client/v2/models/events_timeseries_query.rb new file mode 100644 index 000000000000..fd2088305867 --- /dev/null +++ b/lib/datadog_api_client/v2/models/events_timeseries_query.rb @@ -0,0 +1,174 @@ +=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 events query. + class EventsTimeseriesQuery + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The instructions for what to compute for this query. + attr_reader :compute + + # A data source that is powered by the Events Platform. + attr_reader :data_source + + # The list of facets on which to split results. + attr_accessor :group_by + + # The indexes in which to search. + attr_accessor :indexes + + # The variable name for use in formulas. + attr_accessor :name + + # Configuration of the search/filter for an events query. + attr_accessor :search + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compute' => :'compute', + :'data_source' => :'data_source', + :'group_by' => :'group_by', + :'indexes' => :'indexes', + :'name' => :'name', + :'search' => :'search' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compute' => :'EventsCompute', + :'data_source' => :'EventsDataSource', + :'group_by' => :'Array', + :'indexes' => :'Array', + :'name' => :'String', + :'search' => :'EventsSearch' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::EventsTimeseriesQuery` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EventsTimeseriesQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'compute') + self.compute = attributes[:'compute'] + 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?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + 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 @compute.nil? + return false if @data_source.nil? + true + end + + # Custom attribute writer method with validation + # @param compute [Object] Object to be assigned + # @!visibility private + def compute=(compute) + if compute.nil? + fail ArgumentError, 'invalid value for "compute", compute cannot be nil.' + end + @compute = compute + 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 + + # 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 && + compute == o.compute && + data_source == o.data_source && + group_by == o.group_by && + indexes == o.indexes && + name == o.name && + search == o.search + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compute, data_source, group_by, indexes, name, search].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/formula_limit.rb b/lib/datadog_api_client/v2/models/formula_limit.rb new file mode 100644 index 000000000000..a5e6d08fc458 --- /dev/null +++ b/lib/datadog_api_client/v2/models/formula_limit.rb @@ -0,0 +1,119 @@ +=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 + # Message for specifying limits to the number of values returned by a query. + class FormulaLimit + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The number of results to which to limit. + attr_reader :count + + # Direction of sort. + attr_accessor :order + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'order' => :'order' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'order' => :'QuerySortOrder' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::FormulaLimit` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::FormulaLimit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + 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 !@count.nil? && @count > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if !count.nil? && count > 2147483647 + fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 2147483647.' + end + @count = count + 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 && + count == o.count && + order == o.order + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, order].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/metrics_aggregator.rb b/lib/datadog_api_client/v2/models/metrics_aggregator.rb new file mode 100644 index 000000000000..1ed417c5712f --- /dev/null +++ b/lib/datadog_api_client/v2/models/metrics_aggregator.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 + # The type of aggregation that can be performed on metrics queries. + class MetricsAggregator + include BaseEnumModel + + AVG = "avg".freeze + MIN = "min".freeze + MAX = "max".freeze + SUM = "sum".freeze + LAST = "last".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/metrics_data_source.rb b/lib/datadog_api_client/v2/models/metrics_data_source.rb new file mode 100644 index 000000000000..8fa7000595f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/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 that is powered by the Metrics backend. + class MetricsDataSource + include BaseEnumModel + + METRICS = "metrics".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/metrics_scalar_query.rb b/lib/datadog_api_client/v2/models/metrics_scalar_query.rb new file mode 100644 index 000000000000..19cebb0cdbfb --- /dev/null +++ b/lib/datadog_api_client/v2/models/metrics_scalar_query.rb @@ -0,0 +1,161 @@ +=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 metrics query. + class MetricsScalarQuery + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The type of aggregation that can be performed on metrics queries. + attr_reader :aggregator + + # A data source that is powered by the Metrics backend. + attr_reader :data_source + + # The variable name for use in formulas. + attr_accessor :name + + # A classic metrics query string. + attr_reader :query + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregator' => :'aggregator', + :'data_source' => :'data_source', + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregator' => :'MetricsAggregator', + :'data_source' => :'MetricsDataSource', + :'name' => :'String', + :'query' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::MetricsScalarQuery` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricsScalarQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregator') + self.aggregator = attributes[:'aggregator'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + 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 @aggregator.nil? + return false if @data_source.nil? + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param aggregator [Object] Object to be assigned + # @!visibility private + def aggregator=(aggregator) + if aggregator.nil? + fail ArgumentError, 'invalid value for "aggregator", aggregator cannot be nil.' + end + @aggregator = aggregator + 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 query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + 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 && + name == o.name && + query == o.query + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregator, data_source, name, query].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/metrics_timeseries_query.rb b/lib/datadog_api_client/v2/models/metrics_timeseries_query.rb new file mode 100644 index 000000000000..55d5be35d885 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metrics_timeseries_query.rb @@ -0,0 +1,140 @@ +=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 metrics query. + class MetricsTimeseriesQuery + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # A data source that is powered by the Metrics backend. + attr_reader :data_source + + # The variable name for use in formulas. + attr_accessor :name + + # A classic metrics query string. + attr_reader :query + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'MetricsDataSource', + :'name' => :'String', + :'query' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::MetricsTimeseriesQuery` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MetricsTimeseriesQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + 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 @query.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 query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + 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 && + name == o.name && + query == o.query + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, name, query].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/query_formula.rb b/lib/datadog_api_client/v2/models/query_formula.rb new file mode 100644 index 000000000000..098e81a6d34b --- /dev/null +++ b/lib/datadog_api_client/v2/models/query_formula.rb @@ -0,0 +1,119 @@ +=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 formula for calculation based on one or more queries. + class QueryFormula + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # Formula string, referencing one or more queries with their name property. + attr_reader :formula + + # Message for specifying limits to the number of values returned by a query. + attr_accessor :limit + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'formula' => :'formula', + :'limit' => :'limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'formula' => :'String', + :'limit' => :'FormulaLimit' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::QueryFormula` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::QueryFormula`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'formula') + self.formula = attributes[:'formula'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + 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 @formula.nil? + true + end + + # Custom attribute writer method with validation + # @param formula [Object] Object to be assigned + # @!visibility private + def formula=(formula) + if formula.nil? + fail ArgumentError, 'invalid value for "formula", formula cannot be nil.' + end + @formula = formula + 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 && + formula == o.formula && + limit == o.limit + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [formula, limit].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_column.rb b/lib/datadog_api_client/v2/models/scalar_column.rb new file mode 100644 index 000000000000..e56392b7bf7d --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_column.rb @@ -0,0 +1,112 @@ +=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 single column in a scalar query response. + class ScalarColumn + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # List of units. + attr_accessor :unit + + # Array of values for each group-by combination that results from one formula or query. + attr_accessor :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'unit' => :'unit', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'unit' => :'Array', + :'values' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarColumn` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarColumn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'unit') + if (value = attributes[:'unit']).is_a?(Array) + self.unit = value + end + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + 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? + true + 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 && + unit == o.unit && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [unit, values].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_query_request.rb b/lib/datadog_api_client/v2/models/scalar_formula_query_request.rb new file mode 100644 index 000000000000..93f8fd3021e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_query_request.rb @@ -0,0 +1,109 @@ +=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 wrapper request around one scalar query to be executed. + class ScalarFormulaQueryRequest + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # A single scalar query to be executed. + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ScalarFormulaRequest' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarFormulaQueryRequest` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarFormulaQueryRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + 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.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_query_response.rb b/lib/datadog_api_client/v2/models/scalar_formula_query_response.rb new file mode 100644 index 000000000000..47be5a79fa97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_query_response.rb @@ -0,0 +1,108 @@ +=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 message containing one or more responses to scalar queries. + class ScalarFormulaQueryResponse + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # A message containing the response to a scalar query. + attr_accessor :data + + # An error generated when processing a request. + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'errors' => :'errors' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ScalarResponse', + :'errors' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarFormulaQueryResponse` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarFormulaQueryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'errors') + self.errors = attributes[:'errors'] + 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? + true + 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 == o.data && + errors == o.errors + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, errors].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_request.rb b/lib/datadog_api_client/v2/models/scalar_formula_request.rb new file mode 100644 index 000000000000..51ef0743431b --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_request.rb @@ -0,0 +1,130 @@ +=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 single scalar query to be executed. + class ScalarFormulaRequest + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The object describing a scalar formula request. + attr_reader :attributes + + # The type of the resource. The value should always be scalar_request. + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ScalarFormulaRequestAttributes', + :'type' => :'ScalarFormulaRequestType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarFormulaRequest` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarFormulaRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_request_attributes.rb b/lib/datadog_api_client/v2/models/scalar_formula_request_attributes.rb new file mode 100644 index 000000000000..ff5ad6d44b02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_request_attributes.rb @@ -0,0 +1,165 @@ +=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 object describing a scalar formula request. + class ScalarFormulaRequestAttributes + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # List of formulas to be calculated and returned as responses. + attr_accessor :formulas + + # Start date (inclusive) of the query in milliseconds since the Unix epoch. + attr_reader :from + + # List of queries to be run and used as inputs to the formulas. + attr_reader :queries + + # End date (exclusive) of the query in milliseconds since the Unix epoch. + attr_reader :to + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'formulas' => :'formulas', + :'from' => :'from', + :'queries' => :'queries', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'formulas' => :'Array', + :'from' => :'Integer', + :'queries' => :'Array', + :'to' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarFormulaRequestAttributes` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarFormulaRequestAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'formulas') + if (value = attributes[:'formulas']).is_a?(Array) + self.formulas = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + 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 @from.nil? + return false if @queries.nil? + return false if @to.nil? + true + end + + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param queries [Object] Object to be assigned + # @!visibility private + def queries=(queries) + if queries.nil? + fail ArgumentError, 'invalid value for "queries", queries cannot be nil.' + end + @queries = queries + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + 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 && + formulas == o.formulas && + from == o.from && + queries == o.queries && + to == o.to + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [formulas, from, queries, to].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_request_type.rb b/lib/datadog_api_client/v2/models/scalar_formula_request_type.rb new file mode 100644 index 000000000000..76f4df9efa58 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_request_type.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 + # The type of the resource. The value should always be scalar_request. + class ScalarFormulaRequestType + include BaseEnumModel + + SCALAR_REQUEST = "scalar_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_response_atrributes.rb b/lib/datadog_api_client/v2/models/scalar_formula_response_atrributes.rb new file mode 100644 index 000000000000..2fe250a43f3e --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_response_atrributes.rb @@ -0,0 +1,112 @@ +=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 object describing a scalar response. + class ScalarFormulaResponseAtrributes + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # List of response columns, each corresponding to an individual formula or query in the request and with values in parallel arrays matching the series list. + attr_accessor :columns + + # List of group-by tags for the response. Parallel array to the values in each scalar column. + attr_accessor :series + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'series' => :'series' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'series' => :'Array>' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarFormulaResponseAtrributes` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarFormulaResponseAtrributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'series') + if (value = attributes[:'series']).is_a?(Array) + self.series = value + end + 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? + true + 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 && + columns == o.columns && + series == o.series + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, series].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_formula_response_type.rb b/lib/datadog_api_client/v2/models/scalar_formula_response_type.rb new file mode 100644 index 000000000000..3a9d92bc0b02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_formula_response_type.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 + # The type of the resource. The value should always be scalar_response. + class ScalarFormulaResponseType + include BaseEnumModel + + SCALAR_RESPONSE = "scalar_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_query.rb b/lib/datadog_api_client/v2/models/scalar_query.rb new file mode 100644 index 000000000000..5575bc9f1a12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_query.rb @@ -0,0 +1,63 @@ +=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 query to one of the basic Datadog data sources. + module ScalarQuery + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'MetricsScalarQuery', + :'EventsScalarQuery' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/scalar_response.rb b/lib/datadog_api_client/v2/models/scalar_response.rb new file mode 100644 index 000000000000..2d663b1e0722 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scalar_response.rb @@ -0,0 +1,108 @@ +=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 message containing the response to a scalar query. + class ScalarResponse + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The object describing a scalar response. + attr_accessor :attributes + + # The type of the resource. The value should always be scalar_response. + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ScalarFormulaResponseAtrributes', + :'type' => :'ScalarFormulaResponseType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::ScalarResponse` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ScalarResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'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? + true + 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 && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_formula_query_request.rb b/lib/datadog_api_client/v2/models/timeseries_formula_query_request.rb new file mode 100644 index 000000000000..810f161dafa4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_formula_query_request.rb @@ -0,0 +1,109 @@ +=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 request wrapper around a single timeseries query to be executed. + class TimeseriesFormulaQueryRequest + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # A single timeseries query to be executed. + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TimeseriesFormulaRequest' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesFormulaQueryRequest` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesFormulaQueryRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + 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.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_formula_query_response.rb b/lib/datadog_api_client/v2/models/timeseries_formula_query_response.rb new file mode 100644 index 000000000000..9b65f3c02299 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_formula_query_response.rb @@ -0,0 +1,108 @@ +=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 message containing one response to a timeseries query made with timeseries formula query request. + class TimeseriesFormulaQueryResponse + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # A message containing the response to a timeseries query. + attr_accessor :data + + # The error generated by the request. + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'errors' => :'errors' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TimeseriesResponse', + :'errors' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesFormulaQueryResponse` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesFormulaQueryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'errors') + self.errors = attributes[:'errors'] + 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? + true + 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 == o.data && + errors == o.errors + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, errors].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_formula_request.rb b/lib/datadog_api_client/v2/models/timeseries_formula_request.rb new file mode 100644 index 000000000000..799ea9ca9258 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_formula_request.rb @@ -0,0 +1,130 @@ +=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 single timeseries query to be executed. + class TimeseriesFormulaRequest + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The object describing a timeseries formula request. + attr_reader :attributes + + # The type of the resource. The value should always be timeseries_request. + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TimeseriesFormulaRequestAttributes', + :'type' => :'TimeseriesFormulaRequestType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesFormulaRequest` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesFormulaRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_formula_request_attributes.rb b/lib/datadog_api_client/v2/models/timeseries_formula_request_attributes.rb new file mode 100644 index 000000000000..6c5007fabb3c --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_formula_request_attributes.rb @@ -0,0 +1,178 @@ +=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 object describing a timeseries formula request. + class TimeseriesFormulaRequestAttributes + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # List of formulas to be calculated and returned as responses. + attr_accessor :formulas + + # Start date (inclusive) of the query in milliseconds since the Unix epoch. + attr_reader :from + + # A time interval in milliseconds. + # May be overridden by a larger interval if the query would result in + # too many points for the specified timeframe. + # Defaults to a reasonable interval for the given timeframe. + attr_accessor :interval + + # List of queries to be run and used as inputs to the formulas. + attr_reader :queries + + # End date (exclusive) of the query in milliseconds since the Unix epoch. + attr_reader :to + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'formulas' => :'formulas', + :'from' => :'from', + :'interval' => :'interval', + :'queries' => :'queries', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'formulas' => :'Array', + :'from' => :'Integer', + :'interval' => :'Integer', + :'queries' => :'Array', + :'to' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesFormulaRequestAttributes` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'formulas') + if (value = attributes[:'formulas']).is_a?(Array) + self.formulas = value + end + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + 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 @from.nil? + return false if @queries.nil? + return false if @to.nil? + true + end + + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param queries [Object] Object to be assigned + # @!visibility private + def queries=(queries) + if queries.nil? + fail ArgumentError, 'invalid value for "queries", queries cannot be nil.' + end + @queries = queries + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + 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 && + formulas == o.formulas && + from == o.from && + interval == o.interval && + queries == o.queries && + to == o.to + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [formulas, from, interval, queries, to].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_formula_request_type.rb b/lib/datadog_api_client/v2/models/timeseries_formula_request_type.rb new file mode 100644 index 000000000000..d3c9906e7764 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_formula_request_type.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 + # The type of the resource. The value should always be timeseries_request. + class TimeseriesFormulaRequestType + include BaseEnumModel + + TIMESERIES_REQUEST = "timeseries_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_formula_response_type.rb b/lib/datadog_api_client/v2/models/timeseries_formula_response_type.rb new file mode 100644 index 000000000000..ecd03f3d0891 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_formula_response_type.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 + # The type of the resource. The value should always be timeseries_response. + class TimeseriesFormulaResponseType + include BaseEnumModel + + TIMESERIES_RESPONSE = "timeseries_response".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 new file mode 100644 index 000000000000..a5aa7994d402 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_query.rb @@ -0,0 +1,63 @@ +=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 query to one of the basic Datadog data sources. + module TimeseriesQuery + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'MetricsTimeseriesQuery', + :'EventsTimeseriesQuery' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_response.rb b/lib/datadog_api_client/v2/models/timeseries_response.rb new file mode 100644 index 000000000000..114541746391 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_response.rb @@ -0,0 +1,108 @@ +=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 message containing the response to a timeseries query. + class TimeseriesResponse + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # The object describing a timeseries response. + attr_accessor :attributes + + # The type of the resource. The value should always be timeseries_response. + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TimeseriesResponseAttributes', + :'type' => :'TimeseriesFormulaResponseType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesResponse` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'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? + true + 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 && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_response_attributes.rb b/lib/datadog_api_client/v2/models/timeseries_response_attributes.rb new file mode 100644 index 000000000000..6cb9b5680698 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_response_attributes.rb @@ -0,0 +1,124 @@ +=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 object describing a timeseries response. + class TimeseriesResponseAttributes + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # Array of response series. The index here corresponds to the index in the `formulas` or `queries` array from the request. + attr_accessor :series + + # Array of times, 1-1 match with individual values arrays. + attr_accessor :times + + # Array of value-arrays. The index here corresponds to the index in the `formulas` or `queries` array from the request. + attr_accessor :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'series' => :'series', + :'times' => :'times', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'series' => :'Array', + :'times' => :'Array', + :'values' => :'Array>' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesResponseAttributes` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesResponseAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'series') + if (value = attributes[:'series']).is_a?(Array) + self.series = value + end + end + + if attributes.key?(:'times') + if (value = attributes[:'times']).is_a?(Array) + self.times = value + end + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + 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? + true + 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 && + series == o.series && + times == o.times && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [series, times, values].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timeseries_response_series.rb b/lib/datadog_api_client/v2/models/timeseries_response_series.rb new file mode 100644 index 000000000000..360204224051 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timeseries_response_series.rb @@ -0,0 +1,133 @@ +=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 + # + class TimeseriesResponseSeries + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # List of tags that apply to a single response value. + attr_accessor :group_tags + + # The index of the query in the "formulas" array (or "queries" array if no "formulas" was specified). + attr_reader :query_index + + # List of units. + attr_accessor :unit + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'group_tags' => :'group_tags', + :'query_index' => :'query_index', + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'group_tags' => :'Array', + :'query_index' => :'Integer', + :'unit' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::TimeseriesResponseSeries` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TimeseriesResponseSeries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'group_tags') + if (value = attributes[:'group_tags']).is_a?(Array) + self.group_tags = value + end + end + + if attributes.key?(:'query_index') + self.query_index = attributes[:'query_index'] + end + + if attributes.key?(:'unit') + if (value = attributes[:'unit']).is_a?(Array) + self.unit = value + end + 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 !@query_index.nil? && @query_index > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param query_index [Object] Object to be assigned + # @!visibility private + def query_index=(query_index) + if !query_index.nil? && query_index > 2147483647 + fail ArgumentError, 'invalid value for "query_index", must be smaller than or equal to 2147483647.' + end + @query_index = query_index + 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 && + group_tags == o.group_tags && + query_index == o.query_index && + unit == o.unit + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [group_tags, query_index, unit].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/unit.rb b/lib/datadog_api_client/v2/models/unit.rb new file mode 100644 index 000000000000..8a57eaf42dfa --- /dev/null +++ b/lib/datadog_api_client/v2/models/unit.rb @@ -0,0 +1,138 @@ +=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 + # Object containing the metric unit family, scale factor, name, and short name. + class Unit + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # Unit family, allows for conversion between units of the same family, for scaling. + attr_accessor :family + + # Unit name + attr_accessor :name + + # Plural form of the unit name. + attr_accessor :plural + + # Factor for scaling between units of the same family. + attr_accessor :scale_factor + + # Abbreviation of the unit. + attr_accessor :short_name + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'family' => :'family', + :'name' => :'name', + :'plural' => :'plural', + :'scale_factor' => :'scale_factor', + :'short_name' => :'short_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'family' => :'String', + :'name' => :'String', + :'plural' => :'String', + :'scale_factor' => :'Float', + :'short_name' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + ]) + 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::Unit` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::Unit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'family') + self.family = attributes[:'family'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'plural') + self.plural = attributes[:'plural'] + end + + if attributes.key?(:'scale_factor') + self.scale_factor = attributes[:'scale_factor'] + end + + if attributes.key?(:'short_name') + self.short_name = attributes[:'short_name'] + 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? + true + 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 && + family == o.family && + name == o.name && + plural == o.plural && + scale_factor == o.scale_factor && + short_name == o.short_name + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [family, name, plural, scale_factor, short_name].hash + end + end +end