Skip to content

Commit

Permalink
[MetricsAdvisor] Removed Gen2 from data source name (#22364)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinelski authored Jul 1, 2021
1 parent 85f363a commit e74936f
Show file tree
Hide file tree
Showing 35 changed files with 67 additions and 65 deletions.
1 change: 1 addition & 0 deletions sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Renamed class `MetricAnomalyAlertConfiguration` to `MetricAlertConfiguration`.
- Renamed class `MetricAnomalyAlertConfigurationsOperator` to `DetectionConditionOperator`. Similarly, `MetricAnomalyAlertConfiguration.CrossMetricsOperator` has been renamed to `ConditionOperator`.
- Renamed class `DataSourceType` to `DataSourceKind`. Similarly, `GetDataFeedsFilter.SourceType` has been renamed to `SourceKind`, and `DataFeedSource.DataSourceType` has been renamed to `DataSourceKind`.
- Renamed class `AzureDataLakeStorageGen2DataFeedSource` to `AzureDataLakeStorageDataFeedSource`. Similarly, `DataSourceType.AzureDataLakeStorageGen2` has been renamed to `AzureDataLakeStorage`.
- Renamed class `FeedbackType` to `MetricFeedbackKind`. Similarly, `GetAllFeedbackOptions.FeedbackType` has been renamed to `FeedbackKind`, and `MetricFeedback.Type` has been renamed to `Kind`.
- Renamed class `PeriodType` to `MetricPeriodType`.
- Split the method `GetAnomalies` into two different methods: `GetAnomaliesForAlert` and `GetAnomaliesForDetectionConfiguration`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ public enum AuthenticationType
ServicePrincipalInKeyVault = 3,
}
}
public partial class AzureDataLakeStorageGen2DataFeedSource : Azure.AI.MetricsAdvisor.Administration.DataFeedSource
public partial class AzureDataLakeStorageDataFeedSource : Azure.AI.MetricsAdvisor.Administration.DataFeedSource
{
public AzureDataLakeStorageGen2DataFeedSource(string accountName, string accountKey, string fileSystemName, string directoryTemplate, string fileTemplate) { }
public AzureDataLakeStorageDataFeedSource(string accountName, string accountKey, string fileSystemName, string directoryTemplate, string fileTemplate) { }
public string AccountName { get { throw null; } set { } }
public Azure.AI.MetricsAdvisor.Administration.AzureDataLakeStorageGen2DataFeedSource.AuthenticationType? Authentication { get { throw null; } set { } }
public Azure.AI.MetricsAdvisor.Administration.AzureDataLakeStorageDataFeedSource.AuthenticationType? Authentication { get { throw null; } set { } }
public string DataSourceCredentialId { get { throw null; } set { } }
public string DirectoryTemplate { get { throw null; } set { } }
public string FileSystemName { get { throw null; } set { } }
Expand Down Expand Up @@ -936,7 +936,7 @@ public DataFeedSchema() { }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureBlob { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureCosmosDb { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureDataExplorer { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureDataLakeStorageGen2 { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureDataLakeStorage { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureEventHubs { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind AzureTable { get { throw null; } }
public static Azure.AI.MetricsAdvisor.Models.DataFeedSourceKind InfluxDb { get { throw null; } }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private static void SetAuthenticationProperties(DataFeedDetail detail, DataFeedS
detail.AuthenticationType = s.GetAuthenticationTypeEnum();
detail.CredentialId = s.DataSourceCredentialId;
break;
case AzureDataLakeStorageGen2DataFeedSource s:
case AzureDataLakeStorageDataFeedSource s:
detail.AuthenticationType = s.GetAuthenticationTypeEnum();
detail.CredentialId = s.DataSourceCredentialId;
break;
Expand All @@ -283,7 +283,7 @@ private static void SetAuthenticationProperties(DataFeedDetailPatch patch, DataF
patch.AuthenticationType = s.GetAuthenticationTypeEnum();
patch.CredentialId = s.DataSourceCredentialId;
break;
case AzureDataLakeStorageGen2DataFeedSource s:
case AzureDataLakeStorageDataFeedSource s:
patch.AuthenticationType = s.GetAuthenticationTypeEnum();
patch.CredentialId = s.DataSourceCredentialId;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal static DataFeedSource GetDataFeedSource(DataFeedDetail dataFeedDetail)
AzureBlobDataFeed d => new AzureBlobDataFeedSource(d.DataSourceParameter, d.AuthenticationType),
AzureCosmosDBDataFeed d => new AzureCosmosDbDataFeedSource(d.DataSourceParameter),
AzureDataExplorerDataFeed d => new AzureDataExplorerDataFeedSource(d.DataSourceParameter, d.AuthenticationType, d.CredentialId),
AzureDataLakeStorageGen2DataFeed d => new AzureDataLakeStorageGen2DataFeedSource(d.DataSourceParameter, d.AuthenticationType, d.CredentialId),
AzureDataLakeStorageGen2DataFeed d => new AzureDataLakeStorageDataFeedSource(d.DataSourceParameter, d.AuthenticationType, d.CredentialId),
AzureEventHubsDataFeed d => new AzureEventHubsDataFeedSource(d.DataSourceParameter),
AzureLogAnalyticsDataFeed d => new LogAnalyticsDataFeedSource(d.DataSourceParameter),
AzureTableDataFeed d => new AzureTableDataFeedSource(d.DataSourceParameter),
Expand Down Expand Up @@ -58,7 +58,7 @@ internal DataFeedDetail InstantiateDataFeedDetail(string name, DataFeedGranulari
new AzureCosmosDBParameter(d.SqlQuery, d.Database, d.CollectionId) { ConnectionString = d.ConnectionString }),
AzureDataExplorerDataFeedSource d => new AzureDataExplorerDataFeed(name, granularityType, metricColumns, ingestionStartTime,
new SqlSourceParameter(d.Query) { ConnectionString = d.ConnectionString }),
AzureDataLakeStorageGen2DataFeedSource d => new AzureDataLakeStorageGen2DataFeed(name, granularityType, metricColumns, ingestionStartTime,
AzureDataLakeStorageDataFeedSource d => new AzureDataLakeStorageGen2DataFeed(name, granularityType, metricColumns, ingestionStartTime,
new AzureDataLakeStorageGen2Parameter(d.FileSystemName, d.DirectoryTemplate, d.FileTemplate) { AccountKey = d.AccountKey, AccountName = d.AccountName }),
AzureEventHubsDataFeedSource d => new AzureEventHubsDataFeed(name, granularityType, metricColumns, ingestionStartTime,
new AzureEventHubsParameter(d.ConsumerGroup) { ConnectionString = d.ConnectionString }),
Expand Down Expand Up @@ -93,7 +93,7 @@ internal DataFeedDetail InstantiateDataFeedDetail(string name, DataFeedGranulari
{ DataSourceParameter = new() { SqlQuery = d.SqlQuery, Database = d.Database, CollectionId = d.CollectionId, ConnectionString = d.ConnectionString } },
AzureDataExplorerDataFeedSource d => new AzureDataExplorerDataFeedPatch()
{ DataSourceParameter = new() { Query = d.Query, ConnectionString = d.ConnectionString } },
AzureDataLakeStorageGen2DataFeedSource d => new AzureDataLakeStorageGen2DataFeedPatch()
AzureDataLakeStorageDataFeedSource d => new AzureDataLakeStorageGen2DataFeedPatch()
{ DataSourceParameter = new() { FileSystemName = d.FileSystemName, DirectoryTemplate = d.DirectoryTemplate, FileTemplate = d.FileTemplate, AccountKey = d.AccountKey, AccountName = d.AccountName } },
AzureEventHubsDataFeedSource d => new AzureEventHubsDataFeedPatch()
{ DataSourceParameter = new() { ConnectionString = d.ConnectionString, ConsumerGroup = d.ConsumerGroup } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public readonly partial struct DataFeedSourceKind
/// <summary>
/// Azure Data Lake Storage Gen2.
/// </summary>
public static DataFeedSourceKind AzureDataLakeStorageGen2 { get; } = new DataFeedSourceKind(AzureDataLakeStorageGen2Value);
[CodeGenMember("AzureDataLakeStorageGen2")]
public static DataFeedSourceKind AzureDataLakeStorage { get; } = new DataFeedSourceKind(AzureDataLakeStorageValue);

/// <summary>
/// Azure Event Hubs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ namespace Azure.AI.MetricsAdvisor.Administration
/// <summary>
/// Describes an Azure Data Lake Storage Gen2 data source which ingests data into a <see cref="DataFeed"/> for anomaly detection.
/// </summary>
public class AzureDataLakeStorageGen2DataFeedSource : DataFeedSource
public class AzureDataLakeStorageDataFeedSource : DataFeedSource
{
private string _accountKey;

/// <summary>
/// Initializes a new instance of the <see cref="AzureDataLakeStorageGen2DataFeedSource"/> class.
/// Initializes a new instance of the <see cref="AzureDataLakeStorageDataFeedSource"/> class.
/// </summary>
/// <param name="accountName">The name of the Storage Account.</param>
/// <param name="accountKey">The Storage Account key.</param>
Expand Down Expand Up @@ -49,8 +49,8 @@ public class AzureDataLakeStorageGen2DataFeedSource : DataFeedSource
/// </param>
/// <exception cref="ArgumentNullException"><paramref name="accountName"/>, <paramref name="accountKey"/>, <paramref name="fileSystemName"/>, <paramref name="directoryTemplate"/>, or <paramref name="fileTemplate"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="accountName"/>, <paramref name="accountKey"/>, <paramref name="fileSystemName"/>, <paramref name="directoryTemplate"/>, or <paramref name="fileTemplate"/> is empty.</exception>
public AzureDataLakeStorageGen2DataFeedSource(string accountName, string accountKey, string fileSystemName, string directoryTemplate, string fileTemplate)
: base(DataFeedSourceKind.AzureDataLakeStorageGen2)
public AzureDataLakeStorageDataFeedSource(string accountName, string accountKey, string fileSystemName, string directoryTemplate, string fileTemplate)
: base(DataFeedSourceKind.AzureDataLakeStorage)
{
Argument.AssertNotNullOrEmpty(accountName, nameof(accountName));
Argument.AssertNotNullOrEmpty(accountKey, nameof(accountKey));
Expand All @@ -65,8 +65,8 @@ public AzureDataLakeStorageGen2DataFeedSource(string accountName, string account
FileTemplate = fileTemplate;
}

internal AzureDataLakeStorageGen2DataFeedSource(AzureDataLakeStorageGen2Parameter parameter, AuthenticationTypeEnum? authentication, string credentialId)
: base(DataFeedSourceKind.AzureDataLakeStorageGen2)
internal AzureDataLakeStorageDataFeedSource(AzureDataLakeStorageGen2Parameter parameter, AuthenticationTypeEnum? authentication, string credentialId)
: base(DataFeedSourceKind.AzureDataLakeStorage)
{
Argument.AssertNotNull(parameter, nameof(parameter));

Expand All @@ -81,15 +81,15 @@ internal AzureDataLakeStorageGen2DataFeedSource(AzureDataLakeStorageGen2Paramete
}

/// <summary>
/// The different ways of authenticating to an <see cref="AzureDataLakeStorageGen2DataFeedSource"/>. Be aware that
/// The different ways of authenticating to an <see cref="AzureDataLakeStorageDataFeedSource"/>. Be aware that
/// some authentication types require you to have a <see cref="DataSourceCredentialEntity"/> in the service. In this
/// case, you also need to set the property <see cref="DataSourceCredentialId"/> to specify which credential
/// to use. Defaults to <see cref="Basic"/>.
/// </summary>
public enum AuthenticationType
{
/// <summary>
/// Only uses the <see cref="AccountKey"/> present in this <see cref="AzureDataLakeStorageGen2DataFeedSource"/>
/// Only uses the <see cref="AccountKey"/> present in this <see cref="AzureDataLakeStorageDataFeedSource"/>
/// instance for authentication.
/// </summary>
Basic,
Expand All @@ -115,7 +115,7 @@ public enum AuthenticationType
};

/// <summary>
/// The method used to authenticate to this <see cref="AzureDataLakeStorageGen2DataFeedSource"/>. Be aware that some
/// The method used to authenticate to this <see cref="AzureDataLakeStorageDataFeedSource"/>. Be aware that some
/// authentication types require you to have a <see cref="DataSourceCredentialEntity"/> in the service. In this
/// case, you also need to set the property <see cref="DataSourceCredentialId"/> to specify which credential
/// to use. Defaults to <see cref="AuthenticationType.Basic"/>.
Expand Down
Loading

0 comments on commit e74936f

Please sign in to comment.