From 5eced3f1e5f1b9a2fe8e4378572080053328a09b Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 12 Oct 2020 14:44:13 -0700 Subject: [PATCH] [metricsadvisor] live tests setup (#14396) * add live test yml for metrics advisor * some fixes * hardcode test ids and rerecord a few tests * add ids back as env variables --- .../tests/async_tests/base_testcase_async.py | 24 +++++------ ...test_list_metric_enriched_series_data.yaml | 20 ++++----- ...e_async.test_list_metrics_series_data.yaml | 22 +++++----- .../test_metrics_advisor_client_live_async.py | 4 +- .../tests/base_testcase.py | 24 +++++------ ...test_list_metric_enriched_series_data.yaml | 18 ++++---- ...nt_live.test_list_metrics_series_data.yaml | 20 ++++----- .../tests/test_metrics_advisor_client_live.py | 4 +- sdk/metricsadvisor/tests.yml | 41 +++++++++++++++++++ 9 files changed, 109 insertions(+), 68 deletions(-) create mode 100644 sdk/metricsadvisor/tests.yml diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/base_testcase_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/base_testcase_async.py index 58d35312ba42..8721f9fb6784 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/base_testcase_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/base_testcase_async.py @@ -68,14 +68,14 @@ def __init__(self, method_name): self.http_request_post_url = self.get_settings_value("METRICS_ADVISOR_HTTP_POST_URL") self.application_insights_api_key = self.get_settings_value("METRICS_ADVISOR_APPLICATION_INSIGHTS_API_KEY") self.azure_data_explorer_connection_string = self.get_settings_value("METRICS_ADVISOR_AZURE_DATA_EXPLORER_CONNECTION_STRING") - self.influxdb_connection_string = self.get_settings_value("METRICS_ADVISOR_INFLUXDB_CONNECTION_STRING") - self.influxdb_password = self.get_settings_value("METRICS_ADVISOR_INFLUXDB_PASSWORD") + self.influxdb_connection_string = self.get_settings_value("METRICS_ADVISOR_INFLUX_DB_CONNECTION_STRING") + self.influxdb_password = self.get_settings_value("METRICS_ADVISOR_INFLUX_DB_PASSWORD") self.azure_datalake_account_key = self.get_settings_value("METRICS_ADVISOR_AZURE_DATALAKE_ACCOUNT_KEY") - self.mongodb_connection_string = self.get_settings_value("METRICS_ADVISOR_AZURE_MONGODB_CONNECTION_STRING") + self.mongodb_connection_string = self.get_settings_value("METRICS_ADVISOR_AZURE_MONGO_DB_CONNECTION_STRING") self.mysql_connection_string = self.get_settings_value("METRICS_ADVISOR_MYSQL_CONNECTION_STRING") self.postgresql_connection_string = self.get_settings_value("METRICS_ADVISOR_POSTGRESQL_CONNECTION_STRING") - self.elasticsearch_auth_header = self.get_settings_value("METRICS_ADVISOR_ELASTICSEARCH_AUTH") - self.anomaly_detection_configuration_id = self.get_settings_value("ANOMALY_DETECTION_CONFIGURATION_ID") + self.elasticsearch_auth_header = self.get_settings_value("METRICS_ADVISOR_ELASTICSEARCH_AUTH_HEADER") + self.anomaly_detection_configuration_id = self.get_settings_value("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") self.data_feed_id = self.get_settings_value("METRICS_ADVISOR_DATA_FEED_ID") self.metric_id = self.get_settings_value("METRICS_ADVISOR_METRIC_ID") self.scrubber.register_name_pair( @@ -428,13 +428,13 @@ def __init__(self, method_name): service_endpoint = self.get_settings_value("METRICS_ADVISOR_ENDPOINT") subscription_key = self.get_settings_value("METRICS_ADVISOR_SUBSCRIPTION_KEY") api_key = self.get_settings_value("METRICS_ADVISOR_API_KEY") - self.anomaly_detection_configuration_id = self.get_settings_value("ANOMALY_DETECTION_CONFIGURATION_ID") - self.anomaly_alert_configuration_id = self.get_settings_value("ANOMALY_ALERT_CONFIGURATION_ID") - self.metric_id = self.get_settings_value("METRIC_ID") - self.incident_id = self.get_settings_value("INCIDENT_ID") - self.dimension_name = self.get_settings_value("DIMENSION_NAME") - self.feedback_id = self.get_settings_value("FEEDBACK_ID") - self.alert_id = self.get_settings_value("ALERT_ID") + self.anomaly_detection_configuration_id = self.get_settings_value("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") + self.anomaly_alert_configuration_id = self.get_settings_value("METRICS_ADVISOR_ANOMALY_ALERT_CONFIGURATION_ID") + self.metric_id = self.get_settings_value("METRICS_ADVISOR_METRIC_ID") + self.incident_id = self.get_settings_value("METRICS_ADVISOR_INCIDENT_ID") + self.dimension_name = self.get_settings_value("METRICS_ADVISOR_DIMENSION_NAME") + self.feedback_id = self.get_settings_value("METRICS_ADVISOR_FEEDBACK_ID") + self.alert_id = self.get_settings_value("METRICS_ADVISOR_ALERT_ID") self.scrubber.register_name_pair( self.anomaly_detection_configuration_id, "anomaly_detection_configuration_id" diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metric_enriched_series_data.yaml b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metric_enriched_series_data.yaml index 65ca8471064e..f2bd249c3127 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metric_enriched_series_data.yaml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metric_enriched_series_data.yaml @@ -1,32 +1,32 @@ interactions: - request: body: '{"startTime": "2020-01-01T00:00:00.000Z", "endTime": "2020-09-09T00:00:00.000Z", - "series": [{"dimension": {"city": "city"}}]}' + "series": [{"dimension": {"dimension_name": "Common Lime"}}]}' headers: Accept: - application/json Content-Length: - - '125' + - '132' Content-Type: - application/json User-Agent: - - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) method: POST uri: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/enrichment/anomalyDetection/configurations/anomaly_detection_configuration_id/series/query response: body: - string: '{"value":[{"series":{"dimension":{"city":"city"}},"timestampList":[],"valueList":[],"isAnomalyList":[],"periodList":[],"expectedValueList":[],"lowerBoundaryList":[],"upperBoundaryList":[]}]}' + string: '{"value":[{"series":{"dimension":{"dimension_name":"Common Lime"}},"timestampList":[],"valueList":[],"isAnomalyList":[],"periodList":[],"expectedValueList":[],"lowerBoundaryList":[],"upperBoundaryList":[]}]}' headers: - apim-request-id: e38d671d-e46f-45cd-a755-02054d4bab34 - content-length: '190' + apim-request-id: a6634fbd-31a3-4db2-b7b2-934f2fa4a127 + content-length: '197' content-type: application/json; charset=utf-8 - date: Mon, 21 Sep 2020 16:55:13 GMT + date: Mon, 12 Oct 2020 19:26:30 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '379' - x-request-id: e38d671d-e46f-45cd-a755-02054d4bab34 + x-envoy-upstream-service-time: '5701' + x-request-id: a6634fbd-31a3-4db2-b7b2-934f2fa4a127 status: code: 200 message: OK - url: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/enrichment/anomalyDetection/configurations/c0f2539f-b804-4ab9-a70f-0da0c89c76d8/series/query + url: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com//metricsadvisor/v1.0/enrichment/anomalyDetection/configurations/c0f2539f-b804-4ab9-a70f-0da0c89c76d8/series/query version: 1 diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metrics_series_data.yaml b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metrics_series_data.yaml index f17109c6513a..65f122fb36ab 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metrics_series_data.yaml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/recordings/test_metrics_advisor_client_live_async.test_list_metrics_series_data.yaml @@ -1,33 +1,33 @@ interactions: - request: body: '{"startTime": "2020-01-01T00:00:00.000Z", "endTime": "2020-09-09T00:00:00.000Z", - "series": [{"city": "Mumbai", "category": "Shoes Handbags & Sunglasses"}]}' + "series": [{"dimension_name": "Common Lime", "Dim2": "African buffalo"}]}' headers: Accept: - application/json Content-Length: - - '155' + - '144' Content-Type: - application/json User-Agent: - - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) method: POST uri: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/metrics/metric_id/data/query response: body: - string: '{"value":[{"id":{"metricId":"metric_id","dimension":{"city":"Mumbai","category":"Shoes - Handbags & Sunglasses"}},"timestampList":[],"valueList":[]}]}' + string: '{"value":[{"id":{"metricId":"metric_id","dimension":{"dimension_name":"Common + Lime","Dim2":"African buffalo"}},"timestampList":["2020-01-01T00:00:00Z","2020-01-02T00:00:00Z","2020-01-03T00:00:00Z","2020-01-04T00:00:00Z","2020-01-05T00:00:00Z","2020-01-06T00:00:00Z","2020-01-07T00:00:00Z","2020-01-08T00:00:00Z","2020-01-09T00:00:00Z","2020-01-10T00:00:00Z","2020-01-11T00:00:00Z","2020-01-12T00:00:00Z","2020-01-13T00:00:00Z","2020-01-14T00:00:00Z","2020-01-15T00:00:00Z","2020-01-16T00:00:00Z","2020-01-17T00:00:00Z","2020-01-18T00:00:00Z","2020-01-19T00:00:00Z","2020-01-20T00:00:00Z","2020-01-21T00:00:00Z","2020-01-22T00:00:00Z","2020-01-23T00:00:00Z","2020-01-24T00:00:00Z","2020-01-25T00:00:00Z","2020-01-26T00:00:00Z","2020-01-27T00:00:00Z","2020-01-28T00:00:00Z","2020-01-29T00:00:00Z","2020-01-30T00:00:00Z","2020-01-31T00:00:00Z","2020-02-01T00:00:00Z","2020-02-02T00:00:00Z","2020-02-03T00:00:00Z","2020-02-04T00:00:00Z","2020-02-05T00:00:00Z","2020-02-06T00:00:00Z","2020-02-07T00:00:00Z","2020-02-08T00:00:00Z","2020-02-09T00:00:00Z","2020-02-10T00:00:00Z","2020-02-11T00:00:00Z","2020-02-12T00:00:00Z","2020-02-13T00:00:00Z","2020-02-14T00:00:00Z","2020-02-15T00:00:00Z","2020-02-16T00:00:00Z","2020-02-17T00:00:00Z","2020-02-18T00:00:00Z","2020-02-19T00:00:00Z","2020-02-20T00:00:00Z","2020-02-21T00:00:00Z","2020-02-22T00:00:00Z","2020-02-23T00:00:00Z","2020-02-24T00:00:00Z","2020-02-25T00:00:00Z","2020-02-26T00:00:00Z","2020-02-27T00:00:00Z","2020-02-28T00:00:00Z","2020-02-29T00:00:00Z","2020-03-01T00:00:00Z","2020-03-02T00:00:00Z","2020-03-03T00:00:00Z","2020-03-04T00:00:00Z","2020-03-05T00:00:00Z","2020-03-06T00:00:00Z","2020-03-07T00:00:00Z","2020-03-08T00:00:00Z","2020-03-09T00:00:00Z","2020-03-10T00:00:00Z","2020-03-11T00:00:00Z","2020-03-12T00:00:00Z","2020-03-13T00:00:00Z","2020-03-14T00:00:00Z","2020-03-15T00:00:00Z","2020-03-16T00:00:00Z","2020-03-17T00:00:00Z","2020-03-18T00:00:00Z","2020-03-19T00:00:00Z","2020-03-20T00:00:00Z","2020-03-21T00:00:00Z","2020-03-22T00:00:00Z","2020-03-23T00:00:00Z","2020-03-24T00:00:00Z","2020-03-26T00:00:00Z","2020-03-27T00:00:00Z","2020-03-28T00:00:00Z","2020-03-29T00:00:00Z","2020-03-30T00:00:00Z","2020-03-31T00:00:00Z","2020-04-01T00:00:00Z","2020-04-02T00:00:00Z","2020-04-03T00:00:00Z","2020-04-04T00:00:00Z","2020-04-05T00:00:00Z","2020-04-06T00:00:00Z","2020-04-07T00:00:00Z","2020-04-08T00:00:00Z","2020-04-09T00:00:00Z","2020-04-10T00:00:00Z","2020-04-11T00:00:00Z","2020-04-12T00:00:00Z","2020-04-13T00:00:00Z","2020-04-14T00:00:00Z","2020-04-15T00:00:00Z","2020-04-16T00:00:00Z","2020-04-17T00:00:00Z","2020-04-18T00:00:00Z","2020-04-19T00:00:00Z","2020-04-20T00:00:00Z","2020-04-21T00:00:00Z","2020-04-22T00:00:00Z","2020-04-23T00:00:00Z","2020-04-24T00:00:00Z","2020-04-25T00:00:00Z","2020-04-26T00:00:00Z","2020-04-27T00:00:00Z","2020-04-28T00:00:00Z","2020-04-29T00:00:00Z","2020-04-30T00:00:00Z","2020-05-01T00:00:00Z","2020-05-02T00:00:00Z","2020-05-03T00:00:00Z","2020-05-04T00:00:00Z","2020-05-05T00:00:00Z","2020-05-06T00:00:00Z","2020-05-07T00:00:00Z","2020-05-08T00:00:00Z","2020-05-09T00:00:00Z","2020-05-10T00:00:00Z","2020-05-11T00:00:00Z","2020-05-12T00:00:00Z","2020-05-13T00:00:00Z","2020-05-14T00:00:00Z","2020-05-15T00:00:00Z","2020-05-16T00:00:00Z","2020-05-17T00:00:00Z","2020-05-18T00:00:00Z","2020-05-19T00:00:00Z","2020-05-20T00:00:00Z","2020-05-21T00:00:00Z","2020-05-22T00:00:00Z","2020-05-23T00:00:00Z","2020-05-24T00:00:00Z","2020-05-25T00:00:00Z","2020-05-26T00:00:00Z","2020-05-27T00:00:00Z","2020-05-28T00:00:00Z","2020-05-29T00:00:00Z","2020-05-30T00:00:00Z","2020-05-31T00:00:00Z","2020-06-01T00:00:00Z","2020-06-02T00:00:00Z","2020-06-03T00:00:00Z","2020-06-04T00:00:00Z","2020-06-05T00:00:00Z","2020-06-06T00:00:00Z","2020-06-07T00:00:00Z","2020-06-08T00:00:00Z","2020-06-09T00:00:00Z","2020-06-10T00:00:00Z","2020-06-11T00:00:00Z","2020-06-12T00:00:00Z","2020-06-13T00:00:00Z","2020-06-14T00:00:00Z","2020-06-15T00:00:00Z","2020-06-16T00:00:00Z","2020-06-17T00:00:00Z","2020-06-18T00:00:00Z","2020-06-19T00:00:00Z","2020-06-20T00:00:00Z","2020-06-21T00:00:00Z","2020-06-22T00:00:00Z","2020-06-23T00:00:00Z","2020-06-24T00:00:00Z","2020-06-25T00:00:00Z","2020-06-26T00:00:00Z","2020-06-27T00:00:00Z","2020-06-28T00:00:00Z","2020-06-29T00:00:00Z","2020-06-30T00:00:00Z","2020-07-01T00:00:00Z","2020-07-02T00:00:00Z","2020-07-03T00:00:00Z","2020-07-04T00:00:00Z","2020-07-05T00:00:00Z","2020-07-06T00:00:00Z","2020-07-07T00:00:00Z","2020-07-08T00:00:00Z","2020-07-09T00:00:00Z","2020-07-10T00:00:00Z","2020-07-11T00:00:00Z","2020-07-12T00:00:00Z","2020-07-13T00:00:00Z","2020-07-14T00:00:00Z","2020-07-15T00:00:00Z","2020-07-16T00:00:00Z","2020-07-17T00:00:00Z","2020-07-18T00:00:00Z","2020-07-19T00:00:00Z","2020-07-20T00:00:00Z","2020-07-21T00:00:00Z","2020-07-22T00:00:00Z","2020-07-23T00:00:00Z","2020-07-24T00:00:00Z","2020-07-25T00:00:00Z","2020-07-26T00:00:00Z","2020-07-28T00:00:00Z","2020-07-29T00:00:00Z","2020-07-30T00:00:00Z","2020-07-31T00:00:00Z","2020-08-01T00:00:00Z","2020-08-02T00:00:00Z","2020-08-03T00:00:00Z","2020-08-04T00:00:00Z","2020-08-05T00:00:00Z","2020-08-06T00:00:00Z","2020-08-07T00:00:00Z","2020-08-08T00:00:00Z","2020-08-09T00:00:00Z","2020-08-10T00:00:00Z","2020-08-11T00:00:00Z","2020-08-12T00:00:00Z","2020-08-13T00:00:00Z","2020-08-14T00:00:00Z","2020-08-15T00:00:00Z","2020-08-16T00:00:00Z","2020-08-17T00:00:00Z","2020-08-18T00:00:00Z","2020-08-19T00:00:00Z","2020-08-20T00:00:00Z","2020-08-21T00:00:00Z","2020-08-22T00:00:00Z","2020-08-23T00:00:00Z","2020-08-24T00:00:00Z","2020-08-25T00:00:00Z","2020-08-26T00:00:00Z","2020-08-27T00:00:00Z","2020-08-28T00:00:00Z","2020-08-29T00:00:00Z","2020-08-30T00:00:00Z","2020-08-31T00:00:00Z","2020-09-01T00:00:00Z","2020-09-02T00:00:00Z","2020-09-03T00:00:00Z","2020-09-04T00:00:00Z","2020-09-05T00:00:00Z","2020-09-06T00:00:00Z","2020-09-07T00:00:00Z","2020-09-08T00:00:00Z"],"valueList":[7854850.800000001,11851700.0,11284033.0,9402787.200000001,9478130.0,14726500.600000001,16313667.200000001,15318459.8,15704612.8,14138480.8,9565602.200000001,10473989.600000001,15341320.8,15731336.8,15977300.0,16195569.600000001,14259638.600000001,9610269.0,10373597.600000001,16009645.0,15317262.8,16282958.200000001,15910257.4,13633258.200000001,9512735.0,10650016.200000001,16320904.200000001,16184360.600000001,15444507.4,15153126.8,13929597.600000001,9196932.200000001,10311248.4,16239479.200000001,15557522.0,15747650.8,14025890.8,12542470.8,8919166.8,10933434.600000001,15147589.0,15293700.200000001,15714501.200000001,15020104.4,12291352.8,9646224.200000001,10035271.6,14147478.4,13696033.600000001,14264729.0,14965573.600000001,13129416.8,9217183.6,9976889.4,15302997.200000001,15277996.200000001,14831796.600000001,15884461.200000001,13753535.8,9714499.4,9913345.4,15754560.600000001,14926305.4,15380605.0,15441719.600000001,13679689.8,9108651.6,9689024.4,16250223.600000001,15457939.8,15431406.8,16016256.8,13374326.200000001,9554079.6,10007615.4,16322626.8,16918545.8,16437928.0,16900578.0,14866695.4,10092403.0,10569827.0,20898025.0,20860358.400000002,19595481.0,16765411.0,10932949.8,12312259.600000001,19595135.8,17490434.6,18341139.0,19246726.6,17228383.6,11288914.8,10857898.8,16741690.4,15487843.4,15309001.600000001,14572264.200000001,10675005.0,9937299.4,10677299.4,12320819.200000001,15472227.0,15887236.4,15634259.600000001,15071490.4,12184452.600000001,11410264.8,18611939.2,18900609.8,17973650.400000002,18115690.6,15743904.4,10895736.4,11118896.8,19481619.2,20217109.0,19874497.6,20249933.0,19140980.2,12534667.600000001,13178879.0,20035173.400000002,20459106.0,19607923.400000002,19040986.400000002,12894159.200000001,11512563.600000001,12889099.0,20255684.6,21143846.200000003,19408511.0,18813865.8,17616761.8,11994004.600000001,11763333.0,18478424.8,17803044.8,17695425.8,18191694.400000002,17529708.400000002,12188561.600000001,10779704.4,11148547.8,15109668.8,15281866.8,14601456.4,14463524.4,10327891.600000001,10889339.8,17417491.6,16884522.8,19740214.8,19605459.400000002,17485772.8,12034595.600000001,12351505.200000001,18642203.0,18140215.400000002,19904796.6,20266572.6,17652276.400000002,10769635.200000001,11391018.0,19210187.0,18373197.400000002,19113857.0,19472034.6,17320471.6,11290738.4,11572349.4,17919376.2,16919929.2,17328292.400000002,15879806.200000001,15447272.600000001,11692120.200000001,12082901.0,17925372.2,18508991.6,17327061.8,17918057.2,17023012.400000002,11408163.4,11509009.600000001,17390291.8,17105059.400000002,17857243.400000002,16910108.2,14251733.0,9868058.200000001,10095415.600000001,16437912.0,16088477.0,16329950.0,15289834.0,13389251.200000001,9835769.200000001,10338422.8,15295568.200000001,14883422.4,14586111.200000001,14800721.4,13025176.600000001,10454889.200000001,10507729.600000001,14593264.8,13967648.0,38292884.6,11884509.4,9134974.6,9633951.0,13988339.0,14273325.4,13407748.0,12959531.200000001,11605750.8,8266370.800000001,9377140.6,13773464.0,13803502.600000001,13442921.0,13933631.0,12665234.8,9541988.200000001,10255369.200000001,14368218.200000001,13860647.0,13907949.0,13018104.4,12609829.600000001,9237317.4,10042807.200000001,13923284.4,14434924.8,13736635.0,13640096.200000001,12188965.0,8978845.8,9034608.0,10411126.0,13956154.200000001,14289103.200000001,14393151.4,13125172.200000001,9359021.200000001,9878885.4,14689277.200000001,14303029.600000001]}]}' headers: - apim-request-id: 6f6023a8-9b7d-4c1c-8bab-490028dc0bb8 - content-length: '175' + apim-request-id: 51765e6e-bb9b-49bc-8b9d-2ac5ce910aa3 + content-length: '9353' content-type: application/json; charset=utf-8 - date: Mon, 21 Sep 2020 16:55:14 GMT + date: Mon, 12 Oct 2020 19:28:17 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '434' - x-request-id: 6f6023a8-9b7d-4c1c-8bab-490028dc0bb8 + x-envoy-upstream-service-time: '861' + x-request-id: 51765e6e-bb9b-49bc-8b9d-2ac5ce910aa3 status: code: 200 message: OK - url: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/metrics/3d48ed3e-6e6e-4391-b78f-b00dfee1e6f5/data/query + url: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com//metricsadvisor/v1.0/metrics/3d48ed3e-6e6e-4391-b78f-b00dfee1e6f5/data/query version: 1 diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_metrics_advisor_client_live_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_metrics_advisor_client_live_async.py index 94982b288bb3..b012921895cc 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_metrics_advisor_client_live_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/async_tests/test_metrics_advisor_client_live_async.py @@ -88,7 +88,7 @@ async def test_list_incident_root_cause(self): @TestMetricsAdvisorClientBaseAsync.await_prepared_test async def test_list_metric_enriched_series_data(self): async with self.client: - series_identity = {"city":"city"} + series_identity = {"Dim1": "Common Lime"} results = self.client.list_metric_enriched_series_data( detection_configuration_id=self.anomaly_detection_configuration_id, start_time=datetime.datetime(2020, 1, 1), @@ -135,7 +135,7 @@ async def test_list_metrics_series_data(self): start_time=datetime.datetime(2020, 1, 1), end_time=datetime.datetime(2020, 9, 9), series_to_filter=[ - {"city": "Mumbai", "category": "Shoes Handbags & Sunglasses"} + {"Dim1": "Common Lime", "Dim2": "African buffalo"} ] ) tolist = [] diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/base_testcase.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/base_testcase.py index b2f98b3f88c0..c0f0cf31fe61 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/base_testcase.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/base_testcase.py @@ -62,14 +62,14 @@ def __init__(self, method_name): self.http_request_post_url = self.get_settings_value("METRICS_ADVISOR_HTTP_POST_URL") self.application_insights_api_key = self.get_settings_value("METRICS_ADVISOR_APPLICATION_INSIGHTS_API_KEY") self.azure_data_explorer_connection_string = self.get_settings_value("METRICS_ADVISOR_AZURE_DATA_EXPLORER_CONNECTION_STRING") - self.influxdb_connection_string = self.get_settings_value("METRICS_ADVISOR_INFLUXDB_CONNECTION_STRING") - self.influxdb_password = self.get_settings_value("METRICS_ADVISOR_INFLUXDB_PASSWORD") + self.influxdb_connection_string = self.get_settings_value("METRICS_ADVISOR_INFLUX_DB_CONNECTION_STRING") + self.influxdb_password = self.get_settings_value("METRICS_ADVISOR_INFLUX_DB_PASSWORD") self.azure_datalake_account_key = self.get_settings_value("METRICS_ADVISOR_AZURE_DATALAKE_ACCOUNT_KEY") - self.mongodb_connection_string = self.get_settings_value("METRICS_ADVISOR_AZURE_MONGODB_CONNECTION_STRING") + self.mongodb_connection_string = self.get_settings_value("METRICS_ADVISOR_AZURE_MONGO_DB_CONNECTION_STRING") self.mysql_connection_string = self.get_settings_value("METRICS_ADVISOR_MYSQL_CONNECTION_STRING") self.postgresql_connection_string = self.get_settings_value("METRICS_ADVISOR_POSTGRESQL_CONNECTION_STRING") - self.elasticsearch_auth_header = self.get_settings_value("METRICS_ADVISOR_ELASTICSEARCH_AUTH") - self.anomaly_detection_configuration_id = self.get_settings_value("ANOMALY_DETECTION_CONFIGURATION_ID") + self.elasticsearch_auth_header = self.get_settings_value("METRICS_ADVISOR_ELASTICSEARCH_AUTH_HEADER") + self.anomaly_detection_configuration_id = self.get_settings_value("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") self.data_feed_id = self.get_settings_value("METRICS_ADVISOR_DATA_FEED_ID") self.metric_id = self.get_settings_value("METRICS_ADVISOR_METRIC_ID") self.scrubber.register_name_pair( @@ -409,13 +409,13 @@ def __init__(self, method_name): service_endpoint = self.get_settings_value("METRICS_ADVISOR_ENDPOINT") subscription_key = self.get_settings_value("METRICS_ADVISOR_SUBSCRIPTION_KEY") api_key = self.get_settings_value("METRICS_ADVISOR_API_KEY") - self.anomaly_detection_configuration_id = self.get_settings_value("ANOMALY_DETECTION_CONFIGURATION_ID") - self.anomaly_alert_configuration_id = self.get_settings_value("ANOMALY_ALERT_CONFIGURATION_ID") - self.metric_id = self.get_settings_value("METRIC_ID") - self.incident_id = self.get_settings_value("INCIDENT_ID") - self.dimension_name = self.get_settings_value("DIMENSION_NAME") - self.feedback_id = self.get_settings_value("FEEDBACK_ID") - self.alert_id = self.get_settings_value("ALERT_ID") + self.anomaly_detection_configuration_id = self.get_settings_value("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") + self.anomaly_alert_configuration_id = self.get_settings_value("METRICS_ADVISOR_ANOMALY_ALERT_CONFIGURATION_ID") + self.metric_id = self.get_settings_value("METRICS_ADVISOR_METRIC_ID") + self.incident_id = self.get_settings_value("METRICS_ADVISOR_INCIDENT_ID") + self.dimension_name = self.get_settings_value("METRICS_ADVISOR_DIMENSION_NAME") + self.feedback_id = self.get_settings_value("METRICS_ADVISOR_FEEDBACK_ID") + self.alert_id = self.get_settings_value("METRICS_ADVISOR_ALERT_ID") self.scrubber.register_name_pair( self.anomaly_detection_configuration_id, "anomaly_detection_configuration_id" diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metric_enriched_series_data.yaml b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metric_enriched_series_data.yaml index af30590db27c..93175ded894b 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metric_enriched_series_data.yaml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metric_enriched_series_data.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"startTime": "2020-01-01T00:00:00.000Z", "endTime": "2020-09-09T00:00:00.000Z", - "series": [{"dimension": {"city": "city"}}]}' + "series": [{"dimension": {"dimension_name": "Common Lime"}}]}' headers: Accept: - application/json @@ -10,33 +10,33 @@ interactions: Connection: - keep-alive Content-Length: - - '125' + - '132' Content-Type: - application/json User-Agent: - - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) method: POST uri: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/enrichment/anomalyDetection/configurations/anomaly_detection_configuration_id/series/query response: body: - string: '{"value":[{"series":{"dimension":{"city":"city"}},"timestampList":[],"valueList":[],"isAnomalyList":[],"periodList":[],"expectedValueList":[],"lowerBoundaryList":[],"upperBoundaryList":[]}]}' + string: '{"value":[{"series":{"dimension":{"dimension_name":"Common Lime"}},"timestampList":[],"valueList":[],"isAnomalyList":[],"periodList":[],"expectedValueList":[],"lowerBoundaryList":[],"upperBoundaryList":[]}]}' headers: apim-request-id: - - 524c68e3-cd44-4c61-a893-725f62a2cb04 + - 3522168e-3190-4eca-a234-85848884b36c content-length: - - '190' + - '197' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Sep 2020 16:54:12 GMT + - Mon, 12 Oct 2020 19:21:47 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '199' + - '583' x-request-id: - - 524c68e3-cd44-4c61-a893-725f62a2cb04 + - 3522168e-3190-4eca-a234-85848884b36c status: code: 200 message: OK diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metrics_series_data.yaml b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metrics_series_data.yaml index ecfb08a9235a..322491e3536d 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metrics_series_data.yaml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/recordings/test_metrics_advisor_client_live.test_list_metrics_series_data.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"startTime": "2020-01-01T00:00:00.000Z", "endTime": "2020-09-09T00:00:00.000Z", - "series": [{"city": "Mumbai", "category": "Shoes Handbags & Sunglasses"}]}' + "series": [{"dimension_name": "Common Lime", "Dim2": "African buffalo"}]}' headers: Accept: - application/json @@ -10,34 +10,34 @@ interactions: Connection: - keep-alive Content-Length: - - '155' + - '144' Content-Type: - application/json User-Agent: - - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-metricsadvisor/1.0.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) method: POST uri: https://anuchan-cg-metric-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/metrics/metric_id/data/query response: body: - string: '{"value":[{"id":{"metricId":"metric_id","dimension":{"city":"Mumbai","category":"Shoes - Handbags & Sunglasses"}},"timestampList":[],"valueList":[]}]}' + string: '{"value":[{"id":{"metricId":"metric_id","dimension":{"dimension_name":"Common + Lime","Dim2":"African buffalo"}},"timestampList":["2020-01-01T00:00:00Z","2020-01-02T00:00:00Z","2020-01-03T00:00:00Z","2020-01-04T00:00:00Z","2020-01-05T00:00:00Z","2020-01-06T00:00:00Z","2020-01-07T00:00:00Z","2020-01-08T00:00:00Z","2020-01-09T00:00:00Z","2020-01-10T00:00:00Z","2020-01-11T00:00:00Z","2020-01-12T00:00:00Z","2020-01-13T00:00:00Z","2020-01-14T00:00:00Z","2020-01-15T00:00:00Z","2020-01-16T00:00:00Z","2020-01-17T00:00:00Z","2020-01-18T00:00:00Z","2020-01-19T00:00:00Z","2020-01-20T00:00:00Z","2020-01-21T00:00:00Z","2020-01-22T00:00:00Z","2020-01-23T00:00:00Z","2020-01-24T00:00:00Z","2020-01-25T00:00:00Z","2020-01-26T00:00:00Z","2020-01-27T00:00:00Z","2020-01-28T00:00:00Z","2020-01-29T00:00:00Z","2020-01-30T00:00:00Z","2020-01-31T00:00:00Z","2020-02-01T00:00:00Z","2020-02-02T00:00:00Z","2020-02-03T00:00:00Z","2020-02-04T00:00:00Z","2020-02-05T00:00:00Z","2020-02-06T00:00:00Z","2020-02-07T00:00:00Z","2020-02-08T00:00:00Z","2020-02-09T00:00:00Z","2020-02-10T00:00:00Z","2020-02-11T00:00:00Z","2020-02-12T00:00:00Z","2020-02-13T00:00:00Z","2020-02-14T00:00:00Z","2020-02-15T00:00:00Z","2020-02-16T00:00:00Z","2020-02-17T00:00:00Z","2020-02-18T00:00:00Z","2020-02-19T00:00:00Z","2020-02-20T00:00:00Z","2020-02-21T00:00:00Z","2020-02-22T00:00:00Z","2020-02-23T00:00:00Z","2020-02-24T00:00:00Z","2020-02-25T00:00:00Z","2020-02-26T00:00:00Z","2020-02-27T00:00:00Z","2020-02-28T00:00:00Z","2020-02-29T00:00:00Z","2020-03-01T00:00:00Z","2020-03-02T00:00:00Z","2020-03-03T00:00:00Z","2020-03-04T00:00:00Z","2020-03-05T00:00:00Z","2020-03-06T00:00:00Z","2020-03-07T00:00:00Z","2020-03-08T00:00:00Z","2020-03-09T00:00:00Z","2020-03-10T00:00:00Z","2020-03-11T00:00:00Z","2020-03-12T00:00:00Z","2020-03-13T00:00:00Z","2020-03-14T00:00:00Z","2020-03-15T00:00:00Z","2020-03-16T00:00:00Z","2020-03-17T00:00:00Z","2020-03-18T00:00:00Z","2020-03-19T00:00:00Z","2020-03-20T00:00:00Z","2020-03-21T00:00:00Z","2020-03-22T00:00:00Z","2020-03-23T00:00:00Z","2020-03-24T00:00:00Z","2020-03-26T00:00:00Z","2020-03-27T00:00:00Z","2020-03-28T00:00:00Z","2020-03-29T00:00:00Z","2020-03-30T00:00:00Z","2020-03-31T00:00:00Z","2020-04-01T00:00:00Z","2020-04-02T00:00:00Z","2020-04-03T00:00:00Z","2020-04-04T00:00:00Z","2020-04-05T00:00:00Z","2020-04-06T00:00:00Z","2020-04-07T00:00:00Z","2020-04-08T00:00:00Z","2020-04-09T00:00:00Z","2020-04-10T00:00:00Z","2020-04-11T00:00:00Z","2020-04-12T00:00:00Z","2020-04-13T00:00:00Z","2020-04-14T00:00:00Z","2020-04-15T00:00:00Z","2020-04-16T00:00:00Z","2020-04-17T00:00:00Z","2020-04-18T00:00:00Z","2020-04-19T00:00:00Z","2020-04-20T00:00:00Z","2020-04-21T00:00:00Z","2020-04-22T00:00:00Z","2020-04-23T00:00:00Z","2020-04-24T00:00:00Z","2020-04-25T00:00:00Z","2020-04-26T00:00:00Z","2020-04-27T00:00:00Z","2020-04-28T00:00:00Z","2020-04-29T00:00:00Z","2020-04-30T00:00:00Z","2020-05-01T00:00:00Z","2020-05-02T00:00:00Z","2020-05-03T00:00:00Z","2020-05-04T00:00:00Z","2020-05-05T00:00:00Z","2020-05-06T00:00:00Z","2020-05-07T00:00:00Z","2020-05-08T00:00:00Z","2020-05-09T00:00:00Z","2020-05-10T00:00:00Z","2020-05-11T00:00:00Z","2020-05-12T00:00:00Z","2020-05-13T00:00:00Z","2020-05-14T00:00:00Z","2020-05-15T00:00:00Z","2020-05-16T00:00:00Z","2020-05-17T00:00:00Z","2020-05-18T00:00:00Z","2020-05-19T00:00:00Z","2020-05-20T00:00:00Z","2020-05-21T00:00:00Z","2020-05-22T00:00:00Z","2020-05-23T00:00:00Z","2020-05-24T00:00:00Z","2020-05-25T00:00:00Z","2020-05-26T00:00:00Z","2020-05-27T00:00:00Z","2020-05-28T00:00:00Z","2020-05-29T00:00:00Z","2020-05-30T00:00:00Z","2020-05-31T00:00:00Z","2020-06-01T00:00:00Z","2020-06-02T00:00:00Z","2020-06-03T00:00:00Z","2020-06-04T00:00:00Z","2020-06-05T00:00:00Z","2020-06-06T00:00:00Z","2020-06-07T00:00:00Z","2020-06-08T00:00:00Z","2020-06-09T00:00:00Z","2020-06-10T00:00:00Z","2020-06-11T00:00:00Z","2020-06-12T00:00:00Z","2020-06-13T00:00:00Z","2020-06-14T00:00:00Z","2020-06-15T00:00:00Z","2020-06-16T00:00:00Z","2020-06-17T00:00:00Z","2020-06-18T00:00:00Z","2020-06-19T00:00:00Z","2020-06-20T00:00:00Z","2020-06-21T00:00:00Z","2020-06-22T00:00:00Z","2020-06-23T00:00:00Z","2020-06-24T00:00:00Z","2020-06-25T00:00:00Z","2020-06-26T00:00:00Z","2020-06-27T00:00:00Z","2020-06-28T00:00:00Z","2020-06-29T00:00:00Z","2020-06-30T00:00:00Z","2020-07-01T00:00:00Z","2020-07-02T00:00:00Z","2020-07-03T00:00:00Z","2020-07-04T00:00:00Z","2020-07-05T00:00:00Z","2020-07-06T00:00:00Z","2020-07-07T00:00:00Z","2020-07-08T00:00:00Z","2020-07-09T00:00:00Z","2020-07-10T00:00:00Z","2020-07-11T00:00:00Z","2020-07-12T00:00:00Z","2020-07-13T00:00:00Z","2020-07-14T00:00:00Z","2020-07-15T00:00:00Z","2020-07-16T00:00:00Z","2020-07-17T00:00:00Z","2020-07-18T00:00:00Z","2020-07-19T00:00:00Z","2020-07-20T00:00:00Z","2020-07-21T00:00:00Z","2020-07-22T00:00:00Z","2020-07-23T00:00:00Z","2020-07-24T00:00:00Z","2020-07-25T00:00:00Z","2020-07-26T00:00:00Z","2020-07-28T00:00:00Z","2020-07-29T00:00:00Z","2020-07-30T00:00:00Z","2020-07-31T00:00:00Z","2020-08-01T00:00:00Z","2020-08-02T00:00:00Z","2020-08-03T00:00:00Z","2020-08-04T00:00:00Z","2020-08-05T00:00:00Z","2020-08-06T00:00:00Z","2020-08-07T00:00:00Z","2020-08-08T00:00:00Z","2020-08-09T00:00:00Z","2020-08-10T00:00:00Z","2020-08-11T00:00:00Z","2020-08-12T00:00:00Z","2020-08-13T00:00:00Z","2020-08-14T00:00:00Z","2020-08-15T00:00:00Z","2020-08-16T00:00:00Z","2020-08-17T00:00:00Z","2020-08-18T00:00:00Z","2020-08-19T00:00:00Z","2020-08-20T00:00:00Z","2020-08-21T00:00:00Z","2020-08-22T00:00:00Z","2020-08-23T00:00:00Z","2020-08-24T00:00:00Z","2020-08-25T00:00:00Z","2020-08-26T00:00:00Z","2020-08-27T00:00:00Z","2020-08-28T00:00:00Z","2020-08-29T00:00:00Z","2020-08-30T00:00:00Z","2020-08-31T00:00:00Z","2020-09-01T00:00:00Z","2020-09-02T00:00:00Z","2020-09-03T00:00:00Z","2020-09-04T00:00:00Z","2020-09-05T00:00:00Z","2020-09-06T00:00:00Z","2020-09-07T00:00:00Z","2020-09-08T00:00:00Z"],"valueList":[7854850.800000001,11851700.0,11284033.0,9402787.200000001,9478130.0,14726500.600000001,16313667.200000001,15318459.8,15704612.8,14138480.8,9565602.200000001,10473989.600000001,15341320.8,15731336.8,15977300.0,16195569.600000001,14259638.600000001,9610269.0,10373597.600000001,16009645.0,15317262.8,16282958.200000001,15910257.4,13633258.200000001,9512735.0,10650016.200000001,16320904.200000001,16184360.600000001,15444507.4,15153126.8,13929597.600000001,9196932.200000001,10311248.4,16239479.200000001,15557522.0,15747650.8,14025890.8,12542470.8,8919166.8,10933434.600000001,15147589.0,15293700.200000001,15714501.200000001,15020104.4,12291352.8,9646224.200000001,10035271.6,14147478.4,13696033.600000001,14264729.0,14965573.600000001,13129416.8,9217183.6,9976889.4,15302997.200000001,15277996.200000001,14831796.600000001,15884461.200000001,13753535.8,9714499.4,9913345.4,15754560.600000001,14926305.4,15380605.0,15441719.600000001,13679689.8,9108651.6,9689024.4,16250223.600000001,15457939.8,15431406.8,16016256.8,13374326.200000001,9554079.6,10007615.4,16322626.8,16918545.8,16437928.0,16900578.0,14866695.4,10092403.0,10569827.0,20898025.0,20860358.400000002,19595481.0,16765411.0,10932949.8,12312259.600000001,19595135.8,17490434.6,18341139.0,19246726.6,17228383.6,11288914.8,10857898.8,16741690.4,15487843.4,15309001.600000001,14572264.200000001,10675005.0,9937299.4,10677299.4,12320819.200000001,15472227.0,15887236.4,15634259.600000001,15071490.4,12184452.600000001,11410264.8,18611939.2,18900609.8,17973650.400000002,18115690.6,15743904.4,10895736.4,11118896.8,19481619.2,20217109.0,19874497.6,20249933.0,19140980.2,12534667.600000001,13178879.0,20035173.400000002,20459106.0,19607923.400000002,19040986.400000002,12894159.200000001,11512563.600000001,12889099.0,20255684.6,21143846.200000003,19408511.0,18813865.8,17616761.8,11994004.600000001,11763333.0,18478424.8,17803044.8,17695425.8,18191694.400000002,17529708.400000002,12188561.600000001,10779704.4,11148547.8,15109668.8,15281866.8,14601456.4,14463524.4,10327891.600000001,10889339.8,17417491.6,16884522.8,19740214.8,19605459.400000002,17485772.8,12034595.600000001,12351505.200000001,18642203.0,18140215.400000002,19904796.6,20266572.6,17652276.400000002,10769635.200000001,11391018.0,19210187.0,18373197.400000002,19113857.0,19472034.6,17320471.6,11290738.4,11572349.4,17919376.2,16919929.2,17328292.400000002,15879806.200000001,15447272.600000001,11692120.200000001,12082901.0,17925372.2,18508991.6,17327061.8,17918057.2,17023012.400000002,11408163.4,11509009.600000001,17390291.8,17105059.400000002,17857243.400000002,16910108.2,14251733.0,9868058.200000001,10095415.600000001,16437912.0,16088477.0,16329950.0,15289834.0,13389251.200000001,9835769.200000001,10338422.8,15295568.200000001,14883422.4,14586111.200000001,14800721.4,13025176.600000001,10454889.200000001,10507729.600000001,14593264.8,13967648.0,38292884.6,11884509.4,9134974.6,9633951.0,13988339.0,14273325.4,13407748.0,12959531.200000001,11605750.8,8266370.800000001,9377140.6,13773464.0,13803502.600000001,13442921.0,13933631.0,12665234.8,9541988.200000001,10255369.200000001,14368218.200000001,13860647.0,13907949.0,13018104.4,12609829.600000001,9237317.4,10042807.200000001,13923284.4,14434924.8,13736635.0,13640096.200000001,12188965.0,8978845.8,9034608.0,10411126.0,13956154.200000001,14289103.200000001,14393151.4,13125172.200000001,9359021.200000001,9878885.4,14689277.200000001,14303029.600000001]}]}' headers: apim-request-id: - - a0494a9a-bb01-4f77-800b-1f72315c6f2e + - 01b575d4-936b-4c54-9f40-1adc4b327566 content-length: - - '175' + - '9353' content-type: - application/json; charset=utf-8 date: - - Mon, 21 Sep 2020 16:54:44 GMT + - Mon, 12 Oct 2020 19:21:00 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '370' + - '1002' x-request-id: - - a0494a9a-bb01-4f77-800b-1f72315c6f2e + - 01b575d4-936b-4c54-9f40-1adc4b327566 status: code: 200 message: OK diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/test_metrics_advisor_client_live.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/test_metrics_advisor_client_live.py index 6b470ff9c615..8ae77c4f0414 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/test_metrics_advisor_client_live.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/tests/test_metrics_advisor_client_live.py @@ -63,7 +63,7 @@ def test_list_incident_root_cause(self): assert len(results) == 0 def test_list_metric_enriched_series_data(self): - series_identity = {"city":"city"} + series_identity = {"Dim1":"Common Lime"} results = list(self.client.list_metric_enriched_series_data( detection_configuration_id=self.anomaly_detection_configuration_id, start_time=datetime.datetime(2020, 1, 1), @@ -95,7 +95,7 @@ def test_list_metrics_series_data(self): start_time=datetime.datetime(2020, 1, 1), end_time=datetime.datetime(2020, 9, 9), series_to_filter=[ - {"city": "Mumbai", "category": "Shoes Handbags & Sunglasses"} + {"Dim1": "Common Lime", "Dim2": "African buffalo"} ] )) assert len(results) > 0 diff --git a/sdk/metricsadvisor/tests.yml b/sdk/metricsadvisor/tests.yml new file mode 100644 index 000000000000..075b6271c6d7 --- /dev/null +++ b/sdk/metricsadvisor/tests.yml @@ -0,0 +1,41 @@ +trigger: none + +jobs: + - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + parameters: + BuildTargetingString: azure-ai-metricsadvisor + ServiceDirectory: metricsadvisor + EnvVars: + AZURE_SUBSCRIPTION_ID: $(provisioner-subscription) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_METRICS_ADVISOR_ENDPOINT: $(metricsadvisor-test-service-endpoint) + AZURE_METRICS_ADVISOR_SUBSCRIPTION_KEY: $(metricsadvisor-test-subscription-key) + AZURE_METRICS_ADVISOR_API_KEY: $(python-metricsadvisor-test-api-key) + AZURE_METRICS_ADVISOR_SQL_SERVER_CONNECTION_STRING: $(metricsadvisor-test-sql-server-connection-string) + AZURE_METRICS_ADVISOR_AZURE_TABLE_CONNECTION_STRING: $(metricsadvisor-test-azure-table-connection-string) + AZURE_METRICS_ADVISOR_AZURE_BLOB_CONNECTION_STRING: $(metricsadvisor-test-azure-blob-connection-string) + AZURE_METRICS_ADVISOR_COSMOS_DB_CONNECTION_STRING: $(metricsadvisor-test-cosmos-db-connection-string) + AZURE_METRICS_ADVISOR_HTTP_GET_URL: $(metricsadvisor-test-http-get-url) + AZURE_METRICS_ADVISOR_HTTP_POST_URL: $(metricsadvisor-test-http-post-url) + AZURE_METRICS_ADVISOR_APPLICATION_INSIGHTS_API_KEY: $(metricsadvisor-test-application-insights-api-key) + AZURE_METRICS_ADVISOR_AZURE_DATA_EXPLORER_CONNECTION_STRING: $(metricsadvisor-test-azure-data-explorer-connection-string) + AZURE_METRICS_ADVISOR_INFLUX_DB_CONNECTION_STRING: $(metricsadvisor-test-influx-db-connection-string) + AZURE_METRICS_ADVISOR_INFLUX_DB_PASSWORD: $(metricsadvisor-test-influx-db-password) + AZURE_METRICS_ADVISOR_AZURE_DATALAKE_ACCOUNT_KEY: $(metricsadvisor-test-azure-datalake-account-key) + AZURE_METRICS_ADVISOR_AZURE_MONGO_DB_CONNECTION_STRING: $(metricsadvisor-test-azure-mongo-db-connection-string) + AZURE_METRICS_ADVISOR_MYSQL_CONNECTION_STRING: $(metricsadvisor-test-mysql-connection-string) + AZURE_METRICS_ADVISOR_POSTGRESQL_CONNECTION_STRING: $(metricsadvisor-test-postgresql-connection-string) + AZURE_METRICS_ADVISOR_ELASTICSEARCH_AUTH_HEADER: $(metricsadvisor-test-elasticsearch-auth-header) + AZURE_METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID: $(python-metricsadvisor-test-anomaly-detection-config-id) + AZURE_METRICS_ADVISOR_DATA_FEED_ID: $(python-metricsadvisor-test-data-feed-id) + AZURE_METRICS_ADVISOR_METRIC_ID: $(python-metricsadvisor-test-metric-id) + AZURE_METRICS_ADVISOR_ANOMALY_ALERT_CONFIGURATION_ID: $(python-metricsadvisor-test-anomaly-alert-config-id) + AZURE_METRICS_ADVISOR_INCIDENT_ID: $(python-metricsadvisor-test-incident-id) + AZURE_METRICS_ADVISOR_DIMENSION_NAME: $(python-metricsadvisor-test-dimension-name) + AZURE_METRICS_ADVISOR_FEEDBACK_ID: $(python-metricsadvisor-test-feedback-id) + AZURE_METRICS_ADVISOR_ALERT_ID: $(python-metricsadvisor-test-alert-id) + TEST_MODE: 'RunLiveNoRecord' + AZURE_SKIP_LIVE_RECORDING: 'True' + AZURE_TEST_RUN_LIVE: 'true'