Skip to content

Commit

Permalink
rename list_dimension_values (Azure#16292)
Browse files Browse the repository at this point in the history
* rename list_dimension_values

* add samples
  • Loading branch information
xiangyan99 authored Jan 22, 2021
1 parent c12a9c0 commit 9fca61b
Show file tree
Hide file tree
Showing 356 changed files with 58,247 additions and 21,961 deletions.
4 changes: 4 additions & 0 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- AAD support authentication #15922
- `MetricsAdvisorKeyCredential` support for rotating the subscription and api keys to update long-lived clients

**Breaking Changes**

- `list_dimension_values` has been renamed to `list_anomaly_dimension_values`

## 1.0.0b2 (2020-11-10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def list_anomalies(self, **kwargs):
return self._list_anomalies_for_alert(**kwargs)

@distributed_trace
def list_dimension_values(
def list_anomaly_dimension_values(
self, detection_configuration_id,
dimension_name,
start_time,
Expand All @@ -517,8 +517,8 @@ def list_dimension_values(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_queries.py
:start-after: [START list_dimension_values]
:end-before: [END list_dimension_values]
:start-after: [START list_anomaly_dimension_values]
:end-before: [END list_anomaly_dimension_values]
:language: python
:dedent: 4
:caption: Query dimension values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def list_anomalies(self, **kwargs):
return self._list_anomalies_for_alert(**kwargs)

@distributed_trace
def list_dimension_values(
def list_anomaly_dimension_values(
self, detection_configuration_id,
dimension_name,
start_time,
Expand All @@ -523,8 +523,8 @@ def list_dimension_values(
.. admonition:: Example:
.. literalinclude:: ../samples/async_samples/sample_queries_async.py
:start-after: [START list_dimension_values_async]
:end-before: [END list_dimension_values_async]
:start-after: [START list_anomaly_dimension_values_async]
:end-before: [END list_anomaly_dimension_values_async]
:language: python
:dedent: 4
:caption: Query dimension values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ async def sample_list_metric_enriched_series_data_async():

# [END list_metric_enriched_series_data_async]

async def sample_list_dimension_values_async():
# [START list_dimension_values_async]
async def sample_list_anomaly_dimension_values_async():
# [START list_anomaly_dimension_values_async]
import datetime
from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential
from azure.ai.metricsadvisor.aio import MetricsAdvisorClient
Expand All @@ -75,7 +75,7 @@ async def sample_list_dimension_values_async():
MetricsAdvisorKeyCredential(subscription_key, api_key))

async with client:
results = client.list_dimension_values(
results = client.list_anomaly_dimension_values(
detection_configuration_id=detection_configuration_id,
dimension_name=dimension_name,
start_time=datetime.datetime(2020, 1, 1),
Expand All @@ -84,7 +84,7 @@ async def sample_list_dimension_values_async():
async for result in results:
print(str(result))

# [END list_dimension_values_async]
# [END list_anomaly_dimension_values_async]

async def sample_list_metric_dimension_values_async():
# [START list_metric_dimension_values_async]
Expand Down Expand Up @@ -191,7 +191,7 @@ async def main():
print("---List metric enriched series data...")
await sample_list_metric_enriched_series_data_async()
print("---List dimension values...")
await sample_list_dimension_values_async()
await sample_list_anomaly_dimension_values_async()
print("---List metric dimension values...")
await sample_list_metric_dimension_values_async()
print("---List metric series data...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def sample_list_metric_enriched_series_data():

# [END list_metric_enriched_series_data]

def sample_list_dimension_values():
# [START list_dimension_values]
def sample_list_anomaly_dimension_values():
# [START list_anomaly_dimension_values]
import datetime
from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient

Expand All @@ -70,7 +70,7 @@ def sample_list_dimension_values():
client = MetricsAdvisorClient(service_endpoint,
MetricsAdvisorKeyCredential(subscription_key, api_key))

results = client.list_dimension_values(
results = client.list_anomaly_dimension_values(
detection_configuration_id=detection_configuration_id,
dimension_name=dimension_name,
start_time=datetime.datetime(2020, 1, 1),
Expand All @@ -79,7 +79,7 @@ def sample_list_dimension_values():
for result in results:
print(str(result))

# [END list_dimension_values]
# [END list_anomaly_dimension_values]

def sample_list_metric_dimension_values():
# [START list_metric_dimension_values]
Expand Down Expand Up @@ -178,7 +178,7 @@ def sample_list_metric_enrichment_status():
print("---List metric enriched series data...")
sample_list_metric_enriched_series_data()
print("---List dimension values...")
sample_list_dimension_values()
sample_list_anomaly_dimension_values()
print("---List metric dimension values...")
sample_list_metric_dimension_values()
print("---List metric series data...")
Expand Down
Loading

0 comments on commit 9fca61b

Please sign in to comment.