From 5de7f16d2567dfabfa7d58f42137ff6e10c502f9 Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Wed, 2 Jun 2021 15:41:10 -0700 Subject: [PATCH 1/8] Updated hook update methods --- .../src/MetricsAdvisorAdministrationClient.cs | 37 +++++++++---------- .../NotificationHookLiveTests.cs | 16 ++++---- .../NotificationHookTests.cs | 16 +++----- .../Samples/Sample04_HookCrudOperations.cs | 4 +- 4 files changed, 33 insertions(+), 40 deletions(-) diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs index 542d0928fbdcd..cde21bf744261 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs @@ -1590,20 +1590,23 @@ public virtual Response CreateHook(NotificationHook hook, Canc /// /// Updates an existing . /// - /// The ID of the existing to update. /// The model containing the updates to be applied. /// A controlling the request lifetime. /// /// A containing the result of the operation. /// - /// or is null. - /// is empty or not a valid GUID. - public virtual async Task UpdateHookAsync(string hookId, NotificationHook hook, CancellationToken cancellationToken = default) + /// or .Id is null. + public virtual async Task> UpdateHookAsync(NotificationHook hook, CancellationToken cancellationToken = default) { - /* - Guid hookGuid = ClientCommon.ValidateGuid(hookId, nameof(hookId)); Argument.AssertNotNull(hook, nameof(hook)); + if (hook.Id == null) + { + throw new ArgumentNullException(nameof(hook), $"{nameof(hook)}.Id not available. Call {nameof(GetHookAsync)} and update the returned model before calling this method."); + } + + Guid hookGuid = new Guid(hook.Id); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(UpdateHook)}"); scope.Start(); @@ -1618,29 +1621,28 @@ public virtual async Task UpdateHookAsync(string hookId, NotificationH scope.Failed(e); throw; } - */ - - await Task.CompletedTask.ConfigureAwait(false); - return default; } /// /// Updates an existing . /// - /// The ID of the existing to update. /// The model containing the updates to be applied. /// A controlling the request lifetime. /// /// A containing the result of the operation. /// - /// or is null. - /// is empty or not a valid GUID. - public virtual Response UpdateHook(string hookId, NotificationHook hook, CancellationToken cancellationToken = default) + /// or .Id is null. + public virtual Response UpdateHook(NotificationHook hook, CancellationToken cancellationToken = default) { - /* - Guid hookGuid = ClientCommon.ValidateGuid(hookId, nameof(hookId)); Argument.AssertNotNull(hook, nameof(hook)); + if (hook.Id == null) + { + throw new ArgumentNullException(nameof(hook), $"{nameof(hook)}.Id not available. Call {nameof(GetHook)} and update the returned model before calling this method."); + } + + Guid hookGuid = new Guid(hook.Id); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(MetricsAdvisorAdministrationClient)}.{nameof(UpdateHook)}"); scope.Start(); @@ -1655,9 +1657,6 @@ public virtual Response UpdateHook(string hookId, NotificationHook hook, Cancell scope.Failed(e); throw; } - */ - - return default; } /// diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs index e57332252c22f..1cba5b297ce16 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs @@ -198,7 +198,7 @@ public async Task UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(bool hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -239,7 +239,7 @@ public async Task UpdateEmailNotificationHookWithMinimumSetupAndNewInstance() hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -281,7 +281,7 @@ public async Task UpdateEmailNotificationHookWithEveryMemberAndGetInstance() hookToUpdate.ExternalLink = new Uri("http://fake.endpoint.com/"); hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -327,7 +327,7 @@ public async Task UpdateEmailNotificationHookWithEveryMemberAndNewInstance() hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -362,7 +362,7 @@ public async Task UpdateWebNotificationHookWithMinimumSetupAndGetInstance() hookToUpdate.Username = "fakeUsername"; - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -402,7 +402,7 @@ public async Task UpdateWebNotificationHookWithMinimumSetupAndNewInstance() var hookToUpdate = new WebNotificationHook() { Endpoint = endpoint, Username = "fakeUsername" }; - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -460,7 +460,7 @@ public async Task UpdateWebNotificationHookWithEveryMemberAndGetInstance() hookToUpdate.Headers.Add(header); } - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. @@ -520,7 +520,7 @@ public async Task UpdateWebNotificationHookWithEveryMemberAndNewInstance() hookToUpdate.Headers.Add(header); } - await adminClient.UpdateHookAsync(disposableHook.Id, hookToUpdate); + await adminClient.UpdateHookAsync(hookToUpdate); // Get the hook and check if updates are in place. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs index 27c5339ebec57..51294dd42c566 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs @@ -88,15 +88,9 @@ public void UpdateHookValidatesArguments() var hook = new EmailNotificationHook(); - Assert.That(() => adminClient.UpdateHookAsync(null, hook), Throws.InstanceOf()); - Assert.That(() => adminClient.UpdateHookAsync("", hook), Throws.InstanceOf()); - Assert.That(() => adminClient.UpdateHookAsync("hookId", hook), Throws.InstanceOf().With.InnerException.TypeOf(typeof(FormatException))); - Assert.That(() => adminClient.UpdateHookAsync(FakeGuid, null), Throws.InstanceOf()); - - Assert.That(() => adminClient.UpdateHook(null, hook), Throws.InstanceOf()); - Assert.That(() => adminClient.UpdateHook("", hook), Throws.InstanceOf()); - Assert.That(() => adminClient.UpdateHook("hookId", hook), Throws.InstanceOf().With.InnerException.TypeOf(typeof(FormatException))); - Assert.That(() => adminClient.UpdateHook(FakeGuid, null), Throws.InstanceOf()); + Assert.That(() => adminClient.UpdateHookAsync(null), Throws.InstanceOf()); + + Assert.That(() => adminClient.UpdateHook(null), Throws.InstanceOf()); } [Test] @@ -110,8 +104,8 @@ public void UpdateHookRespectsTheCancellationToken() using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); - Assert.That(() => adminClient.UpdateHookAsync(FakeGuid, hook, cancellationSource.Token), Throws.InstanceOf()); - Assert.That(() => adminClient.UpdateHook(FakeGuid, hook, cancellationSource.Token), Throws.InstanceOf()); + Assert.That(() => adminClient.UpdateHookAsync(hook, cancellationSource.Token), Throws.InstanceOf()); + Assert.That(() => adminClient.UpdateHook(hook, cancellationSource.Token), Throws.InstanceOf()); } [Test] diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs index b706d23941c1c..41cf09a5e4103 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs @@ -112,13 +112,13 @@ public async Task UpdateHookAsync() string originalDescription = hook.Description; hook.Description = "This description was generated by a sample."; - await adminClient.UpdateHookAsync(hookId, hook); + await adminClient.UpdateHookAsync(hook); // Undo the changes to leave the hook unaltered. Skip this step if you intend to keep // the changes. hook.Description = originalDescription; - await adminClient.UpdateHookAsync(hookId, hook); + await adminClient.UpdateHookAsync(hook); } [Test] From 74c3f0664ca0f31b948a42b9e4266d15f4983b3d Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Wed, 2 Jun 2021 18:04:38 -0700 Subject: [PATCH 2/8] Fixed patch model creation --- .../NotificationHook/NotificationHook.cs | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs index 1d403e0b73fa8..9bfc783acaa1d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs @@ -64,12 +64,35 @@ internal NotificationHook(HookType hookType, string id, string name, string desc internal static HookInfoPatch GetPatchModel(NotificationHook hook) { - return hook switch + if (hook is EmailNotificationHook emailHook) { - EmailNotificationHook h => new EmailHookInfoPatch() { HookName = h.Name, Description = h.Description, ExternalLink = h.ExternalLink?.AbsoluteUri, /*HookParameter = h.HookParameter,*/ Admins = h.Administrators }, - WebNotificationHook h => new WebhookHookInfoPatch() { HookName = h.Name, Description = h.Description, ExternalLink = h.ExternalLink?.AbsoluteUri, /*HookParameter = h.HookParameter,*/ Admins = h.Administrators }, - _ => throw new InvalidOperationException("Unknown AlertingHook type.") - }; + var h = emailHook; + var patch = new EmailHookInfoPatch() { HookName = h.Name, Description = h.Description, ExternalLink = h.ExternalLink?.AbsoluteUri, HookParameter = new(), Admins = h.Administrators }; + + foreach (var item in h.HookParameter.ToList) + { + patch.HookParameter.ToList.Add(item); + } + + return patch; + } + else if (hook is WebNotificationHook webHook) + { + var h = webHook; + var patch = new WebhookHookInfoPatch() { HookName = h.Name, Description = h.Description, + ExternalLink = h.ExternalLink?.AbsoluteUri, HookParameter = { CertificateKey = h.CertificateKey, + CertificatePassword = h.CertificatePassword, Endpoint = h.Endpoint.AbsoluteUri, + Password = h.Password, Username = h.Username }, Admins = h.Administrators }; + + foreach (var item in h.HookParameter.Headers) + { + patch.HookParameter.Headers.Add(item); + } + + return patch; + } + + throw new InvalidOperationException("Unknown AlertingHook type."); } } } From 8d795ba1e9b4f9a2e2417255d160070f30242979 Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Thu, 3 Jun 2021 11:05:18 -0700 Subject: [PATCH 3/8] Fixed build --- .../Models/EmailHookParameterPatch.cs | 3 -- .../Models/WebhookHookParameterPatch.cs | 2 - .../src/MetricsAdvisorAdministrationClient.cs | 8 ++- .../EmailHookParameterPatch.cs | 12 +++++ .../WebhookHookParameterPatch.cs | 12 +++++ .../NotificationHook/NotificationHook.cs | 50 +++++++++---------- 6 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/EmailHookParameterPatch.cs create mode 100644 sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/WebhookHookParameterPatch.cs diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameterPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameterPatch.cs index a993756c0bfea..677b7468a6d1f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameterPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameterPatch.cs @@ -18,8 +18,5 @@ public EmailHookParameterPatch() { ToList = new ChangeTrackingList(); } - - /// Email TO: list. - public IList ToList { get; } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookParameterPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookParameterPatch.cs index b1cd55504299a..69b538f7e4a0a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookParameterPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookParameterPatch.cs @@ -25,8 +25,6 @@ public WebhookHookParameterPatch() public string Username { get; set; } /// (Deprecated) The password, if using basic authentication. public string Password { get; set; } - /// custom headers in api call. - public IDictionary Headers { get; } /// The certificate key, if using client certificate. public string CertificateKey { get; set; } /// The certificate password, if using client certificate. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs index 4610a240c23d0..d09c2d0cdb5d8 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/MetricsAdvisorAdministrationClient.cs @@ -1588,7 +1588,9 @@ public virtual Response CreateHook(NotificationHook hook, Canc } /// - /// Updates an existing . + /// Updates an existing . In order to update your hook, you cannot create a + /// directly from its constructor. You need to obtain an instance via or another CRUD operation and update it + /// before calling this method. /// /// The model containing the updates to be applied. /// A controlling the request lifetime. @@ -1624,7 +1626,9 @@ public virtual async Task> UpdateHookAsync(Notificati } /// - /// Updates an existing . + /// Updates an existing . In order to update your hook, you cannot create a + /// directly from its constructor. You need to obtain an instance via or another CRUD operation and update it + /// before calling this method. /// /// The model containing the updates to be applied. /// A controlling the request lifetime. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/EmailHookParameterPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/EmailHookParameterPatch.cs new file mode 100644 index 0000000000000..164ee0af80057 --- /dev/null +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/EmailHookParameterPatch.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.AI.MetricsAdvisor.Models +{ + internal partial class EmailHookParameterPatch + { + public IList ToList { get; internal set; } + } +} diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/WebhookHookParameterPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/WebhookHookParameterPatch.cs new file mode 100644 index 0000000000000..ce0b17e114dd9 --- /dev/null +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/WebhookHookParameterPatch.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.AI.MetricsAdvisor.Models +{ + internal partial class WebhookHookParameterPatch + { + public IDictionary Headers { get; internal set; } + } +} diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs index 9bfc783acaa1d..8f020feb7b7e1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/NotificationHook/NotificationHook.cs @@ -64,35 +64,33 @@ internal NotificationHook(HookType hookType, string id, string name, string desc internal static HookInfoPatch GetPatchModel(NotificationHook hook) { - if (hook is EmailNotificationHook emailHook) + HookInfoPatch patch = hook switch { - var h = emailHook; - var patch = new EmailHookInfoPatch() { HookName = h.Name, Description = h.Description, ExternalLink = h.ExternalLink?.AbsoluteUri, HookParameter = new(), Admins = h.Administrators }; - - foreach (var item in h.HookParameter.ToList) + EmailNotificationHook h => new EmailHookInfoPatch() { - patch.HookParameter.ToList.Add(item); - } - - return patch; - } - else if (hook is WebNotificationHook webHook) - { - var h = webHook; - var patch = new WebhookHookInfoPatch() { HookName = h.Name, Description = h.Description, - ExternalLink = h.ExternalLink?.AbsoluteUri, HookParameter = { CertificateKey = h.CertificateKey, - CertificatePassword = h.CertificatePassword, Endpoint = h.Endpoint.AbsoluteUri, - Password = h.Password, Username = h.Username }, Admins = h.Administrators }; - - foreach (var item in h.HookParameter.Headers) + HookParameter = new() { ToList = h.EmailsToAlert } + }, + WebNotificationHook h => new WebhookHookInfoPatch() { - patch.HookParameter.Headers.Add(item); - } - - return patch; - } - - throw new InvalidOperationException("Unknown AlertingHook type."); + HookParameter = new() + { + Endpoint = h.Endpoint?.AbsoluteUri, + Username = h.Username, + Password = h.Password, + CertificateKey = h.CertificateKey, + CertificatePassword = h.CertificatePassword, + Headers = h.Headers + } + }, + _ => throw new InvalidOperationException("Unknown hook type.") + }; + + patch.HookName = hook.Name; + patch.Description = hook.Description; + patch.ExternalLink = hook.ExternalLink?.AbsoluteUri; + patch.Admins = hook.Administrators; + + return patch; } } } From 2791322949e1b29cfe113c782a0fd01483caffa8 Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Thu, 3 Jun 2021 11:12:13 -0700 Subject: [PATCH 4/8] Updated non-live tests --- .../NotificationHookTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs index 51294dd42c566..5f2af9761b070 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookTests.cs @@ -81,7 +81,6 @@ public void CreateHookRespectsTheCancellationToken() } [Test] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] public void UpdateHookValidatesArguments() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); @@ -89,17 +88,20 @@ public void UpdateHookValidatesArguments() var hook = new EmailNotificationHook(); Assert.That(() => adminClient.UpdateHookAsync(null), Throws.InstanceOf()); - Assert.That(() => adminClient.UpdateHook(null), Throws.InstanceOf()); + + var hookWithNullId = new EmailNotificationHook(); + + Assert.That(() => adminClient.UpdateHookAsync(hookWithNullId), Throws.InstanceOf()); + Assert.That(() => adminClient.UpdateHook(hookWithNullId), Throws.InstanceOf()); } [Test] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] public void UpdateHookRespectsTheCancellationToken() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); - var hook = new EmailNotificationHook(); + var hook = new EmailNotificationHook(default, FakeGuid, default, default, default, new List(), new EmailHookParameter(new List())); using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); From dbd2324e004131fa9db927a33360418e90ceef9a Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Thu, 3 Jun 2021 11:21:25 -0700 Subject: [PATCH 5/8] Updated tests --- .../NotificationHookLiveTests.cs | 10 +- ...tionHookWithEveryMemberAndGetInstance.json | 154 +++++++++--------- ...ookWithEveryMemberAndGetInstanceAsync.json | 154 +++++++++--------- ...WithMinimumSetupAndGetInstance(False).json | 149 ++++++++--------- ...inimumSetupAndGetInstance(False)Async.json | 149 ++++++++--------- ...kWithMinimumSetupAndGetInstance(True).json | 149 ++++++++--------- ...MinimumSetupAndGetInstance(True)Async.json | 149 ++++++++--------- 7 files changed, 460 insertions(+), 454 deletions(-) diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs index 1cba5b297ce16..961be7ce3173e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs @@ -175,7 +175,6 @@ public async Task CreateAndGetWebNotificationHookWithOptionalMembers() [RecordedTest] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] public async Task UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(bool useTokenCredential) { // Create a hook. @@ -255,7 +254,6 @@ public async Task UpdateEmailNotificationHookWithMinimumSetupAndNewInstance() } [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] public async Task UpdateEmailNotificationHookWithEveryMemberAndGetInstance() { // Create a hook. @@ -343,7 +341,7 @@ public async Task UpdateEmailNotificationHookWithEveryMemberAndNewInstance() } [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] + [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21504")] public async Task UpdateWebNotificationHookWithMinimumSetupAndGetInstance() { // Create a hook. @@ -384,7 +382,7 @@ public async Task UpdateWebNotificationHookWithMinimumSetupAndGetInstance() } [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] + [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21504")] public async Task UpdateWebNotificationHookWithMinimumSetupAndNewInstance() { // Create a hook. @@ -424,7 +422,7 @@ public async Task UpdateWebNotificationHookWithMinimumSetupAndNewInstance() } [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] + [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21504")] public async Task UpdateWebNotificationHookWithEveryMemberAndGetInstance() { // Create a hook. @@ -482,7 +480,7 @@ public async Task UpdateWebNotificationHookWithEveryMemberAndGetInstance() } [RecordedTest] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21177")] + [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/21504")] public async Task UpdateWebNotificationHookWithEveryMemberAndNewInstance() { // Create a hook. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstance.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstance.json index b638351cde411..e0d74b024a812 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstance.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstance.json @@ -8,11 +8,8 @@ "Content-Length": "111", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-8d9966de965caa40a59710b25e1d8670-e4461ef70528064d-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-bc644e0036465248b2026eec757eade2-46d7b5dcae5a6b49-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "5a00061810b6332d6b205bbd1b12768b", "x-ms-return-client-request-id": "true" @@ -29,28 +26,25 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "d6063f8b-7b23-40a2-b1b6-355f7c6ca65c", + "apim-request-id": "00ad899b-63f1-4169-bfd7-c0fe619fa5aa", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:28 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/23f3ddc9-6069-4ba5-8e87-e4212110de09", + "Date": "Thu, 03 Jun 2021 18:20:04 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/1f45df20-1c8e-44d8-9b3e-704480a4632d", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "296", - "X-Request-ID": "d6063f8b-7b23-40a2-b1b6-355f7c6ca65c" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "559", + "x-request-id": "00ad899b-63f1-4169-bfd7-c0fe619fa5aa" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/23f3ddc9-6069-4ba5-8e87-e4212110de09", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/1f45df20-1c8e-44d8-9b3e-704480a4632d", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-8d9966de965caa40a59710b25e1d8670-713e7355d7a7d241-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-bc644e0036465248b2026eec757eade2-cc1306060525444f-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "d77b157f3e8f5628221dad1b475f5e74", "x-ms-return-client-request-id": "true" @@ -58,17 +52,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "4d4b68a5-f3ef-4137-8e7e-5103b33a2f83", + "apim-request-id": "76604e34-a74b-41ec-9388-15777a6cb437", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:28 GMT", + "Date": "Thu, 03 Jun 2021 18:20:04 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "145", - "X-Request-ID": "4d4b68a5-f3ef-4137-8e7e-5103b33a2f83" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "158", + "x-request-id": "76604e34-a74b-41ec-9388-15777a6cb437" }, "ResponseBody": { - "hookId": "23f3ddc9-6069-4ba5-8e87-e4212110de09", + "hookId": "1f45df20-1c8e-44d8-9b3e-704480a4632d", "hookName": "hookAcxnNIKY", "hookType": "Email", "externalLink": "", @@ -85,16 +79,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/23f3ddc9-6069-4ba5-8e87-e4212110de09", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/1f45df20-1c8e-44d8-9b3e-704480a4632d", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-8699a801dbaaa34798ba2eb3526f6fed-0ee95f5ec7894b45-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-c7455286fcd46a40b8583aa1fdcc39e4-7850e62088ea1343-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "5d13c8252faf49f6a478aa60b0007e13", "x-ms-return-client-request-id": "true" @@ -102,17 +93,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "af177901-fe36-4649-bf9e-af5237808189", + "apim-request-id": "cebf550b-b8de-403f-807b-b52413b38d0f", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:29 GMT", + "Date": "Thu, 03 Jun 2021 18:20:05 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "149", - "X-Request-ID": "af177901-fe36-4649-bf9e-af5237808189" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "165", + "x-request-id": "cebf550b-b8de-403f-807b-b52413b38d0f" }, "ResponseBody": { - "hookId": "23f3ddc9-6069-4ba5-8e87-e4212110de09", + "hookId": "1f45df20-1c8e-44d8-9b3e-704480a4632d", "hookName": "hookAcxnNIKY", "hookType": "Email", "externalLink": "", @@ -129,18 +120,15 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/23f3ddc9-6069-4ba5-8e87-e4212110de09", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/1f45df20-1c8e-44d8-9b3e-704480a4632d", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "234", + "Content-Length": "264", "Content-Type": "application/merge-patch\u002Bjson", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-46af14e2b2269946aa5a1e66423c0521-f0bd57941013f34d-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-664b24069f73424c8fe3ab870e229640-e25a95c7b2128048-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "123e66c7d175d9d7dda938996312ec0b", "x-ms-return-client-request-id": "true" @@ -156,31 +144,48 @@ "hookType": "Email", "hookName": "hookAcxnNIKY", "description": "This hook was created to test the .NET client.", - "externalLink": "http://fake.endpoint.com" + "externalLink": "http://fake.endpoint.com/", + "admins": [ + "foo@contoso.com" + ] }, - "StatusCode": 204, + "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "5f76e398-a433-48ba-8357-df8477860002", - "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:29 GMT", + "apim-request-id": "00226e66-c923-4e4d-a5d3-9d323001872e", + "Content-Length": "312", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Jun 2021 18:20:05 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "277", - "X-Request-ID": "5f76e398-a433-48ba-8357-df8477860002" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "684", + "x-request-id": "00226e66-c923-4e4d-a5d3-9d323001872e" }, - "ResponseBody": [] + "ResponseBody": { + "hookId": "1f45df20-1c8e-44d8-9b3e-704480a4632d", + "hookName": "hookAcxnNIKY", + "hookType": "Email", + "externalLink": "http://fake.endpoint.com/", + "description": "This hook was created to test the .NET client.", + "admins": [ + "foo@contoso.com" + ], + "hookParameter": { + "toList": [ + "fake1@email.com", + "fake2@email.com", + "fake3@email.com" + ] + } + } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/23f3ddc9-6069-4ba5-8e87-e4212110de09", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/1f45df20-1c8e-44d8-9b3e-704480a4632d", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-22407e21259ddb4bb3effd98481fdc80-90873fc0e9261a4a-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-ed47003fe3f8c0489465c011c8095205-b2ef606d49e64f45-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "5397e7c119fe4fdc1e31321694c8a622", "x-ms-return-client-request-id": "true" @@ -188,20 +193,20 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "370c1a50-a5cf-4421-b1c0-2fbbb8d3b5cb", - "Content-Length": "311", + "apim-request-id": "29b57f88-a8ef-40fa-a331-ade8273d9a7e", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:29 GMT", + "Date": "Thu, 03 Jun 2021 18:20:05 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "136", - "X-Request-ID": "370c1a50-a5cf-4421-b1c0-2fbbb8d3b5cb" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "162", + "x-request-id": "29b57f88-a8ef-40fa-a331-ade8273d9a7e" }, "ResponseBody": { - "hookId": "23f3ddc9-6069-4ba5-8e87-e4212110de09", + "hookId": "1f45df20-1c8e-44d8-9b3e-704480a4632d", "hookName": "hookAcxnNIKY", "hookType": "Email", - "externalLink": "http://fake.endpoint.com", + "externalLink": "http://fake.endpoint.com/", "description": "This hook was created to test the .NET client.", "admins": [ "foo@contoso.com" @@ -216,16 +221,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/23f3ddc9-6069-4ba5-8e87-e4212110de09", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/1f45df20-1c8e-44d8-9b3e-704480a4632d", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-c7a82ca5fcc3ab42ba688fa1698fb5e7-d90b2a5759212a43-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-559d07a11b107c4f9b0a60d5944af128-f76181d142222946-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "e0539a9e4b2153fef13a7f06f75de692", "x-ms-return-client-request-id": "true" @@ -233,13 +235,13 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "bc19f4db-43f8-425a-9dc5-b1d62d23879a", + "apim-request-id": "0a7a3869-8b52-4ba6-a194-b77953bb1a73", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:29 GMT", + "Date": "Thu, 03 Jun 2021 18:20:07 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "174", - "X-Request-ID": "bc19f4db-43f8-425a-9dc5-b1d62d23879a" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "206", + "x-request-id": "0a7a3869-8b52-4ba6-a194-b77953bb1a73" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstanceAsync.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstanceAsync.json index fe21fc2773afb..2dbf64a9bee28 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstanceAsync.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithEveryMemberAndGetInstanceAsync.json @@ -8,11 +8,8 @@ "Content-Length": "111", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-519eb86b1e721a4491183bbabe8ef80b-e690db6fc8456b4c-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-7f72cdd5f2eae3468563651e7b4f159b-fcd2a07054ee3447-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "ce20e4c46180a62bfc5b1c87d135846b", "x-ms-return-client-request-id": "true" @@ -29,28 +26,25 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "77f441cb-bd86-4cc5-8aec-6a8d9d6e8024", + "apim-request-id": "001cf901-108a-43dd-9072-9b9d54bccbc6", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:56 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5111f772-8abc-43bd-958b-074f8219c4d9", + "Date": "Thu, 03 Jun 2021 18:20:28 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5890cfdf-95b4-4f1a-b9ce-19859defa032", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "271", - "X-Request-ID": "77f441cb-bd86-4cc5-8aec-6a8d9d6e8024" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "511", + "x-request-id": "001cf901-108a-43dd-9072-9b9d54bccbc6" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5111f772-8abc-43bd-958b-074f8219c4d9", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5890cfdf-95b4-4f1a-b9ce-19859defa032", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-519eb86b1e721a4491183bbabe8ef80b-4b9f4e67995dcb44-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-7f72cdd5f2eae3468563651e7b4f159b-00e567f56c4b2541-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "5369c5dfeda4b1a12bf20cb0b3ead8b6", "x-ms-return-client-request-id": "true" @@ -58,17 +52,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "ee88ad47-64a4-407e-ae20-2eebd4fa514c", + "apim-request-id": "4739d56f-2713-4fb9-be4b-fdb016d611bb", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:56 GMT", + "Date": "Thu, 03 Jun 2021 18:20:28 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "195", - "X-Request-ID": "ee88ad47-64a4-407e-ae20-2eebd4fa514c" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "228", + "x-request-id": "4739d56f-2713-4fb9-be4b-fdb016d611bb" }, "ResponseBody": { - "hookId": "5111f772-8abc-43bd-958b-074f8219c4d9", + "hookId": "5890cfdf-95b4-4f1a-b9ce-19859defa032", "hookName": "hookB07vsv5L", "hookType": "Email", "externalLink": "", @@ -85,16 +79,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5111f772-8abc-43bd-958b-074f8219c4d9", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5890cfdf-95b4-4f1a-b9ce-19859defa032", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-cb0432b473235a4f9ec0de25e60f4150-bdfc94a727504049-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-ea3c6a4937efb649be4699ed78e28c6c-2f2e342e92e82646-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "9186b9c93de55dd1635cfdf7171ae7e4", "x-ms-return-client-request-id": "true" @@ -102,17 +93,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "90f7bb6c-97dd-477d-80ba-b9db7cf8bf69", + "apim-request-id": "552b0a18-ae9f-4317-8ca8-35b17850ad1d", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:56 GMT", + "Date": "Thu, 03 Jun 2021 18:20:29 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "204", - "X-Request-ID": "90f7bb6c-97dd-477d-80ba-b9db7cf8bf69" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "252", + "x-request-id": "552b0a18-ae9f-4317-8ca8-35b17850ad1d" }, "ResponseBody": { - "hookId": "5111f772-8abc-43bd-958b-074f8219c4d9", + "hookId": "5890cfdf-95b4-4f1a-b9ce-19859defa032", "hookName": "hookB07vsv5L", "hookType": "Email", "externalLink": "", @@ -129,18 +120,15 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5111f772-8abc-43bd-958b-074f8219c4d9", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5890cfdf-95b4-4f1a-b9ce-19859defa032", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "234", + "Content-Length": "264", "Content-Type": "application/merge-patch\u002Bjson", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-6e52e34abe55cb4d87ef45c1ef24a2b2-750723dbb8e08245-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-0c09455dada5ce4dbd7ce58f6b28c2e3-c1e4ea0ccd86d949-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "434821a04eccd7b3436fa28d547bf312", "x-ms-return-client-request-id": "true" @@ -156,31 +144,48 @@ "hookType": "Email", "hookName": "hookB07vsv5L", "description": "This hook was created to test the .NET client.", - "externalLink": "http://fake.endpoint.com" + "externalLink": "http://fake.endpoint.com/", + "admins": [ + "foo@contoso.com" + ] }, - "StatusCode": 204, + "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "a79cc3df-8712-41a1-939f-6a33e56830cb", - "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:56 GMT", + "apim-request-id": "5d826ba4-b90a-4e73-8bd1-395c4e0478e4", + "Content-Length": "312", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Jun 2021 18:20:29 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "286", - "X-Request-ID": "a79cc3df-8712-41a1-939f-6a33e56830cb" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "753", + "x-request-id": "5d826ba4-b90a-4e73-8bd1-395c4e0478e4" }, - "ResponseBody": [] + "ResponseBody": { + "hookId": "5890cfdf-95b4-4f1a-b9ce-19859defa032", + "hookName": "hookB07vsv5L", + "hookType": "Email", + "externalLink": "http://fake.endpoint.com/", + "description": "This hook was created to test the .NET client.", + "admins": [ + "foo@contoso.com" + ], + "hookParameter": { + "toList": [ + "fake1@email.com", + "fake2@email.com", + "fake3@email.com" + ] + } + } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5111f772-8abc-43bd-958b-074f8219c4d9", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5890cfdf-95b4-4f1a-b9ce-19859defa032", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-b9a7d2bec573b442bc7f4c9cca75643d-889d68f3f02cb945-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-b7fead621cd755438c38c2466ca3a44b-2c1367bf6130b444-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "18bd6582f3afa186f30cef47efa99a11", "x-ms-return-client-request-id": "true" @@ -188,20 +193,20 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "1aed40fd-d835-417e-9dbd-2a254296410b", - "Content-Length": "311", + "apim-request-id": "deab0561-bfb4-4c12-b1b2-6d29acc0b585", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:57 GMT", + "Date": "Thu, 03 Jun 2021 18:20:30 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "159", - "X-Request-ID": "1aed40fd-d835-417e-9dbd-2a254296410b" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "231", + "x-request-id": "deab0561-bfb4-4c12-b1b2-6d29acc0b585" }, "ResponseBody": { - "hookId": "5111f772-8abc-43bd-958b-074f8219c4d9", + "hookId": "5890cfdf-95b4-4f1a-b9ce-19859defa032", "hookName": "hookB07vsv5L", "hookType": "Email", - "externalLink": "http://fake.endpoint.com", + "externalLink": "http://fake.endpoint.com/", "description": "This hook was created to test the .NET client.", "admins": [ "foo@contoso.com" @@ -216,16 +221,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5111f772-8abc-43bd-958b-074f8219c4d9", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/5890cfdf-95b4-4f1a-b9ce-19859defa032", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-422152e51270474ebb556fdc0c7838ef-0ca26402bb822e45-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-6776f2a725082d4091dd83b92bedb46f-7a996e5f5dfb6f46-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "9210280b95a17bea05af4d769b4409e8", "x-ms-return-client-request-id": "true" @@ -233,13 +235,13 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "e0e7053e-8cfd-4579-b6c2-14fa09e1eb40", + "apim-request-id": "2d57fe0d-6aed-4f32-8692-073b12507523", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:57 GMT", + "Date": "Thu, 03 Jun 2021 18:20:30 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "185", - "X-Request-ID": "e0e7053e-8cfd-4579-b6c2-14fa09e1eb40" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "214", + "x-request-id": "2d57fe0d-6aed-4f32-8692-073b12507523" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False).json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False).json index 411804ad20dbb..4ba077f0f221d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False).json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False).json @@ -8,11 +8,8 @@ "Content-Length": "111", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-51cb3785c066984291666686465282c3-fa1b6826c8cf4948-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-140d9525cffb344dafe2ef7b2521f0db-735e26a17ed32c49-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "a292f2076d2e0e12fa978ca259aa0159", "x-ms-return-client-request-id": "true" @@ -29,28 +26,25 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "36643b2b-7ea2-4b0f-958a-06cc8115cdfe", + "apim-request-id": "5b4709ba-062a-49f2-8e71-2706a90eb0f4", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:49 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "Date": "Thu, 03 Jun 2021 18:20:15 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/c891416b-a661-44e5-a8ce-842cc2b25594", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "258", - "X-Request-ID": "36643b2b-7ea2-4b0f-958a-06cc8115cdfe" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "488", + "x-request-id": "5b4709ba-062a-49f2-8e71-2706a90eb0f4" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/c891416b-a661-44e5-a8ce-842cc2b25594", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-51cb3785c066984291666686465282c3-b1e01e0de47ec140-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-140d9525cffb344dafe2ef7b2521f0db-3330513bd1d2a14d-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "32bce9cb1b7f4f844d657c32ffe8b4a6", "x-ms-return-client-request-id": "true" @@ -58,17 +52,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "0ac98475-7310-4036-8b62-b3bc353e85df", + "apim-request-id": "4c6c6cc6-ab1b-464f-9db8-0b22ffd34512", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:49 GMT", + "Date": "Thu, 03 Jun 2021 18:20:21 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "155", - "X-Request-ID": "0ac98475-7310-4036-8b62-b3bc353e85df" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5183", + "x-request-id": "4c6c6cc6-ab1b-464f-9db8-0b22ffd34512" }, "ResponseBody": { - "hookId": "7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "hookId": "c891416b-a661-44e5-a8ce-842cc2b25594", "hookName": "hookC674MsBm", "hookType": "Email", "externalLink": "", @@ -85,16 +79,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/c891416b-a661-44e5-a8ce-842cc2b25594", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-4ed73f56c6a7b04d95f6567ed3685f54-a4b7bb25b2e60641-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-f4787bcb523b024b89cab93a4af313ed-76c1eba4050bf44c-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "9dad8b2f9ea0141f6102ad68bf1a76ad", "x-ms-return-client-request-id": "true" @@ -102,17 +93,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "565d7041-cbb4-4c33-bea7-c696e13a9b31", + "apim-request-id": "7e89523f-cc1c-4bfa-9016-cef8337f1136", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:49 GMT", + "Date": "Thu, 03 Jun 2021 18:20:21 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "159", - "X-Request-ID": "565d7041-cbb4-4c33-bea7-c696e13a9b31" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "232", + "x-request-id": "7e89523f-cc1c-4bfa-9016-cef8337f1136" }, "ResponseBody": { - "hookId": "7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "hookId": "c891416b-a661-44e5-a8ce-842cc2b25594", "hookName": "hookC674MsBm", "hookType": "Email", "externalLink": "", @@ -129,18 +120,15 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/c891416b-a661-44e5-a8ce-842cc2b25594", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "164", + "Content-Length": "175", "Content-Type": "application/merge-patch\u002Bjson", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-4df84d22c9eb80419cfd7a40393cd8be-c7c6db485e03e146-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-458b38f9b2a67445ad2abf9f64c89573-e34c6e7615f93042-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "5e619fc13007eb866e4254c8f1e00e11", "x-ms-return-client-request-id": "true" @@ -156,31 +144,47 @@ "hookType": "Email", "hookName": "hookC674MsBm", "description": "", - "externalLink": "" + "admins": [ + "foo@contoso.com" + ] }, - "StatusCode": 204, + "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "5c3db48e-2938-4cd2-98da-a65faf0736a8", - "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:49 GMT", + "apim-request-id": "ca938c1b-c221-4636-8163-3587e7cb8a02", + "Content-Length": "241", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Jun 2021 18:20:27 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "345", - "X-Request-ID": "5c3db48e-2938-4cd2-98da-a65faf0736a8" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5727", + "x-request-id": "ca938c1b-c221-4636-8163-3587e7cb8a02" }, - "ResponseBody": [] + "ResponseBody": { + "hookId": "c891416b-a661-44e5-a8ce-842cc2b25594", + "hookName": "hookC674MsBm", + "hookType": "Email", + "externalLink": "", + "description": "", + "admins": [ + "foo@contoso.com" + ], + "hookParameter": { + "toList": [ + "fake1@email.com", + "fake2@email.com", + "fake3@email.com" + ] + } + } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/c891416b-a661-44e5-a8ce-842cc2b25594", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-b53d282b267cbd40adafceb140b402a9-86f3a80df4e1da41-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-e073ffd0ac5c054d8da5490e167d1dd5-3eff92cae583b741-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "ce73e5e363fc2cb8caa7d07d6e1c8f33", "x-ms-return-client-request-id": "true" @@ -188,17 +192,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "0666016e-77fc-41b8-a7f9-0465e57d1632", + "apim-request-id": "7794589f-73be-48ec-86fa-43f1bbeb5ce8", "Content-Length": "241", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:50 GMT", + "Date": "Thu, 03 Jun 2021 18:20:27 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "149", - "X-Request-ID": "0666016e-77fc-41b8-a7f9-0465e57d1632" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "174", + "x-request-id": "7794589f-73be-48ec-86fa-43f1bbeb5ce8" }, "ResponseBody": { - "hookId": "7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "hookId": "c891416b-a661-44e5-a8ce-842cc2b25594", "hookName": "hookC674MsBm", "hookType": "Email", "externalLink": "", @@ -216,16 +220,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/7d163c7b-a5b4-4c25-9efc-3e9e1988d31e", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/c891416b-a661-44e5-a8ce-842cc2b25594", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-524aaa57885ac54db4be37497589ba5f-fd24f7ed7d332a47-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-46989308824c4b47b7416a8a84df5fa2-d0ec873a9710ae4f-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "5f70ceef5587ff9f04c12f5d49562381", "x-ms-return-client-request-id": "true" @@ -233,13 +234,13 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "33392316-c185-4d17-919d-1f4516fb3f09", + "apim-request-id": "d684da34-5b21-41cf-a09b-6914ed9c2980", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:50 GMT", + "Date": "Thu, 03 Jun 2021 18:20:27 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "162", - "X-Request-ID": "33392316-c185-4d17-919d-1f4516fb3f09" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "310", + "x-request-id": "d684da34-5b21-41cf-a09b-6914ed9c2980" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False)Async.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False)Async.json index 413f392895cb2..188b63ae8f252 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False)Async.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(False)Async.json @@ -8,11 +8,8 @@ "Content-Length": "111", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-dadd49d6a61f9d4190bf117a97418c78-9b69508c210c3642-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-9361943cd83b8641bdeb9ec4d1db16a2-3a1a2661fe143540-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "c0bd03356926376ce3a9e715abff87c9", "x-ms-return-client-request-id": "true" @@ -29,28 +26,25 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "6d249135-37ca-4446-b702-7c23811a7944", + "apim-request-id": "a306ae11-1417-4e4c-ac7c-34667ebc1861", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 18:00:15 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "Date": "Thu, 03 Jun 2021 18:20:46 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d868ad73-2a0e-49ef-84a6-b7830e4580bf", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "644", - "X-Request-ID": "6d249135-37ca-4446-b702-7c23811a7944" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "317", + "x-request-id": "a306ae11-1417-4e4c-ac7c-34667ebc1861" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d868ad73-2a0e-49ef-84a6-b7830e4580bf", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-dadd49d6a61f9d4190bf117a97418c78-a12fea41efdab343-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-9361943cd83b8641bdeb9ec4d1db16a2-df4531752c98ff47-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "c62e59d08cb008599cd3e9b613ff4fc5", "x-ms-return-client-request-id": "true" @@ -58,17 +52,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "ba4bd22c-52c8-4400-b3b4-f09ca2ec83fa", + "apim-request-id": "0bd34a26-a421-4a41-bf4d-b4786fe541c8", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 18:00:15 GMT", + "Date": "Thu, 03 Jun 2021 18:20:47 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "181", - "X-Request-ID": "ba4bd22c-52c8-4400-b3b4-f09ca2ec83fa" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "229", + "x-request-id": "0bd34a26-a421-4a41-bf4d-b4786fe541c8" }, "ResponseBody": { - "hookId": "3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "hookId": "d868ad73-2a0e-49ef-84a6-b7830e4580bf", "hookName": "hookVHsNsODG", "hookType": "Email", "externalLink": "", @@ -85,16 +79,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d868ad73-2a0e-49ef-84a6-b7830e4580bf", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-cceec87376cc564fadddd0ce3454844b-02a05bfbc5a03d45-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-1838c5c428023d4d95c7f14e4fd601ce-f7449719fe02ec49-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "9cb46fdd3675aff098307a07dc4a5902", "x-ms-return-client-request-id": "true" @@ -102,17 +93,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "43b6c392-0ff6-448d-b4b0-6128c63af43c", + "apim-request-id": "f6f578f2-96fd-4aaa-a0dc-b142baa4e4e5", "Content-Length": "223", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 18:00:15 GMT", + "Date": "Thu, 03 Jun 2021 18:20:47 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "158", - "X-Request-ID": "43b6c392-0ff6-448d-b4b0-6128c63af43c" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "218", + "x-request-id": "f6f578f2-96fd-4aaa-a0dc-b142baa4e4e5" }, "ResponseBody": { - "hookId": "3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "hookId": "d868ad73-2a0e-49ef-84a6-b7830e4580bf", "hookName": "hookVHsNsODG", "hookType": "Email", "externalLink": "", @@ -129,18 +120,15 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d868ad73-2a0e-49ef-84a6-b7830e4580bf", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "164", + "Content-Length": "175", "Content-Type": "application/merge-patch\u002Bjson", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-cd982335da18c7469da4cf71ad19fc6c-302fad3c3d001248-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-0295f8852606b8499d7037c0fb2eef30-9c0a6c7db9569d4c-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "93b80610dadda9bdaab4235380b623e3", "x-ms-return-client-request-id": "true" @@ -156,31 +144,47 @@ "hookType": "Email", "hookName": "hookVHsNsODG", "description": "", - "externalLink": "" + "admins": [ + "foo@contoso.com" + ] }, - "StatusCode": 204, + "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "b323021c-a313-480e-a198-4635b9c8c9b5", - "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 18:00:16 GMT", + "apim-request-id": "229c99af-722e-43db-a4e1-a831080ba355", + "Content-Length": "241", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Jun 2021 18:20:53 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "551", - "X-Request-ID": "b323021c-a313-480e-a198-4635b9c8c9b5" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5593", + "x-request-id": "229c99af-722e-43db-a4e1-a831080ba355" }, - "ResponseBody": [] + "ResponseBody": { + "hookId": "d868ad73-2a0e-49ef-84a6-b7830e4580bf", + "hookName": "hookVHsNsODG", + "hookType": "Email", + "externalLink": "", + "description": "", + "admins": [ + "foo@contoso.com" + ], + "hookParameter": { + "toList": [ + "fake1@email.com", + "fake2@email.com", + "fake3@email.com" + ] + } + } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d868ad73-2a0e-49ef-84a6-b7830e4580bf", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-e97fe436b0e3784297bd2d5ef43dde7f-0e4c045f4a716244-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-6b1ab49714ca4a48b9e99e34e27ab02b-de6bfa14894fa246-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "3b37225aea4b9954687f2d8011512b51", "x-ms-return-client-request-id": "true" @@ -188,17 +192,17 @@ "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "7d8dadc1-0950-40f9-b5a0-4d47d84c53eb", + "apim-request-id": "5e084210-cb4f-4485-a472-5751ba5b8caa", "Content-Length": "241", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 18:00:16 GMT", + "Date": "Thu, 03 Jun 2021 18:20:53 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "146", - "X-Request-ID": "7d8dadc1-0950-40f9-b5a0-4d47d84c53eb" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "191", + "x-request-id": "5e084210-cb4f-4485-a472-5751ba5b8caa" }, "ResponseBody": { - "hookId": "3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "hookId": "d868ad73-2a0e-49ef-84a6-b7830e4580bf", "hookName": "hookVHsNsODG", "hookType": "Email", "externalLink": "", @@ -216,16 +220,13 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/3d30f9f4-a871-4b3e-90c1-d1d0c265a690", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d868ad73-2a0e-49ef-84a6-b7830e4580bf", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-a797b4469daf11469f0404c97d411add-6b0d742c28ac4c4e-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-7ce81d346c1466469359b889ff810283-1f22dd7df5dabd44-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-api-key": "Sanitized", "x-ms-client-request-id": "0da5e77abc4602e8b10af2c0129d2fe2", "x-ms-return-client-request-id": "true" @@ -233,13 +234,13 @@ "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "d1dfc87d-42ce-414c-a847-f0709903f0bf", + "apim-request-id": "ed720444-f30d-46c9-9f99-72bacbb8e8a3", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 18:00:16 GMT", + "Date": "Thu, 03 Jun 2021 18:20:53 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "174", - "X-Request-ID": "d1dfc87d-42ce-414c-a847-f0709903f0bf" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "208", + "x-request-id": "ed720444-f30d-46c9-9f99-72bacbb8e8a3" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True).json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True).json index 085c3fb3fd2d1..719ee0c9e79e0 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True).json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True).json @@ -8,11 +8,8 @@ "Authorization": "Sanitized", "Content-Length": "111", "Content-Type": "application/json", - "traceparent": "00-50685e27bd1d7f4182a83ed58c6b7d92-69ac8a5690248a4e-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-d6c632f57d07114aa4c659bc225a63a3-0767d8c479246d45-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "62c34e7ef571d4504f4d00cc323f3955", "x-ms-return-client-request-id": "true" }, @@ -28,45 +25,42 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "c1974c58-a508-4697-a1d8-e28d727eb511", + "apim-request-id": "9c44c740-9a50-4978-9a45-34184e11927e", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:47 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/a8a0087c-f713-4335-ba50-225325696e68", + "Date": "Thu, 03 Jun 2021 18:20:09 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d7aed06b-891d-4030-a895-1bf2edb8f72c", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "251", - "X-Request-ID": "c1974c58-a508-4697-a1d8-e28d727eb511" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "551", + "x-request-id": "9c44c740-9a50-4978-9a45-34184e11927e" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/a8a0087c-f713-4335-ba50-225325696e68", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d7aed06b-891d-4030-a895-1bf2edb8f72c", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-50685e27bd1d7f4182a83ed58c6b7d92-4de48ccaef572143-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-d6c632f57d07114aa4c659bc225a63a3-0b179299371a9943-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "8f78cdcffe7cf0da7d7e476753a102fe", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "3eb8040f-db31-46ef-8aa2-eacbed78009d", + "apim-request-id": "6534c904-c5b1-48b1-b1dd-22938cb3ee63", "Content-Length": "244", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:47 GMT", + "Date": "Thu, 03 Jun 2021 18:20:09 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "79", - "X-Request-ID": "3eb8040f-db31-46ef-8aa2-eacbed78009d" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "80", + "x-request-id": "6534c904-c5b1-48b1-b1dd-22938cb3ee63" }, "ResponseBody": { - "hookId": "a8a0087c-f713-4335-ba50-225325696e68", + "hookId": "d7aed06b-891d-4030-a895-1bf2edb8f72c", "hookName": "hookmKAYdTxX", "hookType": "Email", "externalLink": "", @@ -83,33 +77,30 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/a8a0087c-f713-4335-ba50-225325696e68", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d7aed06b-891d-4030-a895-1bf2edb8f72c", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ed8237405d04e5428eba98861f22c36f-afeddc888a5ecb46-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-edc838fb0d73f34da7ba9a27cb25d48a-9ea8bb9758b0b744-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "b879dcf176f133863c429918a53f107a", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "a887b90a-5a9f-450e-a07d-e7cfb9c8af61", + "apim-request-id": "51891024-e7a4-4e42-9ebe-9cf09427c962", "Content-Length": "244", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:47 GMT", + "Date": "Thu, 03 Jun 2021 18:20:09 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "80", - "X-Request-ID": "a887b90a-5a9f-450e-a07d-e7cfb9c8af61" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "158", + "x-request-id": "51891024-e7a4-4e42-9ebe-9cf09427c962" }, "ResponseBody": { - "hookId": "a8a0087c-f713-4335-ba50-225325696e68", + "hookId": "d7aed06b-891d-4030-a895-1bf2edb8f72c", "hookName": "hookmKAYdTxX", "hookType": "Email", "externalLink": "", @@ -126,18 +117,15 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/a8a0087c-f713-4335-ba50-225325696e68", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d7aed06b-891d-4030-a895-1bf2edb8f72c", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "164", + "Content-Length": "196", "Content-Type": "application/merge-patch\u002Bjson", - "traceparent": "00-1dbd69585980d641b94623a4a0d5ecfc-6593edce0fe0d145-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-4fa963af9824af46b902f723415fa341-f2d6facce309a342-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "03aa63aa73bb7f6a74d2e5f2ade980ad", "x-ms-return-client-request-id": "true" }, @@ -152,48 +140,64 @@ "hookType": "Email", "hookName": "hookmKAYdTxX", "description": "", - "externalLink": "" + "admins": [ + "94dc466b-52e4-4678-892d-70a0c45c5f42" + ] }, - "StatusCode": 204, + "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "b9abf4f3-b0ac-4431-8e45-49bcb6c3bab8", - "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:48 GMT", + "apim-request-id": "d3e3bbdc-96cb-459a-9b15-7073833da432", + "Content-Length": "262", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Jun 2021 18:20:10 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "219", - "X-Request-ID": "b9abf4f3-b0ac-4431-8e45-49bcb6c3bab8" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "632", + "x-request-id": "d3e3bbdc-96cb-459a-9b15-7073833da432" }, - "ResponseBody": [] + "ResponseBody": { + "hookId": "d7aed06b-891d-4030-a895-1bf2edb8f72c", + "hookName": "hookmKAYdTxX", + "hookType": "Email", + "externalLink": "", + "description": "", + "admins": [ + "94dc466b-52e4-4678-892d-70a0c45c5f42" + ], + "hookParameter": { + "toList": [ + "fake1@email.com", + "fake2@email.com", + "fake3@email.com" + ] + } + } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/a8a0087c-f713-4335-ba50-225325696e68", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d7aed06b-891d-4030-a895-1bf2edb8f72c", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-90dcad4c6d3e5c45b9281145046fa113-75294854c52ff94c-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-56e6a04e54911f40a6e47a815a96b562-421a6b53a66fe843-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "55db014a81c658644645533964c24b3e", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "51672105-a753-467a-8382-718dc4f1dab3", + "apim-request-id": "d946fd7c-65f9-4c18-8944-beb99a38cb07", "Content-Length": "262", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 17:59:48 GMT", + "Date": "Thu, 03 Jun 2021 18:20:10 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "72", - "X-Request-ID": "51672105-a753-467a-8382-718dc4f1dab3" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "184", + "x-request-id": "d946fd7c-65f9-4c18-8944-beb99a38cb07" }, "ResponseBody": { - "hookId": "a8a0087c-f713-4335-ba50-225325696e68", + "hookId": "d7aed06b-891d-4030-a895-1bf2edb8f72c", "hookName": "hookmKAYdTxX", "hookType": "Email", "externalLink": "", @@ -211,29 +215,26 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/a8a0087c-f713-4335-ba50-225325696e68", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/d7aed06b-891d-4030-a895-1bf2edb8f72c", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-78ce3c1a43629640a5ebe4d0cbe666b4-1295bc3ecb6ccb48-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-cedf118b7560954fa26fdd3cdddbb153-abdccd3ada62e34c-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "efbdcd6dfff77d4272f9441e91948553", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "a73ba7ad-687d-4608-a8c4-77aa72d4c690", + "apim-request-id": "2379b133-176b-4f59-b7a1-09b5f9ad3f90", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 17:59:48 GMT", + "Date": "Thu, 03 Jun 2021 18:20:15 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "105", - "X-Request-ID": "a73ba7ad-687d-4608-a8c4-77aa72d4c690" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5217", + "x-request-id": "2379b133-176b-4f59-b7a1-09b5f9ad3f90" }, "ResponseBody": [] } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True)Async.json b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True)Async.json index a9e2d381969ee..ecbcf5b723c42 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True)Async.json +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/SessionRecords/NotificationHookLiveTests/UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(True)Async.json @@ -8,11 +8,8 @@ "Authorization": "Sanitized", "Content-Length": "111", "Content-Type": "application/json", - "traceparent": "00-8c9d5f8256d00f429d5d10512a9a471e-a5116ca229f57445-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-20f8109460e5f647ab05d6f1f7718ecc-465b03bb7259e54e-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "5f4947188a4c7c5caa8c925bb0ab44f1", "x-ms-return-client-request-id": "true" }, @@ -28,45 +25,42 @@ }, "StatusCode": 201, "ResponseHeaders": { - "apim-request-id": "7cee91fb-0a3a-4f64-ae02-858f29bdbd0d", + "apim-request-id": "79b2a1ff-cc2a-413f-9a1a-a9a349b306da", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 18:00:13 GMT", - "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/25332683-31ed-49e8-a191-97bea4cc16e4", + "Date": "Thu, 03 Jun 2021 18:20:36 GMT", + "Location": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "544", - "X-Request-ID": "7cee91fb-0a3a-4f64-ae02-858f29bdbd0d" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5608", + "x-request-id": "79b2a1ff-cc2a-413f-9a1a-a9a349b306da" }, "ResponseBody": [] }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/25332683-31ed-49e8-a191-97bea4cc16e4", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-8c9d5f8256d00f429d5d10512a9a471e-7033a7b1c1f5e848-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-20f8109460e5f647ab05d6f1f7718ecc-b965452d46d2d34b-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "f298c26b80b396e32e0f8bee0e46e68f", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "49dd1eb0-aa73-429f-ad7f-a884432a066a", + "apim-request-id": "03376d7e-c286-406c-8465-1514d62224c8", "Content-Length": "244", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 18:00:13 GMT", + "Date": "Thu, 03 Jun 2021 18:20:36 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "145", - "X-Request-ID": "49dd1eb0-aa73-429f-ad7f-a884432a066a" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "193", + "x-request-id": "03376d7e-c286-406c-8465-1514d62224c8" }, "ResponseBody": { - "hookId": "25332683-31ed-49e8-a191-97bea4cc16e4", + "hookId": "dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "hookName": "hooksvvcRVbp", "hookType": "Email", "externalLink": "", @@ -83,33 +77,30 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/25332683-31ed-49e8-a191-97bea4cc16e4", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-0ca9cbe2efd35244923e9b3fd2ebcbc1-6d6740df4bc98e43-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-fab54ca90531524aa63213153e76cb59-1db157c708ec2045-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "2c793c85cc2677135d82020e383c1cb8", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "610124f2-842b-41a6-a90c-7e2ab7d359c6", + "apim-request-id": "9be93d45-8889-4921-89e9-a45204aea425", "Content-Length": "244", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 18:00:13 GMT", + "Date": "Thu, 03 Jun 2021 18:20:41 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "93", - "X-Request-ID": "610124f2-842b-41a6-a90c-7e2ab7d359c6" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "3554", + "x-request-id": "9be93d45-8889-4921-89e9-a45204aea425" }, "ResponseBody": { - "hookId": "25332683-31ed-49e8-a191-97bea4cc16e4", + "hookId": "dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "hookName": "hooksvvcRVbp", "hookType": "Email", "externalLink": "", @@ -126,18 +117,15 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/25332683-31ed-49e8-a191-97bea4cc16e4", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "164", + "Content-Length": "196", "Content-Type": "application/merge-patch\u002Bjson", - "traceparent": "00-0bfb43d1ceace24ab63a4bfd7f404cb0-512bf466f6b30747-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-290379f8ea5c4e4b8efa6a491abb109a-267fb4960f5cae46-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "20ce9555c236980a64b3303dfe6d6e64", "x-ms-return-client-request-id": "true" }, @@ -152,48 +140,64 @@ "hookType": "Email", "hookName": "hooksvvcRVbp", "description": "", - "externalLink": "" + "admins": [ + "94dc466b-52e4-4678-892d-70a0c45c5f42" + ] }, - "StatusCode": 204, + "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "7d4d8aac-61f8-43c2-ba82-8a28d6f24e67", - "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 18:00:14 GMT", + "apim-request-id": "a09a9014-cdec-4b19-8ea6-2be3f708470e", + "Content-Length": "262", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 03 Jun 2021 18:20:46 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "442", - "X-Request-ID": "7d4d8aac-61f8-43c2-ba82-8a28d6f24e67" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5565", + "x-request-id": "a09a9014-cdec-4b19-8ea6-2be3f708470e" }, - "ResponseBody": [] + "ResponseBody": { + "hookId": "dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", + "hookName": "hooksvvcRVbp", + "hookType": "Email", + "externalLink": "", + "description": "", + "admins": [ + "94dc466b-52e4-4678-892d-70a0c45c5f42" + ], + "hookParameter": { + "toList": [ + "fake1@email.com", + "fake2@email.com", + "fake3@email.com" + ] + } + } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/25332683-31ed-49e8-a191-97bea4cc16e4", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-4d699d6cdbb6d6498188af3330bddd35-b97c5d402a68cd42-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-ff72b56eb24ff549a31df2e7d58bc530-6e875c5f3819eb44-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "73d602a517329fcbae2194307dd45df2", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "f7eb567a-2e2b-426c-a2f5-d82fbda68062", + "apim-request-id": "ee6ef495-08b4-4453-9785-e45820dc15f4", "Content-Length": "262", "Content-Type": "application/json; charset=utf-8", - "Date": "Fri, 05 Feb 2021 18:00:14 GMT", + "Date": "Thu, 03 Jun 2021 18:20:46 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "80", - "X-Request-ID": "f7eb567a-2e2b-426c-a2f5-d82fbda68062" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "192", + "x-request-id": "ee6ef495-08b4-4453-9785-e45820dc15f4" }, "ResponseBody": { - "hookId": "25332683-31ed-49e8-a191-97bea4cc16e4", + "hookId": "dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "hookName": "hooksvvcRVbp", "hookType": "Email", "externalLink": "", @@ -211,29 +215,26 @@ } }, { - "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/25332683-31ed-49e8-a191-97bea4cc16e4", + "RequestUri": "https://js-metrics-advisor.cognitiveservices.azure.com/metricsadvisor/v1.0/hooks/dd9d3c6c-c09a-4ff2-94cf-867aefcfeac7", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-c19854d75b019d439d752e7a2b472971-10b598e2bf7a7648-00", - "User-Agent": [ - "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-c27a61a615d29f4aaf78a773408cf5bb-a3e6457faf76a24d-00", + "User-Agent": "azsdk-net-AI.MetricsAdvisor/1.0.0-alpha.20210603.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "7898d3f2c677c35932e1c7729cd578ef", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { - "apim-request-id": "bf8e1961-54d1-4ae5-a7c7-0e50bc52b1e2", + "apim-request-id": "cdefdc97-71e7-4b2e-a839-07e60fa64c4f", "Content-Length": "0", - "Date": "Fri, 05 Feb 2021 18:00:14 GMT", + "Date": "Thu, 03 Jun 2021 18:20:46 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "155", - "X-Request-ID": "bf8e1961-54d1-4ae5-a7c7-0e50bc52b1e2" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "169", + "x-request-id": "cdefdc97-71e7-4b2e-a839-07e60fa64c4f" }, "ResponseBody": [] } From ea3bda149238f5f41775e7b73ff0c00b98fd241b Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Thu, 3 Jun 2021 11:24:11 -0700 Subject: [PATCH 6/8] Updated API --- .../api/Azure.AI.MetricsAdvisor.netstandard2.0.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 c46cbec8db406..9e67dc5045e2d 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 @@ -299,8 +299,8 @@ public MetricsAdvisorAdministrationClient(System.Uri endpoint, Azure.Core.TokenC public virtual System.Threading.Tasks.Task UpdateDataFeedAsync(string dataFeedId, Azure.AI.MetricsAdvisor.Models.DataFeed dataFeed, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateDetectionConfiguration(string detectionConfigurationId, Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration detectionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateDetectionConfigurationAsync(string detectionConfigurationId, Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration detectionConfiguration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateHook(string hookId, Azure.AI.MetricsAdvisor.Models.NotificationHook hook, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateHookAsync(string hookId, Azure.AI.MetricsAdvisor.Models.NotificationHook hook, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateHook(Azure.AI.MetricsAdvisor.Models.NotificationHook hook, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateHookAsync(Azure.AI.MetricsAdvisor.Models.NotificationHook hook, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.AI.MetricsAdvisor.Models From d89574547db77b933d20655d8584c5072e2d84ef Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Fri, 4 Jun 2021 13:11:47 -0700 Subject: [PATCH 7/8] Updated samples --- .../Samples/Sample03_DetectionConfigurationCrudOperations.cs | 5 ++++- .../tests/Samples/Sample04_HookCrudOperations.cs | 5 ++++- .../Samples/Sample05_AlertConfigurationCrudOperations.cs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample03_DetectionConfigurationCrudOperations.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample03_DetectionConfigurationCrudOperations.cs index c23e7af82753b..c0a7a98c48ccc 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample03_DetectionConfigurationCrudOperations.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample03_DetectionConfigurationCrudOperations.cs @@ -103,7 +103,10 @@ public async Task UpdateDetectionConfigurationAsync() string originalDescription = detectionConfiguration.Description; detectionConfiguration.Description = "This description was generated by a sample."; - await adminClient.UpdateDetectionConfigurationAsync(detectionConfiguration); + response = await adminClient.UpdateDetectionConfigurationAsync(detectionConfiguration); + AnomalyDetectionConfiguration updatedDetectionConfiguration = response.Value; + + Console.WriteLine($"Updated description: {updatedDetectionConfiguration.Description}"); // Undo the changes to leave the detection configuration unaltered. Skip this step if you intend to keep // the changes. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs index 38971e5a15f26..fe30967b571a8 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs @@ -112,7 +112,10 @@ public async Task UpdateHookAsync() string originalDescription = hook.Description; hook.Description = "This description was generated by a sample."; - await adminClient.UpdateHookAsync(hook); + response = await adminClient.UpdateHookAsync(hook); + NotificationHook updatedHook = response.Value; + + Console.WriteLine($"Updated description: {updatedHook.Description}"); // Undo the changes to leave the hook unaltered. Skip this step if you intend to keep // the changes. 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 4f519116c98f3..fc0b57ff23678 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample05_AlertConfigurationCrudOperations.cs @@ -113,7 +113,10 @@ public async Task UpdateAlertConfigurationAsync() string originalDescription = alertConfiguration.Description; alertConfiguration.Description = "This description was generated by a sample."; - await adminClient.UpdateAlertConfigurationAsync(alertConfiguration); + response = await adminClient.UpdateAlertConfigurationAsync(alertConfiguration); + AnomalyAlertConfiguration updatedAlertConfiguration = response.Value; + + Console.WriteLine($"Updated description: {updatedAlertConfiguration.Description}"); // Undo the changes to leave the alert configuration unaltered. Skip this step if you intend to keep // the changes. From 5f59aba541dbf51d678b5c2a0f59323508f367f1 Mon Sep 17 00:00:00 2001 From: Caio Saldanha Date: Fri, 4 Jun 2021 13:27:07 -0700 Subject: [PATCH 8/8] Updated tests --- .../AnomalyAlertConfigurationLiveTests.cs | 24 ++++------ .../AnomalyDetectionConfigurationLiveTests.cs | 24 ++++------ .../NotificationHookLiveTests.cs | 48 +++++++------------ 3 files changed, 32 insertions(+), 64 deletions(-) diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs index 79efc5fd6cb58..2a664977bb36f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyAlertConfigurationLiveTests.cs @@ -404,11 +404,9 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndGetInstance(bool us configToUpdate.CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Or; - await adminClient.UpdateAlertConfigurationAsync(configToUpdate); + AnomalyAlertConfiguration updatedConfig = await adminClient.UpdateAlertConfigurationAsync(configToUpdate); - // Get the updated configuration and validate top-level members. - - AnomalyAlertConfiguration updatedConfig = await adminClient.GetAlertConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.Name, Is.EqualTo(configName)); @@ -519,11 +517,9 @@ public async Task UpdateAlertConfigurationWithMinimumSetupAndNewInstance() CrossMetricsOperator = MetricAnomalyAlertConfigurationsOperator.Or }; - await adminClient.UpdateAlertConfigurationAsync(configToUpdate); - - // Get the updated configuration and validate top-level members. + AnomalyAlertConfiguration updatedConfig = await adminClient.UpdateAlertConfigurationAsync(configToUpdate); - AnomalyAlertConfiguration updatedConfig = await adminClient.GetAlertConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.Name, Is.EqualTo(configName)); @@ -658,11 +654,9 @@ public async Task UpdateAlertConfigurationWithEveryMemberAndGetInstance() metricAlertConfigToUpdate.AlertSnoozeCondition = null; - await adminClient.UpdateAlertConfigurationAsync(configToUpdate); + AnomalyAlertConfiguration updatedConfig = await adminClient.UpdateAlertConfigurationAsync(configToUpdate); - // Get the updated configuration and validate top-level members. - - AnomalyAlertConfiguration updatedConfig = await adminClient.GetAlertConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.Name, Is.EqualTo(configName)); @@ -800,11 +794,9 @@ public async Task UpdateAlertConfigurationWithEveryMemberAndNewInstance() metricAlertConfigToUpdate.AlertSnoozeCondition = null; - await adminClient.UpdateAlertConfigurationAsync(configToUpdate); - - // Get the updated configuration and validate top-level members. + AnomalyAlertConfiguration updatedConfig = await adminClient.UpdateAlertConfigurationAsync(configToUpdate); - AnomalyAlertConfiguration updatedConfig = await adminClient.GetAlertConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.Name, Is.EqualTo(configName)); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationLiveTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationLiveTests.cs index dc62a58545025..e321c3e1152d0 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationLiveTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/AnomalyDetectionConfigurationLiveTests.cs @@ -390,11 +390,9 @@ public async Task UpdateDetectionConfigurationWithMinimumSetupAndGetInstance(boo configToUpdate.WholeSeriesDetectionConditions.HardThresholdCondition.LowerBound = 12.0; - await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); + AnomalyDetectionConfiguration updatedConfig = await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); - // Get the updated configuration and validate top-level members. - - AnomalyDetectionConfiguration updatedConfig = await adminClient.GetDetectionConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.MetricId, Is.EqualTo(MetricId)); @@ -512,11 +510,9 @@ public async Task UpdateDetectionConfigurationWithMinimumSetupAndNewInstance() configToUpdate.WholeSeriesDetectionConditions.HardThresholdCondition.LowerBound = 12.0; - await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); - - // Get the updated configuration and validate top-level members. + AnomalyDetectionConfiguration updatedConfig = await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); - AnomalyDetectionConfiguration updatedConfig = await adminClient.GetDetectionConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.MetricId, Is.EqualTo(MetricId)); @@ -652,11 +648,9 @@ public async Task UpdateDetectionConfigurationWithEveryMemberAndGetInstance() configToUpdate.SeriesDetectionConditions.Clear(); - await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); + AnomalyDetectionConfiguration updatedConfig = await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); - // Get the updated configuration and validate top-level members. - - AnomalyDetectionConfiguration updatedConfig = await adminClient.GetDetectionConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.MetricId, Is.EqualTo(MetricId)); @@ -798,11 +792,9 @@ public async Task UpdateDetectionConfigurationWithEveryMemberAndNewInstance() configToUpdate.SeriesDetectionConditions.Clear(); - await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); - - // Get the updated configuration and validate top-level members. + AnomalyDetectionConfiguration updatedConfig = await adminClient.UpdateDetectionConfigurationAsync(configToUpdate); - AnomalyDetectionConfiguration updatedConfig = await adminClient.GetDetectionConfigurationAsync(disposableConfig.Id); + // Validate top-level members. Assert.That(updatedConfig.Id, Is.EqualTo(disposableConfig.Id)); Assert.That(updatedConfig.MetricId, Is.EqualTo(MetricId)); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs index 8f088df54cbb1..a9110445a3644 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorAdministrationClient/NotificationHookLiveTests.cs @@ -198,11 +198,9 @@ public async Task UpdateEmailNotificationHookWithMinimumSetupAndGetInstance(bool hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(hookToUpdate); + var updatedEmailHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as EmailNotificationHook; - // Get the hook and check if updates are in place. - - var updatedEmailHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as EmailNotificationHook; + // Check if updates are in place. Assert.That(updatedEmailHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedEmailHook.Name, Is.EqualTo(hookName)); @@ -239,11 +237,9 @@ public async Task UpdateEmailNotificationHookWithMinimumSetupAndNewInstance() hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(hookToUpdate); - - // Get the hook and check if updates are in place. + var updatedEmailHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as EmailNotificationHook; - var updatedEmailHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as EmailNotificationHook; + // Check if updates are in place. Assert.That(updatedEmailHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedEmailHook.Name, Is.EqualTo(hookName)); @@ -280,11 +276,9 @@ public async Task UpdateEmailNotificationHookWithEveryMemberAndGetInstance() hookToUpdate.ExternalLink = new Uri("http://fake.endpoint.com/"); hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(hookToUpdate); + var updatedEmailHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as EmailNotificationHook; - // Get the hook and check if updates are in place. - - var updatedEmailHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as EmailNotificationHook; + // Check if updates are in place. Assert.That(updatedEmailHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedEmailHook.Name, Is.EqualTo(hookName)); @@ -326,11 +320,9 @@ public async Task UpdateEmailNotificationHookWithEveryMemberAndNewInstance() hookToUpdate.EmailsToAlert.Add("fake3@email.com"); - await adminClient.UpdateHookAsync(hookToUpdate); - - // Get the hook and check if updates are in place. + var updatedEmailHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as EmailNotificationHook; - var updatedEmailHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as EmailNotificationHook; + // Check if updates are in place. Assert.That(updatedEmailHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedEmailHook.Name, Is.EqualTo(hookName)); @@ -361,11 +353,9 @@ public async Task UpdateWebNotificationHookWithMinimumSetupAndGetInstance() hookToUpdate.Username = "fakeUsername"; - await adminClient.UpdateHookAsync(hookToUpdate); + var updatedWebHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as WebNotificationHook; - // Get the hook and check if updates are in place. - - var updatedWebHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as WebNotificationHook; + // Check if updates are in place. Assert.That(updatedWebHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedWebHook.Name, Is.EqualTo(hookName)); @@ -401,11 +391,9 @@ public async Task UpdateWebNotificationHookWithMinimumSetupAndNewInstance() var hookToUpdate = new WebNotificationHook() { Endpoint = endpoint, Username = "fakeUsername" }; - await adminClient.UpdateHookAsync(hookToUpdate); - - // Get the hook and check if updates are in place. + var updatedWebHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as WebNotificationHook; - var updatedWebHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as WebNotificationHook; + // Check if updates are in place. Assert.That(updatedWebHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedWebHook.Name, Is.EqualTo(hookName)); @@ -459,11 +447,9 @@ public async Task UpdateWebNotificationHookWithEveryMemberAndGetInstance() hookToUpdate.Headers.Add(header); } - await adminClient.UpdateHookAsync(hookToUpdate); + var updatedWebHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as WebNotificationHook; - // Get the hook and check if updates are in place. - - var updatedWebHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as WebNotificationHook; + // Check if updates are in place. Assert.That(updatedWebHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedWebHook.Name, Is.EqualTo(hookName)); @@ -519,11 +505,9 @@ public async Task UpdateWebNotificationHookWithEveryMemberAndNewInstance() hookToUpdate.Headers.Add(header); } - await adminClient.UpdateHookAsync(hookToUpdate); - - // Get the hook and check if updates are in place. + var updatedWebHook = (await adminClient.UpdateHookAsync(hookToUpdate)).Value as WebNotificationHook; - var updatedWebHook = (await adminClient.GetHookAsync(disposableHook.Id)).Value as WebNotificationHook; + // Check if updates are in place. Assert.That(updatedWebHook.Id, Is.EqualTo(disposableHook.Id)); Assert.That(updatedWebHook.Name, Is.EqualTo(hookName));