diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md index 592061d455aa0..1f49691ff88d5 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md @@ -12,9 +12,14 @@ - The constructor of the `AnomalyDetectionConfiguration` class is now parameterless. Required properties should be set via setters. - The constructor of the `MetricSingleSeriesDetectionCondition` class is now parameterless. Dimension columns can be added directly to `SeriesKey`. - The constructor of the `MetricSeriesGroupDetectionCondition` class is now parameterless. Dimension columns can be added directly to `SeriesGroupKey`. +- The constructor of the `AnomalyAlertConfiguration` class is now parameterless. Required properties should be set via setters. - In `DataFeed`, added property setters to `Name`, `DataSource`, `Granularity`, `IngestionSettings`, and `Schema`. - In `DataFeedIngestionSettings`, added a property setter to `IngestionStartTime`. - In `AnomalyDetectionConfiguration`, added property setters to `MetricId`, `Name`, and `WholeSeriesDetectionConditions`. +- In `AnomalyAlertConfiguration`, added a property setter to `Name`. +- In `MetricAnomalyAlertSnoozeCondition`, added property setters to `AutoSnooze`, `IsOnlyForSuccessive`, and `SnoozeScope`. +- In `MetricBoundaryCondition`, added a property setter to `Direction`. +- In `SeverityCondition`, added property setters to `MaximumAlertSeverity` and `MinimumAlertSeverity`. - In `DataFeed`, removed the setters of the properties `Administrators` and `Viewers`. - In `DataFeedSchema`, removed the setter of the property `DimensionColumns`. - In `DataFeedRollupSettings`, removed the setter of the property `AutoRollupGroupByColumnNames`. @@ -23,6 +28,7 @@ - `DataFeed.IngestionStartTime` is now nullable. - `MetricsAdvisorAdministrationClient.CreateDataFeed` sync and async methods now throw an `ArgumentException` if required properties are not set properly. - `MetricsAdvisorAdministrationClient.CreateDetectionConfiguration` sync and async methods now throw an `ArgumentException` if required properties are not set properly. +- `MetricsAdvisorAdministrationClient.CreateAlertConfiguration` sync and async methods now throw an `ArgumentException` if required properties are not set properly. - In `MetricsAdvisorKeyCredential`, renamed the parameter `key` to `subscriptionKey` in the method `UpdateSubscriptionKey`. - In `MetricsAdvisorKeyCredential`, renamed the parameter `key` to `apiKey` in the method `UpdateApiKey`. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md index 18734816a4070..7e4239ecff3d7 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md @@ -334,15 +334,18 @@ string hookId = ""; string anomalyDetectionConfigurationId = ""; string configurationName = "Sample anomaly alert configuration"; -var idsOfHooksToAlert = new List() { hookId }; -var scope = MetricAnomalyAlertScope.GetScopeForWholeSeries(); -var metricAlertConfigurations = new List() +AnomalyAlertConfiguration alertConfiguration = new AnomalyAlertConfiguration() { - new MetricAnomalyAlertConfiguration(anomalyDetectionConfigurationId, scope) + Name = configurationName }; -AnomalyAlertConfiguration alertConfiguration = new AnomalyAlertConfiguration(configurationName, idsOfHooksToAlert, metricAlertConfigurations); +alertConfiguration.IdsOfHooksToAlert.Add(hookId); + +var scope = MetricAnomalyAlertScope.GetScopeForWholeSeries(); +var metricAlertConfiguration = new MetricAnomalyAlertConfiguration(anomalyDetectionConfigurationId, scope); + +alertConfiguration.MetricAlertConfigurations.Add(metricAlertConfiguration); Response response = await adminClient.CreateAlertConfigurationAsync(alertConfiguration); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs index 8b46c65f8c86d..f0871a116260c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs @@ -289,13 +289,13 @@ internal AnomalyAlert() { } } public partial class AnomalyAlertConfiguration { - public AnomalyAlertConfiguration(string name, System.Collections.Generic.IList idsOfHooksToAlert, System.Collections.Generic.IList metricAlertConfigurations) { } + public AnomalyAlertConfiguration() { } public Azure.AI.MetricsAdvisor.Models.MetricAnomalyAlertConfigurationsOperator? CrossMetricsOperator { get { throw null; } set { } } public string Description { get { throw null; } set { } } public string Id { get { throw null; } } public System.Collections.Generic.IList IdsOfHooksToAlert { get { throw null; } } public System.Collections.Generic.IList MetricAlertConfigurations { get { throw null; } } - public string Name { get { throw null; } } + public string Name { get { throw null; } set { } } } public partial class AnomalyDetectionConfiguration { @@ -957,9 +957,9 @@ internal MetricAnomalyAlertScope() { } public partial class MetricAnomalyAlertSnoozeCondition { public MetricAnomalyAlertSnoozeCondition(int autoSnooze, Azure.AI.MetricsAdvisor.Models.SnoozeScope snoozeScope, bool isOnlyForSuccessive) { } - public int AutoSnooze { get { throw null; } } - public bool IsOnlyForSuccessive { get { throw null; } } - public Azure.AI.MetricsAdvisor.Models.SnoozeScope SnoozeScope { get { throw null; } } + public int AutoSnooze { get { throw null; } set { } } + public bool IsOnlyForSuccessive { get { throw null; } set { } } + public Azure.AI.MetricsAdvisor.Models.SnoozeScope SnoozeScope { get { throw null; } set { } } } public partial class MetricAnomalyFeedback : Azure.AI.MetricsAdvisor.Models.MetricFeedback { @@ -974,7 +974,7 @@ public partial class MetricBoundaryCondition { public MetricBoundaryCondition(Azure.AI.MetricsAdvisor.Models.BoundaryDirection direction) { } public string CompanionMetricId { get { throw null; } set { } } - public Azure.AI.MetricsAdvisor.Models.BoundaryDirection Direction { get { throw null; } } + public Azure.AI.MetricsAdvisor.Models.BoundaryDirection Direction { get { throw null; } set { } } public double? LowerBound { get { throw null; } set { } } public bool? TriggerForMissing { get { throw null; } set { } } public double? UpperBound { get { throw null; } set { } } @@ -1101,8 +1101,8 @@ public PostgreSqlDataFeedSource(string connectionString, string query) { } public partial class SeverityCondition { public SeverityCondition(Azure.AI.MetricsAdvisor.Models.AnomalySeverity minimumAlertSeverity, Azure.AI.MetricsAdvisor.Models.AnomalySeverity maximumAlertSeverity) { } - public Azure.AI.MetricsAdvisor.Models.AnomalySeverity MaximumAlertSeverity { get { throw null; } } - public Azure.AI.MetricsAdvisor.Models.AnomalySeverity MinimumAlertSeverity { get { throw null; } } + public Azure.AI.MetricsAdvisor.Models.AnomalySeverity MaximumAlertSeverity { get { throw null; } set { } } + public Azure.AI.MetricsAdvisor.Models.AnomalySeverity MinimumAlertSeverity { get { throw null; } set { } } } public partial class SmartDetectionCondition { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs index e3a233bfe624e..13543fee95934 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs @@ -1030,12 +1030,12 @@ private static void ValidateDetectionConfigurationToCreate(AnomalyDetectionConfi /// A containing the result of the operation. The result is a string /// containing the ID of the newly created configuration. /// - /// or .MetricAlertConfigurations is null. - /// .MetricAlertConfigurations is empty. + /// or .Name is null. + /// .Name is empty. public virtual async Task> CreateAlertConfigurationAsync(AnomalyAlertConfiguration alertConfiguration, CancellationToken cancellationToken = default) { Argument.AssertNotNull(alertConfiguration, nameof(alertConfiguration)); - Argument.AssertNotNullOrEmpty(alertConfiguration.MetricAlertConfigurations, $"{nameof(alertConfiguration)}.{nameof(alertConfiguration.MetricAlertConfigurations)}"); + Argument.AssertNotNullOrEmpty(alertConfiguration.Name, $"{nameof(alertConfiguration)}.{nameof(alertConfiguration.Name)}"); using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(CreateAlertConfiguration)}"); scope.Start(); @@ -1063,12 +1063,12 @@ public virtual async Task> CreateAlertConfigurationAsync(Anomal /// A containing the result of the operation. The result is a string /// containing the ID of the newly created configuration. /// - /// or .MetricAlertConfigurations is null. - /// .MetricAlertConfigurations is empty. + /// or .Name is null. + /// .Name is empty. public virtual Response CreateAlertConfiguration(AnomalyAlertConfiguration alertConfiguration, CancellationToken cancellationToken = default) { Argument.AssertNotNull(alertConfiguration, nameof(alertConfiguration)); - Argument.AssertNotNullOrEmpty(alertConfiguration.MetricAlertConfigurations, $"{nameof(alertConfiguration)}.{nameof(alertConfiguration.MetricAlertConfigurations)}"); + Argument.AssertNotNullOrEmpty(alertConfiguration.Name, $"{nameof(alertConfiguration)}.{nameof(alertConfiguration.Name)}"); using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(CreateAlertConfiguration)}"); scope.Start(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/AnomalyAlertConfiguration.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/AnomalyAlertConfiguration.cs index 955e817855048..904c7d0bb9590 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/AnomalyAlertConfiguration.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/AnomalyAlertConfiguration.cs @@ -18,20 +18,10 @@ public partial class AnomalyAlertConfiguration /// /// Initializes a new instance of the class. /// - /// A custom name for this to be displayed on fired alerts. - /// The unique identifiers of the s that must be notified when an alert is detected by this configuration. - /// The configurations that define which anomalies are eligible for triggering an alert. - /// , , or is null. - /// is empty. - public AnomalyAlertConfiguration(string name, IList idsOfHooksToAlert, IList metricAlertConfigurations) + public AnomalyAlertConfiguration() { - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(idsOfHooksToAlert, nameof(idsOfHooksToAlert)); - Argument.AssertNotNull(metricAlertConfigurations, nameof(metricAlertConfigurations)); - - Name = name; - IdsOfHooksToAlert = idsOfHooksToAlert; - MetricAlertConfigurations = metricAlertConfigurations; + IdsOfHooksToAlert = new ChangeTrackingList(); + MetricAlertConfigurations = new ChangeTrackingList(); } /// @@ -43,7 +33,7 @@ public AnomalyAlertConfiguration(string name, IList idsOfHooksToAlert, I /// /// A custom name for this to be displayed on fired alerts. /// - public string Name { get; } + public string Name { get; set; } /// /// The unique identifiers of the s that must be notified when an alert is diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricAnomalyAlertSnoozeCondition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricAnomalyAlertSnoozeCondition.cs index 59d96274221ea..7eb504aa5680c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricAnomalyAlertSnoozeCondition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricAnomalyAlertSnoozeCondition.cs @@ -28,12 +28,12 @@ public MetricAnomalyAlertSnoozeCondition(int autoSnooze, SnoozeScope snoozeScope /// Defines the set of time series to which this /// applies. /// - public SnoozeScope SnoozeScope { get; } + public SnoozeScope SnoozeScope { get; set; } /// /// The number of data points to be ingested before alerts are enabled again. /// - public int AutoSnooze { get; } + public int AutoSnooze { get; set; } /// /// If true, snoozing will stop as soon as a data point that's not an anomaly is found. @@ -41,6 +41,6 @@ public MetricAnomalyAlertSnoozeCondition(int autoSnooze, SnoozeScope snoozeScope /// have been ingested. /// [CodeGenMember("OnlyForSuccessive")] - public bool IsOnlyForSuccessive { get; } + public bool IsOnlyForSuccessive { get; set; } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricBoundaryCondition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricBoundaryCondition.cs index 06282acf9b777..a0e09e86c8960 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricBoundaryCondition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/MetricBoundaryCondition.cs @@ -25,7 +25,7 @@ public MetricBoundaryCondition(BoundaryDirection direction) /// The direction of the specified boundaries. Depending on its value, /// and/or may be required. /// - public BoundaryDirection Direction { get; } + public BoundaryDirection Direction { get; set; } /// /// The minimum value a data point can assume to be able to trigger an alert. Must be set if diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/SeverityCondition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/SeverityCondition.cs index 9c0ebee902829..7ad8e25f7aa11 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/SeverityCondition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/AlertTriggering/SeverityCondition.cs @@ -25,12 +25,12 @@ public SeverityCondition(AnomalySeverity minimumAlertSeverity, AnomalySeverity m /// The minimum severity an anomaly must have to be able to trigger alerts. /// [CodeGenMember("MinAlertSeverity")] - public AnomalySeverity MinimumAlertSeverity { get; } + public AnomalySeverity MinimumAlertSeverity { get; set; } /// /// The maximum severity an anomaly must have to be able to trigger alerts. /// [CodeGenMember("MaxAlertSeverity")] - public AnomalySeverity MaximumAlertSeverity { get; } + public AnomalySeverity MaximumAlertSeverity { get; set; } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs index ec17901ab22f3..c4a165e612860 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs @@ -29,9 +29,12 @@ public async Task CreateAndGetAlertConfigurationWithWholeSeriesScope(bool useTok var metricAlertConfig = new MetricAnomalyAlertConfiguration(DetectionConfigurationId, scope); string configName = Recording.GenerateAlphaNumericId("config"); - var metricAlertConfigs = new List() { metricAlertConfig }; - var configToCreate = new AnomalyAlertConfiguration(configName, new List(), metricAlertConfigs); + var configToCreate = new AnomalyAlertConfiguration() + { + Name = configName, + MetricAlertConfigurations = { metricAlertConfig } + }; await using var disposableConfig = await DisposableAlertConfiguration.CreateAlertConfigurationAsync(adminClient, configToCreate); @@ -73,9 +76,12 @@ public async Task CreateAndGetAlertConfigurationWithSeriesGroupScope() var metricAlertConfig = new MetricAnomalyAlertConfiguration(DetectionConfigurationId, scope); string configName = Recording.GenerateAlphaNumericId("config"); - var metricAlertConfigs = new List() { metricAlertConfig }; - var configToCreate = new AnomalyAlertConfiguration(configName, new List(), metricAlertConfigs); + var configToCreate = new AnomalyAlertConfiguration() + { + Name = configName, + MetricAlertConfigurations = { metricAlertConfig } + }; await using var disposableConfig = await DisposableAlertConfiguration.CreateAlertConfigurationAsync(adminClient, configToCreate); @@ -121,9 +127,12 @@ public async Task CreateAndGetAlertConfigurationWithTopNScope() var metricAlertConfig = new MetricAnomalyAlertConfiguration(DetectionConfigurationId, scope); string configName = Recording.GenerateAlphaNumericId("config"); - var metricAlertConfigs = new List() { metricAlertConfig }; - var configToCreate = new AnomalyAlertConfiguration(configName, new List(), metricAlertConfigs); + var configToCreate = new AnomalyAlertConfiguration() + { + Name = configName, + MetricAlertConfigurations = { metricAlertConfig } + }; await using var disposableConfig = await DisposableAlertConfiguration.CreateAlertConfigurationAsync(adminClient, configToCreate); @@ -190,11 +199,12 @@ public async Task CreateAndGetAlertConfigurationWithOptionalSingleMetricConfigur string configName = Recording.GenerateAlphaNumericId("config"); var description = "This hook was created to test the .NET client."; - var hookIds = new List(){ disposableHook0.Id, disposableHook1.Id }; - var metricAlertConfigs = new List() { metricAlertConfig }; - var configToCreate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs) + var configToCreate = new AnomalyAlertConfiguration() { + Name = configName, + IdsOfHooksToAlert = { disposableHook0.Id, disposableHook1.Id }, + MetricAlertConfigurations = { metricAlertConfig }, Description = description }; @@ -206,7 +216,9 @@ public async Task CreateAndGetAlertConfigurationWithOptionalSingleMetricConfigur Assert.That(createdConfig.Name, Is.EqualTo(configName)); Assert.That(createdConfig.Description, Is.EqualTo(description)); Assert.That(createdConfig.CrossMetricsOperator, Is.Null); - Assert.That(createdConfig.IdsOfHooksToAlert, Is.EqualTo(hookIds)); + Assert.That(createdConfig.IdsOfHooksToAlert.Count, Is.EqualTo(2)); + Assert.That(createdConfig.IdsOfHooksToAlert.Contains(disposableHook0.Id)); + Assert.That(createdConfig.IdsOfHooksToAlert.Contains(disposableHook1.Id)); Assert.That(createdConfig.MetricAlertConfigurations, Is.Not.Null); MetricAnomalyAlertConfiguration createdMetricAlertConfig = createdConfig.MetricAlertConfigurations.Single(); @@ -264,10 +276,11 @@ public async Task CreateAndGetAlertConfigurationWithMultipleMetricConfigurations // Create the Anomaly Alert Configuration. string configName = Recording.GenerateAlphaNumericId("config"); - var metricAlertConfigs = new List() { metricAlertConfig0, metricAlertConfig1 }; - var configToCreate = new AnomalyAlertConfiguration(configName, new List(), metricAlertConfigs) + var configToCreate = new AnomalyAlertConfiguration() { + Name = configName, + MetricAlertConfigurations = { metricAlertConfig0, metricAlertConfig1 }, CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Xor }; @@ -372,8 +385,11 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndGetInstance(bool us var hookIds = new List() { disposableHook.Id }; var metricAlertConfigs = new List() { metricAlertConfig0, metricAlertConfig1 }; - var configToCreate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs) + var configToCreate = new AnomalyAlertConfiguration() { + Name = configName, + IdsOfHooksToAlert = { disposableHook.Id }, + MetricAlertConfigurations = { metricAlertConfig0, metricAlertConfig1 }, CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Xor }; @@ -447,6 +463,7 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndGetInstance(bool us } [RecordedTest] + [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/18447")] public async Task UpdateAlertConfigurationWithMinimumSetupAndNewInstance() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); @@ -481,11 +498,12 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndNewInstance() // Create the Anomaly Alert Configuration. string configName = Recording.GenerateAlphaNumericId("config"); - var hookIds = new List() { disposableHook.Id }; - var metricAlertConfigs = new List() { metricAlertConfig0, metricAlertConfig1 }; - var configToCreate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs) + var configToCreate = new AnomalyAlertConfiguration() { + Name = configName, + IdsOfHooksToAlert = { disposableHook.Id }, + MetricAlertConfigurations = { metricAlertConfig0, metricAlertConfig1 }, CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Xor }; @@ -493,9 +511,10 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndNewInstance() // Update the created configuration. - var configToUpdate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs); - - configToUpdate.CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Or; + var configToUpdate = new AnomalyAlertConfiguration() + { + CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Or + }; await adminClient.UpdateAlertConfigurationAsync(disposableConfig.Id, configToUpdate); @@ -507,7 +526,7 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndNewInstance() Assert.That(updatedConfig.Name, Is.EqualTo(configName)); Assert.That(updatedConfig.Description, Is.Empty); Assert.That(updatedConfig.CrossMetricsOperator, Is.EqualTo(MetricAnomalyAlertConfigurationsOperator.Or)); - Assert.That(updatedConfig.IdsOfHooksToAlert, Is.EqualTo(hookIds)); + Assert.That(updatedConfig.IdsOfHooksToAlert.Single(), Is.EqualTo(disposableHook.Id)); Assert.That(updatedConfig.MetricAlertConfigurations, Is.Not.Null); Assert.That(updatedConfig.MetricAlertConfigurations.Count, Is.EqualTo(2)); @@ -597,8 +616,11 @@ public async Task UpdateAlertConfigurationWithEveryMemberAndGetInstance() var hookIds = new List() { disposableHook.Id }; var metricAlertConfigs = new List() { metricAlertConfig0, metricAlertConfig1 }; - var configToCreate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs) + var configToCreate = new AnomalyAlertConfiguration() { + Name = configName, + IdsOfHooksToAlert = { disposableHook.Id }, + MetricAlertConfigurations = { metricAlertConfig0, metricAlertConfig1 }, CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Xor }; @@ -732,11 +754,12 @@ public async Task UpdateAlertConfigurationWithEveryMemberAndNewInstance() string configName = Recording.GenerateAlphaNumericId("config"); var description = "This hook was created to test the .NET client."; - var hookIds = new List() { disposableHook.Id }; - var metricAlertConfigs = new List() { metricAlertConfig0, metricAlertConfig1 }; - var configToCreate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs) + var configToCreate = new AnomalyAlertConfiguration() { + Name = configName, + IdsOfHooksToAlert = { disposableHook.Id }, + MetricAlertConfigurations = { metricAlertConfig0, metricAlertConfig1 }, CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Xor }; @@ -744,12 +767,14 @@ public async Task UpdateAlertConfigurationWithEveryMemberAndNewInstance() // Update the created configuration. - AnomalyAlertConfiguration configToUpdate = new AnomalyAlertConfiguration(configName, hookIds, metricAlertConfigs); + AnomalyAlertConfiguration configToUpdate = new AnomalyAlertConfiguration() + { + Description = description, + MetricAlertConfigurations = { metricAlertConfig0 }, + CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.And + }; - configToUpdate.Description = description; configToUpdate.IdsOfHooksToAlert.Clear(); - configToUpdate.CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.And; - configToUpdate.MetricAlertConfigurations.RemoveAt(1); var newScope = MetricAnomalyAlertScope.GetScopeForTopNGroup(new TopNGroupScope(50, 40, 30)); var newMetricAlertConfig = new MetricAnomalyAlertConfiguration(DetectionConfigurationId, newScope) @@ -896,8 +921,11 @@ public async Task DeleteAlertConfiguration(bool useTokenCredential) string configName = Recording.GenerateAlphaNumericId("config"); var scope = MetricAnomalyAlertScope.GetScopeForWholeSeries(); - var metricAlertConfigs = new List() { new (DetectionConfigurationId, scope) }; - var configToCreate = new AnomalyAlertConfiguration(DetectionConfigurationId, new List(), metricAlertConfigs); + var configToCreate = new AnomalyAlertConfiguration() + { + Name = configName, + MetricAlertConfigurations = { new (DetectionConfigurationId, scope) } + }; string configId = null; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs index f6438337b4ebe..a5c91b6c098fb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationTests.cs @@ -24,9 +24,17 @@ public void CreateAlertConfigurationValidatesArguments() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); - Assert.That(() => adminClient.CreateAlertConfigurationAsync(null), Throws.InstanceOf()); + var config = new AnomalyAlertConfiguration() { Name = null }; + Assert.That(() => adminClient.CreateAlertConfigurationAsync(null), Throws.InstanceOf()); Assert.That(() => adminClient.CreateAlertConfiguration(null), Throws.InstanceOf()); + + Assert.That(() => adminClient.CreateAlertConfigurationAsync(config), Throws.InstanceOf()); + Assert.That(() => adminClient.CreateAlertConfiguration(config), Throws.InstanceOf()); + + config.Name = ""; + Assert.That(() => adminClient.CreateAlertConfigurationAsync(config), Throws.InstanceOf()); + Assert.That(() => adminClient.CreateAlertConfiguration(config), Throws.InstanceOf()); } [Test] @@ -34,11 +42,7 @@ public void CreateAlertConfigurationRespectsTheCancellationToken() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); - var metricConfigs = new List() - { - new MetricAnomalyAlertConfiguration(FakeGuid, MetricAnomalyAlertScope.GetScopeForWholeSeries()) - }; - var config = new AnomalyAlertConfiguration("configName", new List(), metricConfigs); + var config = new AnomalyAlertConfiguration() { Name = "configName" }; using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); @@ -52,11 +56,7 @@ public void UpdateAlertConfigurationValidatesArguments() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); - var metricConfigs = new List() - { - new MetricAnomalyAlertConfiguration(FakeGuid, MetricAnomalyAlertScope.GetScopeForWholeSeries()) - }; - var config = new AnomalyAlertConfiguration("configName", new List(), metricConfigs); + var config = new AnomalyAlertConfiguration(); Assert.That(() => adminClient.UpdateAlertConfigurationAsync(null, config), Throws.InstanceOf()); Assert.That(() => adminClient.UpdateAlertConfigurationAsync("", config), Throws.InstanceOf()); @@ -74,11 +74,7 @@ public void UpdateAlertConfigurationRespectsTheCancellationToken() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); - var metricConfigs = new List() - { - new MetricAnomalyAlertConfiguration(FakeGuid, MetricAnomalyAlertScope.GetScopeForWholeSeries()) - }; - var config = new AnomalyAlertConfiguration("configName", new List(), metricConfigs); + var config = new AnomalyAlertConfiguration(); using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs index a139fe2075ab4..17047409573af 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs @@ -31,15 +31,18 @@ public async Task CreateAndDeleteAlertConfigurationAsync() //@@ string anomalyDetectionConfigurationId = ""; string configurationName = "Sample anomaly alert configuration"; - var idsOfHooksToAlert = new List() { hookId }; - var scope = MetricAnomalyAlertScope.GetScopeForWholeSeries(); - var metricAlertConfigurations = new List() + AnomalyAlertConfiguration alertConfiguration = new AnomalyAlertConfiguration() { - new MetricAnomalyAlertConfiguration(anomalyDetectionConfigurationId, scope) + Name = configurationName }; - AnomalyAlertConfiguration alertConfiguration = new AnomalyAlertConfiguration(configurationName, idsOfHooksToAlert, metricAlertConfigurations); + alertConfiguration.IdsOfHooksToAlert.Add(hookId); + + var scope = MetricAnomalyAlertScope.GetScopeForWholeSeries(); + var metricAlertConfiguration = new MetricAnomalyAlertConfiguration(anomalyDetectionConfigurationId, scope); + + alertConfiguration.MetricAlertConfigurations.Add(metricAlertConfiguration); Response response = await adminClient.CreateAlertConfigurationAsync(alertConfiguration); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False).json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False).json index 9abcf7a9d7060..9cf84b04dbb4e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False).json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False).json @@ -5,17 +5,17 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "193", + "Content-Length": "171", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-f6bc9d3e93fe9a4cbb9e88892433e599-f2081dc5932cff4d-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-39a5aa9aeddbaa409974238fa10317f2-70662f3853ce044b-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "9ff5d74238cc803d2cce996cd6d34728", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", + "name": "configsUChpHC2", "hookIds": [], "metricAlertingConfigurations": [ { @@ -26,25 +26,25 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "03eeac3e-7232-44f1-8fd1-af7bc967c741", + "apim-request-id": "bb1588af-b42e-4167-b3e6-18e2c9a3fd23", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:39 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/f9ca78d2-9cf2-40b5-b1ad-7a1643c45ac6", + "Date": "Thu, 04 Feb 2021 21:15:00 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/9618b166-c4fc-4ffa-8a64-2e3951e838da", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "120", - "x-request-id": "03eeac3e-7232-44f1-8fd1-af7bc967c741" + "x-envoy-upstream-service-time": "123", + "x-request-id": "bb1588af-b42e-4167-b3e6-18e2c9a3fd23" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/f9ca78d2-9cf2-40b5-b1ad-7a1643c45ac6", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/9618b166-c4fc-4ffa-8a64-2e3951e838da", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-9a3f8423ca96124fb838baca00a92075-ebab251f40ed9a4e-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-5ae4def6c258444a83fa89ce9dd45e21-972cabfc37ba3241-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "a1794ec541487dd3e9b4f2a906fb9137", "x-ms-return-client-request-id": "true" @@ -52,24 +52,24 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "1fb26676-b05f-400b-b913-5e3fbecf3c2e", + "apim-request-id": "b253bace-4bc3-4306-bd74-6841f9578d12", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:39 GMT", + "Date": "Thu, 04 Feb 2021 21:15:00 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "102", - "x-request-id": "1fb26676-b05f-400b-b913-5e3fbecf3c2e" + "x-envoy-upstream-service-time": "111", + "x-request-id": "b253bace-4bc3-4306-bd74-6841f9578d12" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/f9ca78d2-9cf2-40b5-b1ad-7a1643c45ac6", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/9618b166-c4fc-4ffa-8a64-2e3951e838da", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-dc7ba5ef683a174b8e534f3e7c25b071-4be74568021a1d46-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-c13805f5633e3a469ce25749f76db6be-b6f0874a91a7fc43-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "971711cabfb06649f5258ecdb24f0226", "x-ms-return-client-request-id": "true" @@ -77,18 +77,18 @@ "RequestBody": null, "StatusCode": 404, "ResponseHeaders": { - "apim-request-id": "6fb24f37-5fb0-4310-bfde-334c8c9dbaa7", + "apim-request-id": "9fafc240-10f1-4459-95ad-3d94e7c242e3", "Content-Length": "123", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 19 Jan 2021 17:57:39 GMT", + "Date": "Thu, 04 Feb 2021 21:15:00 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "68", - "x-request-id": "6fb24f37-5fb0-4310-bfde-334c8c9dbaa7" + "x-envoy-upstream-service-time": "69", + "x-request-id": "9fafc240-10f1-4459-95ad-3d94e7c242e3" }, "ResponseBody": { "code": "Not Found", - "message": "Not found this AnomalyAlertingConfiguration. TraceId: df9963ab-f430-415c-9c0f-868c4aa715d7" + "message": "Not found this AnomalyAlertingConfiguration. TraceId: 5ee799ac-ff46-416b-9ed3-30f7c4e0ffe4" } } ], diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False)Async.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False)Async.json index a749398210926..2003b645847e5 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False)Async.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(False)Async.json @@ -5,17 +5,17 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "193", + "Content-Length": "171", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-fc632c411f1529458d14a3846f0bf49b-11a6102bca926c44-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-56c6c09c5af6404c94b966dcc4123282-02ec92759524a44f-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "f790259472215d0349a3c4dde9b1398a", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", + "name": "config2uxnFFBF", "hookIds": [], "metricAlertingConfigurations": [ { @@ -26,25 +26,25 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "739e0d11-a8a0-4ba4-a374-50ada2ea643f", + "apim-request-id": "6d1b4e5a-bea9-49f1-b4d8-719e89277fd6", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:48 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d018a7e2-eabd-4514-b5f3-75139fcc131c", + "Date": "Thu, 04 Feb 2021 21:15:07 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3ab96833-67ca-41af-baf7-4b6a0b63bc6b", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "117", - "x-request-id": "739e0d11-a8a0-4ba4-a374-50ada2ea643f" + "x-envoy-upstream-service-time": "115", + "x-request-id": "6d1b4e5a-bea9-49f1-b4d8-719e89277fd6" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d018a7e2-eabd-4514-b5f3-75139fcc131c", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3ab96833-67ca-41af-baf7-4b6a0b63bc6b", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-92bd7fbabca75d4c80cbcc9cdd12c5b2-a6abdb9e18922140-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-f67f7ef65f5e4443bdd95df869a65a3c-033bcbd120000548-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "edf1b65e0edb93db09858949bd83abae", "x-ms-return-client-request-id": "true" @@ -52,24 +52,24 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "77756397-e659-4c02-a65b-32285aa41ea5", + "apim-request-id": "0df00b0d-ee13-44a2-bca6-0cd958de3fed", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:48 GMT", + "Date": "Thu, 04 Feb 2021 21:15:07 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "116", - "x-request-id": "77756397-e659-4c02-a65b-32285aa41ea5" + "x-envoy-upstream-service-time": "98", + "x-request-id": "0df00b0d-ee13-44a2-bca6-0cd958de3fed" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d018a7e2-eabd-4514-b5f3-75139fcc131c", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3ab96833-67ca-41af-baf7-4b6a0b63bc6b", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-d01f8e76eaa434459d0263433b9b9659-105580f08bef2c48-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-f43d7472a7cd9d428e377671ddbe10cf-d431e581baac5046-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "7dfd3bd8b06fe191205121a6f9e6ba93", "x-ms-return-client-request-id": "true" @@ -77,18 +77,18 @@ "RequestBody": null, "StatusCode": 404, "ResponseHeaders": { - "apim-request-id": "b79e9492-3b70-432c-949e-7f360a958bef", + "apim-request-id": "994fb498-56f5-4348-936c-5fe7b1cc56de", "Content-Length": "123", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 19 Jan 2021 17:57:49 GMT", + "Date": "Thu, 04 Feb 2021 21:15:08 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", "x-envoy-upstream-service-time": "69", - "x-request-id": "b79e9492-3b70-432c-949e-7f360a958bef" + "x-request-id": "994fb498-56f5-4348-936c-5fe7b1cc56de" }, "ResponseBody": { "code": "Not Found", - "message": "Not found this AnomalyAlertingConfiguration. TraceId: a6a88b4e-4e9b-4a4a-b50b-596e8edb904b" + "message": "Not found this AnomalyAlertingConfiguration. TraceId: fc480222-dd8f-40e5-b56d-6758e8a7a0d0" } } ], diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True).json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True).json index 7e344c632eb8f..9d0d317fe00bd 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True).json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True).json @@ -6,15 +6,15 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "193", + "Content-Length": "171", "Content-Type": "application/json", - "traceparent": "00-baa5f83afd8bf247bdb6c9a08c2e21cd-19bf2468c9006846-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-543683d87905ba47b2b720e61fc0d33b-6506150754c85b4f-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "49e42a47b986162b5a914d9bb48c2eed", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", + "name": "configrhEIkenj", "hookIds": [], "metricAlertingConfigurations": [ { @@ -25,67 +25,67 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "1a8f4b97-60d5-4ace-9372-cbdee0620f51", + "apim-request-id": "b4135447-4dff-4df9-82ed-0a68bfe790a1", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:39 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/723b5cc5-3916-479a-a78f-8ef5106d57bb", + "Date": "Thu, 04 Feb 2021 21:14:58 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/971c67ba-849e-4ffe-ba0a-ade2ad44966e", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "59", - "x-request-id": "1a8f4b97-60d5-4ace-9372-cbdee0620f51" + "x-envoy-upstream-service-time": "194", + "x-request-id": "b4135447-4dff-4df9-82ed-0a68bfe790a1" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/723b5cc5-3916-479a-a78f-8ef5106d57bb", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/971c67ba-849e-4ffe-ba0a-ade2ad44966e", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-4b14d92bb5ce3a40aee999059b3e7745-76186f2d35c25041-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-4749b9fede771545bba17dfef821e231-91a9996cb3b35b4c-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "db56131897cc92f45e5a634eeb76dcef", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "e76daff8-9bf6-4384-b0f4-98c4c87b0194", + "apim-request-id": "a6c4b931-ca0d-4430-837a-5ecc5374a665", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:39 GMT", + "Date": "Thu, 04 Feb 2021 21:14:59 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "50", - "x-request-id": "e76daff8-9bf6-4384-b0f4-98c4c87b0194" + "x-envoy-upstream-service-time": "164", + "x-request-id": "a6c4b931-ca0d-4430-837a-5ecc5374a665" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/723b5cc5-3916-479a-a78f-8ef5106d57bb", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/971c67ba-849e-4ffe-ba0a-ade2ad44966e", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-dfa56f3054791947b17c591a91bda919-e31c9f9d9fa23841-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-59ab2e842cae004a9d7b62904c2c6a24-fa4335e8f672dd46-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "50617b01f9a9f789a15d88603d05ed52", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 404, "ResponseHeaders": { - "apim-request-id": "55e7e0e5-2672-4494-90cb-97be67493bb6", + "apim-request-id": "0fc404ed-4ae2-4fcf-ae0a-679a9a9d178f", "Content-Length": "123", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 19 Jan 2021 17:57:39 GMT", + "Date": "Thu, 04 Feb 2021 21:14:59 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "20", - "x-request-id": "55e7e0e5-2672-4494-90cb-97be67493bb6" + "x-envoy-upstream-service-time": "313", + "x-request-id": "0fc404ed-4ae2-4fcf-ae0a-679a9a9d178f" }, "ResponseBody": { "code": "Not Found", - "message": "Not found this AnomalyAlertingConfiguration. TraceId: 96dbf70a-6257-480e-af6d-7cb90ed798db" + "message": "Not found this AnomalyAlertingConfiguration. TraceId: 775221f4-47a4-45fe-b2dd-b655c29f5f4e" } } ], diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True)Async.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True)Async.json index f07cd6bfd9b45..c2520bc7d1c60 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True)Async.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/DeleteAlertConfiguration(True)Async.json @@ -6,15 +6,15 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "193", + "Content-Length": "171", "Content-Type": "application/json", - "traceparent": "00-3769e2a2d2213347b6684d19e82aa48e-d21e7241a4a5f045-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-3b772693efee02429903a603b0181549-65392a1c2466134e-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "d47b4268b29c67acc618b38070805b95", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", + "name": "configCCysdj7O", "hookIds": [], "metricAlertingConfigurations": [ { @@ -25,67 +25,67 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "25f87740-7ff1-4191-a831-3c1fc914d415", + "apim-request-id": "ef07cca8-072b-4d42-abe3-f66db72d44bb", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:48 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7bc0bd1a-3304-4185-af47-cb34af0ca2e0", + "Date": "Thu, 04 Feb 2021 21:15:07 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/da7a6177-b4db-43de-86b5-e2f798b43eac", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "70", - "x-request-id": "25f87740-7ff1-4191-a831-3c1fc914d415" + "x-envoy-upstream-service-time": "66", + "x-request-id": "ef07cca8-072b-4d42-abe3-f66db72d44bb" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7bc0bd1a-3304-4185-af47-cb34af0ca2e0", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/da7a6177-b4db-43de-86b5-e2f798b43eac", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-d9275ef50d06a045801550995bb199fa-014fd9d04046f340-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-8bb7e3bedc282543b6170c7e29e7fa29-1a389167efce8141-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "b35807a6fdef510d09f3f393fad723a4", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "878c9ff6-0451-427d-b04f-73fdeb1a42f9", + "apim-request-id": "7d4e2b04-2e57-4207-a1f0-f4fb930b92bc", "Content-Length": "0", - "Date": "Tue, 19 Jan 2021 17:57:48 GMT", + "Date": "Thu, 04 Feb 2021 21:15:07 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "47", - "x-request-id": "878c9ff6-0451-427d-b04f-73fdeb1a42f9" + "x-envoy-upstream-service-time": "59", + "x-request-id": "7d4e2b04-2e57-4207-a1f0-f4fb930b92bc" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7bc0bd1a-3304-4185-af47-cb34af0ca2e0", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/da7a6177-b4db-43de-86b5-e2f798b43eac", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-c5888140df0d5e49b9b3819845024d4f-db344865e57fde42-00", - "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210119.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "traceparent": "00-a5dbc950eec7e94ab65aa264ee9f93b5-4ce5398d1bdee44b-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "fd64eef108603e3c5cfa00f0f562d480", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 404, "ResponseHeaders": { - "apim-request-id": "500ce29e-7509-4e8d-9556-d5e558ef45e9", + "apim-request-id": "bb2dd546-ba20-40ae-bb94-8b674125ca59", "Content-Length": "123", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 19 Jan 2021 17:57:48 GMT", + "Date": "Thu, 04 Feb 2021 21:15:07 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "21", - "x-request-id": "500ce29e-7509-4e8d-9556-d5e558ef45e9" + "x-envoy-upstream-service-time": "155", + "x-request-id": "bb2dd546-ba20-40ae-bb94-8b674125ca59" }, "ResponseBody": { "code": "Not Found", - "message": "Not found this AnomalyAlertingConfiguration. TraceId: 60755953-b36f-4b5d-9fc5-e4c9ce4da525" + "message": "Not found this AnomalyAlertingConfiguration. TraceId: 90ff1445-bd50-440a-9a5a-7d48491ca50a" } } ], diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstance.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstance.json index cb26761c73c85..ab88c8a87bd81 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstance.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstance.json @@ -8,11 +8,8 @@ "Content-Length": "98", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-9634ec4da9c05b46bad652d59c012f89-626845cde96cf44b-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-673fb7683fc1ce41ba33f958b3ef224a-2e172e93f4e12b4a-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "a557d9a5886b8b49d9e6860c22d9efaa", "x-ms-return-client-request-id": "true" @@ -26,14 +23,14 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "55a4e025-f7cd-4e5f-8adc-e9f021961f1e", + "apim-request-id": "463d6c94-a83b-4ca2-9d61-c8fed530a086", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:10 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/8fbf3ae7-4130-4b24-8891-709687a6beae", + "Date": "Thu, 04 Feb 2021 21:14:48 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/06c6de31-97a5-41c1-96b4-7799fd55825b", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "740", - "X-Request-ID": "55a4e025-f7cd-4e5f-8adc-e9f021961f1e" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "1050", + "x-request-id": "463d6c94-a83b-4ca2-9d61-c8fed530a086" }, "ResponseBody": [] }, @@ -45,11 +42,8 @@ "Content-Length": "648", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-4407b1d99463934e9ea5ced4f8f92da0-02779dc1012c5543-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-5a92f8a1a89f3640875f9817f29c664c-703438688f93ad41-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "11fbf12e0cb17f55394128b5481353f6", "x-ms-return-client-request-id": "true" @@ -58,7 +52,7 @@ "name": "configASxi3Wsh", "crossMetricsOperator": "XOR", "hookIds": [ - "8fbf3ae7-4130-4b24-8891-709687a6beae" + "06c6de31-97a5-41c1-96b4-7799fd55825b" ], "metricAlertingConfigurations": [ { @@ -90,36 +84,32 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "09d29e1c-8cd4-41a2-87cf-3e21665db888", + "apim-request-id": "dbf6cc71-6912-41bf-b88b-f26eae2618c6", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:11 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/72ed515f-0d84-44db-9595-037de37d5696", + "Date": "Thu, 04 Feb 2021 21:14:51 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/dec16400-6bff-45e3-88bd-9cd3151e0c7a", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "126", - "X-Request-ID": "09d29e1c-8cd4-41a2-87cf-3e21665db888" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "1999", + "x-request-id": "dbf6cc71-6912-41bf-b88b-f26eae2618c6" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/72ed515f-0d84-44db-9595-037de37d5696", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/dec16400-6bff-45e3-88bd-9cd3151e0c7a", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "683", + "Content-Length": "659", "Content-Type": "application/merge-patch\u002Bjson", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-4cbb3de36d391e4992d3cf4e7bf9718b-102c5ac609c30a4f-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-354b965793db6547bd0d57a67ca3b304-693586a67e3ec14d-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "511b448603ad05a24938456bfa66886a", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "configASxi3Wsh", "description": "This hook was created to test the .NET client.", "crossMetricsOperator": "AND", "hookIds": [], @@ -157,27 +147,24 @@ }, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "52d8a318-70c4-461c-aeb6-46b573451888", + "apim-request-id": "e1ec7688-ca6c-44c4-9d77-dd39cca289ad", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:11 GMT", + "Date": "Thu, 04 Feb 2021 21:14:52 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "129", - "X-Request-ID": "52d8a318-70c4-461c-aeb6-46b573451888" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "315", + "x-request-id": "e1ec7688-ca6c-44c4-9d77-dd39cca289ad" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/72ed515f-0d84-44db-9595-037de37d5696", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/dec16400-6bff-45e3-88bd-9cd3151e0c7a", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-c1391c5b7f2c0a4e9123fbe5f3f7509e-8a003e11a1952044-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-5b2a3314b464ba4a953b3e54710cc968-cac7faaac6ab7d41-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "7a77f8e6388ccdda9106d3e0b13a6121", "x-ms-return-client-request-id": "true" @@ -185,17 +172,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "5ef54231-51c0-4130-8bd0-a4ff4a53a8f8", + "apim-request-id": "36bc4638-00c9-4116-b6d2-6f00cd129991", "Content-Length": "785", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 22 Dec 2020 02:28:11 GMT", + "Date": "Thu, 04 Feb 2021 21:14:52 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "77", - "X-Request-ID": "5ef54231-51c0-4130-8bd0-a4ff4a53a8f8" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "180", + "x-request-id": "36bc4638-00c9-4116-b6d2-6f00cd129991" }, "ResponseBody": { - "anomalyAlertingConfigurationId": "72ed515f-0d84-44db-9595-037de37d5696", + "anomalyAlertingConfigurationId": "dec16400-6bff-45e3-88bd-9cd3151e0c7a", "name": "configASxi3Wsh", "description": "This hook was created to test the .NET client.", "crossMetricsOperator": "AND", @@ -235,16 +222,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/72ed515f-0d84-44db-9595-037de37d5696", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/dec16400-6bff-45e3-88bd-9cd3151e0c7a", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-ac817e0b2d340446a9752d7bb562aa46-d600d7c5ab4a5c42-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-61f3e9f8a64b384cb82fb769fb4390f8-d38777bbae455340-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "32a7fdc6a21f2bb04ef6c778c6e985d2", "x-ms-return-client-request-id": "true" @@ -252,27 +236,24 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "3a2b265f-3672-4476-a707-e6298207650b", + "apim-request-id": "ace857f0-bb5e-4e24-be8d-49ff9b3f4eb8", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:11 GMT", + "Date": "Thu, 04 Feb 2021 21:14:52 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "113", - "X-Request-ID": "3a2b265f-3672-4476-a707-e6298207650b" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "154", + "x-request-id": "ace857f0-bb5e-4e24-be8d-49ff9b3f4eb8" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/8fbf3ae7-4130-4b24-8891-709687a6beae", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/06c6de31-97a5-41c1-96b4-7799fd55825b", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-03f6886bf350e942861916ecad37051b-2f1bba14323a384e-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-60e02918b4f7fd4a8a83e2a3b5e8e376-b050079e21f94340-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "50cfbeb8d99b4d696a4ec0a730c1530f", "x-ms-return-client-request-id": "true" @@ -280,13 +261,13 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "03445367-e41d-4bac-af22-08c5ecee50e7", + "apim-request-id": "faf92a56-e5dd-4671-b2ad-87f4c64c0995", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:11 GMT", + "Date": "Thu, 04 Feb 2021 21:14:53 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "179", - "X-Request-ID": "03445367-e41d-4bac-af22-08c5ecee50e7" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "211", + "x-request-id": "faf92a56-e5dd-4671-b2ad-87f4c64c0995" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstanceAsync.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstanceAsync.json index a62fdbfa1bd56..d642d1dbb147b 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstanceAsync.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithEveryMemberAndNewInstanceAsync.json @@ -8,11 +8,8 @@ "Content-Length": "98", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-440734f74d3eaf4d9ee41d40fc1a34f6-9bea234ab7122147-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-fafc0ac0d5de6c41b50630b6ef213669-fcfdd1480e091940-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "355a31a13708170ff784b197e1af996c", "x-ms-return-client-request-id": "true" @@ -26,14 +23,14 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "41cf31ff-8deb-459c-b496-2d08dbc189f4", + "apim-request-id": "86ab1347-8324-436c-9e67-67d8ff59b7f6", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:25 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/558ff3c4-7d66-49b1-b249-3ac991b3932e", + "Date": "Thu, 04 Feb 2021 21:15:02 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/63606e17-d495-47a6-b622-a8d58ea37d4c", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "905", - "X-Request-ID": "41cf31ff-8deb-459c-b496-2d08dbc189f4" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "1161", + "x-request-id": "86ab1347-8324-436c-9e67-67d8ff59b7f6" }, "ResponseBody": [] }, @@ -45,11 +42,8 @@ "Content-Length": "648", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-41238cf0070e694b8976527338ae6732-ed16311b70039e4f-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-24053019141a734aaf27075259f8641d-685fba65d8aa5d46-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "6dca5c0556fcdcfb26ae9d4b89da29bc", "x-ms-return-client-request-id": "true" @@ -58,7 +52,7 @@ "name": "confignSIYRHjo", "crossMetricsOperator": "XOR", "hookIds": [ - "558ff3c4-7d66-49b1-b249-3ac991b3932e" + "63606e17-d495-47a6-b622-a8d58ea37d4c" ], "metricAlertingConfigurations": [ { @@ -90,36 +84,32 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "23c7f8ec-998e-46d3-a30b-e233e8765d2a", + "apim-request-id": "888dae21-f861-45f4-9942-c4cceeb1f08d", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:25 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/189ac968-9e2d-4821-91bf-625f6150ea19", + "Date": "Thu, 04 Feb 2021 21:15:02 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d9f049d5-b544-41e6-ad7e-363057657d07", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "150", - "X-Request-ID": "23c7f8ec-998e-46d3-a30b-e233e8765d2a" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "162", + "x-request-id": "888dae21-f861-45f4-9942-c4cceeb1f08d" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/189ac968-9e2d-4821-91bf-625f6150ea19", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d9f049d5-b544-41e6-ad7e-363057657d07", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "683", + "Content-Length": "659", "Content-Type": "application/merge-patch\u002Bjson", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-7b7dccdfbf21e4478aa6942ff388dad3-8d4650b7f4fc7649-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-4fef0cde1ef8564da8b0454f6a732a88-1278949bbf92cb48-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "2ea15abfcfad535727b63fc807e1bf02", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "confignSIYRHjo", "description": "This hook was created to test the .NET client.", "crossMetricsOperator": "AND", "hookIds": [], @@ -157,27 +147,24 @@ }, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "7824a3b6-ada7-415c-b562-190820a7aab0", + "apim-request-id": "0a704b17-3019-4280-809d-21491047248b", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:25 GMT", + "Date": "Thu, 04 Feb 2021 21:15:02 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "129", - "X-Request-ID": "7824a3b6-ada7-415c-b562-190820a7aab0" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "135", + "x-request-id": "0a704b17-3019-4280-809d-21491047248b" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/189ac968-9e2d-4821-91bf-625f6150ea19", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d9f049d5-b544-41e6-ad7e-363057657d07", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-37cac0957cdcdd49bda4a72fa0bbdb64-5f9afa4da830d54d-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-21b5663e551d9442baae45a37524fbca-24242642e523414d-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "ab2f3605a26ca01b89d57132114ee3cd", "x-ms-return-client-request-id": "true" @@ -185,17 +172,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "6d046ce0-0c15-49d6-b16d-9ca825622f13", + "apim-request-id": "a1d93488-29fe-41dc-b825-73069986ef26", "Content-Length": "785", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 22 Dec 2020 02:28:25 GMT", + "Date": "Thu, 04 Feb 2021 21:15:02 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "99", - "X-Request-ID": "6d046ce0-0c15-49d6-b16d-9ca825622f13" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "86", + "x-request-id": "a1d93488-29fe-41dc-b825-73069986ef26" }, "ResponseBody": { - "anomalyAlertingConfigurationId": "189ac968-9e2d-4821-91bf-625f6150ea19", + "anomalyAlertingConfigurationId": "d9f049d5-b544-41e6-ad7e-363057657d07", "name": "confignSIYRHjo", "description": "This hook was created to test the .NET client.", "crossMetricsOperator": "AND", @@ -235,16 +222,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/189ac968-9e2d-4821-91bf-625f6150ea19", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/d9f049d5-b544-41e6-ad7e-363057657d07", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-3c504ee3eb61d141b93facbe12cb6e9e-dcf13123e2ae7d4a-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-9f2c77862862734a86a94b7653208dac-8406707340dc3243-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "337a0700fefd3677047745451732d445", "x-ms-return-client-request-id": "true" @@ -252,27 +236,24 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "2691e39e-e04a-491b-b4ed-4b3d6030f9ba", + "apim-request-id": "b58a35c8-6900-414b-b979-da477d19ab5a", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:26 GMT", + "Date": "Thu, 04 Feb 2021 21:15:03 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "124", - "X-Request-ID": "2691e39e-e04a-491b-b4ed-4b3d6030f9ba" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "156", + "x-request-id": "b58a35c8-6900-414b-b979-da477d19ab5a" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/558ff3c4-7d66-49b1-b249-3ac991b3932e", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/63606e17-d495-47a6-b622-a8d58ea37d4c", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-9b99e262b8e4784199ee6690bbac1b42-c2b48fa3566e8c49-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-3206fac251857c4f9ccd1c94418adfbe-26cd7e3bb197324d-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210204.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "52469bef7daa1d4f3e00a4d75d2541d8", "x-ms-return-client-request-id": "true" @@ -280,13 +261,13 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "e20f8121-59c3-48a0-99e5-c4e945ebeda6", + "apim-request-id": "b875d9c3-6f6e-4031-b792-90caaa5f61e8", "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:26 GMT", + "Date": "Thu, 04 Feb 2021 21:15:03 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "179", - "X-Request-ID": "e20f8121-59c3-48a0-99e5-c4e945ebeda6" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "189", + "x-request-id": "b875d9c3-6f6e-4031-b792-90caaa5f61e8" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithMinimumSetupAndNewInstance.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithMinimumSetupAndNewInstance.json deleted file mode 100644 index d178c7e8027dd..0000000000000 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithMinimumSetupAndNewInstance.json +++ /dev/null @@ -1,296 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "98", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-be9e959e79162a4babbd1e8c23bc07a3-5e930487e9ae084a-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "c205b4c4fd60e39fd4a2b49f9e2364db", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "hookParameter": { - "endpoint": "http://contoso.com" - }, - "hookType": "Webhook", - "hookName": "hookCbmaRckO" - }, - "StatusCode": 201, - "ResponseHeaders": { - "apim-request-id": "b682e43c-6214-49eb-8e29-31ab19025de4", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:14 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5528778e-896b-476f-952e-5ab86ce138f9", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "669", - "X-Request-ID": "b682e43c-6214-49eb-8e29-31ab19025de4" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "648", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-fe3f48566e348a4aa9aa1f2ac521d6f2-2e22bf1000e30645-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "1e04315272ee1d82d3b4a6e6e9edce4c", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "name": "configbmc8z96Z", - "crossMetricsOperator": "XOR", - "hookIds": [ - "5528778e-896b-476f-952e-5ab86ce138f9" - ], - "metricAlertingConfigurations": [ - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "severityFilter": { - "minAlertSeverity": "Low", - "maxAlertSeverity": "Medium" - }, - "snoozeFilter": { - "autoSnooze": 12, - "snoozeScope": "Series", - "onlyForSuccessive": true - }, - "valueFilter": { - "lower": 10, - "upper": 20, - "direction": "Both", - "metricId": "27e3015f-04fd-44ba-a20b-bc529a0aebae", - "triggerForMissing": true - } - }, - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": true - } - ] - }, - "StatusCode": 201, - "ResponseHeaders": { - "apim-request-id": "3de24307-c754-4536-9262-d4a7fd61bdb3", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:15 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7985c8bd-0723-426b-a513-2b91da2076e1", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "143", - "X-Request-ID": "3de24307-c754-4536-9262-d4a7fd61bdb3" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7985c8bd-0723-426b-a513-2b91da2076e1", - "RequestMethod": "PATCH", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "647", - "Content-Type": "application/merge-patch\u002Bjson", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-5af8d8108aaf0440b4222561b603f926-db2427977ae1ba4f-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "41dfd3fd18b53a8ca256a06285068e80", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "name": "configbmc8z96Z", - "crossMetricsOperator": "OR", - "hookIds": [ - "5528778e-896b-476f-952e-5ab86ce138f9" - ], - "metricAlertingConfigurations": [ - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "severityFilter": { - "minAlertSeverity": "Low", - "maxAlertSeverity": "Medium" - }, - "snoozeFilter": { - "autoSnooze": 12, - "snoozeScope": "Series", - "onlyForSuccessive": true - }, - "valueFilter": { - "lower": 10, - "upper": 20, - "direction": "Both", - "metricId": "27e3015f-04fd-44ba-a20b-bc529a0aebae", - "triggerForMissing": true - } - }, - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": true - } - ] - }, - "StatusCode": 204, - "ResponseHeaders": { - "apim-request-id": "4a43c16d-ebc9-4991-92ac-da1b372df1fe", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:15 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "166", - "X-Request-ID": "4a43c16d-ebc9-4991-92ac-da1b372df1fe" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7985c8bd-0723-426b-a513-2b91da2076e1", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-20a037817f3afd4596a72ab707255575-5c4214c0992b5b44-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "2f70ecaf81f962f42096cce97c7df164", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "5e0ab4aa-c097-40c6-bfbc-5ab93f10346a", - "Content-Length": "766", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 22 Dec 2020 02:28:15 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "84", - "X-Request-ID": "5e0ab4aa-c097-40c6-bfbc-5ab93f10346a" - }, - "ResponseBody": { - "anomalyAlertingConfigurationId": "7985c8bd-0723-426b-a513-2b91da2076e1", - "name": "configbmc8z96Z", - "description": "", - "crossMetricsOperator": "OR", - "hookIds": [ - "5528778e-896b-476f-952e-5ab86ce138f9" - ], - "metricAlertingConfigurations": [ - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": false, - "severityFilter": { - "minAlertSeverity": "Low", - "maxAlertSeverity": "Medium" - }, - "snoozeFilter": { - "autoSnooze": 12, - "snoozeScope": "Series", - "onlyForSuccessive": true - }, - "valueFilter": { - "lower": 10.0, - "upper": 20.0, - "direction": "Both", - "metricId": "27e3015f-04fd-44ba-a20b-bc529a0aebae", - "triggerForMissing": true - } - }, - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": true - } - ] - } - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/7985c8bd-0723-426b-a513-2b91da2076e1", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-a96121ccafe3134b9e9687c9b54a3b67-1bd1f90c7cc6d549-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "5d05c6bbc3643962a4c97b97d11f97cc", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 204, - "ResponseHeaders": { - "apim-request-id": "a9f19624-5be5-478c-a1e9-952e78a2a1c9", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:15 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "120", - "X-Request-ID": "a9f19624-5be5-478c-a1e9-952e78a2a1c9" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5528778e-896b-476f-952e-5ab86ce138f9", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-333b3126e973a146829d85bf1ea43644-762d3a8b23411048-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "fc3726259f7d7b53de7c201f4ca2be24", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 204, - "ResponseHeaders": { - "apim-request-id": "f68f1e7a-1650-464e-a9fa-55136bddaed9", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:16 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "182", - "X-Request-ID": "f68f1e7a-1650-464e-a9fa-55136bddaed9" - }, - "ResponseBody": [] - } - ], - "Variables": { - "METRICSADVISOR_ACCOUNT_NAME": "js-metrics-advisor", - "METRICSADVISOR_ENDPOINT_SUFFIX": null, - "METRICSADVISOR_PRIMARY_API_KEY": "Sanitized", - "METRICSADVISOR_SUBSCRIPTION_KEY": "Sanitized", - "RandomSeed": "542956108" - } -} \ No newline at end of file diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithMinimumSetupAndNewInstanceAsync.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithMinimumSetupAndNewInstanceAsync.json deleted file mode 100644 index 1b6e7aacdff8c..0000000000000 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/AnomalyAlertConfigurationLiveTests/UpdateAlertConfigurationWithMinimumSetupAndNewInstanceAsync.json +++ /dev/null @@ -1,296 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "98", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-c953100bcc52904e80f5d183c58c7ec2-11af024625698449-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "5b3e93ae67f83cae97804a6487c66c88", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "hookParameter": { - "endpoint": "http://contoso.com" - }, - "hookType": "Webhook", - "hookName": "hookHLjffVVG" - }, - "StatusCode": 201, - "ResponseHeaders": { - "apim-request-id": "a0b4aa90-1481-42e7-9cd2-974e9873a149", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:29 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/8b67b2d1-3ff8-43dd-a508-e9cce7f02efc", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "961", - "X-Request-ID": "a0b4aa90-1481-42e7-9cd2-974e9873a149" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "648", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-34ccb6fb81e0a041ab69c9beba3159c3-7213bfe75c508447-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "dc065d590607cf9fa86754613c1a7a3f", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "name": "configE6fdYxvm", - "crossMetricsOperator": "XOR", - "hookIds": [ - "8b67b2d1-3ff8-43dd-a508-e9cce7f02efc" - ], - "metricAlertingConfigurations": [ - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "severityFilter": { - "minAlertSeverity": "Low", - "maxAlertSeverity": "Medium" - }, - "snoozeFilter": { - "autoSnooze": 12, - "snoozeScope": "Series", - "onlyForSuccessive": true - }, - "valueFilter": { - "lower": 10, - "upper": 20, - "direction": "Both", - "metricId": "27e3015f-04fd-44ba-a20b-bc529a0aebae", - "triggerForMissing": true - } - }, - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": true - } - ] - }, - "StatusCode": 201, - "ResponseHeaders": { - "apim-request-id": "a221839e-66f7-42bb-8647-2bd0aa8a8a14", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:29 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3b0c79d1-d4bb-477c-8c4e-61b0080d5f2e", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "136", - "X-Request-ID": "a221839e-66f7-42bb-8647-2bd0aa8a8a14" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3b0c79d1-d4bb-477c-8c4e-61b0080d5f2e", - "RequestMethod": "PATCH", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "647", - "Content-Type": "application/merge-patch\u002Bjson", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-59fdae8440d341488510774d54576db2-a0616ab0beaafd40-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "ee22d79be322e83ff101bf4e13cf66d5", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "name": "configE6fdYxvm", - "crossMetricsOperator": "OR", - "hookIds": [ - "8b67b2d1-3ff8-43dd-a508-e9cce7f02efc" - ], - "metricAlertingConfigurations": [ - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "severityFilter": { - "minAlertSeverity": "Low", - "maxAlertSeverity": "Medium" - }, - "snoozeFilter": { - "autoSnooze": 12, - "snoozeScope": "Series", - "onlyForSuccessive": true - }, - "valueFilter": { - "lower": 10, - "upper": 20, - "direction": "Both", - "metricId": "27e3015f-04fd-44ba-a20b-bc529a0aebae", - "triggerForMissing": true - } - }, - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": true - } - ] - }, - "StatusCode": 204, - "ResponseHeaders": { - "apim-request-id": "191ae415-0a7c-49ca-b30f-6b8b60c344ed", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:29 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "133", - "X-Request-ID": "191ae415-0a7c-49ca-b30f-6b8b60c344ed" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3b0c79d1-d4bb-477c-8c4e-61b0080d5f2e", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-f9cf7e4d08aa2347bd055f1ab91e070d-838cb74566150f4a-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "9b024150d2609035e07abc1f720a4b58", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "37617b6c-3cd0-442a-8e69-fa1c29d0620d", - "Content-Length": "766", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 22 Dec 2020 02:28:29 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "88", - "X-Request-ID": "37617b6c-3cd0-442a-8e69-fa1c29d0620d" - }, - "ResponseBody": { - "anomalyAlertingConfigurationId": "3b0c79d1-d4bb-477c-8c4e-61b0080d5f2e", - "name": "configE6fdYxvm", - "description": "", - "crossMetricsOperator": "OR", - "hookIds": [ - "8b67b2d1-3ff8-43dd-a508-e9cce7f02efc" - ], - "metricAlertingConfigurations": [ - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": false, - "severityFilter": { - "minAlertSeverity": "Low", - "maxAlertSeverity": "Medium" - }, - "snoozeFilter": { - "autoSnooze": 12, - "snoozeScope": "Series", - "onlyForSuccessive": true - }, - "valueFilter": { - "lower": 10.0, - "upper": 20.0, - "direction": "Both", - "metricId": "27e3015f-04fd-44ba-a20b-bc529a0aebae", - "triggerForMissing": true - } - }, - { - "anomalyDetectionConfigurationId": "fb5a6ed6-2b9e-4b72-8b0c-0046ead1c15c", - "anomalyScopeType": "All", - "negationOperation": true - } - ] - } - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/alert/anomaly/configurations/3b0c79d1-d4bb-477c-8c4e-61b0080d5f2e", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-1b4aebac4546ea4d92dcd4ea4e32cc6d-e87c4612eae4d142-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "86f8cb4554b675da1e1dea054750bbd8", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 204, - "ResponseHeaders": { - "apim-request-id": "5eaec6f3-ecd5-4694-8901-cb954be67f16", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:29 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "122", - "X-Request-ID": "5eaec6f3-ecd5-4694-8901-cb954be67f16" - }, - "ResponseBody": [] - }, - { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/8b67b2d1-3ff8-43dd-a508-e9cce7f02efc", - "RequestMethod": "DELETE", - "RequestHeaders": { - "Accept": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-3ae68f0340971e408cac9ac02c8f546c-09fcfc24f56c434b-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20201221.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-api-key": "Sanitized", - "x-ms-client-request-id": "fb117f01df18c9dea1920da7271f76e7", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 204, - "ResponseHeaders": { - "apim-request-id": "cb3d0aa0-31d1-4042-9f89-3177fc59f00a", - "Content-Length": "0", - "Date": "Tue, 22 Dec 2020 02:28:30 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "176", - "X-Request-ID": "cb3d0aa0-31d1-4042-9f89-3177fc59f00a" - }, - "ResponseBody": [] - } - ], - "Variables": { - "METRICSADVISOR_ACCOUNT_NAME": "js-metrics-advisor", - "METRICSADVISOR_ENDPOINT_SUFFIX": null, - "METRICSADVISOR_PRIMARY_API_KEY": "Sanitized", - "METRICSADVISOR_SUBSCRIPTION_KEY": "Sanitized", - "RandomSeed": "308509140" - } -} \ No newline at end of file