Skip to content

Commit

Permalink
Ma shorten config names (Azure#14813)
Browse files Browse the repository at this point in the history
* shorten config names to remove anomaly prefix
  • Loading branch information
xiangyan99 authored Oct 29, 2020
1 parent 96da2bf commit c79eadb
Show file tree
Hide file tree
Showing 195 changed files with 17,823 additions and 10,575 deletions.
8 changes: 4 additions & 4 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ anomaly_detection_config = AnomalyDetectionConfiguration(
)
)

detection_config = client.create_metric_anomaly_detection_configuration(anomaly_detection_config)
detection_config = client.create_detection_configuration(anomaly_detection_config)

return detection_config
```
Expand Down Expand Up @@ -370,7 +370,7 @@ client = MetricsAdvisorClient(service_endpoint,
MetricsAdvisorKeyCredential(subscription_key, api_key)
)

results = client.list_alerts_for_alert_configuration(
results = client.list_alerts(
alert_configuration_id=alert_config_id,
start_time=datetime.datetime(2020, 1, 1),
end_time=datetime.datetime(2020, 9, 9),
Expand All @@ -380,7 +380,7 @@ for result in results:
print("Alert id: {}".format(result.id))
print("Create on: {}".format(result.created_on))

results = client.list_anomalies_for_alert(
results = client.list_anomalies(
alert_configuration_id=alert_config_id,
alert_id=alert_id,
)
Expand All @@ -407,7 +407,7 @@ client = MetricsAdvisorClient(service_endpoint,
MetricsAdvisorKeyCredential(subscription_key, api_key)
)

results = client.list_incidents_for_detection_configuration(
results = client.list_incidents(
detection_configuration_id=anomaly_detection_configuration_id,
start_time=datetime.datetime(2020, 1, 1),
end_time=datetime.datetime(2020, 9, 9),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __exit__(self, *args):
self._client.__exit__(*args) # pylint: disable=no-member

@distributed_trace
def create_anomaly_alert_configuration(
def create_alert_configuration(
self, alert_configuration, # type: AnomalyAlertConfiguration
**kwargs # type: Any
): # type: (...) -> AnomalyAlertConfiguration
Expand All @@ -183,9 +183,9 @@ def create_anomaly_alert_configuration(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_alert_configuration.py
:start-after: [START create_anomaly_alert_config]
:end-before: [END create_anomaly_alert_config]
.. literalinclude:: ../samples/sample_alert_configuration.py
:start-after: [START create_alert_config]
:end-before: [END create_alert_config]
:language: python
:dedent: 4
:caption: Create an anomaly alert configuration
Expand All @@ -198,7 +198,7 @@ def create_anomaly_alert_configuration(
)

config_id = response_headers["Location"].split("configurations/")[1]
return self.get_anomaly_alert_configuration(config_id)
return self.get_alert_configuration(config_id)

@distributed_trace
def create_data_feed(
Expand Down Expand Up @@ -284,7 +284,7 @@ def create_hook(
return self.get_hook(hook_id)

@distributed_trace
def create_metric_anomaly_detection_configuration(
def create_detection_configuration(
self, detection_configuration, # type: AnomalyDetectionConfiguration
**kwargs # type: Any
): # type: (...) -> AnomalyDetectionConfiguration
Expand All @@ -298,9 +298,9 @@ def create_metric_anomaly_detection_configuration(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_detection_configuration.py
:start-after: [START create_anomaly_detection_config]
:end-before: [END create_anomaly_detection_config]
.. literalinclude:: ../samples/sample_detection_configuration.py
:start-after: [START create_detection_config]
:end-before: [END create_detection_config]
:language: python
:dedent: 4
:caption: Create an anomaly detection configuration
Expand All @@ -312,7 +312,7 @@ def create_metric_anomaly_detection_configuration(
**kwargs
)
config_id = response_headers["Location"].split("configurations/")[1]
return self.get_metric_anomaly_detection_configuration(config_id)
return self.get_detection_configuration(config_id)

@distributed_trace
def get_data_feed(self, data_feed_id, **kwargs):
Expand Down Expand Up @@ -342,7 +342,7 @@ def get_data_feed(self, data_feed_id, **kwargs):
return DataFeed._from_generated(data_feed)

@distributed_trace
def get_anomaly_alert_configuration(self, alert_configuration_id, **kwargs):
def get_alert_configuration(self, alert_configuration_id, **kwargs):
# type: (str, Any) -> AnomalyAlertConfiguration
"""Get a single anomaly alert configuration.
Expand All @@ -354,9 +354,9 @@ def get_anomaly_alert_configuration(self, alert_configuration_id, **kwargs):
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_alert_configuration.py
:start-after: [START get_anomaly_alert_config]
:end-before: [END get_anomaly_alert_config]
.. literalinclude:: ../samples/sample_alert_configuration.py
:start-after: [START get_alert_config]
:end-before: [END get_alert_config]
:language: python
:dedent: 4
:caption: Get a single anomaly alert configuration by its ID
Expand All @@ -366,7 +366,7 @@ def get_anomaly_alert_configuration(self, alert_configuration_id, **kwargs):
return AnomalyAlertConfiguration._from_generated(config)

@distributed_trace
def get_metric_anomaly_detection_configuration(self, detection_configuration_id, **kwargs):
def get_detection_configuration(self, detection_configuration_id, **kwargs):
# type: (str, Any) -> AnomalyDetectionConfiguration
"""Get a single anomaly detection configuration.
Expand All @@ -378,9 +378,9 @@ def get_metric_anomaly_detection_configuration(self, detection_configuration_id,
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_detection_configuration.py
:start-after: [START get_anomaly_detection_config]
:end-before: [END get_anomaly_detection_config]
.. literalinclude:: ../samples/sample_detection_configuration.py
:start-after: [START get_detection_config]
:end-before: [END get_detection_config]
:language: python
:dedent: 4
:caption: Get a single anomaly detection configuration by its ID
Expand Down Expand Up @@ -491,7 +491,7 @@ def refresh_data_feed_ingestion(
)

@distributed_trace
def delete_anomaly_alert_configuration(self, alert_configuration_id, **kwargs):
def delete_alert_configuration(self, alert_configuration_id, **kwargs):
# type: (str, Any) -> None
"""Delete an anomaly alert configuration by its ID.
Expand All @@ -503,9 +503,9 @@ def delete_anomaly_alert_configuration(self, alert_configuration_id, **kwargs):
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_alert_configuration.py
:start-after: [START delete_anomaly_alert_config]
:end-before: [END delete_anomaly_alert_config]
.. literalinclude:: ../samples/sample_alert_configuration.py
:start-after: [START delete_alert_config]
:end-before: [END delete_alert_config]
:language: python
:dedent: 4
:caption: Delete an anomaly alert configuration by its ID
Expand All @@ -514,7 +514,7 @@ def delete_anomaly_alert_configuration(self, alert_configuration_id, **kwargs):
self._client.delete_anomaly_alerting_configuration(alert_configuration_id, **kwargs)

@distributed_trace
def delete_metric_anomaly_detection_configuration(self, detection_configuration_id, **kwargs):
def delete_detection_configuration(self, detection_configuration_id, **kwargs):
# type: (str, Any) -> None
"""Delete an anomaly detection configuration by its ID.
Expand All @@ -526,9 +526,9 @@ def delete_metric_anomaly_detection_configuration(self, detection_configuration_
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_detection_configuration.py
:start-after: [START delete_anomaly_detection_config]
:end-before: [END delete_anomaly_detection_config]
.. literalinclude:: ../samples/sample_detection_configuration.py
:start-after: [START delete_detection_config]
:end-before: [END delete_detection_config]
:language: python
:dedent: 4
:caption: Delete an anomaly detection configuration by its ID
Expand Down Expand Up @@ -684,7 +684,7 @@ def update_data_feed(
return self.get_data_feed(data_feed_id)

@distributed_trace
def update_anomaly_alert_configuration(
def update_alert_configuration(
self,
alert_configuration, # type: Union[str, AnomalyAlertConfiguration]
**kwargs # type: Any
Expand Down Expand Up @@ -712,9 +712,9 @@ def update_anomaly_alert_configuration(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_alert_configuration.py
:start-after: [START update_anomaly_alert_config]
:end-before: [END update_anomaly_alert_config]
.. literalinclude:: ../samples/sample_alert_configuration.py
:start-after: [START update_alert_config]
:end-before: [END update_alert_config]
:language: python
:dedent: 4
:caption: Update an existing anomaly alert configuration
Expand Down Expand Up @@ -748,10 +748,10 @@ def update_anomaly_alert_configuration(
alert_configuration_patch,
**kwargs
)
return self.get_anomaly_alert_configuration(alert_configuration_id)
return self.get_alert_configuration(alert_configuration_id)

@distributed_trace
def update_metric_anomaly_detection_configuration(
def update_detection_configuration(
self,
detection_configuration, # type: Union[str, AnomalyDetectionConfiguration]
**kwargs # type: Any
Expand Down Expand Up @@ -783,9 +783,9 @@ def update_metric_anomaly_detection_configuration(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_detection_configuration.py
:start-after: [START update_anomaly_detection_config]
:end-before: [END update_anomaly_detection_config]
.. literalinclude:: ../samples/sample_detection_configuration.py
:start-after: [START update_detection_config]
:end-before: [END update_detection_config]
:language: python
:dedent: 4
:caption: Update an existing anomaly detection configuration
Expand Down Expand Up @@ -819,7 +819,7 @@ def update_metric_anomaly_detection_configuration(
detection_config_patch,
**kwargs
)
return self.get_metric_anomaly_detection_configuration(detection_configuration_id)
return self.get_detection_configuration(detection_configuration_id)

@distributed_trace
def update_hook(
Expand Down Expand Up @@ -1006,7 +1006,7 @@ def list_data_feeds(
)

@distributed_trace
def list_anomaly_alert_configurations(
def list_alert_configurations(
self,
detection_configuration_id, # type: str
**kwargs # type: Any
Expand All @@ -1022,9 +1022,9 @@ def list_anomaly_alert_configurations(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_alert_configuration.py
:start-after: [START list_anomaly_alert_configs]
:end-before: [END list_anomaly_alert_configs]
.. literalinclude:: ../samples/sample_alert_configuration.py
:start-after: [START list_alert_configs]
:end-before: [END list_alert_configs]
:language: python
:dedent: 4
:caption: List all anomaly alert configurations for specific anomaly detection configuration
Expand All @@ -1038,7 +1038,7 @@ def list_anomaly_alert_configurations(
)

@distributed_trace
def list_metric_anomaly_detection_configurations(
def list_detection_configurations(
self,
metric_id, # type: str
**kwargs # type: Any
Expand All @@ -1054,9 +1054,9 @@ def list_metric_anomaly_detection_configurations(
.. admonition:: Example:
.. literalinclude:: ../samples/sample_anomaly_detection_configuration.py
:start-after: [START list_anomaly_detection_configs]
:end-before: [END list_anomaly_detection_configs]
.. literalinclude:: ../samples/sample_detection_configuration.py
:start-after: [START list_detection_configs]
:end-before: [END list_detection_configs]
:language: python
:dedent: 4
:caption: List all anomaly detection configurations for a specific metric
Expand Down
Loading

0 comments on commit c79eadb

Please sign in to comment.