Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some misc fixes. #19024

Merged
merged 3 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.0.0b4 (2021-06-07)

**New Features**

- Added `AzureLogAnalyticsDataFeedSource` and `AzureEventHubsDataFeedSource`
- Update method now returns the updated object
- Added DatasourceCredentials and DatasourceCredential operations
Expand All @@ -14,21 +15,21 @@
- `update_subscription_key` and `update_api_key` are merged into one method `update_key`

- Deprecated:
- `HttpRequestDataFeed`
- `ElasticsearchDataFeed`
- `HttpRequestDataFeed`
- `ElasticsearchDataFeed`

- Renamed
- `AzureApplicationInsightsDataFeed` -> `AzureApplicationInsightsDataFeedSource`
- `AzureBlobDataFeed` -> `AzureBlobDataFeedSource`
- `AzureCosmosDBDataFeed` -> `AzureCosmosDbDataFeedSource`
- `AzureDataExplorerDataFeed` -> `AzureDataExplorerDataFeedSource`
- `AzureTableDataFeed` -> `AzureTableDataFeedSource`
- `InfluxDBDataFeed` -> `InfluxDbDataFeedSource`
- `MySqlDataFeed` -> `MySqlDataFeedSource`
- `PostgreSqlDataFeed` -> `PostgreSqlDataFeedSource`
- `SQLServerDataFeed` -> `SqlServerDataFeedSource`
- `MongoDBDataFeed` -> `MongoDbDataFeedSource`
- `AzureDataLakeStorageGen2DataFeed` -> `AzureDataLakeStorageGen2DataFeedSource`
- `AzureApplicationInsightsDataFeed` -> `AzureApplicationInsightsDataFeedSource`
- `AzureBlobDataFeed` -> `AzureBlobDataFeedSource`
- `AzureCosmosDBDataFeed` -> `AzureCosmosDbDataFeedSource`
- `AzureDataExplorerDataFeed` -> `AzureDataExplorerDataFeedSource`
- `AzureTableDataFeed` -> `AzureTableDataFeedSource`
- `InfluxDBDataFeed` -> `InfluxDbDataFeedSource`
- `MySqlDataFeed` -> `MySqlDataFeedSource`
- `PostgreSqlDataFeed` -> `PostgreSqlDataFeedSource`
- `SQLServerDataFeed` -> `SqlServerDataFeedSource`
- `MongoDBDataFeed` -> `MongoDbDataFeedSource`
- `AzureDataLakeStorageGen2DataFeed` -> `AzureDataLakeStorageGen2DataFeedSource`

**Dependency Updates**

Expand All @@ -50,6 +51,7 @@
**Hotfixes**

- Bump `six` requirement from `1.6` to 1.11.0`

## 1.0.0b2 (2020-11-10)

**Breaking Changes**
Expand Down Expand Up @@ -95,4 +97,3 @@
## 1.0.0b1 (2020-10-07)

First preview release

16 changes: 8 additions & 8 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ Metrics Advisor lets you create and subscribe to real-time alerts. These alerts

## Examples

* [Add a data feed from a sample or data source](#add-a-data-feed-from-a-sample-or-data-source "Add a data feed from a sample or data source")
* [Check ingestion status](#check-ingestion-status "Check ingestion status")
* [Configure anomaly detection configuration](#configure-anomaly-detection-configuration "Configure anomaly detection configuration")
* [Configure alert configuration](#configure-alert-configuration "Configure alert configuration")
* [Query anomaly detection results](#query-anomaly-detection-results "Query anomaly detection results")
* [Query incidents](#query-incidents "Query incidents")
* [Query root causes](#query-root-causes "Query root causes")
* [Add hooks for receiving anomaly alerts](#add-hooks-for-receiving-anomaly-alerts "Add hooks for receiving anomaly alerts")
- [Add a data feed from a sample or data source](#add-a-data-feed-from-a-sample-or-data-source "Add a data feed from a sample or data source")
- [Check ingestion status](#check-ingestion-status "Check ingestion status")
- [Configure anomaly detection configuration](#configure-anomaly-detection-configuration "Configure anomaly detection configuration")
- [Configure alert configuration](#configure-alert-configuration "Configure alert configuration")
- [Query anomaly detection results](#query-anomaly-detection-results "Query anomaly detection results")
- [Query incidents](#query-incidents "Query incidents")
- [Query root causes](#query-root-causes "Query root causes")
- [Add hooks for receiving anomaly alerts](#add-hooks-for-receiving-anomaly-alerts "Add hooks for receiving anomaly alerts")

### Add a data feed from a sample or data source

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
'MetricSeriesItem',
'MetricSeriesList',
'MetricSeriesQueryOptions',
'MongoDbDataFeed',
'MongoDBDataFeed',
'MongoDBDataFeedPatch',
'MongoDBParameter',
'MongoDBParameterPatch',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,8 @@ class AzureLogAnalyticsDataFeedSource(DataFeedSource):
:keyword str client_id: The client id of service principal that have access to this Log
Analytics.
:keyword str client_secret: The client secret of service principal that have access to this Log Analytics.
:keyword str datasource_service_principal_id: Datasource service principal unique id.
:keyword str datasource_service_principal_in_kv_id: Datasource service principal in key vault unique id.
:param str workspace_id: Required. The workspace id of this Log Analytics.
:param str query: Required. The KQL (Kusto Query Language) query to fetch data from this Log
Analytics.
Expand All @@ -1772,11 +1774,20 @@ def __init__(self, workspace_id, query, **kwargs):
# type: (str, str, **Any) -> None
super(AzureLogAnalyticsDataFeedSource, self).__init__(
data_source_type='AzureLogAnalytics',
authentication_type="Basic",
**kwargs)
self.tenant_id = kwargs.get("tenant_id", None)
self.client_id = kwargs.get("client_id", None)
self.client_secret = kwargs.get("client_secret", None)
datasource_service_principal_id = kwargs.get("datasource_service_principal_id", False)
datasource_service_principal_in_kv_id = kwargs.get("datasource_service_principal_in_kv_id", False)
if datasource_service_principal_id:
self.authentication_type = "ServicePrincipal"
self.credential_id = datasource_service_principal_id
elif datasource_service_principal_in_kv_id:
self.authentication_type = "ServicePrincipalInKV"
self.credential_id = datasource_service_principal_in_kv_id
else:
self.authentication_type = "Basic"
self.tenant_id = kwargs.get("tenant_id", None)
self.client_id = kwargs.get("client_id", None)
self.client_secret = kwargs.get("client_secret", None)
self.workspace_id = workspace_id
self.query = query

Expand Down
3 changes: 2 additions & 1 deletion sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ urlFragment: metricsadvisor-samples
# Samples for Azure Metrics Advisor client library for Python

These code samples show common scenario operations with the Azure Metrics Advisor client library.
The async versions of the samples require Python 3.5 or later.
The async versions of the samples require Python 3.6 or later.

|**File Name**|**Description**|
|----------------|-------------|
Expand All @@ -27,6 +27,7 @@ The async versions of the samples require Python 3.5 or later.
|[sample_queries.py][sample_queries] and [sample_queries_async.py][sample_queries_async]|Query dimensions/data/status/etc.|

## Prerequisites

* Python 2.7, or 3.6 or later is required to use this package (3.6 or later if using asyncio)
* You must have an [Azure subscription][azure_subscription] and an
[Azure Metrics Advisor account][portal_metrics_advisor_account] to run these samples.
Expand Down