diff --git a/.apigentools-info b/.apigentools-info index e4bc596b3a1e..67407e5872bc 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev8", - "regenerated": "2021-03-03 15:19:21.373104", - "spec_repo_commit": "0de7e0c" + "regenerated": "2021-03-05 09:32:36.177235", + "spec_repo_commit": "aad6dbb" }, "v2": { "apigentools_version": "1.4.1.dev8", - "regenerated": "2021-03-03 15:19:35.515065", - "spec_repo_commit": "0de7e0c" + "regenerated": "2021-03-05 09:32:47.584938", + "spec_repo_commit": "aad6dbb" } } } \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 40ebbb482153..4c65a1c5240d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -179,6 +179,15 @@ docs/LogsSort.md docs/LogsSortOrder.md docs/LogsWarning.md docs/Metric.md +docs/MetricAllTags.md +docs/MetricAllTagsAttributes.md +docs/MetricAllTagsResponse.md +docs/MetricDistinctVolume.md +docs/MetricDistinctVolumeAttributes.md +docs/MetricDistinctVolumeType.md +docs/MetricIngestedIndexedVolume.md +docs/MetricIngestedIndexedVolumeAttributes.md +docs/MetricIngestedIndexedVolumeType.md docs/MetricTagConfiguration.md docs/MetricTagConfigurationAttributes.md docs/MetricTagConfigurationCreateAttributes.md @@ -191,6 +200,8 @@ docs/MetricTagConfigurationUpdateAttributes.md docs/MetricTagConfigurationUpdateData.md docs/MetricTagConfigurationUpdateRequest.md docs/MetricType.md +docs/MetricVolumes.md +docs/MetricVolumesResponse.md docs/MetricsAndMetricTagConfigurations.md docs/MetricsAndMetricTagConfigurationsResponse.md docs/MetricsApi.md @@ -493,6 +504,15 @@ lib/datadog_api_client/v2/models/logs_sort.rb lib/datadog_api_client/v2/models/logs_sort_order.rb lib/datadog_api_client/v2/models/logs_warning.rb lib/datadog_api_client/v2/models/metric.rb +lib/datadog_api_client/v2/models/metric_all_tags.rb +lib/datadog_api_client/v2/models/metric_all_tags_attributes.rb +lib/datadog_api_client/v2/models/metric_all_tags_response.rb +lib/datadog_api_client/v2/models/metric_distinct_volume.rb +lib/datadog_api_client/v2/models/metric_distinct_volume_attributes.rb +lib/datadog_api_client/v2/models/metric_distinct_volume_type.rb +lib/datadog_api_client/v2/models/metric_ingested_indexed_volume.rb +lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb +lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_type.rb lib/datadog_api_client/v2/models/metric_tag_configuration.rb lib/datadog_api_client/v2/models/metric_tag_configuration_attributes.rb lib/datadog_api_client/v2/models/metric_tag_configuration_create_attributes.rb @@ -505,6 +525,8 @@ lib/datadog_api_client/v2/models/metric_tag_configuration_update_attributes.rb lib/datadog_api_client/v2/models/metric_tag_configuration_update_data.rb lib/datadog_api_client/v2/models/metric_tag_configuration_update_request.rb lib/datadog_api_client/v2/models/metric_type.rb +lib/datadog_api_client/v2/models/metric_volumes.rb +lib/datadog_api_client/v2/models/metric_volumes_response.rb lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations.rb lib/datadog_api_client/v2/models/metrics_and_metric_tag_configurations_response.rb lib/datadog_api_client/v2/models/organization.rb @@ -799,6 +821,15 @@ spec/models/logs_response_metadata_spec.rb spec/models/logs_sort_order_spec.rb spec/models/logs_sort_spec.rb spec/models/logs_warning_spec.rb +spec/models/metric_all_tags_attributes_spec.rb +spec/models/metric_all_tags_response_spec.rb +spec/models/metric_all_tags_spec.rb +spec/models/metric_distinct_volume_attributes_spec.rb +spec/models/metric_distinct_volume_spec.rb +spec/models/metric_distinct_volume_type_spec.rb +spec/models/metric_ingested_indexed_volume_attributes_spec.rb +spec/models/metric_ingested_indexed_volume_spec.rb +spec/models/metric_ingested_indexed_volume_type_spec.rb spec/models/metric_spec.rb spec/models/metric_tag_configuration_attributes_spec.rb spec/models/metric_tag_configuration_create_attributes_spec.rb @@ -812,6 +843,8 @@ spec/models/metric_tag_configuration_update_attributes_spec.rb spec/models/metric_tag_configuration_update_data_spec.rb spec/models/metric_tag_configuration_update_request_spec.rb spec/models/metric_type_spec.rb +spec/models/metric_volumes_response_spec.rb +spec/models/metric_volumes_spec.rb spec/models/metrics_and_metric_tag_configurations_response_spec.rb spec/models/metrics_and_metric_tag_configurations_spec.rb spec/models/organization_attributes_spec.rb diff --git a/cassettes/features/v2/metrics/Create-a-Tag-Configuration-returns-Created-response.yml b/cassettes/features/v2/metrics/Create-a-tag-configuration-returns-Created-response.yml similarity index 55% rename from cassettes/features/v2/metrics/Create-a-Tag-Configuration-returns-Created-response.yml rename to cassettes/features/v2/metrics/Create-a-tag-configuration-returns-Created-response.yml index a3de3e8b6e83..026facfead4d 100644 --- a/cassettes/features/v2/metrics/Create-a-Tag-Configuration-returns-Created-response.yml +++ b/cassettes/features/v2/metrics/Create-a-tag-configuration-returns-Created-response.yml @@ -2,14 +2,13 @@ http_interactions: - request: method: post - uri: https://api.datadoghq.com/api/v2/metrics/rubyCreateaTagConfigurationreturnsCreatedresponse1613037330/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyCreateatagconfigurationreturnsCreatedresponse1614797834/tags body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyCreateaTagConfigurationreturnsCreatedresponse1613037330","attributes":{"tags":["app","datacenter"],"metric_type":"distribution"}}}' + string: '{"data":{"type":"manage_tags","id":"rubyCreateatagconfigurationreturnsCreatedresponse1614797834","attributes":{"tags":["app","datacenter"],"metric_type":"distribution"}}}' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -22,7 +21,7 @@ http_interactions: message: Created headers: Date: - - Thu, 11 Feb 2021 09:55:30 GMT + - Wed, 03 Mar 2021 18:57:14 GMT Content-Type: - application/json Content-Length: @@ -33,21 +32,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:30 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '30' + - '46' X-Ratelimit-Remaining: - '49' X-Dd-Debug: - - l4HFlaRP3QwYSqoGKhzbYfv7zgkK63HIRR7YkyVYZspq0lGjjTBwoK8V/alf+XYt + - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -58,6 +54,6 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyCreateaTagConfigurationreturnsCreatedresponse1613037330","attributes":{"tags":["datacenter","app"],"include_percentiles":false,"created_at":"2021-02-11T09:55:30.607637+00:00","updated_at":"2021-02-11T09:55:30.607637+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:30 GMT + string: '{"data":{"type":"manage_tags","id":"rubyCreateatagconfigurationreturnsCreatedresponse1614797834","attributes":{"tags":["datacenter","app"],"include_percentiles":false,"created_at":"2021-03-03T18:57:14.936299+00:00","updated_at":"2021-03-03T18:57:14.936299+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:14 GMT recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Delete-a-Tag-Configuration-returns-No-Content-response.yml b/cassettes/features/v2/metrics/Delete-a-tag-configuration-returns-No-Content-response.yml similarity index 59% rename from cassettes/features/v2/metrics/Delete-a-Tag-Configuration-returns-No-Content-response.yml rename to cassettes/features/v2/metrics/Delete-a-tag-configuration-returns-No-Content-response.yml index 8247c32a0a07..028300e919ce 100644 --- a/cassettes/features/v2/metrics/Delete-a-Tag-Configuration-returns-No-Content-response.yml +++ b/cassettes/features/v2/metrics/Delete-a-tag-configuration-returns-No-Content-response.yml @@ -2,14 +2,13 @@ http_interactions: - request: method: post - uri: https://api.datadoghq.com/api/v2/metrics/rubyDeleteaTagConfigurationreturnsNoContentresponse1613037330/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyDeleteatagconfigurationreturnsNoContentresponse1614797835/tags body: encoding: UTF-8 - string: '{"data":{"attributes":{"tags":["app","datacenter","rubyDeleteaTagConfigurationreturnsNoContentresponse1613037330"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyDeleteaTagConfigurationreturnsNoContentresponse1613037330"}}' + string: '{"data":{"attributes":{"tags":["app","datacenter","rubyDeleteatagconfigurationreturnsNoContentresponse1614797835"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyDeleteatagconfigurationreturnsNoContentresponse1614797835"}}' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -22,7 +21,7 @@ http_interactions: message: Created headers: Date: - - Thu, 11 Feb 2021 09:55:30 GMT + - Wed, 03 Mar 2021 18:57:15 GMT Content-Type: - application/json Content-Length: @@ -33,21 +32,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:30 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '30' + - '45' X-Ratelimit-Remaining: - '47' X-Dd-Debug: - - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU + - tpRCH6w417YjBovRJ8VmtuXmNONVYiRp2c8d2AxjPdGBn8PCtgG4vAztrx3qUZAN X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -58,18 +54,17 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyDeleteaTagConfigurationreturnsNoContentresponse1613037330","attributes":{"tags":["datacenter","app","rubyDeleteaTagConfigurationreturnsNoContentresponse1613037330"],"include_percentiles":false,"created_at":"2021-02-11T09:55:30.933171+00:00","updated_at":"2021-02-11T09:55:30.933171+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:30 GMT + string: '{"data":{"type":"manage_tags","id":"rubyDeleteatagconfigurationreturnsNoContentresponse1614797835","attributes":{"tags":["datacenter","app","rubyDeleteatagconfigurationreturnsNoContentresponse1614797835"],"include_percentiles":false,"created_at":"2021-03-03T18:57:15.108934+00:00","updated_at":"2021-03-03T18:57:15.108934+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT - request: method: delete - uri: https://api.datadoghq.com/api/v2/metrics/rubyDeleteaTagConfigurationreturnsNoContentresponse1613037330/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyDeleteatagconfigurationreturnsNoContentresponse1614797835/tags body: encoding: US-ASCII string: '' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -82,7 +77,7 @@ http_interactions: message: No Content headers: Date: - - Thu, 11 Feb 2021 09:55:31 GMT + - Wed, 03 Mar 2021 18:57:15 GMT Content-Type: - application/json Content-Length: @@ -93,17 +88,14 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:31 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '29' + - '45' X-Ratelimit-Remaining: - '46' X-Dd-Debug: @@ -119,5 +111,5 @@ http_interactions: body: encoding: UTF-8 string: '' - recorded_at: Thu, 11 Feb 2021 09:55:30 GMT + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/List-distinct-metric-volumes-by-metric-name-returns-Success-response.yml b/cassettes/features/v2/metrics/List-distinct-metric-volumes-by-metric-name-returns-Success-response.yml new file mode 100644 index 000000000000..993f368e1047 --- /dev/null +++ b/cassettes/features/v2/metrics/List-distinct-metric-volumes-by-metric-name-returns-Success-response.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.datadoghq.com/api/v2/metrics/rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835/tags + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"tags":["app","datacenter","rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835"}}' + headers: + User-Agent: + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) + Content-Type: + - application/json + Accept: + - application/json + Expect: + - '' + response: + status: + code: 201 + message: Created + headers: + Date: + - Wed, 03 Mar 2021 18:57:15 GMT + Content-Type: + - application/json + Content-Length: + - '384' + Connection: + - keep-alive + Pragma: + - no-cache + Cache-Control: + - no-cache + X-Dd-Version: + - '35.4022232' + X-Ratelimit-Limit: + - '50' + X-Ratelimit-Period: + - '60' + X-Ratelimit-Reset: + - '45' + X-Ratelimit-Remaining: + - '44' + X-Dd-Debug: + - mNzaoDhdDKO7t4QSrAe5X7pHd0bJND187D+vRbwoluXouE2m1UaQQX0RGCvRpLVE + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=15724800; + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + X-Frame-Options: + - SAMEORIGIN + body: + encoding: UTF-8 + string: '{"data":{"type":"manage_tags","id":"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835","attributes":{"tags":["datacenter","app","rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835"],"include_percentiles":false,"created_at":"2021-03-03T18:57:15.398180+00:00","updated_at":"2021-03-03T18:57:15.398180+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT +- request: + method: get + uri: https://api.datadoghq.com/api/v2/metrics/rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835/volumes + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) + Content-Type: + - application/json + Accept: + - application/json + Expect: + - '' + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 03 Mar 2021 18:57:15 GMT + Content-Type: + - application/json + Content-Length: + - '169' + Connection: + - keep-alive + Vary: + - Accept-Encoding + Pragma: + - no-cache + Cache-Control: + - no-cache + X-Dd-Version: + - '35.4022232' + X-Ratelimit-Limit: + - '600' + X-Ratelimit-Period: + - '3600' + X-Ratelimit-Reset: + - '165' + X-Ratelimit-Remaining: + - '599' + X-Dd-Debug: + - gYZcaADwbKcv7Hm19HJx6WsLoKuOijDWAt2viPeCfWqUgyKY+9e1xZdmMJeXV3YV + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=15724800; + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + X-Frame-Options: + - SAMEORIGIN + body: + encoding: UTF-8 + string: '{"data":{"type":"metric_volumes","id":"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1614797835","attributes":{"indexed_volume":0,"ingested_volume":0}}}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/List-Tag-Configuration-by-Name-returns-Success-response.yml b/cassettes/features/v2/metrics/List-tag-configuration-by-name-returns-Success-response.yml similarity index 51% rename from cassettes/features/v2/metrics/List-Tag-Configuration-by-Name-returns-Success-response.yml rename to cassettes/features/v2/metrics/List-tag-configuration-by-name-returns-Success-response.yml index 4eef027c8f6a..f6c8b541907a 100644 --- a/cassettes/features/v2/metrics/List-Tag-Configuration-by-Name-returns-Success-response.yml +++ b/cassettes/features/v2/metrics/List-tag-configuration-by-name-returns-Success-response.yml @@ -2,14 +2,13 @@ http_interactions: - request: method: post - uri: https://api.datadoghq.com/api/v2/metrics/rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyListtagconfigurationbynamereturnsSuccessresponse1614797835/tags body: encoding: UTF-8 - string: '{"data":{"attributes":{"tags":["app","datacenter","rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331"}}' + string: '{"data":{"attributes":{"tags":["app","datacenter","rubyListtagconfigurationbynamereturnsSuccessresponse1614797835"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyListtagconfigurationbynamereturnsSuccessresponse1614797835"}}' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -22,7 +21,7 @@ http_interactions: message: Created headers: Date: - - Thu, 11 Feb 2021 09:55:31 GMT + - Wed, 03 Mar 2021 18:57:15 GMT Content-Type: - application/json Content-Length: @@ -33,21 +32,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:31 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '29' + - '45' X-Ratelimit-Remaining: - - '44' + - '42' X-Dd-Debug: - - F5gm0Rce1/Abr9/0Fw8HAqWfiz0FdiH8er/AXnN6lOn3L6KyGgbsLCwgPlob1No8 + - 5gfwVh/5HZ+AnGd/Di93w3NEWC6KMHT9KzmHEiRJmNdOjBtAsbOcgVFyqEChw71h X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -58,18 +54,17 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331","attributes":{"tags":["datacenter","app","rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331"],"include_percentiles":false,"created_at":"2021-02-11T09:55:31.439257+00:00","updated_at":"2021-02-11T09:55:31.439257+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:31 GMT + string: '{"data":{"type":"manage_tags","id":"rubyListtagconfigurationbynamereturnsSuccessresponse1614797835","attributes":{"tags":["datacenter","app","rubyListtagconfigurationbynamereturnsSuccessresponse1614797835"],"include_percentiles":false,"created_at":"2021-03-03T18:57:15.700363+00:00","updated_at":"2021-03-03T18:57:15.700363+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT - request: method: get - uri: https://api.datadoghq.com/api/v2/metrics/rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyListtagconfigurationbynamereturnsSuccessresponse1614797835/tags body: encoding: US-ASCII string: '' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -82,7 +77,7 @@ http_interactions: message: OK headers: Date: - - Thu, 11 Feb 2021 09:55:31 GMT + - Wed, 03 Mar 2021 18:57:15 GMT Content-Type: - application/json Content-Length: @@ -95,21 +90,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:31 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '29' + - '45' X-Ratelimit-Remaining: - - '43' + - '41' X-Dd-Debug: - - dCmL/3rURV6BPeaqeP3Rxigq41m5CAb17XjrRE42uZ01zpr07HVhbL5/3TWMkvgu + - PhosSd3Ch1B6B0DXI71steKUi7XhPDttnPiIP1NdXTw0VJNWpoUnYyBmODS5ne3q X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -120,6 +112,6 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331","attributes":{"tags":["datacenter","app","rubyListTagConfigurationbyNamereturnsSuccessresponse1613037331"],"include_percentiles":false,"created_at":"2021-02-11T09:55:31.439257+00:00","updated_at":"2021-02-11T09:55:31.439257+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:31 GMT + string: '{"data":{"type":"manage_tags","id":"rubyListtagconfigurationbynamereturnsSuccessresponse1614797835","attributes":{"tags":["datacenter","app","rubyListtagconfigurationbynamereturnsSuccessresponse1614797835"],"include_percentiles":false,"created_at":"2021-03-03T18:57:15.700363+00:00","updated_at":"2021-03-03T18:57:15.700363+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/List-Tag-Configurations-returns-Success-response.yml b/cassettes/features/v2/metrics/List-tag-configurations-returns-Success-response.yml similarity index 51% rename from cassettes/features/v2/metrics/List-Tag-Configurations-returns-Success-response.yml rename to cassettes/features/v2/metrics/List-tag-configurations-returns-Success-response.yml index cd8388a52443..5880a476d4f8 100644 --- a/cassettes/features/v2/metrics/List-Tag-Configurations-returns-Success-response.yml +++ b/cassettes/features/v2/metrics/List-tag-configurations-returns-Success-response.yml @@ -2,14 +2,13 @@ http_interactions: - request: method: post - uri: https://api.datadoghq.com/api/v2/metrics/rubyListTagConfigurationsreturnsSuccessresponse1613037331/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyListtagconfigurationsreturnsSuccessresponse1614797835/tags body: encoding: UTF-8 - string: '{"data":{"attributes":{"tags":["app","datacenter","rubyListTagConfigurationsreturnsSuccessresponse1613037331"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyListTagConfigurationsreturnsSuccessresponse1613037331"}}' + string: '{"data":{"attributes":{"tags":["app","datacenter","rubyListtagconfigurationsreturnsSuccessresponse1614797835"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyListtagconfigurationsreturnsSuccessresponse1614797835"}}' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -22,7 +21,7 @@ http_interactions: message: Created headers: Date: - - Thu, 11 Feb 2021 09:55:31 GMT + - Wed, 03 Mar 2021 18:57:15 GMT Content-Type: - application/json Content-Length: @@ -33,21 +32,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:31 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '29' + - '45' X-Ratelimit-Remaining: - - '41' + - '39' X-Dd-Debug: - - PhosSd3Ch1B6B0DXI71steKUi7XhPDttnPiIP1NdXTw0VJNWpoUnYyBmODS5ne3q + - dCmL/3rURV6BPeaqeP3Rxigq41m5CAb17XjrRE42uZ01zpr07HVhbL5/3TWMkvgu X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -58,18 +54,17 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyListTagConfigurationsreturnsSuccessresponse1613037331","attributes":{"tags":["datacenter","app","rubyListTagConfigurationsreturnsSuccessresponse1613037331"],"include_percentiles":false,"created_at":"2021-02-11T09:55:31.933660+00:00","updated_at":"2021-02-11T09:55:31.933660+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:31 GMT + string: '{"data":{"type":"manage_tags","id":"rubyListtagconfigurationsreturnsSuccessresponse1614797835","attributes":{"tags":["datacenter","app","rubyListtagconfigurationsreturnsSuccessresponse1614797835"],"include_percentiles":false,"created_at":"2021-03-03T18:57:15.937421+00:00","updated_at":"2021-03-03T18:57:15.937421+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT - request: method: get - uri: https://api.datadoghq.com/api/v2/metrics?filter%5Btags_configured%5D=rubyListTagConfigurationsreturnsSuccessresponse1613037331 + uri: https://api.datadoghq.com/api/v2/metrics?filter%5Btags_configured%5D=rubyListtagconfigurationsreturnsSuccessresponse1614797835 body: encoding: US-ASCII string: '' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -82,7 +77,7 @@ http_interactions: message: OK headers: Date: - - Thu, 11 Feb 2021 09:55:36 GMT + - Wed, 03 Mar 2021 18:57:20 GMT Content-Type: - application/json Content-Length: @@ -95,21 +90,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:32 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '28' + - '44' X-Ratelimit-Remaining: - - '40' + - '38' X-Dd-Debug: - - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk + - dCmL/3rURV6BPeaqeP3Rxigq41m5CAb17XjrRE42uZ01zpr07HVhbL5/3TWMkvgu X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -120,6 +112,6 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":[{"type":"manage_tags","id":"rubyListTagConfigurationsreturnsSuccessresponse1613037331","attributes":{"tags":["datacenter","app","rubyListTagConfigurationsreturnsSuccessresponse1613037331"],"include_percentiles":false,"created_at":"2021-02-11T09:55:31.933660+00:00","updated_at":"2021-02-11T09:55:31.933660+00:00","metric_type":"distribution"}}]}' - recorded_at: Thu, 11 Feb 2021 09:55:31 GMT + string: '{"data":[{"type":"manage_tags","id":"rubyListtagconfigurationsreturnsSuccessresponse1614797835","attributes":{"tags":["datacenter","app","rubyListtagconfigurationsreturnsSuccessresponse1614797835"],"include_percentiles":false,"created_at":"2021-03-03T18:57:15.937421+00:00","updated_at":"2021-03-03T18:57:15.937421+00:00","metric_type":"distribution"}}]}' + recorded_at: Wed, 03 Mar 2021 18:57:15 GMT recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/List-tags-by-metric-name-returns-Success-response.yml b/cassettes/features/v2/metrics/List-tags-by-metric-name-returns-Success-response.yml new file mode 100644 index 000000000000..35e69eddd399 --- /dev/null +++ b/cassettes/features/v2/metrics/List-tags-by-metric-name-returns-Success-response.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.datadoghq.com/api/v2/metrics/rubyListtagsbymetricnamereturnsSuccessresponse1614797840/tags + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"tags":["app","datacenter","rubyListtagsbymetricnamereturnsSuccessresponse1614797840"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyListtagsbymetricnamereturnsSuccessresponse1614797840"}}' + headers: + User-Agent: + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) + Content-Type: + - application/json + Accept: + - application/json + Expect: + - '' + response: + status: + code: 201 + message: Created + headers: + Date: + - Wed, 03 Mar 2021 18:57:20 GMT + Content-Type: + - application/json + Content-Length: + - '350' + Connection: + - keep-alive + Pragma: + - no-cache + Cache-Control: + - no-cache + X-Dd-Version: + - '35.4022232' + X-Ratelimit-Limit: + - '50' + X-Ratelimit-Period: + - '60' + X-Ratelimit-Reset: + - '40' + X-Ratelimit-Remaining: + - '36' + X-Dd-Debug: + - dCmL/3rURV6BPeaqeP3Rxigq41m5CAb17XjrRE42uZ01zpr07HVhbL5/3TWMkvgu + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=15724800; + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + X-Frame-Options: + - SAMEORIGIN + body: + encoding: UTF-8 + string: '{"data":{"type":"manage_tags","id":"rubyListtagsbymetricnamereturnsSuccessresponse1614797840","attributes":{"tags":["datacenter","app","rubyListtagsbymetricnamereturnsSuccessresponse1614797840"],"include_percentiles":false,"created_at":"2021-03-03T18:57:20.421135+00:00","updated_at":"2021-03-03T18:57:20.421135+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:20 GMT +- request: + method: get + uri: https://api.datadoghq.com/api/v2/metrics/rubyListtagsbymetricnamereturnsSuccessresponse1614797840/all-tags + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) + Content-Type: + - application/json + Accept: + - application/json + Expect: + - '' + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 03 Mar 2021 18:57:20 GMT + Content-Type: + - application/json + Content-Length: + - '116' + Connection: + - keep-alive + Vary: + - Accept-Encoding + Pragma: + - no-cache + Cache-Control: + - no-cache + X-Dd-Version: + - '35.4022232' + X-Ratelimit-Limit: + - '600' + X-Ratelimit-Period: + - '3600' + X-Ratelimit-Reset: + - '160' + X-Ratelimit-Remaining: + - '598' + X-Dd-Debug: + - 25u1gDlL724DHllbjFT4BhOLorBTilh+aah2uWAUEjFC/+rjczJdiyWrV/HwLwe/ + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=15724800; + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + X-Frame-Options: + - SAMEORIGIN + body: + encoding: UTF-8 + string: '{"data":{"type":"metrics","id":"rubyListtagsbymetricnamereturnsSuccessresponse1614797840","attributes":{"tags":[]}}}' + recorded_at: Wed, 03 Mar 2021 18:57:20 GMT +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/metrics/Update-a-Tag-Configuration-returns-OK-response.yml b/cassettes/features/v2/metrics/Update-a-tag-configuration-returns-OK-response.yml similarity index 50% rename from cassettes/features/v2/metrics/Update-a-Tag-Configuration-returns-OK-response.yml rename to cassettes/features/v2/metrics/Update-a-tag-configuration-returns-OK-response.yml index 31984f9e3925..02c87549b27d 100644 --- a/cassettes/features/v2/metrics/Update-a-Tag-Configuration-returns-OK-response.yml +++ b/cassettes/features/v2/metrics/Update-a-tag-configuration-returns-OK-response.yml @@ -2,14 +2,13 @@ http_interactions: - request: method: post - uri: https://api.datadoghq.com/api/v2/metrics/rubyUpdateaTagConfigurationreturnsOKresponse1613037337/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyUpdateatagconfigurationreturnsOKresponse1614797840/tags body: encoding: UTF-8 - string: '{"data":{"attributes":{"tags":["app","datacenter","rubyUpdateaTagConfigurationreturnsOKresponse1613037337"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyUpdateaTagConfigurationreturnsOKresponse1613037337"}}' + string: '{"data":{"attributes":{"tags":["app","datacenter","rubyUpdateatagconfigurationreturnsOKresponse1614797840"],"metric_type":"distribution"},"type":"manage_tags","id":"rubyUpdateatagconfigurationreturnsOKresponse1614797840"}}' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -22,7 +21,7 @@ http_interactions: message: Created headers: Date: - - Thu, 11 Feb 2021 09:55:37 GMT + - Wed, 03 Mar 2021 18:57:20 GMT Content-Type: - application/json Content-Length: @@ -33,21 +32,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:37 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '23' + - '40' X-Ratelimit-Remaining: - - '38' + - '34' X-Dd-Debug: - - fIO2C4qGDheGHy4YbS+r3a3CXbh4cbRo7roILOimQyiHGjQdOat0cIpWCkupM1uX + - SY1h8ScsWq+kYmtbh63ltMLFAZsQjqfrgvdfAoRX+9TzT1sgMBRYaFRwfWWRRe9a X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -58,18 +54,17 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyUpdateaTagConfigurationreturnsOKresponse1613037337","attributes":{"tags":["datacenter","app","rubyUpdateaTagConfigurationreturnsOKresponse1613037337"],"include_percentiles":false,"created_at":"2021-02-11T09:55:37.229130+00:00","updated_at":"2021-02-11T09:55:37.229130+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:37 GMT + string: '{"data":{"type":"manage_tags","id":"rubyUpdateatagconfigurationreturnsOKresponse1614797840","attributes":{"tags":["datacenter","app","rubyUpdateatagconfigurationreturnsOKresponse1614797840"],"include_percentiles":false,"created_at":"2021-03-03T18:57:20.692813+00:00","updated_at":"2021-03-03T18:57:20.692813+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:20 GMT - request: method: patch - uri: https://api.datadoghq.com/api/v2/metrics/rubyUpdateaTagConfigurationreturnsOKresponse1613037337/tags + uri: https://api.datadoghq.com/api/v2/metrics/rubyUpdateatagconfigurationreturnsOKresponse1614797840/tags body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyUpdateaTagConfigurationreturnsOKresponse1613037337","attributes":{"tags":["app"]}}}' + string: '{"data":{"type":"manage_tags","id":"rubyUpdateatagconfigurationreturnsOKresponse1614797840","attributes":{"tags":["app"]}}}' headers: User-Agent: - - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.1; os darwin19.6.0; arch - x86_64) + - datadog-api-client-ruby/1.0.0.beta.3.dev (ruby 2.7.2; os linux-gnu; arch x86_64) Content-Type: - application/json Accept: @@ -82,7 +77,7 @@ http_interactions: message: OK headers: Date: - - Thu, 11 Feb 2021 09:55:37 GMT + - Wed, 03 Mar 2021 18:57:20 GMT Content-Type: - application/json Content-Length: @@ -95,21 +90,18 @@ http_interactions: - no-cache Cache-Control: - no-cache - Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 18-Feb-2021 09:55:37 GMT; - secure; HttpOnly X-Dd-Version: - - '35.3888455' + - '35.4022232' X-Ratelimit-Limit: - '50' X-Ratelimit-Period: - '60' X-Ratelimit-Reset: - - '23' + - '40' X-Ratelimit-Remaining: - - '37' + - '33' X-Dd-Debug: - - "/L+SFFO+m1pPY+hRCpk5325fvfrNl0KmiquUNJolBN/5hu3HIwflqjZSbJ6NxDFG" + - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU X-Content-Type-Options: - nosniff Strict-Transport-Security: @@ -120,6 +112,6 @@ http_interactions: - SAMEORIGIN body: encoding: UTF-8 - string: '{"data":{"type":"manage_tags","id":"rubyUpdateaTagConfigurationreturnsOKresponse1613037337","attributes":{"tags":["app"],"include_percentiles":false,"created_at":"2021-02-11T09:55:37.229130+00:00","updated_at":"2021-02-11T09:55:37.392804+00:00","metric_type":"distribution"}}}' - recorded_at: Thu, 11 Feb 2021 09:55:37 GMT + string: '{"data":{"type":"manage_tags","id":"rubyUpdateatagconfigurationreturnsOKresponse1614797840","attributes":{"tags":["app"],"include_percentiles":false,"created_at":"2021-03-03T18:57:20.692813+00:00","updated_at":"2021-03-03T18:57:20.784592+00:00","metric_type":"distribution"}}}' + recorded_at: Wed, 03 Mar 2021 18:57:20 GMT recorded_with: VCR 6.0.0 diff --git a/data/v1/openapi.yaml b/data/v1/openapi.yaml index cb8109600c70..5f532c09216b 100644 --- a/data/v1/openapi.yaml +++ b/data/v1/openapi.yaml @@ -18803,11 +18803,12 @@ tags: name: Logs Pipelines - 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\n**Note**: A graph can only contain\ - \ a set number of points\nand as the timeframe over which a metric is viewed increases,\n\ - aggregation 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." + - 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: '[Monitors](https://docs.datadoghq.com/monitors) allow you to watch a metric or check that you care about, diff --git a/data/v2/openapi.yaml b/data/v2/openapi.yaml index 6da838440779..6645bceb576a 100644 --- a/data/v2/openapi.yaml +++ b/data/v2/openapi.yaml @@ -2863,6 +2863,99 @@ components: type: $ref: '#/components/schemas/MetricType' type: object + MetricAllTags: + description: Object for a single metric's indexed tags. + properties: + attributes: + $ref: '#/components/schemas/MetricAllTagsAttributes' + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricType' + type: object + MetricAllTagsAttributes: + description: Object containing the definition of a metric's tags. + properties: + tags: + description: List of indexed tag value pairs. + example: + - sport:golf + - sport:football + - animal:dog + items: + description: Tag key-value pairs. + type: string + type: array + type: object + MetricAllTagsResponse: + description: Response object that includes a single metric's indexed tags. + properties: + data: + $ref: '#/components/schemas/MetricAllTags' + readOnly: true + type: object + MetricDistinctVolume: + description: Object for a single metric's distinct volume. + properties: + attributes: + $ref: '#/components/schemas/MetricDistinctVolumeAttributes' + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricDistinctVolumeType' + type: object + MetricDistinctVolumeAttributes: + description: Object containing the definition of a metric's distinct volume. + properties: + distinct_volume: + description: Distinct volume for the given metric. + example: 10 + format: int64 + type: integer + type: object + MetricDistinctVolumeType: + default: distinct_metric_volumes + description: The metric distinct volume type. + enum: + - distinct_metric_volumes + example: distinct_metric_volumes + type: string + x-enum-varnames: + - DISTINCT_METRIC_VOLUMES + MetricIngestedIndexedVolume: + description: Object for a single metric's ingested and indexed volume. + properties: + attributes: + $ref: '#/components/schemas/MetricIngestedIndexedVolumeAttributes' + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricIngestedIndexedVolumeType' + type: object + MetricIngestedIndexedVolumeAttributes: + description: Object containing the definition of a metric's ingested and indexed + volume. + properties: + indexed_volume: + description: Indexed volume for the given metric. + example: 10 + format: int64 + type: integer + ingested_volume: + description: Ingested volume for the given metric. + example: 20 + format: int64 + type: integer + type: object + MetricIngestedIndexedVolumeType: + default: metric_volumes + description: The metric ingested and indexed volume type. + enum: + - metric_volumes + example: metric_volumes + type: string + x-enum-varnames: + - METRIC_VOLUMES MetricName: description: The metric name for this resource. example: test.metric.latency @@ -3070,6 +3163,19 @@ components: type: string x-enum-varnames: - METRICS + MetricVolumes: + description: Possible response objects for a metric's volume. + oneOf: + - $ref: '#/components/schemas/MetricDistinctVolume' + - $ref: '#/components/schemas/MetricIngestedIndexedVolume' + type: object + MetricVolumesResponse: + description: Response object which includes a single metric's volume. + properties: + data: + $ref: '#/components/schemas/MetricVolumes' + readOnly: true + type: object MetricsAndMetricTagConfigurations: description: Object for a metrics and metric tag configurations. oneOf: @@ -6225,7 +6331,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Too Many Requests - summary: List Tag Configurations + summary: List tag configurations tags: - Metrics x-undo: @@ -6234,6 +6340,51 @@ paths: \ is only accessible for Metrics without Limits™ beta customers.\nIf\ \ you\u2019re interested in Metrics without Limits™, please contact\ \ your Customer Success Manager.**" + /api/v2/metrics/{metric_name}/all-tags: + get: + description: View indexed tag key-value pairs for a given metric name. + operationId: ListTagsByMetricName + parameters: + - $ref: '#/components/parameters/MetricName' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MetricAllTagsResponse' + description: Success + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too Many Requests + summary: List tags by metric name + tags: + - Metrics + x-undo: + type: safe + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' /api/v2/metrics/{metric_name}/tags: delete: description: 'Deletes a metric''s tag configuration. Can only be used with application @@ -6263,7 +6414,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Too Many Requests - summary: Delete a Tag Configuration + summary: Delete a tag configuration tags: - Metrics x-undo: @@ -6302,7 +6453,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Too Many Requests - summary: List Tag Configuration by Name + summary: List tag configuration by name tags: - Metrics x-undo: @@ -6356,7 +6507,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Too Many Requests - summary: Update a Tag Configuration + summary: Update a tag configuration tags: - Metrics x-codegen-request-body-name: body @@ -6412,7 +6563,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Too Many Requests - summary: Create a Tag Configuration + summary: Create a tag configuration tags: - Metrics x-codegen-request-body-name: body @@ -6437,6 +6588,60 @@ paths: \ is only accessible for Metrics without Limits™ beta customers.\nIf\ \ you\u2019re interested in Metrics without Limits™, please contact\ \ your Customer Success Manager.**" + /api/v2/metrics/{metric_name}/volumes: + get: + description: 'View distinct metrics volumes for the given metric name. + + + Custom distribution metrics will return both ingested and indexed custom metrics. + + For Metrics without Limits beta customers, all metrics will return both ingested/indexed + volumes. + + Custom metrics generated in-app from other products will return `null` for + ingested volumes.' + operationId: ListVolumesByMetricName + parameters: + - $ref: '#/components/parameters/MetricName' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MetricVolumesResponse' + description: Success + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too Many Requests + summary: List distinct metric volumes by metric name + tags: + - Metrics + x-undo: + type: safe + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' /api/v2/permissions: get: description: Returns a list of all permissions, including name, description, @@ -8043,11 +8248,12 @@ tags: 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\n**Note**: A graph can only contain\ - \ a set number of points\nand as the timeframe over which a metric is viewed increases,\n\ - aggregation 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." + - 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: The processes API allows you to query processes data for your organization. name: Processes diff --git a/docs/v2/MetricAllTags.md b/docs/v2/MetricAllTags.md new file mode 100644 index 000000000000..5f25db76862d --- /dev/null +++ b/docs/v2/MetricAllTags.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V2::MetricAllTags + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attributes** | [**MetricAllTagsAttributes**](MetricAllTagsAttributes.md) | | [optional] | +| **id** | **String** | The metric name for this resource. | [optional] | +| **type** | [**MetricType**](MetricType.md) | | [optional][default to 'metrics'] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricAllTags.new( + attributes: null, + id: test.metric.latency, + type: null +) +``` + diff --git a/docs/v2/MetricAllTagsAttributes.md b/docs/v2/MetricAllTagsAttributes.md new file mode 100644 index 000000000000..db149e2df1b8 --- /dev/null +++ b/docs/v2/MetricAllTagsAttributes.md @@ -0,0 +1,18 @@ +# DatadogAPIClient::V2::MetricAllTagsAttributes + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tags** | **Array<String>** | List of indexed tag value pairs. | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricAllTagsAttributes.new( + tags: ["sport:golf","sport:football","animal:dog"] +) +``` + diff --git a/docs/v2/MetricAllTagsResponse.md b/docs/v2/MetricAllTagsResponse.md new file mode 100644 index 000000000000..f25ba14ba7f0 --- /dev/null +++ b/docs/v2/MetricAllTagsResponse.md @@ -0,0 +1,18 @@ +# DatadogAPIClient::V2::MetricAllTagsResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **data** | [**MetricAllTags**](MetricAllTags.md) | | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricAllTagsResponse.new( + data: null +) +``` + diff --git a/docs/v2/MetricDistinctVolume.md b/docs/v2/MetricDistinctVolume.md new file mode 100644 index 000000000000..72f081123368 --- /dev/null +++ b/docs/v2/MetricDistinctVolume.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V2::MetricDistinctVolume + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attributes** | [**MetricDistinctVolumeAttributes**](MetricDistinctVolumeAttributes.md) | | [optional] | +| **id** | **String** | The metric name for this resource. | [optional] | +| **type** | [**MetricDistinctVolumeType**](MetricDistinctVolumeType.md) | | [optional][default to 'distinct_metric_volumes'] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricDistinctVolume.new( + attributes: null, + id: test.metric.latency, + type: null +) +``` + diff --git a/docs/v2/MetricDistinctVolumeAttributes.md b/docs/v2/MetricDistinctVolumeAttributes.md new file mode 100644 index 000000000000..6cad6d80940f --- /dev/null +++ b/docs/v2/MetricDistinctVolumeAttributes.md @@ -0,0 +1,18 @@ +# DatadogAPIClient::V2::MetricDistinctVolumeAttributes + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **distinct_volume** | **Integer** | Distinct volume for the given metric. | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricDistinctVolumeAttributes.new( + distinct_volume: 10 +) +``` + diff --git a/docs/v2/MetricDistinctVolumeType.md b/docs/v2/MetricDistinctVolumeType.md new file mode 100644 index 000000000000..c3e3cd07aa6f --- /dev/null +++ b/docs/v2/MetricDistinctVolumeType.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V2::MetricDistinctVolumeType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricDistinctVolumeType.new() +``` + diff --git a/docs/v2/MetricIngestedIndexedVolume.md b/docs/v2/MetricIngestedIndexedVolume.md new file mode 100644 index 000000000000..c783157b46d6 --- /dev/null +++ b/docs/v2/MetricIngestedIndexedVolume.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V2::MetricIngestedIndexedVolume + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attributes** | [**MetricIngestedIndexedVolumeAttributes**](MetricIngestedIndexedVolumeAttributes.md) | | [optional] | +| **id** | **String** | The metric name for this resource. | [optional] | +| **type** | [**MetricIngestedIndexedVolumeType**](MetricIngestedIndexedVolumeType.md) | | [optional][default to 'metric_volumes'] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricIngestedIndexedVolume.new( + attributes: null, + id: test.metric.latency, + type: null +) +``` + diff --git a/docs/v2/MetricIngestedIndexedVolumeAttributes.md b/docs/v2/MetricIngestedIndexedVolumeAttributes.md new file mode 100644 index 000000000000..4a9bf1aad804 --- /dev/null +++ b/docs/v2/MetricIngestedIndexedVolumeAttributes.md @@ -0,0 +1,20 @@ +# DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **indexed_volume** | **Integer** | Indexed volume for the given metric. | [optional] | +| **ingested_volume** | **Integer** | Ingested volume for the given metric. | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes.new( + indexed_volume: 10, + ingested_volume: 20 +) +``` + diff --git a/docs/v2/MetricIngestedIndexedVolumeType.md b/docs/v2/MetricIngestedIndexedVolumeType.md new file mode 100644 index 000000000000..f2e89f7a8911 --- /dev/null +++ b/docs/v2/MetricIngestedIndexedVolumeType.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V2::MetricIngestedIndexedVolumeType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricIngestedIndexedVolumeType.new() +``` + diff --git a/docs/v2/MetricVolumes.md b/docs/v2/MetricVolumes.md new file mode 100644 index 000000000000..8e0060e4df21 --- /dev/null +++ b/docs/v2/MetricVolumes.md @@ -0,0 +1,49 @@ +# DatadogAPIClient::V2::MetricVolumes + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'datadog_api_client/v2' + +DatadogAPIClient::V2::MetricVolumes.openapi_one_of +# => +# [ +# :'MetricDistinctVolume', +# :'MetricIngestedIndexedVolume' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'datadog_api_client/v2' + +DatadogAPIClient::V2::MetricVolumes.build(data) +# => # + +DatadogAPIClient::V2::MetricVolumes.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `MetricDistinctVolume` +- `MetricIngestedIndexedVolume` +- `nil` (if no type matches) + diff --git a/docs/v2/MetricVolumesResponse.md b/docs/v2/MetricVolumesResponse.md new file mode 100644 index 000000000000..034746a22839 --- /dev/null +++ b/docs/v2/MetricVolumesResponse.md @@ -0,0 +1,18 @@ +# DatadogAPIClient::V2::MetricVolumesResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **data** | [**MetricVolumes**](MetricVolumes.md) | | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v2' + +instance = DatadogAPIClient::V2::MetricVolumesResponse.new( + data: null +) +``` + diff --git a/docs/v2/MetricsApi.md b/docs/v2/MetricsApi.md index 7e2880e4fe97..77fdb28fd5c6 100644 --- a/docs/v2/MetricsApi.md +++ b/docs/v2/MetricsApi.md @@ -4,18 +4,20 @@ All URIs are relative to *https://api.datadoghq.com* | Method | HTTP request | Description | | ------ | ------------ | ----------- | -| [**create_tag_configuration**](MetricsApi.md#create_tag_configuration) | **POST** /api/v2/metrics/{metric_name}/tags | Create a Tag Configuration | -| [**delete_tag_configuration**](MetricsApi.md#delete_tag_configuration) | **DELETE** /api/v2/metrics/{metric_name}/tags | Delete a Tag Configuration | -| [**list_tag_configuration_by_name**](MetricsApi.md#list_tag_configuration_by_name) | **GET** /api/v2/metrics/{metric_name}/tags | List Tag Configuration by Name | -| [**list_tag_configurations**](MetricsApi.md#list_tag_configurations) | **GET** /api/v2/metrics | List Tag Configurations | -| [**update_tag_configuration**](MetricsApi.md#update_tag_configuration) | **PATCH** /api/v2/metrics/{metric_name}/tags | Update a Tag Configuration | +| [**create_tag_configuration**](MetricsApi.md#create_tag_configuration) | **POST** /api/v2/metrics/{metric_name}/tags | Create a tag configuration | +| [**delete_tag_configuration**](MetricsApi.md#delete_tag_configuration) | **DELETE** /api/v2/metrics/{metric_name}/tags | Delete a tag configuration | +| [**list_tag_configuration_by_name**](MetricsApi.md#list_tag_configuration_by_name) | **GET** /api/v2/metrics/{metric_name}/tags | List tag configuration by name | +| [**list_tag_configurations**](MetricsApi.md#list_tag_configurations) | **GET** /api/v2/metrics | List tag configurations | +| [**list_tags_by_metric_name**](MetricsApi.md#list_tags_by_metric_name) | **GET** /api/v2/metrics/{metric_name}/all-tags | List tags by metric name | +| [**list_volumes_by_metric_name**](MetricsApi.md#list_volumes_by_metric_name) | **GET** /api/v2/metrics/{metric_name}/volumes | List distinct metric volumes by metric name | +| [**update_tag_configuration**](MetricsApi.md#update_tag_configuration) | **PATCH** /api/v2/metrics/{metric_name}/tags | Update a tag configuration | ## create_tag_configuration > create_tag_configuration(metric_name, body) -Create a Tag Configuration +Create a tag configuration Create and define a list of queryable tag keys for a count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric. Can only be used with application keys of users with the `Manage Tags for Metrics` permission. @@ -44,7 +46,7 @@ metric_name = 'dist.http.endpoint.request' # String | The name of the metric. body = DatadogAPIClient::V2::MetricTagConfigurationCreateRequest.new({data: DatadogAPIClient::V2::MetricTagConfigurationCreateData.new({id: 'test.metric.latency', type: DatadogAPIClient::V2::MetricTagConfigurationType::MANAGE_TAGS})}) # MetricTagConfigurationCreateRequest | begin - # Create a Tag Configuration + # Create a tag configuration result = api_instance.create_tag_configuration(metric_name, body) p result rescue DatadogAPIClient::V2::ApiError => e @@ -60,7 +62,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Create a Tag Configuration + # Create a tag configuration data, status_code, headers = api_instance.create_tag_configuration_with_http_info(metric_name, body) p status_code # => 2xx p headers # => { ... } @@ -95,7 +97,7 @@ end > delete_tag_configuration(metric_name) -Delete a Tag Configuration +Delete a tag configuration Deletes a metric's tag configuration. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. @@ -123,7 +125,7 @@ api_instance = DatadogAPIClient::V2::MetricsApi.new metric_name = 'dist.http.endpoint.request' # String | The name of the metric. begin - # Delete a Tag Configuration + # Delete a tag configuration api_instance.delete_tag_configuration(metric_name) rescue DatadogAPIClient::V2::ApiError => e puts "Error when calling MetricsApi->delete_tag_configuration: #{e}" @@ -138,7 +140,7 @@ This returns an Array which contains the response data (`nil` in this case), sta ```ruby begin - # Delete a Tag Configuration + # Delete a tag configuration data, status_code, headers = api_instance.delete_tag_configuration_with_http_info(metric_name) p status_code # => 2xx p headers # => { ... } @@ -172,7 +174,7 @@ nil (empty response body) > list_tag_configuration_by_name(metric_name) -List Tag Configuration by Name +List tag configuration by name Returns the tag configuration for the given metric name. @@ -200,7 +202,7 @@ api_instance = DatadogAPIClient::V2::MetricsApi.new metric_name = 'dist.http.endpoint.request' # String | The name of the metric. begin - # List Tag Configuration by Name + # List tag configuration by name result = api_instance.list_tag_configuration_by_name(metric_name) p result rescue DatadogAPIClient::V2::ApiError => e @@ -216,7 +218,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # List Tag Configuration by Name + # List tag configuration by name data, status_code, headers = api_instance.list_tag_configuration_by_name_with_http_info(metric_name) p status_code # => 2xx p headers # => { ... } @@ -250,7 +252,7 @@ end > list_tag_configurations(opts) -List Tag Configurations +List tag configurations Returns all configured count/gauge/rate/distribution metric names (with additional filters if specified). @@ -283,7 +285,7 @@ opts = { } begin - # List Tag Configurations + # List tag configurations result = api_instance.list_tag_configurations(opts) p result rescue DatadogAPIClient::V2::ApiError => e @@ -299,7 +301,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # List Tag Configurations + # List tag configurations data, status_code, headers = api_instance.list_tag_configurations_with_http_info(opts) p status_code # => 2xx p headers # => { ... } @@ -332,11 +334,167 @@ end - **Accept**: application/json +## list_tags_by_metric_name + +> list_tags_by_metric_name(metric_name) + +List tags by metric name + +View indexed tag key-value pairs for a given metric name. + +### Examples + +```ruby +require 'time' +require 'datadog_api_client' + +DatadogAPIClient::V2.configure do |config| + # Defining the site is optional and defaults to datadoghq.com + config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE' + + # setup authorization + # Configure API key authorization: apiKeyAuth + config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"] + + # Configure API key authorization: appKeyAuth + config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"] + + config.unstable_operations[:list_tags_by_metric_name] = true +end + +api_instance = DatadogAPIClient::V2::MetricsApi.new +metric_name = 'dist.http.endpoint.request' # String | The name of the metric. + +begin + # List tags by metric name + result = api_instance.list_tags_by_metric_name(metric_name) + p result +rescue DatadogAPIClient::V2::ApiError => e + puts "Error when calling MetricsApi->list_tags_by_metric_name: #{e}" +end +``` + +#### Using the list_tags_by_metric_name_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_tags_by_metric_name_with_http_info(metric_name) + +```ruby +begin + # List tags by metric name + data, status_code, headers = api_instance.list_tags_by_metric_name_with_http_info(metric_name) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue DatadogAPIClient::V2::ApiError => e + puts "Error when calling MetricsApi->list_tags_by_metric_name_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **metric_name** | **String** | The name of the metric. | | + +### Return type + +[**MetricAllTagsResponse**](MetricAllTagsResponse.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_volumes_by_metric_name + +> list_volumes_by_metric_name(metric_name) + +List distinct metric volumes by metric name + +View distinct metrics volumes for the given metric name. Custom distribution metrics will return both ingested and indexed custom metrics. For Metrics without Limits beta customers, all metrics will return both ingested/indexed volumes. Custom metrics generated in-app from other products will return `null` for ingested volumes. + +### Examples + +```ruby +require 'time' +require 'datadog_api_client' + +DatadogAPIClient::V2.configure do |config| + # Defining the site is optional and defaults to datadoghq.com + config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE' + + # setup authorization + # Configure API key authorization: apiKeyAuth + config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"] + + # Configure API key authorization: appKeyAuth + config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"] + + config.unstable_operations[:list_volumes_by_metric_name] = true +end + +api_instance = DatadogAPIClient::V2::MetricsApi.new +metric_name = 'dist.http.endpoint.request' # String | The name of the metric. + +begin + # List distinct metric volumes by metric name + result = api_instance.list_volumes_by_metric_name(metric_name) + p result +rescue DatadogAPIClient::V2::ApiError => e + puts "Error when calling MetricsApi->list_volumes_by_metric_name: #{e}" +end +``` + +#### Using the list_volumes_by_metric_name_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_volumes_by_metric_name_with_http_info(metric_name) + +```ruby +begin + # List distinct metric volumes by metric name + data, status_code, headers = api_instance.list_volumes_by_metric_name_with_http_info(metric_name) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue DatadogAPIClient::V2::ApiError => e + puts "Error when calling MetricsApi->list_volumes_by_metric_name_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **metric_name** | **String** | The name of the metric. | | + +### Return type + +[**MetricVolumesResponse**](MetricVolumesResponse.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## update_tag_configuration > update_tag_configuration(metric_name, body) -Update a Tag Configuration +Update a tag configuration Update the tag configuration of a metric or percentile aggregations of a distribution metric. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. @@ -365,7 +523,7 @@ metric_name = 'dist.http.endpoint.request' # String | The name of the metric. body = DatadogAPIClient::V2::MetricTagConfigurationUpdateRequest.new({data: DatadogAPIClient::V2::MetricTagConfigurationUpdateData.new({id: 'test.metric.latency', type: DatadogAPIClient::V2::MetricTagConfigurationType::MANAGE_TAGS})}) # MetricTagConfigurationUpdateRequest | begin - # Update a Tag Configuration + # Update a tag configuration result = api_instance.update_tag_configuration(metric_name, body) p result rescue DatadogAPIClient::V2::ApiError => e @@ -381,7 +539,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Update a Tag Configuration + # Update a tag configuration data, status_code, headers = api_instance.update_tag_configuration_with_http_info(metric_name, body) p status_code # => 2xx p headers # => { ... } diff --git a/docs/v2/README.md b/docs/v2/README.md index 6c73dc219444..d8e60c9dc224 100644 --- a/docs/v2/README.md +++ b/docs/v2/README.md @@ -136,11 +136,13 @@ Class | Method | HTTP request | Description *DatadogAPIClient::V2::LogsMetricsApi* | [**get_logs_metric**](LogsMetricsApi.md#get_logs_metric) | **GET** /api/v2/logs/config/metrics/{metric_id} | Get a log-based metric *DatadogAPIClient::V2::LogsMetricsApi* | [**list_logs_metrics**](LogsMetricsApi.md#list_logs_metrics) | **GET** /api/v2/logs/config/metrics | Get all log-based metrics *DatadogAPIClient::V2::LogsMetricsApi* | [**update_logs_metric**](LogsMetricsApi.md#update_logs_metric) | **PATCH** /api/v2/logs/config/metrics/{metric_id} | Update a log-based metric -*DatadogAPIClient::V2::MetricsApi* | [**create_tag_configuration**](MetricsApi.md#create_tag_configuration) | **POST** /api/v2/metrics/{metric_name}/tags | Create a Tag Configuration -*DatadogAPIClient::V2::MetricsApi* | [**delete_tag_configuration**](MetricsApi.md#delete_tag_configuration) | **DELETE** /api/v2/metrics/{metric_name}/tags | Delete a Tag Configuration -*DatadogAPIClient::V2::MetricsApi* | [**list_tag_configuration_by_name**](MetricsApi.md#list_tag_configuration_by_name) | **GET** /api/v2/metrics/{metric_name}/tags | List Tag Configuration by Name -*DatadogAPIClient::V2::MetricsApi* | [**list_tag_configurations**](MetricsApi.md#list_tag_configurations) | **GET** /api/v2/metrics | List Tag Configurations -*DatadogAPIClient::V2::MetricsApi* | [**update_tag_configuration**](MetricsApi.md#update_tag_configuration) | **PATCH** /api/v2/metrics/{metric_name}/tags | Update a Tag Configuration +*DatadogAPIClient::V2::MetricsApi* | [**create_tag_configuration**](MetricsApi.md#create_tag_configuration) | **POST** /api/v2/metrics/{metric_name}/tags | Create a tag configuration +*DatadogAPIClient::V2::MetricsApi* | [**delete_tag_configuration**](MetricsApi.md#delete_tag_configuration) | **DELETE** /api/v2/metrics/{metric_name}/tags | Delete a tag configuration +*DatadogAPIClient::V2::MetricsApi* | [**list_tag_configuration_by_name**](MetricsApi.md#list_tag_configuration_by_name) | **GET** /api/v2/metrics/{metric_name}/tags | List tag configuration by name +*DatadogAPIClient::V2::MetricsApi* | [**list_tag_configurations**](MetricsApi.md#list_tag_configurations) | **GET** /api/v2/metrics | List tag configurations +*DatadogAPIClient::V2::MetricsApi* | [**list_tags_by_metric_name**](MetricsApi.md#list_tags_by_metric_name) | **GET** /api/v2/metrics/{metric_name}/all-tags | List tags by metric name +*DatadogAPIClient::V2::MetricsApi* | [**list_volumes_by_metric_name**](MetricsApi.md#list_volumes_by_metric_name) | **GET** /api/v2/metrics/{metric_name}/volumes | List distinct metric volumes by metric name +*DatadogAPIClient::V2::MetricsApi* | [**update_tag_configuration**](MetricsApi.md#update_tag_configuration) | **PATCH** /api/v2/metrics/{metric_name}/tags | Update a tag configuration *DatadogAPIClient::V2::ProcessesApi* | [**list_processes**](ProcessesApi.md#list_processes) | **GET** /api/v2/processes | Get all processes *DatadogAPIClient::V2::RolesApi* | [**add_permission_to_role**](RolesApi.md#add_permission_to_role) | **POST** /api/v2/roles/{role_id}/permissions | Grant permission to a role *DatadogAPIClient::V2::RolesApi* | [**add_user_to_role**](RolesApi.md#add_user_to_role) | **POST** /api/v2/roles/{role_id}/users | Add a user to a role @@ -344,6 +346,15 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V2::LogsSortOrder](LogsSortOrder.md) - [DatadogAPIClient::V2::LogsWarning](LogsWarning.md) - [DatadogAPIClient::V2::Metric](Metric.md) + - [DatadogAPIClient::V2::MetricAllTags](MetricAllTags.md) + - [DatadogAPIClient::V2::MetricAllTagsAttributes](MetricAllTagsAttributes.md) + - [DatadogAPIClient::V2::MetricAllTagsResponse](MetricAllTagsResponse.md) + - [DatadogAPIClient::V2::MetricDistinctVolume](MetricDistinctVolume.md) + - [DatadogAPIClient::V2::MetricDistinctVolumeAttributes](MetricDistinctVolumeAttributes.md) + - [DatadogAPIClient::V2::MetricDistinctVolumeType](MetricDistinctVolumeType.md) + - [DatadogAPIClient::V2::MetricIngestedIndexedVolume](MetricIngestedIndexedVolume.md) + - [DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes](MetricIngestedIndexedVolumeAttributes.md) + - [DatadogAPIClient::V2::MetricIngestedIndexedVolumeType](MetricIngestedIndexedVolumeType.md) - [DatadogAPIClient::V2::MetricTagConfiguration](MetricTagConfiguration.md) - [DatadogAPIClient::V2::MetricTagConfigurationAttributes](MetricTagConfigurationAttributes.md) - [DatadogAPIClient::V2::MetricTagConfigurationCreateAttributes](MetricTagConfigurationCreateAttributes.md) @@ -356,6 +367,8 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V2::MetricTagConfigurationUpdateData](MetricTagConfigurationUpdateData.md) - [DatadogAPIClient::V2::MetricTagConfigurationUpdateRequest](MetricTagConfigurationUpdateRequest.md) - [DatadogAPIClient::V2::MetricType](MetricType.md) + - [DatadogAPIClient::V2::MetricVolumes](MetricVolumes.md) + - [DatadogAPIClient::V2::MetricVolumesResponse](MetricVolumesResponse.md) - [DatadogAPIClient::V2::MetricsAndMetricTagConfigurations](MetricsAndMetricTagConfigurations.md) - [DatadogAPIClient::V2::MetricsAndMetricTagConfigurationsResponse](MetricsAndMetricTagConfigurationsResponse.md) - [DatadogAPIClient::V2::Organization](Organization.md) diff --git a/features/v1/metrics.feature b/features/v1/metrics.feature index 0bfa45b1481d..598ea2aaa168 100644 --- a/features/v1/metrics.feature +++ b/features/v1/metrics.feature @@ -2,11 +2,12 @@ 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 **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. + 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 diff --git a/features/v2/metrics.feature b/features/v2/metrics.feature index 7e6fbb619bca..3a0c426da168 100644 --- a/features/v2/metrics.feature +++ b/features/v2/metrics.feature @@ -2,11 +2,12 @@ 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 **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. + 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 @@ -14,7 +15,7 @@ Feature: Metrics And an instance of "Metrics" API @generated @skip - Scenario: Create a Tag Configuration returns "Bad Request" response + Scenario: Create a tag configuration returns "Bad Request" response Given operation "CreateTagConfiguration" enabled And new "CreateTagConfiguration" request And request contains "metric_name" parameter from "" @@ -23,7 +24,7 @@ Feature: Metrics Then the response status is 400 Bad Request @generated @skip - Scenario: Create a Tag Configuration returns "Conflict" response + Scenario: Create a tag configuration returns "Conflict" response Given operation "CreateTagConfiguration" enabled And new "CreateTagConfiguration" request And request contains "metric_name" parameter from "" @@ -31,7 +32,7 @@ Feature: Metrics When the request is sent Then the response status is 409 Conflict - Scenario: Create a Tag Configuration returns "Created" response + Scenario: Create a tag configuration returns "Created" response Given operation "CreateTagConfiguration" enabled And new "CreateTagConfiguration" request And request contains "metric_name" parameter with value "{{ unique_alnum }}" @@ -40,7 +41,7 @@ Feature: Metrics Then the response status is 201 Created @generated @skip - Scenario: Create a Tag Configuration returns "Too Many Requests" response + Scenario: Create a tag configuration returns "Too Many Requests" response Given operation "CreateTagConfiguration" enabled And new "CreateTagConfiguration" request And request contains "metric_name" parameter from "" @@ -48,7 +49,7 @@ Feature: Metrics When the request is sent Then the response status is 429 Too Many Requests - Scenario: Delete a Tag Configuration returns "No Content" response + Scenario: Delete a tag configuration returns "No Content" response Given there is a valid "metric_tag_configuration" in the system And operation "DeleteTagConfiguration" enabled And new "DeleteTagConfiguration" request @@ -57,7 +58,7 @@ Feature: Metrics Then the response status is 204 No Content @generated @skip - Scenario: Delete a Tag Configuration returns "Not found" response + Scenario: Delete a tag configuration returns "Not found" response Given operation "DeleteTagConfiguration" enabled And new "DeleteTagConfiguration" request And request contains "metric_name" parameter from "" @@ -65,7 +66,7 @@ Feature: Metrics Then the response status is 404 Not found @generated @skip - Scenario: Delete a Tag Configuration returns "Too Many Requests" response + Scenario: Delete a tag configuration returns "Too Many Requests" response Given operation "DeleteTagConfiguration" enabled And new "DeleteTagConfiguration" request And request contains "metric_name" parameter from "" @@ -73,14 +74,47 @@ Feature: Metrics Then the response status is 429 Too Many Requests @generated @skip - Scenario: List Tag Configuration by Name returns "Not Found" response + Scenario: List distinct metric volumes by metric name returns "Bad Request" response + Given operation "ListVolumesByMetricName" enabled + And new "ListVolumesByMetricName" request + And request contains "metric_name" parameter from "" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip + Scenario: List distinct metric volumes by metric name returns "Not Found" response + Given operation "ListVolumesByMetricName" enabled + And new "ListVolumesByMetricName" request + And request contains "metric_name" parameter from "" + When the request is sent + Then the response status is 404 Not Found + + Scenario: List distinct metric volumes by metric name returns "Success" response + Given there is a valid "metric_tag_configuration" in the system + And operation "ListVolumesByMetricName" enabled + And new "ListVolumesByMetricName" request + And request contains "metric_name" parameter from "metric_tag_configuration.data.id" + When the request is sent + Then the response status is 200 Success + And the response "data.id" has the same value as "metric_tag_configuration.data.id" + + @generated @skip + Scenario: List distinct metric volumes by metric name returns "Too Many Requests" response + Given operation "ListVolumesByMetricName" enabled + And new "ListVolumesByMetricName" request + And request contains "metric_name" parameter from "" + When the request is sent + Then the response status is 429 Too Many Requests + + @generated @skip + Scenario: List tag configuration by name returns "Not Found" response Given operation "ListTagConfigurationByName" enabled And new "ListTagConfigurationByName" request And request contains "metric_name" parameter from "" When the request is sent Then the response status is 404 Not Found - Scenario: List Tag Configuration by Name returns "Success" response + Scenario: List tag configuration by name returns "Success" response Given there is a valid "metric_tag_configuration" in the system And operation "ListTagConfigurationByName" enabled And new "ListTagConfigurationByName" request @@ -90,7 +124,7 @@ Feature: Metrics And the response "data.id" has the same value as "metric_tag_configuration.data.id" @generated @skip - Scenario: List Tag Configuration by Name returns "Too Many Requests" response + Scenario: List tag configuration by name returns "Too Many Requests" response Given operation "ListTagConfigurationByName" enabled And new "ListTagConfigurationByName" request And request contains "metric_name" parameter from "" @@ -98,13 +132,13 @@ Feature: Metrics Then the response status is 429 Too Many Requests @generated @skip - Scenario: List Tag Configurations returns "Bad Request" response + Scenario: List tag configurations returns "Bad Request" response Given operation "ListTagConfigurations" enabled And new "ListTagConfigurations" request When the request is sent Then the response status is 400 Bad Request - Scenario: List Tag Configurations returns "Success" response + Scenario: List tag configurations returns "Success" response Given there is a valid "metric_tag_configuration" in the system And operation "ListTagConfigurations" enabled And new "ListTagConfigurations" request @@ -114,14 +148,47 @@ Feature: Metrics And the response "data[0].id" has the same value as "metric_tag_configuration.data.id" @generated @skip - Scenario: List Tag Configurations returns "Too Many Requests" response + Scenario: List tag configurations returns "Too Many Requests" response Given operation "ListTagConfigurations" enabled And new "ListTagConfigurations" request When the request is sent Then the response status is 429 Too Many Requests @generated @skip - Scenario: Update a Tag Configuration returns "Bad Request" response + Scenario: List tags by metric name returns "Bad Request" response + Given operation "ListTagsByMetricName" enabled + And new "ListTagsByMetricName" request + And request contains "metric_name" parameter from "" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip + Scenario: List tags by metric name returns "Not Found" response + Given operation "ListTagsByMetricName" enabled + And new "ListTagsByMetricName" request + And request contains "metric_name" parameter from "" + When the request is sent + Then the response status is 404 Not Found + + Scenario: List tags by metric name returns "Success" response + Given there is a valid "metric_tag_configuration" in the system + And operation "ListTagsByMetricName" enabled + And new "ListTagsByMetricName" request + And request contains "metric_name" parameter from "metric_tag_configuration.data.id" + When the request is sent + Then the response status is 200 Success + And the response "data.id" has the same value as "metric_tag_configuration.data.id" + + @generated @skip + Scenario: List tags by metric name returns "Too Many Requests" response + Given operation "ListTagsByMetricName" enabled + And new "ListTagsByMetricName" request + And request contains "metric_name" parameter from "" + When the request is sent + Then the response status is 429 Too Many Requests + + @generated @skip + Scenario: Update a tag configuration returns "Bad Request" response Given operation "UpdateTagConfiguration" enabled And new "UpdateTagConfiguration" request And request contains "metric_name" parameter from "" @@ -129,7 +196,7 @@ Feature: Metrics When the request is sent Then the response status is 400 Bad Request - Scenario: Update a Tag Configuration returns "OK" response + Scenario: Update a tag configuration returns "OK" response Given operation "UpdateTagConfiguration" enabled And there is a valid "metric_tag_configuration" in the system And new "UpdateTagConfiguration" request @@ -140,7 +207,7 @@ Feature: Metrics And the response "data.attributes.tags[0]" is equal to "app" @generated @skip - Scenario: Update a Tag Configuration returns "Too Many Requests" response + Scenario: Update a tag configuration returns "Too Many Requests" response Given operation "UpdateTagConfiguration" enabled And new "UpdateTagConfiguration" request And request contains "metric_name" parameter from "" @@ -149,7 +216,7 @@ Feature: Metrics Then the response status is 429 Too Many Requests @generated @skip - Scenario: Update a Tag Configuration returns "Unprocessable Entity" response + Scenario: Update a tag configuration returns "Unprocessable Entity" response Given operation "UpdateTagConfiguration" enabled And new "UpdateTagConfiguration" request And request contains "metric_name" parameter from "" diff --git a/features/v2/undo.json b/features/v2/undo.json index a9e69cb2da56..a4789c8720eb 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -280,6 +280,12 @@ "type": "safe" } }, + "ListTagsByMetricName": { + "tag": "Metrics", + "undo": { + "type": "safe" + } + }, "DeleteTagConfiguration": { "tag": "Metrics", "undo": { @@ -311,6 +317,12 @@ "type": "unsafe" } }, + "ListVolumesByMetricName": { + "tag": "Metrics", + "undo": { + "type": "safe" + } + }, "ListPermissions": { "tag": "Roles", "undo": { diff --git a/lib/datadog_api_client/v2.rb b/lib/datadog_api_client/v2.rb index 3637efbea247..23c1e3f215c0 100644 --- a/lib/datadog_api_client/v2.rb +++ b/lib/datadog_api_client/v2.rb @@ -190,6 +190,15 @@ require 'datadog_api_client/v2/models/logs_sort_order' require 'datadog_api_client/v2/models/logs_warning' require 'datadog_api_client/v2/models/metric' +require 'datadog_api_client/v2/models/metric_all_tags' +require 'datadog_api_client/v2/models/metric_all_tags_attributes' +require 'datadog_api_client/v2/models/metric_all_tags_response' +require 'datadog_api_client/v2/models/metric_distinct_volume' +require 'datadog_api_client/v2/models/metric_distinct_volume_attributes' +require 'datadog_api_client/v2/models/metric_distinct_volume_type' +require 'datadog_api_client/v2/models/metric_ingested_indexed_volume' +require 'datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes' +require 'datadog_api_client/v2/models/metric_ingested_indexed_volume_type' require 'datadog_api_client/v2/models/metric_tag_configuration' require 'datadog_api_client/v2/models/metric_tag_configuration_attributes' require 'datadog_api_client/v2/models/metric_tag_configuration_create_attributes' @@ -202,6 +211,8 @@ require 'datadog_api_client/v2/models/metric_tag_configuration_update_data' require 'datadog_api_client/v2/models/metric_tag_configuration_update_request' require 'datadog_api_client/v2/models/metric_type' +require 'datadog_api_client/v2/models/metric_volumes' +require 'datadog_api_client/v2/models/metric_volumes_response' require 'datadog_api_client/v2/models/metrics_and_metric_tag_configurations' require 'datadog_api_client/v2/models/metrics_and_metric_tag_configurations_response' require 'datadog_api_client/v2/models/organization' diff --git a/lib/datadog_api_client/v2/api/metrics_api.rb b/lib/datadog_api_client/v2/api/metrics_api.rb index 12a38c83576b..cb611b4f0081 100644 --- a/lib/datadog_api_client/v2/api/metrics_api.rb +++ b/lib/datadog_api_client/v2/api/metrics_api.rb @@ -22,7 +22,7 @@ class MetricsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create a Tag Configuration + # Create a tag configuration # Create and define a list of queryable tag keys for a count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric. Can only be used with application keys of users with the `Manage Tags for Metrics` permission. # @param metric_name [String] The name of the metric. # @param body [MetricTagConfigurationCreateRequest] @@ -33,7 +33,7 @@ def create_tag_configuration(metric_name, body, opts = {}) data end - # Create a Tag Configuration + # Create a tag configuration # Create and define a list of queryable tag keys for a count/gauge/rate/distribution metric. Optionally, include percentile aggregations on any distribution metric. Can only be used with application keys of users with the `Manage Tags for Metrics` permission. # @param metric_name [String] The name of the metric. # @param body [MetricTagConfigurationCreateRequest] @@ -103,7 +103,7 @@ def create_tag_configuration_with_http_info(metric_name, body, opts = {}) return data, status_code, headers end - # Delete a Tag Configuration + # Delete a tag configuration # Deletes a metric's tag configuration. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. # @param metric_name [String] The name of the metric. # @param [Hash] opts the optional parameters @@ -113,7 +113,7 @@ def delete_tag_configuration(metric_name, opts = {}) nil end - # Delete a Tag Configuration + # Delete a tag configuration # Deletes a metric's tag configuration. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. # @param metric_name [String] The name of the metric. # @param [Hash] opts the optional parameters @@ -176,7 +176,7 @@ def delete_tag_configuration_with_http_info(metric_name, opts = {}) return data, status_code, headers end - # List Tag Configuration by Name + # List tag configuration by name # Returns the tag configuration for the given metric name. # @param metric_name [String] The name of the metric. # @param [Hash] opts the optional parameters @@ -186,7 +186,7 @@ def list_tag_configuration_by_name(metric_name, opts = {}) data end - # List Tag Configuration by Name + # List tag configuration by name # Returns the tag configuration for the given metric name. # @param metric_name [String] The name of the metric. # @param [Hash] opts the optional parameters @@ -249,7 +249,7 @@ def list_tag_configuration_by_name_with_http_info(metric_name, opts = {}) return data, status_code, headers end - # List Tag Configurations + # List tag configurations # Returns all configured count/gauge/rate/distribution metric names (with additional filters if specified). # @param [Hash] opts the optional parameters # @option opts [Boolean] :filter_configured Filter metrics that have configured tags. @@ -262,7 +262,7 @@ def list_tag_configurations(opts = {}) data end - # List Tag Configurations + # List tag configurations # Returns all configured count/gauge/rate/distribution metric names (with additional filters if specified). # @param [Hash] opts the optional parameters # @option opts [Boolean] :filter_configured Filter metrics that have configured tags. @@ -328,7 +328,153 @@ def list_tag_configurations_with_http_info(opts = {}) return data, status_code, headers end - # Update a Tag Configuration + # List tags by metric name + # View indexed tag key-value pairs for a given metric name. + # @param metric_name [String] The name of the metric. + # @param [Hash] opts the optional parameters + # @return [MetricAllTagsResponse] + def list_tags_by_metric_name(metric_name, opts = {}) + data, _status_code, _headers = list_tags_by_metric_name_with_http_info(metric_name, opts) + data + end + + # List tags by metric name + # View indexed tag key-value pairs for a given metric name. + # @param metric_name [String] The name of the metric. + # @param [Hash] opts the optional parameters + # @return [Array<(MetricAllTagsResponse, Integer, Hash)>] MetricAllTagsResponse data, response status code and response headers + def list_tags_by_metric_name_with_http_info(metric_name, opts = {}) + + if @api_client.config.unstable_operations.has_key?(:list_tags_by_metric_name) + unstable_enabled = @api_client.config.unstable_operations[:list_tags_by_metric_name] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "list_tags_by_metric_name") + else + raise ApiError.new(message: format("Unstable operation '%s' is disabled", "list_tags_by_metric_name")) + end + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.list_tags_by_metric_name ...' + end + # verify the required parameter 'metric_name' is set + if @api_client.config.client_side_validation && metric_name.nil? + fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsApi.list_tags_by_metric_name" + end + # resource path + local_var_path = '/api/v2/metrics/{metric_name}/all-tags'.sub('{' + 'metric_name' + '}', CGI.escape(metric_name.to_s)) + + # 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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MetricAllTagsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'appKeyAuth'] + + new_options = opts.merge( + :operation => :"MetricsApi.list_tags_by_metric_name", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#list_tags_by_metric_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List distinct metric volumes by metric name + # View distinct metrics volumes for the given metric name. Custom distribution metrics will return both ingested and indexed custom metrics. For Metrics without Limits beta customers, all metrics will return both ingested/indexed volumes. Custom metrics generated in-app from other products will return `null` for ingested volumes. + # @param metric_name [String] The name of the metric. + # @param [Hash] opts the optional parameters + # @return [MetricVolumesResponse] + def list_volumes_by_metric_name(metric_name, opts = {}) + data, _status_code, _headers = list_volumes_by_metric_name_with_http_info(metric_name, opts) + data + end + + # List distinct metric volumes by metric name + # View distinct metrics volumes for the given metric name. Custom distribution metrics will return both ingested and indexed custom metrics. For Metrics without Limits beta customers, all metrics will return both ingested/indexed volumes. Custom metrics generated in-app from other products will return `null` for ingested volumes. + # @param metric_name [String] The name of the metric. + # @param [Hash] opts the optional parameters + # @return [Array<(MetricVolumesResponse, Integer, Hash)>] MetricVolumesResponse data, response status code and response headers + def list_volumes_by_metric_name_with_http_info(metric_name, opts = {}) + + if @api_client.config.unstable_operations.has_key?(:list_volumes_by_metric_name) + unstable_enabled = @api_client.config.unstable_operations[:list_volumes_by_metric_name] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "list_volumes_by_metric_name") + else + raise ApiError.new(message: format("Unstable operation '%s' is disabled", "list_volumes_by_metric_name")) + end + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.list_volumes_by_metric_name ...' + end + # verify the required parameter 'metric_name' is set + if @api_client.config.client_side_validation && metric_name.nil? + fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsApi.list_volumes_by_metric_name" + end + # resource path + local_var_path = '/api/v2/metrics/{metric_name}/volumes'.sub('{' + 'metric_name' + '}', CGI.escape(metric_name.to_s)) + + # 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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MetricVolumesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'appKeyAuth'] + + new_options = opts.merge( + :operation => :"MetricsApi.list_volumes_by_metric_name", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#list_volumes_by_metric_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a tag configuration # Update the tag configuration of a metric or percentile aggregations of a distribution metric. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. # @param metric_name [String] The name of the metric. # @param body [MetricTagConfigurationUpdateRequest] @@ -339,7 +485,7 @@ def update_tag_configuration(metric_name, body, opts = {}) data end - # Update a Tag Configuration + # Update a tag configuration # Update the tag configuration of a metric or percentile aggregations of a distribution metric. Can only be used with application keys from users with the `Manage Tags for Metrics` permission. # @param metric_name [String] The name of the metric. # @param body [MetricTagConfigurationUpdateRequest] diff --git a/lib/datadog_api_client/v2/configuration.rb b/lib/datadog_api_client/v2/configuration.rb index b9c5fd0fea52..02a7b16d1404 100644 --- a/lib/datadog_api_client/v2/configuration.rb +++ b/lib/datadog_api_client/v2/configuration.rb @@ -184,6 +184,8 @@ def initialize delete_tag_configuration: false, list_tag_configuration_by_name: false, list_tag_configurations: false, + list_tags_by_metric_name: false, + list_volumes_by_metric_name: false, update_tag_configuration: false, list_security_monitoring_signals: false, search_security_monitoring_signals: false, diff --git a/lib/datadog_api_client/v2/models/metric_all_tags.rb b/lib/datadog_api_client/v2/models/metric_all_tags.rb new file mode 100644 index 000000000000..53ec4d1c201d --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_all_tags.rb @@ -0,0 +1,243 @@ +=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://openapi-generator.tech + + 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 for a single metric's indexed tags. + class MetricAllTags + attr_accessor :attributes + + # The metric name for this resource. + attr_accessor :id + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'attributes' => :'MetricAllTagsAttributes', + :'id' => :'String', + :'type' => :'MetricType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricAllTags` 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::MetricAllTags`. 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'metrics' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [attributes, id, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_all_tags_attributes.rb b/lib/datadog_api_client/v2/models/metric_all_tags_attributes.rb new file mode 100644 index 000000000000..e0ba31cf98ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_all_tags_attributes.rb @@ -0,0 +1,225 @@ +=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://openapi-generator.tech + + 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 definition of a metric's tags. + class MetricAllTagsAttributes + # List of indexed tag value pairs. + attr_accessor :tags + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tags' => :'tags' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricAllTagsAttributes` 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::MetricAllTagsAttributes`. 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?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tags == o.tags + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tags].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_all_tags_response.rb b/lib/datadog_api_client/v2/models/metric_all_tags_response.rb new file mode 100644 index 000000000000..309d70fbdbab --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_all_tags_response.rb @@ -0,0 +1,222 @@ +=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://openapi-generator.tech + + 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 + # Response object that includes a single metric's indexed tags. + class MetricAllTagsResponse + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'MetricAllTags' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricAllTagsResponse` 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::MetricAllTagsResponse`. 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 + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_distinct_volume.rb b/lib/datadog_api_client/v2/models/metric_distinct_volume.rb new file mode 100644 index 000000000000..d35512d2201c --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_distinct_volume.rb @@ -0,0 +1,243 @@ +=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://openapi-generator.tech + + 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 for a single metric's distinct volume. + class MetricDistinctVolume + attr_accessor :attributes + + # The metric name for this resource. + attr_accessor :id + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'attributes' => :'MetricDistinctVolumeAttributes', + :'id' => :'String', + :'type' => :'MetricDistinctVolumeType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricDistinctVolume` 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::MetricDistinctVolume`. 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'distinct_metric_volumes' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [attributes, id, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_distinct_volume_attributes.rb b/lib/datadog_api_client/v2/models/metric_distinct_volume_attributes.rb new file mode 100644 index 000000000000..a72dde767b68 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_distinct_volume_attributes.rb @@ -0,0 +1,223 @@ +=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://openapi-generator.tech + + 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 definition of a metric's distinct volume. + class MetricDistinctVolumeAttributes + # Distinct volume for the given metric. + attr_accessor :distinct_volume + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'distinct_volume' => :'distinct_volume' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'distinct_volume' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricDistinctVolumeAttributes` 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::MetricDistinctVolumeAttributes`. 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?(:'distinct_volume') + self.distinct_volume = attributes[:'distinct_volume'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + distinct_volume == o.distinct_volume + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [distinct_volume].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_distinct_volume_type.rb b/lib/datadog_api_client/v2/models/metric_distinct_volume_type.rb new file mode 100644 index 000000000000..4ae337d3f940 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_distinct_volume_type.rb @@ -0,0 +1,39 @@ +=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://openapi-generator.tech + + 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 MetricDistinctVolumeType + DISTINCT_METRIC_VOLUMES = "distinct_metric_volumes".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = MetricDistinctVolumeType.constants.select { |c| MetricDistinctVolumeType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #MetricDistinctVolumeType" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume.rb b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume.rb new file mode 100644 index 000000000000..86f369322596 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume.rb @@ -0,0 +1,243 @@ +=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://openapi-generator.tech + + 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 for a single metric's ingested and indexed volume. + class MetricIngestedIndexedVolume + attr_accessor :attributes + + # The metric name for this resource. + attr_accessor :id + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'attributes' => :'MetricIngestedIndexedVolumeAttributes', + :'id' => :'String', + :'type' => :'MetricIngestedIndexedVolumeType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricIngestedIndexedVolume` 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::MetricIngestedIndexedVolume`. 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'metric_volumes' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [attributes, id, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb new file mode 100644 index 000000000000..79fcb6bee243 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_attributes.rb @@ -0,0 +1,233 @@ +=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://openapi-generator.tech + + 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 definition of a metric's ingested and indexed volume. + class MetricIngestedIndexedVolumeAttributes + # Indexed volume for the given metric. + attr_accessor :indexed_volume + + # Ingested volume for the given metric. + attr_accessor :ingested_volume + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'indexed_volume' => :'indexed_volume', + :'ingested_volume' => :'ingested_volume' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'indexed_volume' => :'Integer', + :'ingested_volume' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes` 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::MetricIngestedIndexedVolumeAttributes`. 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?(:'indexed_volume') + self.indexed_volume = attributes[:'indexed_volume'] + end + + if attributes.key?(:'ingested_volume') + self.ingested_volume = attributes[:'ingested_volume'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + indexed_volume == o.indexed_volume && + ingested_volume == o.ingested_volume + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [indexed_volume, ingested_volume].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_type.rb b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_type.rb new file mode 100644 index 000000000000..a8fec465f841 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_ingested_indexed_volume_type.rb @@ -0,0 +1,39 @@ +=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://openapi-generator.tech + + 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 MetricIngestedIndexedVolumeType + METRIC_VOLUMES = "metric_volumes".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = MetricIngestedIndexedVolumeType.constants.select { |c| MetricIngestedIndexedVolumeType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #MetricIngestedIndexedVolumeType" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v2/models/metric_volumes.rb b/lib/datadog_api_client/v2/models/metric_volumes.rb new file mode 100644 index 000000000000..646c082b6ad3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_volumes.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://openapi-generator.tech + + 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 + # Possible response objects for a metric's volume. + module MetricVolumes + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'MetricDistinctVolume', + :'MetricIngestedIndexedVolume' + ] + end + + # Builds the object + # @param [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 defacto 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) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = DatadogAPIClient::V2.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/datadog_api_client/v2/models/metric_volumes_response.rb b/lib/datadog_api_client/v2/models/metric_volumes_response.rb new file mode 100644 index 000000000000..3854ff749636 --- /dev/null +++ b/lib/datadog_api_client/v2/models/metric_volumes_response.rb @@ -0,0 +1,222 @@ +=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://openapi-generator.tech + + 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 + # Response object which includes a single metric's volume. + class MetricVolumesResponse + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'MetricVolumes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricVolumesResponse` 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::MetricVolumesResponse`. 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 + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V2.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/spec/v2/models/metric_all_tags_attributes_spec.rb b/spec/v2/models/metric_all_tags_attributes_spec.rb new file mode 100644 index 000000000000..bfada49d6cb0 --- /dev/null +++ b/spec/v2/models/metric_all_tags_attributes_spec.rb @@ -0,0 +1,37 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricAllTagsAttributes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricAllTagsAttributes do + let(:instance) { DatadogAPIClient::V2::MetricAllTagsAttributes.new } + + describe 'test an instance of MetricAllTagsAttributes' do + it 'should create an instance of MetricAllTagsAttributes' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricAllTagsAttributes) + end + end + describe 'test attribute "tags"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_all_tags_response_spec.rb b/spec/v2/models/metric_all_tags_response_spec.rb new file mode 100644 index 000000000000..0091e6b8b8f1 --- /dev/null +++ b/spec/v2/models/metric_all_tags_response_spec.rb @@ -0,0 +1,37 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricAllTagsResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricAllTagsResponse do + let(:instance) { DatadogAPIClient::V2::MetricAllTagsResponse.new } + + describe 'test an instance of MetricAllTagsResponse' do + it 'should create an instance of MetricAllTagsResponse' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricAllTagsResponse) + end + end + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_all_tags_spec.rb b/spec/v2/models/metric_all_tags_spec.rb new file mode 100644 index 000000000000..f0e484abf43c --- /dev/null +++ b/spec/v2/models/metric_all_tags_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricAllTags +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricAllTags do + let(:instance) { DatadogAPIClient::V2::MetricAllTags.new } + + describe 'test an instance of MetricAllTags' do + it 'should create an instance of MetricAllTags' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricAllTags) + end + end + describe 'test attribute "attributes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_distinct_volume_attributes_spec.rb b/spec/v2/models/metric_distinct_volume_attributes_spec.rb new file mode 100644 index 000000000000..06c3bc34c482 --- /dev/null +++ b/spec/v2/models/metric_distinct_volume_attributes_spec.rb @@ -0,0 +1,37 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricDistinctVolumeAttributes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricDistinctVolumeAttributes do + let(:instance) { DatadogAPIClient::V2::MetricDistinctVolumeAttributes.new } + + describe 'test an instance of MetricDistinctVolumeAttributes' do + it 'should create an instance of MetricDistinctVolumeAttributes' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricDistinctVolumeAttributes) + end + end + describe 'test attribute "distinct_volume"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_distinct_volume_spec.rb b/spec/v2/models/metric_distinct_volume_spec.rb new file mode 100644 index 000000000000..27227171ef1c --- /dev/null +++ b/spec/v2/models/metric_distinct_volume_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricDistinctVolume +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricDistinctVolume do + let(:instance) { DatadogAPIClient::V2::MetricDistinctVolume.new } + + describe 'test an instance of MetricDistinctVolume' do + it 'should create an instance of MetricDistinctVolume' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricDistinctVolume) + end + end + describe 'test attribute "attributes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_distinct_volume_type_spec.rb b/spec/v2/models/metric_distinct_volume_type_spec.rb new file mode 100644 index 000000000000..4361758d0876 --- /dev/null +++ b/spec/v2/models/metric_distinct_volume_type_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricDistinctVolumeType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricDistinctVolumeType do + let(:instance) { DatadogAPIClient::V2::MetricDistinctVolumeType.new } + + describe 'test an instance of MetricDistinctVolumeType' do + it 'should create an instance of MetricDistinctVolumeType' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricDistinctVolumeType) + end + end +end diff --git a/spec/v2/models/metric_ingested_indexed_volume_attributes_spec.rb b/spec/v2/models/metric_ingested_indexed_volume_attributes_spec.rb new file mode 100644 index 000000000000..048e2c9e95bf --- /dev/null +++ b/spec/v2/models/metric_ingested_indexed_volume_attributes_spec.rb @@ -0,0 +1,43 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes do + let(:instance) { DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes.new } + + describe 'test an instance of MetricIngestedIndexedVolumeAttributes' do + it 'should create an instance of MetricIngestedIndexedVolumeAttributes' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricIngestedIndexedVolumeAttributes) + end + end + describe 'test attribute "indexed_volume"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ingested_volume"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_ingested_indexed_volume_spec.rb b/spec/v2/models/metric_ingested_indexed_volume_spec.rb new file mode 100644 index 000000000000..915c085372be --- /dev/null +++ b/spec/v2/models/metric_ingested_indexed_volume_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricIngestedIndexedVolume +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricIngestedIndexedVolume do + let(:instance) { DatadogAPIClient::V2::MetricIngestedIndexedVolume.new } + + describe 'test an instance of MetricIngestedIndexedVolume' do + it 'should create an instance of MetricIngestedIndexedVolume' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricIngestedIndexedVolume) + end + end + describe 'test attribute "attributes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_ingested_indexed_volume_type_spec.rb b/spec/v2/models/metric_ingested_indexed_volume_type_spec.rb new file mode 100644 index 000000000000..14f6b2163272 --- /dev/null +++ b/spec/v2/models/metric_ingested_indexed_volume_type_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricIngestedIndexedVolumeType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricIngestedIndexedVolumeType do + let(:instance) { DatadogAPIClient::V2::MetricIngestedIndexedVolumeType.new } + + describe 'test an instance of MetricIngestedIndexedVolumeType' do + it 'should create an instance of MetricIngestedIndexedVolumeType' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricIngestedIndexedVolumeType) + end + end +end diff --git a/spec/v2/models/metric_volumes_response_spec.rb b/spec/v2/models/metric_volumes_response_spec.rb new file mode 100644 index 000000000000..b095f2dffad3 --- /dev/null +++ b/spec/v2/models/metric_volumes_response_spec.rb @@ -0,0 +1,37 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricVolumesResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricVolumesResponse do + let(:instance) { DatadogAPIClient::V2::MetricVolumesResponse.new } + + describe 'test an instance of MetricVolumesResponse' do + it 'should create an instance of MetricVolumesResponse' do + expect(instance).to be_instance_of(DatadogAPIClient::V2::MetricVolumesResponse) + end + end + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v2/models/metric_volumes_spec.rb b/spec/v2/models/metric_volumes_spec.rb new file mode 100644 index 000000000000..0149dd2b5df1 --- /dev/null +++ b/spec/v2/models/metric_volumes_spec.rb @@ -0,0 +1,34 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V2::MetricVolumes +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V2::MetricVolumes do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + end + end +end