From 76b1c64be6ac3d7680b2473b8a0e7d1ae4dd9401 Mon Sep 17 00:00:00 2001 From: Chengming Date: Tue, 23 May 2023 14:43:36 +0800 Subject: [PATCH 1/7] test --- .../src/autorest.md | 1 + .../tests/AutomationManagementTestBase.cs | 2 + .../CreateOrUpdateExistGetGetAllDelete.json | 383 ++++++++++++++++++ .../tests/TestCase/WebhookTests.cs | 80 ++++ 4 files changed, 466 insertions(+) create mode 100644 sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json create mode 100644 sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md index a6b020038d85a..21f2b98bdb5e3 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md +++ b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md @@ -130,6 +130,7 @@ rename-mapping: WindowsUpdateClasses: WindowsUpdateClassification WindowsProperties.excludedKbNumbers: ExcludedKBNumbers WindowsProperties.includedKbNumbers: IncludedKBNumbers + WebhookProperties.uri: uriString prepend-rp-prefix: - Certificate diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs index 503088ed5be38..bdaff098d4a9b 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs @@ -3,9 +3,11 @@ using Azure.Core; using Azure.Core.TestFramework; +using Azure.ResourceManager.Automation.Models; using Azure.ResourceManager.Resources; using Azure.ResourceManager.TestFramework; using NUnit.Framework; +using System.Collections.ObjectModel; using System.Threading.Tasks; namespace Azure.ResourceManager.Automation.Tests diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json new file mode 100644 index 0000000000000..bf004c7d0cccb --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json @@ -0,0 +1,383 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2021-01-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-66a7e896dc4984ad576cd2737bf122c5-31f5939488771fc6-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9bb793b43fde3c877837722b8b41f3eb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "748", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 06:26:32 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "dd69f45b-ac78-42f8-b727-9992323a748a", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "dd69f45b-ac78-42f8-b727-9992323a748a", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062632Z:dd69f45b-ac78-42f8-b727-9992323a748a" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "TagKey-9823": "TagValue-1254", + "TagKey-3481": "TagValue-320", + "TagKey-4926": "TagValue-1187", + "TagKey-751": "TagValue-3921", + "TagKey-1866": "TagValue-8559", + "TagKey-3094": "TagValue-9190", + "TagKey-2449": "TagValue-9", + "TagKey-8379": "TagValue-164", + "TagKey-7470": "TagValue-2205", + "TagKey-4236": "TagValue-3698", + "TagKey-5316": "TagValue-2725" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": ".NET Mgmt SDK Test with TTL = 1 Day", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-2826?api-version=**", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "43", + "Content-Type": "application/json", + "traceparent": "00-aad79e57d72d66e5eb5405c4a586bed1-8a4ab4267004f05a-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "abfc22b56c01e843ab5e8c10e7ac68bd", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "tags": { + "test": "env" + }, + "location": "eastus" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "241", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 06:26:32 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "44d11389-96ee-4edc-b6b7-f89fe4716899", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "44d11389-96ee-4edc-b6b7-f89fe4716899", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062633Z:44d11389-96ee-4edc-b6b7-f89fe4716899" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826", + "name": "testRG-2826", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "test": "env" + }, + "properties": { + "provisioningState": "Succeeded" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770?api-version=2021-06-22", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "traceparent": "00-df7ebb5f9eb57cbd3a9c4039cf63566f-e93b1bafdfc7c682-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b4a8320b66a164ce51eacd35449baa55", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "location": "eastus", + "properties": { + "sku": { + "name": "Basic" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1135", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 06:26:35 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770?api-version=2021-06-22", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "394db09b-0903-4826-b894-c9a4cdb8c3d4", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "ee4fcf1e-e792-4c17-97a0-be21b70bc825", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062635Z:394db09b-0903-4826-b894-c9a4cdb8c3d4" + }, + "ResponseBody": { + "name": "automation2770", + "systemData": { + "createdAt": "2023-05-23T06:26:34.5533333\u002B00:00", + "lastModifiedAt": "2023-05-23T06:26:34.5533333\u002B00:00" + }, + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770", + "type": "Microsoft.Automation/AutomationAccounts", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "disableLocalAuth": false, + "sku": { + "name": "Basic", + "family": null, + "capacity": null + }, + "state": "Ok", + "RegistrationUrl": "https://3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5.agentsvc.eus.azure-automation.net/accounts/3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5", + "encryption": { + "keySource": "Microsoft.Automation", + "identity": { + "userAssignedIdentity": null + } + }, + "automationHybridServiceUrl": "https://3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5.jrds.eus.azure-automation.net/automationAccounts/3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5", + "RuntimeConfiguration": { + "powershell": { + "builtinModules": { + "Az": "8.0.0" + } + }, + "powershell7": { + "builtinModules": { + "Az": "8.0.0" + } + } + }, + "creationTime": "2023-05-23T06:26:34.5533333\u002B00:00", + "lastModifiedBy": null, + "lastModifiedTime": "2023-05-23T06:26:34.5533333\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771?api-version=2018-06-30", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "traceparent": "00-7b03806c537f0bdc6bbd448da6d43264-64d1c0bd919edbc9-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "03d4ff4526b3b37432e1fa2c918b096e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "location": "eastus", + "properties": { + "runbookType": "Script" + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "680", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 06:26:37 GMT", + "ETag": "\u0022638204199978433333\u0022", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771?api-version=2018-06-30", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cc2f9bb7-d241-4852-8303-b7c06ede671f", + "x-ms-ratelimit-remaining-subscription-writes": "1197", + "x-ms-request-id": "d32e5e4f-98ce-4431-944b-99edd72456b0", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062638Z:cc2f9bb7-d241-4852-8303-b7c06ede671f" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771", + "name": "runbook6771", + "type": "Microsoft.Automation/AutomationAccounts/Runbooks", + "location": "eastus", + "tags": {}, + "etag": "\u0022638204199978433333\u0022", + "properties": { + "description": null, + "logVerbose": false, + "logProgress": false, + "logActivityTrace": 0, + "runbookType": "Script", + "parameters": {}, + "state": "New", + "jobCount": 0, + "provisioningState": "Succeeded", + "serviceManagementTags": null, + "outputTypes": [], + "creationTime": "2023-05-23T06:26:37.8433333\u002B00:00", + "lastModifiedBy": null, + "lastModifiedTime": "2023-05-23T06:26:37.8433333\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771/publish?api-version=2018-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "traceparent": "00-0f311e37a11914614df68b16845c8f82-867cdf5ab82249c5-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b9e7bbbc00279580dc9c1b581a7619f1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Tue, 23 May 2023 06:26:38 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771/operationResults/a65436ef-2e4f-4970-b7c0-eedb38c8809e?api-version=2018-06-30", + "ocp-automation-operationresultid": [ + "a65436ef-2e4f-4970-b7c0-eedb38c8809e", + "a65436ef-2e4f-4970-b7c0-eedb38c8809e" + ], + "Pragma": "no-cache", + "Retry-After": "5", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "ef54d3ff-26a2-43d8-a5a5-5e3836c449d9", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "b59b4863-9f3f-4a5c-9893-6fdb7207b629", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062639Z:ef54d3ff-26a2-43d8-a5a5-5e3836c449d9" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771/operationResults/a65436ef-2e4f-4970-b7c0-eedb38c8809e?api-version=2018-06-30", + "RequestMethod": "GET", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-0f311e37a11914614df68b16845c8f82-ae10b1a413bf8e63-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "89795fe0f0b3442e7f3f26160b1b99bc", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Type": "text/plain; charset=utf-8", + "Date": "Tue, 23 May 2023 06:26:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "04574d26-0dc5-4248-9c3e-ec4f3f31dc15", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "e0c04fcb-d536-45a5-8ca0-3a19086e96ab", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062639Z:04574d26-0dc5-4248-9c3e-ec4f3f31dc15" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/webhooks/webhook5674?api-version=2015-10-31", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "114", + "Content-Type": "application/json", + "traceparent": "00-501b1b9e4697cf87a2544892704b5868-3b2e698febf4d187-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "24ffc50985a1e8f002fb327ebf293ac8", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "name": "webhook5674", + "properties": { + "expiryTime": "2023-05-24T06:26:38.8216413Z", + "runbook": { + "name": "runbook6771" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "695", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 06:26:42 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/webhooks/webhook5674?api-version=2015-10-31", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "48577d25-e2a6-48b3-b482-fab79a4b57ef", + "x-ms-ratelimit-remaining-subscription-writes": "1196", + "x-ms-request-id": "9310073c-9c77-4a86-bfe5-1ebcc102df3a", + "x-ms-routing-request-id": "KOREASOUTH:20230523T062642Z:48577d25-e2a6-48b3-b482-fab79a4b57ef" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/webhooks/webhook5674", + "name": "webhook5674", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T06:26:38.8216413\u002B00:00", + "runbook": { + "name": "runbook6771" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "https://3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5.webhook.eus.azure-automation.net/webhooks?token=4dPzl4gPJRDbtzCU8AuzwszrFhScu3z8EjMa8dAfKAU%3d", + "creationTime": "2023-05-23T06:26:42.4354161\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T06:26:42.4354161\u002B00:00" + } + } + } + ], + "Variables": { + "AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com", + "DateTimeOffsetNow": "2023-05-23T14:26:38.8216413\u002B08:00", + "LOCATION": "eastus", + "RandomSeed": "130527200", + "RESOURCE_MANAGER_URL": null, + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs new file mode 100644 index 0000000000000..c334a835f87a4 --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Automation.Models; +using Azure.ResourceManager.Automation.Tests.Helpers; +using NUnit.Framework; + +namespace Azure.ResourceManager.Automation.Tests.TestCase +{ + internal class WebhookTests : AutomationManagementTestBase + { + private AutomationRunbookResource _runbook; + private AutomationWebhookCollection _webhookCollection; + + public WebhookTests(bool isAsync) : base(isAsync, RecordedTestMode.Record) + { + } + + [SetUp] + public async Task SetUp() + { + var rg = await CreateResourceGroupAsync(); + string automationAccountName = Recording.GenerateAssetName("automation"); + string runbookName = Recording.GenerateAssetName("runbook"); + var automationAccount = await rg.GetAutomationAccounts().CreateOrUpdateAsync(WaitUntil.Completed, automationAccountName, ResourceDataHelpers.GetAccountData()); + var runbook = await automationAccount.Value.GetAutomationRunbooks().CreateOrUpdateAsync(WaitUntil.Completed, runbookName, ResourceDataHelpers.GetRunbookData()); + _runbook = runbook.Value; + _webhookCollection = automationAccount.Value.GetAutomationWebhooks(); + await _runbook.PublishAsync(WaitUntil.Completed); + } + + private async Task CreateWebhook(string webhookName) + { + var data = new AutomationWebhookCreateOrUpdateContent(webhookName) + { + RunbookName = _runbook.Data.Name, + ExpireOn = Recording.UtcNow.AddDays(1), + }; + var webhook = await _webhookCollection.CreateOrUpdateAsync(WaitUntil.Completed, webhookName, data); + return webhook.Value; + } + + [RecordedTest] + public async Task CreateOrUpdateExistGetGetAllDelete() + { + // CreateOrUpdate + string webhookName = Recording.GenerateAssetName("webhook"); + var webhook = await CreateWebhook(webhookName); + + // Exist + var flag = await _webhookCollection.ExistsAsync(webhookName); + Assert.IsTrue(flag); + + // Get + var getwebhook = await _webhookCollection.GetAsync(webhookName); + ValidateWebhook(getwebhook.Value.Data, webhookName); + + // GetAll + var list = await _webhookCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotEmpty(list); + ValidateWebhook(list.FirstOrDefault().Data, webhookName); + + // Delete + await webhook.DeleteAsync(WaitUntil.Completed); + flag = await _webhookCollection.ExistsAsync(webhookName); + Assert.IsFalse(flag); + } + + private void ValidateWebhook(AutomationWebhookData webhook, string webhookName) + { + Assert.IsNotNull(webhook); + } + } +} From cfd788a661aaad2c4aaa59c04d19e5f4da5d68a3 Mon Sep 17 00:00:00 2001 From: Chengming Date: Tue, 23 May 2023 15:24:36 +0800 Subject: [PATCH 2/7] add 'UriString' replace 'Uri' --- .../CHANGELOG.md | 2 + ...sourceManager.Automation.netstandard2.0.cs | 12 +- .../src/Customized/AutomationWebhookData.cs | 23 + .../src/Generated/AutomationWebhookData.cs | 8 +- .../AutomationWebhookData.Serialization.cs | 12 +- .../src/autorest.md | 2 +- .../CreateOrUpdateExistGetGetAll.json | 530 ++++++++++++++++++ .../CreateOrUpdateExistGetGetAllAsync.json | 529 +++++++++++++++++ .../tests/TestCase/WebhookTests.cs | 7 +- 9 files changed, 1105 insertions(+), 20 deletions(-) create mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs create mode 100644 sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json create mode 100644 sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json diff --git a/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md b/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md index 381c2feeaeaf2..2abdcec2e8c10 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md +++ b/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md @@ -6,6 +6,8 @@ ### Breaking Changes +- Add property `UriString` to class `AutomationWebhookData`, replace the `Uri`. + ### Bugs Fixed ### Other Changes diff --git a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs index 6e605b438817b..4beb56a03c529 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs @@ -854,7 +854,7 @@ public AutomationWebhookData() { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public string RunbookName { get { throw null; } set { } } public string RunOn { get { throw null; } set { } } - public System.Uri Uri { get { throw null; } set { } } + public string UriString { get { throw null; } set { } } } public partial class AutomationWebhookResource : Azure.ResourceManager.ArmResource { @@ -1175,6 +1175,16 @@ protected SoftwareUpdateConfigurationResource() { } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Automation.SoftwareUpdateConfigurationData data, string clientRequestId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } +namespace Azure.ResourceManager.Automation.Customized +{ + public partial class AutomationWebhookData + { + public AutomationWebhookData() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This property has been replaced by UriString", false)] + public System.Uri Uri { get { throw null; } set { } } + } +} namespace Azure.ResourceManager.Automation.Models { public partial class AgentRegistration diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs new file mode 100644 index 0000000000000..a8aab0bd9e325 --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Automation +{ + /// + /// A class representing the AutomationWebhook data model. + /// Definition of the webhook type. + /// + public partial class AutomationWebhookData + { + /// Gets or sets the webhook uri. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This property has been replaced by UriString", false)] + public Uri Uri { get; set; } + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs index d987b5c3b9708..7b342fecfe0a4 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs @@ -31,7 +31,7 @@ public AutomationWebhookData() /// The resourceType. /// The systemData. /// Gets or sets the value of the enabled flag of the webhook. - /// Gets or sets the webhook uri. + /// Gets or sets the webhook uri. /// Gets or sets the expiry time. /// Gets or sets the last invoked time. /// Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. @@ -41,10 +41,10 @@ public AutomationWebhookData() /// Gets or sets the last modified time. /// Details of the user who last modified the Webhook. /// Gets or sets the description. - internal AutomationWebhookData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isEnabled, Uri uri, DateTimeOffset? expireOn, DateTimeOffset? lastInvokedOn, IDictionary parameters, RunbookAssociationProperty runbook, string runOn, DateTimeOffset? createdOn, DateTimeOffset? lastModifiedOn, string lastModifiedBy, string description) : base(id, name, resourceType, systemData) + internal AutomationWebhookData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isEnabled, string uriString, DateTimeOffset? expireOn, DateTimeOffset? lastInvokedOn, IDictionary parameters, RunbookAssociationProperty runbook, string runOn, DateTimeOffset? createdOn, DateTimeOffset? lastModifiedOn, string lastModifiedBy, string description) : base(id, name, resourceType, systemData) { IsEnabled = isEnabled; - Uri = uri; + UriString = uriString; ExpireOn = expireOn; LastInvokedOn = lastInvokedOn; Parameters = parameters; @@ -59,7 +59,7 @@ internal AutomationWebhookData(ResourceIdentifier id, string name, ResourceType /// Gets or sets the value of the enabled flag of the webhook. public bool? IsEnabled { get; set; } /// Gets or sets the webhook uri. - public Uri Uri { get; set; } + public string UriString { get; set; } /// Gets or sets the expiry time. public DateTimeOffset? ExpireOn { get; set; } /// Gets or sets the last invoked time. diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs index 5689eeaa43816..34c65907985ad 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs @@ -26,10 +26,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("isEnabled"u8); writer.WriteBooleanValue(IsEnabled.Value); } - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(UriString)) { writer.WritePropertyName("uri"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WriteStringValue(UriString); } if (Optional.IsDefined(ExpireOn)) { @@ -104,7 +104,7 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme ResourceType type = default; Optional systemData = default; Optional isEnabled = default; - Optional uri = default; + Optional uri = default; Optional expiryTime = default; Optional lastInvokedTime = default; Optional> parameters = default; @@ -160,11 +160,7 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme } if (property0.NameEquals("uri"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - uri = new Uri(property0.Value.GetString()); + uri = property0.Value.GetString(); continue; } if (property0.NameEquals("expiryTime"u8)) diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md index 21f2b98bdb5e3..0f9379a64b7e9 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md +++ b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md @@ -98,6 +98,7 @@ rename-mapping: SUCScheduleProperties.nextRun: NextRunOn SUCScheduleProperties.nextRunOffsetMinutes: NextRunInMinutes Webhook.properties.expiryTime: ExpireOn + Webhook.properties.uri: uriString WebhookCreateOrUpdateParameters.properties.expiryTime: ExpireOn ScheduleCreateOrUpdateParameters.properties.expiryTime: ExpireOn Activity.id: -|arm-id @@ -130,7 +131,6 @@ rename-mapping: WindowsUpdateClasses: WindowsUpdateClassification WindowsProperties.excludedKbNumbers: ExcludedKBNumbers WindowsProperties.includedKbNumbers: IncludedKBNumbers - WebhookProperties.uri: uriString prepend-rp-prefix: - Certificate diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json new file mode 100644 index 0000000000000..58341fcd51bff --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json @@ -0,0 +1,530 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2021-01-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-3a79057c545398512ff7b6e3aaf55841-164c991fc5d049fa-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c5b36908ede2e8dbb49efb015833ea4e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "748", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:05 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "6afdf580-0801-4bc7-9e48-76dae63affc5", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "6afdf580-0801-4bc7-9e48-76dae63affc5", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072205Z:6afdf580-0801-4bc7-9e48-76dae63affc5" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "TagKey-9823": "TagValue-1254", + "TagKey-3481": "TagValue-320", + "TagKey-4926": "TagValue-1187", + "TagKey-751": "TagValue-3921", + "TagKey-1866": "TagValue-8559", + "TagKey-3094": "TagValue-9190", + "TagKey-2449": "TagValue-9", + "TagKey-8379": "TagValue-164", + "TagKey-7470": "TagValue-2205", + "TagKey-4236": "TagValue-3698", + "TagKey-5316": "TagValue-2725" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": ".NET Mgmt SDK Test with TTL = 1 Day", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-2937?api-version=**", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "43", + "Content-Type": "application/json", + "traceparent": "00-b1e7fb53256f864fed2eab35d0f03e7a-02ddc6d79a795de9-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "61cb114400e4b35a001b9698f3167cd7", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "tags": { + "test": "env" + }, + "location": "eastus" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "241", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "34513808-bc44-4942-8044-df94e05e08ad", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "34513808-bc44-4942-8044-df94e05e08ad", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072208Z:34513808-bc44-4942-8044-df94e05e08ad" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937", + "name": "testRG-2937", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "test": "env" + }, + "properties": { + "provisioningState": "Succeeded" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670?api-version=2021-06-22", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "traceparent": "00-0fe3879d0dc427a2a1487b3050f0b68d-4a19a21c2922c9db-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ed803faa1026d5692fb5e8a414123c57", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "location": "eastus", + "properties": { + "sku": { + "name": "Basic" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1135", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:11 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670?api-version=2021-06-22", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "e716571d-e205-4486-9703-5fa744902b06", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "0aaa0286-9ef4-41c6-a9ad-1abfa9d60ac7", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072212Z:e716571d-e205-4486-9703-5fa744902b06" + }, + "ResponseBody": { + "name": "automation8670", + "systemData": { + "createdAt": "2023-05-23T07:22:10.4333333\u002B00:00", + "lastModifiedAt": "2023-05-23T07:22:10.4333333\u002B00:00" + }, + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670", + "type": "Microsoft.Automation/AutomationAccounts", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "disableLocalAuth": false, + "sku": { + "name": "Basic", + "family": null, + "capacity": null + }, + "state": "Ok", + "RegistrationUrl": "https://cb7e53a1-a499-4a69-96fd-8db1695eafec.agentsvc.eus.azure-automation.net/accounts/cb7e53a1-a499-4a69-96fd-8db1695eafec", + "encryption": { + "keySource": "Microsoft.Automation", + "identity": { + "userAssignedIdentity": null + } + }, + "automationHybridServiceUrl": "https://cb7e53a1-a499-4a69-96fd-8db1695eafec.jrds.eus.azure-automation.net/automationAccounts/cb7e53a1-a499-4a69-96fd-8db1695eafec", + "RuntimeConfiguration": { + "powershell": { + "builtinModules": { + "Az": "8.0.0" + } + }, + "powershell7": { + "builtinModules": { + "Az": "8.0.0" + } + } + }, + "creationTime": "2023-05-23T07:22:10.4333333\u002B00:00", + "lastModifiedBy": null, + "lastModifiedTime": "2023-05-23T07:22:10.4333333\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/runbooks/runbook6086?api-version=2018-06-30", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "traceparent": "00-51f98bae03e52962b46528bd4da8ee4b-edb9fe3b742cc8e0-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "05d8e3db68231158e1d2444fc0877e2a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "location": "eastus", + "properties": { + "runbookType": "Script" + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "680", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:13 GMT", + "ETag": "\u0022638204233335866667\u0022", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/runbooks/runbook6086?api-version=2018-06-30", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "785b0fd2-6794-4a02-9900-7d68f9da477d", + "x-ms-ratelimit-remaining-subscription-writes": "1197", + "x-ms-request-id": "979d518c-3da9-4ad3-9bb1-95d6b19c3459", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072213Z:785b0fd2-6794-4a02-9900-7d68f9da477d" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/runbooks/runbook6086", + "name": "runbook6086", + "type": "Microsoft.Automation/AutomationAccounts/Runbooks", + "location": "eastus", + "tags": {}, + "etag": "\u0022638204233335866667\u0022", + "properties": { + "description": null, + "logVerbose": false, + "logProgress": false, + "logActivityTrace": 0, + "runbookType": "Script", + "parameters": {}, + "state": "New", + "jobCount": 0, + "provisioningState": "Succeeded", + "serviceManagementTags": null, + "outputTypes": [], + "creationTime": "2023-05-23T07:22:13.5866667\u002B00:00", + "lastModifiedBy": null, + "lastModifiedTime": "2023-05-23T07:22:13.5866667\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/runbooks/runbook6086/publish?api-version=2018-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "traceparent": "00-628cd20f6f5ee338128bdf6442371352-ea469e01cd45711c-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0f40fc2f568fbbeaf70ed1a4ca5c0683", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Tue, 23 May 2023 07:22:14 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/runbooks/runbook6086/operationResults/36ff685b-9567-47d6-b022-0d5f5581f011?api-version=2018-06-30", + "ocp-automation-operationresultid": [ + "36ff685b-9567-47d6-b022-0d5f5581f011", + "36ff685b-9567-47d6-b022-0d5f5581f011" + ], + "Pragma": "no-cache", + "Retry-After": "5", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "00ba2ddf-56bc-4a7f-b17e-936186aace08", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "ecf5bbdc-b21e-4e89-861e-bd30fc3ebc2e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072214Z:00ba2ddf-56bc-4a7f-b17e-936186aace08" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/runbooks/runbook6086/operationResults/36ff685b-9567-47d6-b022-0d5f5581f011?api-version=2018-06-30", + "RequestMethod": "GET", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-628cd20f6f5ee338128bdf6442371352-87f5bf6f5b252321-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "1775be372dd284c7f81d0d1496b44785", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Type": "text/plain; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:14 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "4333792c-fd7d-47e4-81df-6b2bba0f2ef7", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "3012320f-c5c6-43ed-aa9d-be0c6e3abfb3", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072215Z:4333792c-fd7d-47e4-81df-6b2bba0f2ef7" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995?api-version=2015-10-31", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "114", + "Content-Type": "application/json", + "traceparent": "00-914b8fef2fa4bf2b8fca43db4297b08f-18d7fc63d6adc84f-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4c24f3c12ae4e90bfe28204a96efdef9", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "name": "webhook8995", + "properties": { + "expiryTime": "2023-05-24T07:22:14.3804027Z", + "runbook": { + "name": "runbook6086" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "697", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:16 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995?api-version=2015-10-31", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "f9734073-ecf9-4e3e-83da-1ae003de701c", + "x-ms-ratelimit-remaining-subscription-writes": "1196", + "x-ms-request-id": "1f5afb2c-86d7-445d-bdf3-6387546d678a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072216Z:f9734073-ecf9-4e3e-83da-1ae003de701c" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995", + "name": "webhook8995", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:14.3804027\u002B00:00", + "runbook": { + "name": "runbook6086" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "https://cb7e53a1-a499-4a69-96fd-8db1695eafec.webhook.eus.azure-automation.net/webhooks?token=m936BQsyhp5LHoejFE%2fy5IlM4UyyhZBYKrqeCEUmeKI%3d", + "creationTime": "2023-05-23T07:22:16.7298529\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:16.7298529\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995?api-version=2015-10-31", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-dfd06da88292a900a7b6504c218b63a9-26d0d845929d34dd-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "e60c6c2ab1eed42eb6a0e216feab3227", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "556", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "3795bdc5-8145-4ca3-b4dc-e33f724b41a7", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "323443ec-91a0-4244-99c5-ed6ec75c7dca", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072217Z:3795bdc5-8145-4ca3-b4dc-e33f724b41a7" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995", + "name": "webhook8995", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:14.3804027\u002B00:00", + "runbook": { + "name": "runbook6086" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "", + "creationTime": "2023-05-23T07:22:16.7298529\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:16.7298529\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995?api-version=2015-10-31", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-c32a4f88ce53ea10928476e9f0302d84-867ede93e55360fc-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "250a88865bf19353692dd304a73a612d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "556", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:17 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "a87f0b41-c4b2-45c4-a088-0cd9f1c1925e", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "b295ccda-2725-4393-a58c-fc33eebcfa18", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072218Z:a87f0b41-c4b2-45c4-a088-0cd9f1c1925e" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995", + "name": "webhook8995", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:14.3804027\u002B00:00", + "runbook": { + "name": "runbook6086" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "", + "creationTime": "2023-05-23T07:22:16.7298529\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:16.7298529\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks?api-version=2015-10-31", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ef5bd72fd13e5f30f4c4031515410daa-cee78313e758e1d2-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "476c1b2f9e3b10ddc54f954347f5eb53", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "512", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:18 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "f6cd485d-156a-46d2-9a5f-1baa7965b945", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "b8560381-1bb7-4734-b45d-cff1e91b8c62", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072218Z:f6cd485d-156a-46d2-9a5f-1baa7965b945" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2937/providers/Microsoft.Automation/automationAccounts/automation8670/webhooks/webhook8995", + "name": "webhook8995", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:14.3804027\u002B00:00", + "runbook": { + "name": "runbook6086" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": null, + "creationTime": "2023-05-23T07:22:16.7298529\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:16.7298529\u002B00:00" + } + } + ] + } + } + ], + "Variables": { + "AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com", + "DateTimeOffsetNow": "2023-05-23T15:22:14.3804027\u002B08:00", + "LOCATION": "eastus", + "RandomSeed": "815299064", + "RESOURCE_MANAGER_URL": null, + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json new file mode 100644 index 0000000000000..53050df52d4c3 --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json @@ -0,0 +1,529 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2021-01-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-5126ef6f9e7f77addb6a396ef9e0b4e3-8a9674600aa71d4a-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c87e68f5536294cf972efd797376c39f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "748", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:24 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "c5cb0c92-15f0-423a-a48a-850f3f6ae21f", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "c5cb0c92-15f0-423a-a48a-850f3f6ae21f", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072224Z:c5cb0c92-15f0-423a-a48a-850f3f6ae21f" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "TagKey-9823": "TagValue-1254", + "TagKey-3481": "TagValue-320", + "TagKey-4926": "TagValue-1187", + "TagKey-751": "TagValue-3921", + "TagKey-1866": "TagValue-8559", + "TagKey-3094": "TagValue-9190", + "TagKey-2449": "TagValue-9", + "TagKey-8379": "TagValue-164", + "TagKey-7470": "TagValue-2205", + "TagKey-4236": "TagValue-3698", + "TagKey-5316": "TagValue-2725" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": ".NET Mgmt SDK Test with TTL = 1 Day", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-7196?api-version=**", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "43", + "Content-Type": "application/json", + "traceparent": "00-f59db41a7401eec3404231cb7c681c1c-065d7bcc80041ace-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "56084019cd9d3dc41b5af0d2a1f06179", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "tags": { + "test": "env" + }, + "location": "eastus" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "241", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:25 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "dcd4f9a7-f65f-4bad-bdf9-14f2f69c041b", + "x-ms-ratelimit-remaining-subscription-writes": "1195", + "x-ms-request-id": "dcd4f9a7-f65f-4bad-bdf9-14f2f69c041b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072226Z:dcd4f9a7-f65f-4bad-bdf9-14f2f69c041b" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196", + "name": "testRG-7196", + "type": "Microsoft.Resources/resourceGroups", + "location": "eastus", + "tags": { + "test": "env" + }, + "properties": { + "provisioningState": "Succeeded" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547?api-version=2021-06-22", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "traceparent": "00-bdb71c9db15f687c96c445d73494e7f1-abb52dbe09942147-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5d00290061a3c6762626f14daa41f7ce", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "location": "eastus", + "properties": { + "sku": { + "name": "Basic" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "1115", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:27 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547?api-version=2021-06-22", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "b0ad9b75-c1f2-4ed5-a7cf-43653d0e0c7b", + "x-ms-ratelimit-remaining-subscription-writes": "1194", + "x-ms-request-id": "db05f628-8f24-4f67-a562-5a2b0e76aa24", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072228Z:b0ad9b75-c1f2-4ed5-a7cf-43653d0e0c7b" + }, + "ResponseBody": { + "name": "automation6547", + "systemData": { + "createdAt": "2023-05-23T07:22:27.46\u002B00:00", + "lastModifiedAt": "2023-05-23T07:22:27.46\u002B00:00" + }, + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547", + "type": "Microsoft.Automation/AutomationAccounts", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "disableLocalAuth": false, + "sku": { + "name": "Basic", + "family": null, + "capacity": null + }, + "state": "Ok", + "RegistrationUrl": "https://a91fb7a6-0cc2-467b-87cf-4427c5262549.agentsvc.eus.azure-automation.net/accounts/a91fb7a6-0cc2-467b-87cf-4427c5262549", + "encryption": { + "keySource": "Microsoft.Automation", + "identity": { + "userAssignedIdentity": null + } + }, + "automationHybridServiceUrl": "https://a91fb7a6-0cc2-467b-87cf-4427c5262549.jrds.eus.azure-automation.net/automationAccounts/a91fb7a6-0cc2-467b-87cf-4427c5262549", + "RuntimeConfiguration": { + "powershell": { + "builtinModules": { + "Az": "8.0.0" + } + }, + "powershell7": { + "builtinModules": { + "Az": "8.0.0" + } + } + }, + "creationTime": "2023-05-23T07:22:27.46\u002B00:00", + "lastModifiedBy": null, + "lastModifiedTime": "2023-05-23T07:22:27.46\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/runbooks/runbook4471?api-version=2018-06-30", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "59", + "Content-Type": "application/json", + "traceparent": "00-8b6774f8965a0209c4b68b3a521f9f9c-550ee2d97ea25d3b-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0c8be3d29b588aba47f8dec1f63d9b00", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "location": "eastus", + "properties": { + "runbookType": "Script" + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "680", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:29 GMT", + "ETag": "\u0022638204233497466667\u0022", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/runbooks/runbook4471?api-version=2018-06-30", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "b986457b-48f4-4a31-8d3a-3377819b38c2", + "x-ms-ratelimit-remaining-subscription-writes": "1193", + "x-ms-request-id": "ce132b02-f2b1-4494-973c-e634b0cf9017", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072230Z:b986457b-48f4-4a31-8d3a-3377819b38c2" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/runbooks/runbook4471", + "name": "runbook4471", + "type": "Microsoft.Automation/AutomationAccounts/Runbooks", + "location": "eastus", + "tags": {}, + "etag": "\u0022638204233497466667\u0022", + "properties": { + "description": null, + "logVerbose": false, + "logProgress": false, + "logActivityTrace": 0, + "runbookType": "Script", + "parameters": {}, + "state": "New", + "jobCount": 0, + "provisioningState": "Succeeded", + "serviceManagementTags": null, + "outputTypes": [], + "creationTime": "2023-05-23T07:22:29.7466667\u002B00:00", + "lastModifiedBy": null, + "lastModifiedTime": "2023-05-23T07:22:29.7466667\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/runbooks/runbook4471/publish?api-version=2018-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "0", + "traceparent": "00-197daa94636678f007ff3da9e3462f84-ae1cb4442f540d9b-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "76c23cd6bccaa69ce0d7a79d4cceb0af", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Tue, 23 May 2023 07:22:30 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/runbooks/runbook4471/operationResults/28608c02-2c34-475a-8dcb-66e90a193ace?api-version=2018-06-30", + "ocp-automation-operationresultid": [ + "28608c02-2c34-475a-8dcb-66e90a193ace", + "28608c02-2c34-475a-8dcb-66e90a193ace" + ], + "Pragma": "no-cache", + "Retry-After": "5", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "460279e9-e94c-4f2d-b21b-db49563d0a50", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "90ea3777-83bd-4d75-8324-b6d99a2c070a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072230Z:460279e9-e94c-4f2d-b21b-db49563d0a50" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/runbooks/runbook4471/operationResults/28608c02-2c34-475a-8dcb-66e90a193ace?api-version=2018-06-30", + "RequestMethod": "GET", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-197daa94636678f007ff3da9e3462f84-b744a0b7f5c736be-00", + "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "6e76f18a807e160347e42c80f31d3e79", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Content-Type": "text/plain; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:30 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "b98e0a52-38c4-4231-b9d2-218478864ab0", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-request-id": "d05eee51-b13f-4ce1-98d6-911456aa6c95", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072231Z:b98e0a52-38c4-4231-b9d2-218478864ab0" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623?api-version=2015-10-31", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "114", + "Content-Type": "application/json", + "traceparent": "00-1190027b8fb7e0a6e482c133cd737ead-b58ce1461db8554f-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "1f23e52e121e59475c0754a5f1232a07", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "name": "webhook7623", + "properties": { + "expiryTime": "2023-05-24T07:22:30.6484235Z", + "runbook": { + "name": "runbook4471" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "697", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:31 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623?api-version=2015-10-31", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "8ad3e0ac-1e68-4907-ab34-e0de72eb658b", + "x-ms-ratelimit-remaining-subscription-writes": "1192", + "x-ms-request-id": "70af69aa-1cd1-4de4-9c0e-cf3ab39e7135", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072232Z:8ad3e0ac-1e68-4907-ab34-e0de72eb658b" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623", + "name": "webhook7623", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:30.6484235\u002B00:00", + "runbook": { + "name": "runbook4471" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "https://a91fb7a6-0cc2-467b-87cf-4427c5262549.webhook.eus.azure-automation.net/webhooks?token=ynob%2fTC9ypN6RmyP1d2pwX0utjL27GKB3F3jVYpLCYg%3d", + "creationTime": "2023-05-23T07:22:32.3147891\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:32.3147891\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623?api-version=2015-10-31", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-b81476a366fe4acde8986dc478ce6aa7-7f6714f6ecd85efa-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "575b12be3041ce5a0736096261715138", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "556", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:32 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "dac1a455-d8a2-40c7-adf4-28a665db0550", + "x-ms-ratelimit-remaining-subscription-reads": "11992", + "x-ms-request-id": "631a3fd2-811b-460c-805f-523e7d84ea15", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072233Z:dac1a455-d8a2-40c7-adf4-28a665db0550" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623", + "name": "webhook7623", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:30.6484235\u002B00:00", + "runbook": { + "name": "runbook4471" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "", + "creationTime": "2023-05-23T07:22:32.3147891\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:32.3147891\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623?api-version=2015-10-31", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-a6883387477e9c036dcfcdc1ce0b4136-0a284b0fc72eb7e6-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "cf53629dc9acde6c2f142179ae7055c1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "556", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:32 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "d79e7ab2-5bbd-4930-869c-d62023c7055c", + "x-ms-ratelimit-remaining-subscription-reads": "11991", + "x-ms-request-id": "a1198177-8cf7-4e6f-ac43-702a96e80c5d", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072233Z:d79e7ab2-5bbd-4930-869c-d62023c7055c" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623", + "name": "webhook7623", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:30.6484235\u002B00:00", + "runbook": { + "name": "runbook4471" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": "", + "creationTime": "2023-05-23T07:22:32.3147891\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:32.3147891\u002B00:00" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks?api-version=2015-10-31", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0a35780221e2fe068a5417e809e4f7eb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "512", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 23 May 2023 07:22:33 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "7f28b5a3-0122-4b2e-ae07-b0f9e192cf93", + "x-ms-ratelimit-remaining-subscription-reads": "11990", + "x-ms-request-id": "435a4bed-8924-446d-84db-8800ef53e03f", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T072234Z:7f28b5a3-0122-4b2e-ae07-b0f9e192cf93" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-7196/providers/Microsoft.Automation/automationAccounts/automation6547/webhooks/webhook7623", + "name": "webhook7623", + "properties": { + "isEnabled": false, + "expiryTime": "2023-05-24T07:22:30.6484235\u002B00:00", + "runbook": { + "name": "runbook4471" + }, + "lastInvokedTime": null, + "runOn": null, + "parameters": null, + "uri": null, + "creationTime": "2023-05-23T07:22:32.3147891\u002B00:00", + "lastModifiedBy": "", + "lastModifiedTime": "2023-05-23T07:22:32.3147891\u002B00:00" + } + } + ] + } + } + ], + "Variables": { + "AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com", + "DateTimeOffsetNow": "2023-05-23T15:22:30.6484235\u002B08:00", + "LOCATION": "eastus", + "RandomSeed": "1622660388", + "RESOURCE_MANAGER_URL": null, + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs index c334a835f87a4..b96fdd6bbf403 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs @@ -47,7 +47,7 @@ private async Task CreateWebhook(string webhookName) } [RecordedTest] - public async Task CreateOrUpdateExistGetGetAllDelete() + public async Task CreateOrUpdateExistGetGetAll() { // CreateOrUpdate string webhookName = Recording.GenerateAssetName("webhook"); @@ -65,11 +65,6 @@ public async Task CreateOrUpdateExistGetGetAllDelete() var list = await _webhookCollection.GetAllAsync().ToEnumerableAsync(); Assert.IsNotEmpty(list); ValidateWebhook(list.FirstOrDefault().Data, webhookName); - - // Delete - await webhook.DeleteAsync(WaitUntil.Completed); - flag = await _webhookCollection.ExistsAsync(webhookName); - Assert.IsFalse(flag); } private void ValidateWebhook(AutomationWebhookData webhook, string webhookName) From c2f921e80b19424d3a44d16db4ba1ef7f330f9ac Mon Sep 17 00:00:00 2001 From: Chengming Date: Tue, 23 May 2023 15:33:43 +0800 Subject: [PATCH 3/7] update --- .../tests/AutomationManagementTestBase.cs | 2 - .../CreateOrUpdateExistGetGetAllDelete.json | 383 ------------------ .../tests/TestCase/WebhookTests.cs | 6 +- 3 files changed, 5 insertions(+), 386 deletions(-) delete mode 100644 sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs index bdaff098d4a9b..503088ed5be38 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs @@ -3,11 +3,9 @@ using Azure.Core; using Azure.Core.TestFramework; -using Azure.ResourceManager.Automation.Models; using Azure.ResourceManager.Resources; using Azure.ResourceManager.TestFramework; using NUnit.Framework; -using System.Collections.ObjectModel; using System.Threading.Tasks; namespace Azure.ResourceManager.Automation.Tests diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json deleted file mode 100644 index bf004c7d0cccb..0000000000000 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllDelete.json +++ /dev/null @@ -1,383 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2021-01-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "traceparent": "00-66a7e896dc4984ad576cd2737bf122c5-31f5939488771fc6-00", - "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "9bb793b43fde3c877837722b8b41f3eb", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "748", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 06:26:32 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "dd69f45b-ac78-42f8-b727-9992323a748a", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "dd69f45b-ac78-42f8-b727-9992323a748a", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062632Z:dd69f45b-ac78-42f8-b727-9992323a748a" - }, - "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "authorizationSource": "RoleBased", - "managedByTenants": [], - "tags": { - "TagKey-9823": "TagValue-1254", - "TagKey-3481": "TagValue-320", - "TagKey-4926": "TagValue-1187", - "TagKey-751": "TagValue-3921", - "TagKey-1866": "TagValue-8559", - "TagKey-3094": "TagValue-9190", - "TagKey-2449": "TagValue-9", - "TagKey-8379": "TagValue-164", - "TagKey-7470": "TagValue-2205", - "TagKey-4236": "TagValue-3698", - "TagKey-5316": "TagValue-2725" - }, - "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "displayName": ".NET Mgmt SDK Test with TTL = 1 Day", - "state": "Enabled", - "subscriptionPolicies": { - "locationPlacementId": "Internal_2014-09-01", - "quotaId": "Internal_2014-09-01", - "spendingLimit": "Off" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-2826?api-version=**", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "43", - "Content-Type": "application/json", - "traceparent": "00-aad79e57d72d66e5eb5405c4a586bed1-8a4ab4267004f05a-00", - "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "abfc22b56c01e843ab5e8c10e7ac68bd", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "tags": { - "test": "env" - }, - "location": "eastus" - }, - "StatusCode": 201, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "241", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 06:26:32 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "44d11389-96ee-4edc-b6b7-f89fe4716899", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "44d11389-96ee-4edc-b6b7-f89fe4716899", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062633Z:44d11389-96ee-4edc-b6b7-f89fe4716899" - }, - "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826", - "name": "testRG-2826", - "type": "Microsoft.Resources/resourceGroups", - "location": "eastus", - "tags": { - "test": "env" - }, - "properties": { - "provisioningState": "Succeeded" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770?api-version=2021-06-22", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "59", - "Content-Type": "application/json", - "traceparent": "00-df7ebb5f9eb57cbd3a9c4039cf63566f-e93b1bafdfc7c682-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b4a8320b66a164ce51eacd35449baa55", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "location": "eastus", - "properties": { - "sku": { - "name": "Basic" - } - } - }, - "StatusCode": 201, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "1135", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 06:26:35 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770?api-version=2021-06-22", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "394db09b-0903-4826-b894-c9a4cdb8c3d4", - "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "ee4fcf1e-e792-4c17-97a0-be21b70bc825", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062635Z:394db09b-0903-4826-b894-c9a4cdb8c3d4" - }, - "ResponseBody": { - "name": "automation2770", - "systemData": { - "createdAt": "2023-05-23T06:26:34.5533333\u002B00:00", - "lastModifiedAt": "2023-05-23T06:26:34.5533333\u002B00:00" - }, - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770", - "type": "Microsoft.Automation/AutomationAccounts", - "location": "eastus", - "tags": {}, - "etag": null, - "properties": { - "disableLocalAuth": false, - "sku": { - "name": "Basic", - "family": null, - "capacity": null - }, - "state": "Ok", - "RegistrationUrl": "https://3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5.agentsvc.eus.azure-automation.net/accounts/3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5", - "encryption": { - "keySource": "Microsoft.Automation", - "identity": { - "userAssignedIdentity": null - } - }, - "automationHybridServiceUrl": "https://3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5.jrds.eus.azure-automation.net/automationAccounts/3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5", - "RuntimeConfiguration": { - "powershell": { - "builtinModules": { - "Az": "8.0.0" - } - }, - "powershell7": { - "builtinModules": { - "Az": "8.0.0" - } - } - }, - "creationTime": "2023-05-23T06:26:34.5533333\u002B00:00", - "lastModifiedBy": null, - "lastModifiedTime": "2023-05-23T06:26:34.5533333\u002B00:00" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771?api-version=2018-06-30", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "59", - "Content-Type": "application/json", - "traceparent": "00-7b03806c537f0bdc6bbd448da6d43264-64d1c0bd919edbc9-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "03d4ff4526b3b37432e1fa2c918b096e", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "location": "eastus", - "properties": { - "runbookType": "Script" - } - }, - "StatusCode": 201, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "680", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 06:26:37 GMT", - "ETag": "\u0022638204199978433333\u0022", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771?api-version=2018-06-30", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "cc2f9bb7-d241-4852-8303-b7c06ede671f", - "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "d32e5e4f-98ce-4431-944b-99edd72456b0", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062638Z:cc2f9bb7-d241-4852-8303-b7c06ede671f" - }, - "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771", - "name": "runbook6771", - "type": "Microsoft.Automation/AutomationAccounts/Runbooks", - "location": "eastus", - "tags": {}, - "etag": "\u0022638204199978433333\u0022", - "properties": { - "description": null, - "logVerbose": false, - "logProgress": false, - "logActivityTrace": 0, - "runbookType": "Script", - "parameters": {}, - "state": "New", - "jobCount": 0, - "provisioningState": "Succeeded", - "serviceManagementTags": null, - "outputTypes": [], - "creationTime": "2023-05-23T06:26:37.8433333\u002B00:00", - "lastModifiedBy": null, - "lastModifiedTime": "2023-05-23T06:26:37.8433333\u002B00:00" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771/publish?api-version=2018-06-30", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "0", - "traceparent": "00-0f311e37a11914614df68b16845c8f82-867cdf5ab82249c5-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "b9e7bbbc00279580dc9c1b581a7619f1", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Date": "Tue, 23 May 2023 06:26:38 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771/operationResults/a65436ef-2e4f-4970-b7c0-eedb38c8809e?api-version=2018-06-30", - "ocp-automation-operationresultid": [ - "a65436ef-2e4f-4970-b7c0-eedb38c8809e", - "a65436ef-2e4f-4970-b7c0-eedb38c8809e" - ], - "Pragma": "no-cache", - "Retry-After": "5", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ef54d3ff-26a2-43d8-a5a5-5e3836c449d9", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "b59b4863-9f3f-4a5c-9893-6fdb7207b629", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062639Z:ef54d3ff-26a2-43d8-a5a5-5e3836c449d9" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/runbooks/runbook6771/operationResults/a65436ef-2e4f-4970-b7c0-eedb38c8809e?api-version=2018-06-30", - "RequestMethod": "GET", - "RequestHeaders": { - "Authorization": "Sanitized", - "traceparent": "00-0f311e37a11914614df68b16845c8f82-ae10b1a413bf8e63-00", - "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "89795fe0f0b3442e7f3f26160b1b99bc", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 23 May 2023 06:26:39 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "04574d26-0dc5-4248-9c3e-ec4f3f31dc15", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "e0c04fcb-d536-45a5-8ca0-3a19086e96ab", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062639Z:04574d26-0dc5-4248-9c3e-ec4f3f31dc15" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/webhooks/webhook5674?api-version=2015-10-31", - "RequestMethod": "PUT", - "RequestHeaders": { - "Accept": "application/json", - "Authorization": "Sanitized", - "Content-Length": "114", - "Content-Type": "application/json", - "traceparent": "00-501b1b9e4697cf87a2544892704b5868-3b2e698febf4d187-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "24ffc50985a1e8f002fb327ebf293ac8", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "name": "webhook5674", - "properties": { - "expiryTime": "2023-05-24T06:26:38.8216413Z", - "runbook": { - "name": "runbook6771" - } - } - }, - "StatusCode": 201, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "695", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 06:26:42 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/webhooks/webhook5674?api-version=2015-10-31", - "Pragma": "no-cache", - "Server": "Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "48577d25-e2a6-48b3-b482-fab79a4b57ef", - "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "9310073c-9c77-4a86-bfe5-1ebcc102df3a", - "x-ms-routing-request-id": "KOREASOUTH:20230523T062642Z:48577d25-e2a6-48b3-b482-fab79a4b57ef" - }, - "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2826/providers/Microsoft.Automation/automationAccounts/automation2770/webhooks/webhook5674", - "name": "webhook5674", - "type": "Microsoft.Automation/AutomationAccounts/Webhooks", - "properties": { - "isEnabled": false, - "expiryTime": "2023-05-24T06:26:38.8216413\u002B00:00", - "runbook": { - "name": "runbook6771" - }, - "lastInvokedTime": null, - "runOn": null, - "parameters": null, - "uri": "https://3b9cb9ff-c705-45d9-9d4f-2eb79516e7f5.webhook.eus.azure-automation.net/webhooks?token=4dPzl4gPJRDbtzCU8AuzwszrFhScu3z8EjMa8dAfKAU%3d", - "creationTime": "2023-05-23T06:26:42.4354161\u002B00:00", - "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T06:26:42.4354161\u002B00:00" - } - } - } - ], - "Variables": { - "AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com", - "DateTimeOffsetNow": "2023-05-23T14:26:38.8216413\u002B08:00", - "LOCATION": "eastus", - "RandomSeed": "130527200", - "RESOURCE_MANAGER_URL": null, - "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" - } -} diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs index b96fdd6bbf403..f3859e8ad1a71 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs @@ -18,7 +18,7 @@ internal class WebhookTests : AutomationManagementTestBase private AutomationRunbookResource _runbook; private AutomationWebhookCollection _webhookCollection; - public WebhookTests(bool isAsync) : base(isAsync, RecordedTestMode.Record) + public WebhookTests(bool isAsync) : base(isAsync)//, RecordedTestMode.Record) { } @@ -70,6 +70,10 @@ public async Task CreateOrUpdateExistGetGetAll() private void ValidateWebhook(AutomationWebhookData webhook, string webhookName) { Assert.IsNotNull(webhook); + Assert.IsNotEmpty(webhook.Id); + Assert.AreEqual(webhookName, webhook.Name); + Assert.AreEqual(_runbook.Data.Name, webhook.RunbookName); + Assert.IsTrue(string.IsNullOrWhiteSpace(webhook.UriString)); } } } From 4adeba7671fd4c374bb22e4f78575f1802836d62 Mon Sep 17 00:00:00 2001 From: Chengming Date: Tue, 23 May 2023 16:04:52 +0800 Subject: [PATCH 4/7] Update Azure.ResourceManager.Automation.netstandard2.0.cs --- ...ure.ResourceManager.Automation.netstandard2.0.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs index 4beb56a03c529..a4aaeb4b315e6 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs @@ -854,6 +854,9 @@ public AutomationWebhookData() { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public string RunbookName { get { throw null; } set { } } public string RunOn { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This property has been replaced by UriString", false)] + public System.Uri Uri { get { throw null; } set { } } public string UriString { get { throw null; } set { } } } public partial class AutomationWebhookResource : Azure.ResourceManager.ArmResource @@ -1175,16 +1178,6 @@ protected SoftwareUpdateConfigurationResource() { } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Automation.SoftwareUpdateConfigurationData data, string clientRequestId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } -namespace Azure.ResourceManager.Automation.Customized -{ - public partial class AutomationWebhookData - { - public AutomationWebhookData() { } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This property has been replaced by UriString", false)] - public System.Uri Uri { get { throw null; } set { } } - } -} namespace Azure.ResourceManager.Automation.Models { public partial class AgentRegistration From 3355f2a18c7ac6b9b32502bb25723319454a5626 Mon Sep 17 00:00:00 2001 From: Chengming Date: Tue, 23 May 2023 16:23:20 +0800 Subject: [PATCH 5/7] update --- .../tests/AutomationManagementTestBase.cs | 2 + .../CreateOrUpdateExistGetGetAll.json | 246 ++++++++--------- .../CreateOrUpdateExistGetGetAllAsync.json | 248 +++++++++--------- 3 files changed, 249 insertions(+), 247 deletions(-) diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs index 503088ed5be38..5318e0e362062 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/AutomationManagementTestBase.cs @@ -19,11 +19,13 @@ public class AutomationManagementTestBase : ManagementRecordedTestBase Date: Wed, 24 May 2023 14:31:03 +0800 Subject: [PATCH 6/7] update --- .../CHANGELOG.md | 4 +- .../src/Customized/AutomationWebhookData.cs | 23 -- .../src/Generated/AutomationWebhookData.cs | 8 +- .../AutomationWebhookData.Serialization.cs | 20 +- .../src/autorest.md | 6 +- .../CreateOrUpdateExistGetGetAll.json | 254 ++++++++-------- .../CreateOrUpdateExistGetGetAllAsync.json | 284 +++++++++--------- .../tests/TestCase/WebhookTests.cs | 6 +- 8 files changed, 297 insertions(+), 308 deletions(-) delete mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs diff --git a/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md b/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md index 2abdcec2e8c10..db88ee829f563 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md +++ b/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md @@ -6,10 +6,10 @@ ### Breaking Changes -- Add property `UriString` to class `AutomationWebhookData`, replace the `Uri`. - ### Bugs Fixed +- Fixed an issue that `System.UriFormatException` is thrown when `Uri` type field is empty during serialization of `AutomationWebhookData`. + ### Other Changes ## 1.0.1 (2023-02-14) diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs deleted file mode 100644 index a8aab0bd9e325..0000000000000 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Customized/AutomationWebhookData.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Automation -{ - /// - /// A class representing the AutomationWebhook data model. - /// Definition of the webhook type. - /// - public partial class AutomationWebhookData - { - /// Gets or sets the webhook uri. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This property has been replaced by UriString", false)] - public Uri Uri { get; set; } - } -} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs index 7b342fecfe0a4..d987b5c3b9708 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationWebhookData.cs @@ -31,7 +31,7 @@ public AutomationWebhookData() /// The resourceType. /// The systemData. /// Gets or sets the value of the enabled flag of the webhook. - /// Gets or sets the webhook uri. + /// Gets or sets the webhook uri. /// Gets or sets the expiry time. /// Gets or sets the last invoked time. /// Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. @@ -41,10 +41,10 @@ public AutomationWebhookData() /// Gets or sets the last modified time. /// Details of the user who last modified the Webhook. /// Gets or sets the description. - internal AutomationWebhookData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isEnabled, string uriString, DateTimeOffset? expireOn, DateTimeOffset? lastInvokedOn, IDictionary parameters, RunbookAssociationProperty runbook, string runOn, DateTimeOffset? createdOn, DateTimeOffset? lastModifiedOn, string lastModifiedBy, string description) : base(id, name, resourceType, systemData) + internal AutomationWebhookData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isEnabled, Uri uri, DateTimeOffset? expireOn, DateTimeOffset? lastInvokedOn, IDictionary parameters, RunbookAssociationProperty runbook, string runOn, DateTimeOffset? createdOn, DateTimeOffset? lastModifiedOn, string lastModifiedBy, string description) : base(id, name, resourceType, systemData) { IsEnabled = isEnabled; - UriString = uriString; + Uri = uri; ExpireOn = expireOn; LastInvokedOn = lastInvokedOn; Parameters = parameters; @@ -59,7 +59,7 @@ internal AutomationWebhookData(ResourceIdentifier id, string name, ResourceType /// Gets or sets the value of the enabled flag of the webhook. public bool? IsEnabled { get; set; } /// Gets or sets the webhook uri. - public string UriString { get; set; } + public Uri Uri { get; set; } /// Gets or sets the expiry time. public DateTimeOffset? ExpireOn { get; set; } /// Gets or sets the last invoked time. diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs index 34c65907985ad..932928814c5cd 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationWebhookData.Serialization.cs @@ -26,10 +26,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("isEnabled"u8); writer.WriteBooleanValue(IsEnabled.Value); } - if (Optional.IsDefined(UriString)) + if (Optional.IsDefined(Uri)) { writer.WritePropertyName("uri"u8); - writer.WriteStringValue(UriString); + writer.WriteStringValue(Uri.AbsoluteUri); } if (Optional.IsDefined(ExpireOn)) { @@ -104,7 +104,7 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme ResourceType type = default; Optional systemData = default; Optional isEnabled = default; - Optional uri = default; + Optional uri = default; Optional expiryTime = default; Optional lastInvokedTime = default; Optional> parameters = default; @@ -160,12 +160,16 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme } if (property0.NameEquals("uri"u8)) { - uri = property0.Value.GetString(); + if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + { + continue; + } + uri = new Uri(property0.Value.GetString()); continue; } if (property0.NameEquals("expiryTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) { continue; } @@ -174,7 +178,7 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme } if (property0.NameEquals("lastInvokedTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) { lastInvokedTime = null; continue; @@ -212,7 +216,7 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme } if (property0.NameEquals("creationTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) { continue; } @@ -221,7 +225,7 @@ internal static AutomationWebhookData DeserializeAutomationWebhookData(JsonEleme } if (property0.NameEquals("lastModifiedTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) { continue; } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md index 0f9379a64b7e9..aa2d739bb10d5 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md +++ b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md @@ -98,7 +98,6 @@ rename-mapping: SUCScheduleProperties.nextRun: NextRunOn SUCScheduleProperties.nextRunOffsetMinutes: NextRunInMinutes Webhook.properties.expiryTime: ExpireOn - Webhook.properties.uri: uriString WebhookCreateOrUpdateParameters.properties.expiryTime: ExpireOn ScheduleCreateOrUpdateParameters.properties.expiryTime: ExpireOn Activity.id: -|arm-id @@ -221,6 +220,11 @@ rename-rules: no-property-type-replacement: - JobNavigation +models-to-treat-empty-string-as-null: + - AutomationWebhookData + # - Webhook.properties.uri + # : uriString + request-path-to-resource-name: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields: AutomationAccountResource request-path-to-parent: diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json index d5b138a869ee8..793e1f9a3be8d 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAll.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-12b20eaab31ca857bcf47537d126c663-92c51ef5757ad1a6-00", + "traceparent": "00-ff8d72c07e5f80a9c9118b82bdbc1560-f3e53456dd69352d-00", "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "0db3c535ef45b81d8ba97ab0f0c80b31", + "x-ms-client-request-id": "c1d2e53536985deb6be0f5a97d675b6b", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -17,15 +17,15 @@ "Cache-Control": "no-cache", "Content-Length": "748", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:10 GMT", + "Date": "Wed, 24 May 2023 06:07:57 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "89d38c7e-fa01-417c-8d62-f8b2e4fc4d86", + "x-ms-correlation-request-id": "70d68563-35d4-4310-ad99-215ffa6a6ad1", "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "89d38c7e-fa01-417c-8d62-f8b2e4fc4d86", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082210Z:89d38c7e-fa01-417c-8d62-f8b2e4fc4d86" + "x-ms-request-id": "70d68563-35d4-4310-ad99-215ffa6a6ad1", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060758Z:70d68563-35d4-4310-ad99-215ffa6a6ad1" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -56,16 +56,16 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-1141?api-version=**", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-9992?api-version=**", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "43", "Content-Type": "application/json", - "traceparent": "00-85f4c023f4513036662fc3e5f597258f-1c461d9c4136c1dd-00", + "traceparent": "00-63bb82faea88b8391093720f3e3365ee-76426f6a4053c408-00", "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "6bd10424020164725857c97ee8a5981a", + "x-ms-client-request-id": "b0bd1d50e6a6ac05ef3492629996890e", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -79,19 +79,19 @@ "Cache-Control": "no-cache", "Content-Length": "241", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:14 GMT", + "Date": "Wed, 24 May 2023 06:08:00 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "bf1174b5-12b2-4970-97de-31da96a915df", + "x-ms-correlation-request-id": "3d10cc1b-8b98-464c-8c9e-2880181dc5f6", "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "bf1174b5-12b2-4970-97de-31da96a915df", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082214Z:bf1174b5-12b2-4970-97de-31da96a915df" + "x-ms-request-id": "3d10cc1b-8b98-464c-8c9e-2880181dc5f6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060800Z:3d10cc1b-8b98-464c-8c9e-2880181dc5f6" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141", - "name": "testRG-1141", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992", + "name": "testRG-9992", "type": "Microsoft.Resources/resourceGroups", "location": "eastus", "tags": { @@ -103,16 +103,16 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501?api-version=2021-06-22", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501?api-version=2021-06-22", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "59", "Content-Type": "application/json", - "traceparent": "00-e4108858b7ed58eee254581956fb2934-b3aba3f0d27a67b4-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4fb349e82573b4bb4d02d4364a283208", + "traceparent": "00-ee1a810f3139013dfc7fe412315029e8-d9a2ef671a5d1a80-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "fc438da5ae6132e399e38b302f0ff26c", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -128,25 +128,25 @@ "Cache-Control": "no-cache", "Content-Length": "1135", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:17 GMT", + "Date": "Wed, 24 May 2023 06:08:03 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501?api-version=2021-06-22", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501?api-version=2021-06-22", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0ae5a157-a8c2-4ad7-af6f-75c9c9330ddb", + "x-ms-correlation-request-id": "50a66406-005d-4963-9242-b5203fad01bd", "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "d9737775-d8b1-4375-b37c-dc7baa985db6", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082217Z:0ae5a157-a8c2-4ad7-af6f-75c9c9330ddb" + "x-ms-request-id": "b3ddff7d-df1d-4ddc-83b6-2735265414e4", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060803Z:50a66406-005d-4963-9242-b5203fad01bd" }, "ResponseBody": { "name": "automation7501", "systemData": { - "createdAt": "2023-05-23T08:22:15.7633333\u002B00:00", - "lastModifiedAt": "2023-05-23T08:22:15.7633333\u002B00:00" + "createdAt": "2023-05-24T06:08:02.8266667\u002B00:00", + "lastModifiedAt": "2023-05-24T06:08:02.8266667\u002B00:00" }, - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501", "type": "Microsoft.Automation/AutomationAccounts", "location": "eastus", "tags": {}, @@ -159,14 +159,14 @@ "capacity": null }, "state": "Ok", - "RegistrationUrl": "https://d244ddba-c6d6-49fd-82cf-b416949b0210.agentsvc.eus.azure-automation.net/accounts/d244ddba-c6d6-49fd-82cf-b416949b0210", + "RegistrationUrl": "https://699d33ac-dc5c-411b-97e3-8533d0f7300c.agentsvc.eus.azure-automation.net/accounts/699d33ac-dc5c-411b-97e3-8533d0f7300c", "encryption": { "keySource": "Microsoft.Automation", "identity": { "userAssignedIdentity": null } }, - "automationHybridServiceUrl": "https://d244ddba-c6d6-49fd-82cf-b416949b0210.jrds.eus.azure-automation.net/automationAccounts/d244ddba-c6d6-49fd-82cf-b416949b0210", + "automationHybridServiceUrl": "https://699d33ac-dc5c-411b-97e3-8533d0f7300c.jrds.eus.azure-automation.net/automationAccounts/699d33ac-dc5c-411b-97e3-8533d0f7300c", "RuntimeConfiguration": { "powershell": { "builtinModules": { @@ -179,23 +179,23 @@ } } }, - "creationTime": "2023-05-23T08:22:15.7633333\u002B00:00", + "creationTime": "2023-05-24T06:08:02.8266667\u002B00:00", "lastModifiedBy": null, - "lastModifiedTime": "2023-05-23T08:22:15.7633333\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:02.8266667\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook6978?api-version=2018-06-30", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook2643?api-version=2018-06-30", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "59", "Content-Type": "application/json", - "traceparent": "00-7e9e004ffb872e612a1506023464dd2e-a9733fad03f0c640-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "fc54cc45c334a840ec985339a304e196", + "traceparent": "00-048a931d9a1faf91492cc5a6cf805b76-209cf4e4b138204c-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "fdc66fd6ff8e15cda80158fbd1496b9a", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -207,28 +207,28 @@ "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "670", + "Content-Length": "680", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:19 GMT", - "ETag": "\u0022638204269391200000\u0022", + "Date": "Wed, 24 May 2023 06:08:05 GMT", + "ETag": "\u0022638205052850466667\u0022", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook6978?api-version=2018-06-30", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook2643?api-version=2018-06-30", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "538124bc-dd9c-4de4-9757-c18f69ec0d0d", + "x-ms-correlation-request-id": "82d1b29e-e3df-48f4-8f7a-c965cadb31e1", "x-ms-ratelimit-remaining-subscription-writes": "1197", - "x-ms-request-id": "9f2f7382-39eb-4667-942b-2bac004ae27b", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082219Z:538124bc-dd9c-4de4-9757-c18f69ec0d0d" + "x-ms-request-id": "a0d6b599-9b47-4167-b649-f94e3c6a37d0", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060805Z:82d1b29e-e3df-48f4-8f7a-c965cadb31e1" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook6978", - "name": "runbook6978", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook2643", + "name": "runbook2643", "type": "Microsoft.Automation/AutomationAccounts/Runbooks", "location": "eastus", "tags": {}, - "etag": "\u0022638204269391200000\u0022", + "etag": "\u0022638205052850466667\u0022", "properties": { "description": null, "logVerbose": false, @@ -241,22 +241,22 @@ "provisioningState": "Succeeded", "serviceManagementTags": null, "outputTypes": [], - "creationTime": "2023-05-23T08:22:19.12\u002B00:00", + "creationTime": "2023-05-24T06:08:05.0466667\u002B00:00", "lastModifiedBy": null, - "lastModifiedTime": "2023-05-23T08:22:19.12\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:05.0466667\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook6978/publish?api-version=2018-06-30", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook2643/publish?api-version=2018-06-30", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "0", - "traceparent": "00-77c78cb0591e1f2226709398e516d8cf-4fdda99b80580887-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "e8224d07d454ab91af4db46f90220ca1", + "traceparent": "00-40041dc6b69ee3828cdc71acc2bd2fb6-046e277dc8aefa95-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ddb6dec654d60ebccd744c2121bf0582", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -264,33 +264,33 @@ "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Tue, 23 May 2023 08:22:20 GMT", + "Date": "Wed, 24 May 2023 06:08:06 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook6978/operationResults/389e4c8d-8cc2-43d9-a1eb-a100b7a6b0e5?api-version=2018-06-30", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook2643/operationResults/412dd07e-e762-4a08-aee9-9afab7fc559d?api-version=2018-06-30", "ocp-automation-operationresultid": [ - "389e4c8d-8cc2-43d9-a1eb-a100b7a6b0e5", - "389e4c8d-8cc2-43d9-a1eb-a100b7a6b0e5" + "412dd07e-e762-4a08-aee9-9afab7fc559d", + "412dd07e-e762-4a08-aee9-9afab7fc559d" ], "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "cc12b7a1-0314-43d6-825f-d845ebb21cf7", + "x-ms-correlation-request-id": "30fefcad-26d1-412a-8f5d-feac306222e6", "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "89937e83-b6a2-425a-ad0c-83dada8de0b4", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082220Z:cc12b7a1-0314-43d6-825f-d845ebb21cf7" + "x-ms-request-id": "fd8f4fbb-91fe-4072-b6c3-86f7dc303caf", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060806Z:30fefcad-26d1-412a-8f5d-feac306222e6" }, "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook6978/operationResults/389e4c8d-8cc2-43d9-a1eb-a100b7a6b0e5?api-version=2018-06-30", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/runbooks/runbook2643/operationResults/412dd07e-e762-4a08-aee9-9afab7fc559d?api-version=2018-06-30", "RequestMethod": "GET", "RequestHeaders": { "Authorization": "Sanitized", - "traceparent": "00-77c78cb0591e1f2226709398e516d8cf-8d816d8a73a36bf5-00", + "traceparent": "00-40041dc6b69ee3828cdc71acc2bd2fb6-eef1d745e3d10260-00", "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "fc2e3d20490571b43ba84ce60ed018c9", + "x-ms-client-request-id": "5169f17714598196b3b7301ab2abf3e9", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -299,38 +299,38 @@ "Cache-Control": "no-cache", "Content-Length": "0", "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:20 GMT", + "Date": "Wed, 24 May 2023 06:08:06 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2901ad86-f446-4967-8cf0-ca38ad27b005", + "x-ms-correlation-request-id": "4f0ebd88-4c35-45f0-b864-b73103a2cd4a", "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "7bd4168f-adc6-4bb1-a574-2e6421be52e0", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082220Z:2901ad86-f446-4967-8cf0-ca38ad27b005" + "x-ms-request-id": "740e3dbe-7b5d-4866-bcb2-d46a5cbb18e1", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060807Z:4f0ebd88-4c35-45f0-b864-b73103a2cd4a" }, "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677?api-version=2015-10-31", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "114", "Content-Type": "application/json", - "traceparent": "00-c9984c3b8f3bf12a02fafe33c66cad9c-af0bca0b21317168-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a5c4edb2d015061bfddf4971b5d92e3c", + "traceparent": "00-49e9185f95b8f31fa27541eabde6107b-eef41f0d9897370c-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "8aa48ad65151e30d101da7015cb9e413", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "webhook2269", + "name": "webhook3677", "properties": { - "expiryTime": "2023-05-24T08:22:19.9438477Z", + "expiryTime": "2023-05-25T06:08:05.4671158Z", "runbook": { - "name": "runbook6978" + "name": "runbook2643" } } }, @@ -339,47 +339,47 @@ "Cache-Control": "no-cache", "Content-Length": "565", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:22 GMT", + "Date": "Wed, 24 May 2023 06:08:08 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269?api-version=2015-10-31", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677?api-version=2015-10-31", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0f580f59-2a5d-4893-8095-c4270a6f6f72", + "x-ms-correlation-request-id": "b5d27bcd-11db-4a19-8c6b-ff25dbf6749c", "x-ms-ratelimit-remaining-subscription-writes": "1196", - "x-ms-request-id": "0895464b-e089-4133-be36-3db866959f01", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082222Z:0f580f59-2a5d-4893-8095-c4270a6f6f72" + "x-ms-request-id": "b276ebfb-a85e-4504-81f9-6625a2726311", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060809Z:b5d27bcd-11db-4a19-8c6b-ff25dbf6749c" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269", - "name": "webhook2269", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677", + "name": "webhook3677", "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:19.9438477\u002B00:00", + "expiryTime": "2023-05-25T06:08:05.4671158\u002B00:00", "runbook": { - "name": "runbook6978" + "name": "runbook2643" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": "Sanitized", - "creationTime": "2023-05-23T08:22:22.4607092\u002B00:00", + "creationTime": "2023-05-24T06:08:08.9085629\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:22.4607092\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:08.9085629\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677?api-version=2015-10-31", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-a162cce1332a1af549ced8e13788fb73-d58249ec7d69fe8a-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "f4524f6b9b0f2a02ed901d9f5f1737f1", + "traceparent": "00-a358e3c9e76b9182db238b94451c2a73-ba5d5efbdbc61289-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5530aafd28b3955b3d669189e0f3143b", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -388,46 +388,46 @@ "Cache-Control": "no-cache", "Content-Length": "556", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:23 GMT", + "Date": "Wed, 24 May 2023 06:08:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "2968470d-190e-4e59-99c5-b7737e11424c", + "x-ms-correlation-request-id": "cbcfb8cd-04b8-4612-ba89-ebb8a0957135", "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "bfff5d35-bc7b-487a-adfe-bb2a0cbc8e2a", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082223Z:2968470d-190e-4e59-99c5-b7737e11424c" + "x-ms-request-id": "9f7afee8-4522-4fa2-a28a-f531b1538a9a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060809Z:cbcfb8cd-04b8-4612-ba89-ebb8a0957135" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269", - "name": "webhook2269", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677", + "name": "webhook3677", "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:19.9438477\u002B00:00", + "expiryTime": "2023-05-25T06:08:05.4671158\u002B00:00", "runbook": { - "name": "runbook6978" + "name": "runbook2643" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": "", - "creationTime": "2023-05-23T08:22:22.4607092\u002B00:00", + "creationTime": "2023-05-24T06:08:08.9085629\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:22.4607092\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:08.9085629\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677?api-version=2015-10-31", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-11d82d6bfedae192b152d5b2033a5fca-804d490dd7324024-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "93204f99a34c6c0a12f508696aff85ce", + "traceparent": "00-c3a24741f04bba3efa356f134fd76352-6167971d03b3b782-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5d7e636ac5bc9f265c6d49f7ef8056fd", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -436,46 +436,46 @@ "Cache-Control": "no-cache", "Content-Length": "556", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:23 GMT", + "Date": "Wed, 24 May 2023 06:08:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6a740053-45f8-4f04-b52a-bf9be45ad778", + "x-ms-correlation-request-id": "b943dd45-abfc-464e-ad9b-e0bd52aebf6b", "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "a01c8076-a232-48ff-ab5b-6f0a7cda4646", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082223Z:6a740053-45f8-4f04-b52a-bf9be45ad778" + "x-ms-request-id": "5a13e310-bef7-4cf8-a676-c83a82dd1d7b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060810Z:b943dd45-abfc-464e-ad9b-e0bd52aebf6b" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269", - "name": "webhook2269", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677", + "name": "webhook3677", "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:19.9438477\u002B00:00", + "expiryTime": "2023-05-25T06:08:05.4671158\u002B00:00", "runbook": { - "name": "runbook6978" + "name": "runbook2643" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": "", - "creationTime": "2023-05-23T08:22:22.4607092\u002B00:00", + "creationTime": "2023-05-24T06:08:08.9085629\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:22.4607092\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:08.9085629\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks?api-version=2015-10-31", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5e2d3d2e51d7418a9eac0fe96eb590d6-f8cba30679b8a7fe-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "81a3a91dd5c6177beb99b785b37ca6e6", + "traceparent": "00-2ca84457db69df3798bd0bb0d885f87d-94215accfa2c2dcb-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "01b5064b93c3ad482f0f4ceac084031c", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -484,35 +484,35 @@ "Cache-Control": "no-cache", "Content-Length": "512", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:25 GMT", + "Date": "Wed, 24 May 2023 06:08:10 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "1dc30a1d-f57f-45a0-a6c4-1a45466ebc57", + "x-ms-correlation-request-id": "4b556049-e56c-44dc-ae9b-3619a7d99ba5", "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "306208d4-345e-4946-9a45-6f589bccb570", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082225Z:1dc30a1d-f57f-45a0-a6c4-1a45466ebc57" + "x-ms-request-id": "f93bc1fe-b355-42af-bcf9-be28af5c09ca", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060810Z:4b556049-e56c-44dc-ae9b-3619a7d99ba5" }, "ResponseBody": { "value": [ { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-1141/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook2269", - "name": "webhook2269", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-9992/providers/Microsoft.Automation/automationAccounts/automation7501/webhooks/webhook3677", + "name": "webhook3677", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:19.9438477\u002B00:00", + "expiryTime": "2023-05-25T06:08:05.4671158\u002B00:00", "runbook": { - "name": "runbook6978" + "name": "runbook2643" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": null, - "creationTime": "2023-05-23T08:22:22.4607092\u002B00:00", + "creationTime": "2023-05-24T06:08:08.9085629\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:22.4607092\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:08.9085629\u002B00:00" } } ] @@ -521,9 +521,9 @@ ], "Variables": { "AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com", - "DateTimeOffsetNow": "2023-05-23T16:22:19.9438477\u002B08:00", + "DateTimeOffsetNow": "2023-05-24T14:08:05.4671158\u002B08:00", "LOCATION": "eastus", - "RandomSeed": "618927238", + "RandomSeed": "827903692", "RESOURCE_MANAGER_URL": null, "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" } diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json index 89f379fece4c9..6e65fc8af4cca 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/SessionRecords/WebhookTests/CreateOrUpdateExistGetGetAllAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-8aaae4b1044f003660ebee2011c768e5-1299493e359d680e-00", + "traceparent": "00-e41148bdcb9bbf71e74f06346cb49326-fcb9e905a4af0d7c-00", "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "244d564d6a984b794b6358b1af8e6e7a", + "x-ms-client-request-id": "6409bd3cea4f656d014d9398676b8170", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -17,15 +17,15 @@ "Cache-Control": "no-cache", "Content-Length": "748", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:31 GMT", + "Date": "Wed, 24 May 2023 06:08:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ed374ae4-8d75-4dc6-b043-66bc563f4ed9", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "ed374ae4-8d75-4dc6-b043-66bc563f4ed9", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082231Z:ed374ae4-8d75-4dc6-b043-66bc563f4ed9" + "x-ms-correlation-request-id": "8a5e3fa7-8a90-44a2-bfdf-153043962e6e", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "8a5e3fa7-8a90-44a2-bfdf-153043962e6e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060826Z:8a5e3fa7-8a90-44a2-bfdf-153043962e6e" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -56,16 +56,16 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-2059?api-version=**", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourcegroups/testRG-3051?api-version=**", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "43", "Content-Type": "application/json", - "traceparent": "00-32dc0ef98c03d50827dc1819aff3058b-95ad6375eb6bbcda-00", + "traceparent": "00-7b1c9ea2ee9b0428586059cc28363d82-b1c61a38bdff7b8f-00", "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "79dd4dda6bfde97326a2fe1f43f1218d", + "x-ms-client-request-id": "f5f5384ef7ea4cdf01208126b31ad9a9", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -79,19 +79,19 @@ "Cache-Control": "no-cache", "Content-Length": "241", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:32 GMT", + "Date": "Wed, 24 May 2023 06:08:29 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "c81116be-4939-47c9-a314-3b0bee3c1780", - "x-ms-ratelimit-remaining-subscription-writes": "1195", - "x-ms-request-id": "c81116be-4939-47c9-a314-3b0bee3c1780", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082232Z:c81116be-4939-47c9-a314-3b0bee3c1780" + "x-ms-correlation-request-id": "f140c730-1917-488e-9dfc-41ed1791849a", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "f140c730-1917-488e-9dfc-41ed1791849a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060829Z:f140c730-1917-488e-9dfc-41ed1791849a" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059", - "name": "testRG-2059", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051", + "name": "testRG-3051", "type": "Microsoft.Resources/resourceGroups", "location": "eastus", "tags": { @@ -103,16 +103,16 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745?api-version=2021-06-22", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670?api-version=2021-06-22", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "59", "Content-Type": "application/json", - "traceparent": "00-8f16db95dcbc588e36582f587d2c4fc9-e3057f353d6e4974-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "33cf17055272b646d7a1e34f7b3645dc", + "traceparent": "00-dccec3f304e843373c36a60183666b2c-ebf29cf68d679ac4-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "7322b12d1cdb505b417d28b8dcff0d89", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -126,27 +126,27 @@ "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "1115", + "Content-Length": "1135", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:34 GMT", + "Date": "Wed, 24 May 2023 06:08:32 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745?api-version=2021-06-22", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670?api-version=2021-06-22", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f0622610-9b73-4e9e-916e-808bd7eae58c", - "x-ms-ratelimit-remaining-subscription-writes": "1194", - "x-ms-request-id": "fff218bb-fd0a-4091-95d9-cda4b97025fc", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082234Z:f0622610-9b73-4e9e-916e-808bd7eae58c" + "x-ms-correlation-request-id": "93d06442-470e-4d31-bae2-c8c241a7288f", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "27e9be97-818f-442b-83cb-1d907eeec29e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060832Z:93d06442-470e-4d31-bae2-c8c241a7288f" }, "ResponseBody": { - "name": "automation2745", + "name": "automation1670", "systemData": { - "createdAt": "2023-05-23T08:22:33.53\u002B00:00", - "lastModifiedAt": "2023-05-23T08:22:33.53\u002B00:00" + "createdAt": "2023-05-24T06:08:31.3333333\u002B00:00", + "lastModifiedAt": "2023-05-24T06:08:31.3333333\u002B00:00" }, - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670", "type": "Microsoft.Automation/AutomationAccounts", "location": "eastus", "tags": {}, @@ -159,14 +159,14 @@ "capacity": null }, "state": "Ok", - "RegistrationUrl": "https://b47dc572-616e-49cf-ac90-b561768b8c92.agentsvc.eus.azure-automation.net/accounts/b47dc572-616e-49cf-ac90-b561768b8c92", + "RegistrationUrl": "https://1abf7859-b528-4988-a6c2-1174b1622efe.agentsvc.eus.azure-automation.net/accounts/1abf7859-b528-4988-a6c2-1174b1622efe", "encryption": { "keySource": "Microsoft.Automation", "identity": { "userAssignedIdentity": null } }, - "automationHybridServiceUrl": "https://b47dc572-616e-49cf-ac90-b561768b8c92.jrds.eus.azure-automation.net/automationAccounts/b47dc572-616e-49cf-ac90-b561768b8c92", + "automationHybridServiceUrl": "https://1abf7859-b528-4988-a6c2-1174b1622efe.jrds.eus.azure-automation.net/automationAccounts/1abf7859-b528-4988-a6c2-1174b1622efe", "RuntimeConfiguration": { "powershell": { "builtinModules": { @@ -179,23 +179,23 @@ } } }, - "creationTime": "2023-05-23T08:22:33.53\u002B00:00", + "creationTime": "2023-05-24T06:08:31.3333333\u002B00:00", "lastModifiedBy": null, - "lastModifiedTime": "2023-05-23T08:22:33.53\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:31.3333333\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/runbooks/runbook6422?api-version=2018-06-30", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/runbooks/runbook7879?api-version=2018-06-30", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "59", "Content-Type": "application/json", - "traceparent": "00-672c1ae82f973d96fc4841924966747b-1fa2c6be9978eb54-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "69f5beb0ea503bd971c87b2b08723724", + "traceparent": "00-671833ccff323319144e019973f1c91e-d648e905f9ca3f52-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4db00babc55117294ecaeb3f4e32b9ee", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -207,28 +207,28 @@ "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "680", + "Content-Length": "670", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:35 GMT", - "ETag": "\u0022638204269557666667\u0022", + "Date": "Wed, 24 May 2023 06:08:34 GMT", + "ETag": "\u0022638205053141900000\u0022", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/runbooks/runbook6422?api-version=2018-06-30", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/runbooks/runbook7879?api-version=2018-06-30", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "95c53351-cabe-4620-b23c-0aab18b89f02", - "x-ms-ratelimit-remaining-subscription-writes": "1193", - "x-ms-request-id": "928f5506-6e57-4e77-8968-925bbb73c891", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082236Z:95c53351-cabe-4620-b23c-0aab18b89f02" + "x-ms-correlation-request-id": "07c99d31-ecb4-456e-8a66-54cc22f6e329", + "x-ms-ratelimit-remaining-subscription-writes": "1197", + "x-ms-request-id": "48c99d78-e24a-4719-a32a-3b06cef466c9", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060834Z:07c99d31-ecb4-456e-8a66-54cc22f6e329" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/runbooks/runbook6422", - "name": "runbook6422", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/runbooks/runbook7879", + "name": "runbook7879", "type": "Microsoft.Automation/AutomationAccounts/Runbooks", "location": "eastus", "tags": {}, - "etag": "\u0022638204269557666667\u0022", + "etag": "\u0022638205053141900000\u0022", "properties": { "description": null, "logVerbose": false, @@ -241,22 +241,22 @@ "provisioningState": "Succeeded", "serviceManagementTags": null, "outputTypes": [], - "creationTime": "2023-05-23T08:22:35.7666667\u002B00:00", + "creationTime": "2023-05-24T06:08:34.19\u002B00:00", "lastModifiedBy": null, - "lastModifiedTime": "2023-05-23T08:22:35.7666667\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:34.19\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/runbooks/runbook6422/publish?api-version=2018-06-30", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/runbooks/runbook7879/publish?api-version=2018-06-30", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "0", - "traceparent": "00-9867d58f4a5aeb4d7cf73e71984197ad-e72885062662e4bd-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "6369b981a6fb8bdb334694d105d726c8", + "traceparent": "00-42c871731445d413eb60c8775ef35eae-85be619a336dbacc-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "bf5413b1da6cd95d999ab56124484382", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -264,33 +264,33 @@ "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Tue, 23 May 2023 08:22:36 GMT", + "Date": "Wed, 24 May 2023 06:08:35 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/runbooks/runbook6422/operationResults/981871fc-1035-419e-a465-26e2a078536a?api-version=2018-06-30", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/runbooks/runbook7879/operationResults/94a80bae-7f3b-4f63-b0cc-0f361b174389?api-version=2018-06-30", "ocp-automation-operationresultid": [ - "981871fc-1035-419e-a465-26e2a078536a", - "981871fc-1035-419e-a465-26e2a078536a" + "94a80bae-7f3b-4f63-b0cc-0f361b174389", + "94a80bae-7f3b-4f63-b0cc-0f361b174389" ], "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "95193fae-ebd9-42e0-a307-2bd196c1b3ac", - "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "673f931d-beff-4fee-91fc-b32b20bc793e", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082236Z:95193fae-ebd9-42e0-a307-2bd196c1b3ac" + "x-ms-correlation-request-id": "52052e4a-ebf1-4afe-b60e-e32ab5179d5e", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "ccdfe785-1194-4751-9f06-e3350c0c3c6a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060835Z:52052e4a-ebf1-4afe-b60e-e32ab5179d5e" }, "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/runbooks/runbook6422/operationResults/981871fc-1035-419e-a465-26e2a078536a?api-version=2018-06-30", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/runbooks/runbook7879/operationResults/94a80bae-7f3b-4f63-b0cc-0f361b174389?api-version=2018-06-30", "RequestMethod": "GET", "RequestHeaders": { "Authorization": "Sanitized", - "traceparent": "00-9867d58f4a5aeb4d7cf73e71984197ad-44baf84712f97006-00", + "traceparent": "00-42c871731445d413eb60c8775ef35eae-0006c6b8ee60f9e3-00", "User-Agent": "azsdk-net-ResourceManager/1.6.0 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "c2cdbf6ae2cc09e1e369360a5507359a", + "x-ms-client-request-id": "c90739c44eabd01caed7b4b710c8f305", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -299,219 +299,219 @@ "Cache-Control": "no-cache", "Content-Length": "0", "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:37 GMT", + "Date": "Wed, 24 May 2023 06:08:35 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "dc7e229f-8d00-44b8-90da-b215548bc70a", - "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "88a48721-bdd4-4150-86aa-1e3946cb64e3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082237Z:dc7e229f-8d00-44b8-90da-b215548bc70a" + "x-ms-correlation-request-id": "d2efa9e3-427a-4700-b7da-af4137637107", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "5dd8dc61-bf51-4f97-ba79-af8389161dc3", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060835Z:d2efa9e3-427a-4700-b7da-af4137637107" }, "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001?api-version=2015-10-31", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", "Content-Length": "114", "Content-Type": "application/json", - "traceparent": "00-4eb13a3870e147055f5c99cae8dc6f84-13a71f90e18960a8-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "32a151b28bd433be4e2566e431b31997", + "traceparent": "00-197f7d229af25312f675d8d42d449fdb-a484281c08c6ad4f-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c3242669f4eb0d48ec3762b54ca87d98", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "name": "webhook1067", + "name": "webhook8001", "properties": { - "expiryTime": "2023-05-24T08:22:36.5228154Z", + "expiryTime": "2023-05-25T06:08:34.0928233Z", "runbook": { - "name": "runbook6422" + "name": "runbook7879" } } }, "StatusCode": 201, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "563", + "Content-Length": "565", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:38 GMT", + "Date": "Wed, 24 May 2023 06:08:37 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067?api-version=2015-10-31", + "Location": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001?api-version=2015-10-31", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f0320b1b-fa08-43f0-a550-ebd5f317c7a6", - "x-ms-ratelimit-remaining-subscription-writes": "1192", - "x-ms-request-id": "d31d259c-8ed6-49cf-adb3-cc6a64d29150", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082239Z:f0320b1b-fa08-43f0-a550-ebd5f317c7a6" + "x-ms-correlation-request-id": "11c999c6-0fe6-455e-a1be-5f370a043687", + "x-ms-ratelimit-remaining-subscription-writes": "1196", + "x-ms-request-id": "c4a52c75-37a8-47b8-a487-52339775e5f7", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060837Z:11c999c6-0fe6-455e-a1be-5f370a043687" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067", - "name": "webhook1067", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001", + "name": "webhook8001", "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:36.5228154\u002B00:00", + "expiryTime": "2023-05-25T06:08:34.0928233\u002B00:00", "runbook": { - "name": "runbook6422" + "name": "runbook7879" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": "Sanitized", - "creationTime": "2023-05-23T08:22:39.237267\u002B00:00", + "creationTime": "2023-05-24T06:08:37.4961829\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:39.237267\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:37.4961829\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001?api-version=2015-10-31", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-e66d7566d6dc0e93e25f0ceed0674d6d-b6cf417995023ead-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "09466630fb6384f7377e2e8d7bc4355f", + "traceparent": "00-8b783941576986edc120e37a5728b366-8e94f074087f691a-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "40ea9da6d7790dca9e2022b44e57be17", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "554", + "Content-Length": "556", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:39 GMT", + "Date": "Wed, 24 May 2023 06:08:40 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8847bac7-ea65-4c72-98f1-1e9c8888e1d4", - "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "291ba50b-6259-4360-9bc9-c509c5cd205d", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082240Z:8847bac7-ea65-4c72-98f1-1e9c8888e1d4" + "x-ms-correlation-request-id": "ae34cd0b-2c26-4b2c-8731-7f255ef3975c", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "a07ca33f-a486-4b6f-a624-34a112d9c473", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060840Z:ae34cd0b-2c26-4b2c-8731-7f255ef3975c" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067", - "name": "webhook1067", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001", + "name": "webhook8001", "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:36.5228154\u002B00:00", + "expiryTime": "2023-05-25T06:08:34.0928233\u002B00:00", "runbook": { - "name": "runbook6422" + "name": "runbook7879" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": "", - "creationTime": "2023-05-23T08:22:39.237267\u002B00:00", + "creationTime": "2023-05-24T06:08:37.4961829\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:39.237267\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:37.4961829\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001?api-version=2015-10-31", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-a78e97ef4148ee680b5f0d4d203b900b-0219d5a85303f847-00", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "c8240828320c33960f8e7ebd7a24b2b6", + "traceparent": "00-3aed3e996fae188fecb2f4f6a470e127-b8d69366c977d626-00", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f4c78a1f4bdd44d9bebcbf16ba1b612e", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "554", + "Content-Length": "556", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:40 GMT", + "Date": "Wed, 24 May 2023 06:08:40 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "464ef14c-509e-447a-8f1e-fd04269293d2", - "x-ms-ratelimit-remaining-subscription-reads": "11991", - "x-ms-request-id": "d28c72aa-87ae-42a5-82bf-51095f4a892f", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082240Z:464ef14c-509e-447a-8f1e-fd04269293d2" + "x-ms-correlation-request-id": "43b65a6f-09d1-4427-99f7-bcbf84706bae", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "66965836-4ad2-4cfe-912e-e431a7026aae", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060841Z:43b65a6f-09d1-4427-99f7-bcbf84706bae" }, "ResponseBody": { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067", - "name": "webhook1067", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001", + "name": "webhook8001", "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:36.5228154\u002B00:00", + "expiryTime": "2023-05-25T06:08:34.0928233\u002B00:00", "runbook": { - "name": "runbook6422" + "name": "runbook7879" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": "", - "creationTime": "2023-05-23T08:22:39.237267\u002B00:00", + "creationTime": "2023-05-24T06:08:37.4961829\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:39.237267\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:37.4961829\u002B00:00" } } }, { - "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks?api-version=2015-10-31", + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks?api-version=2015-10-31", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230523.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "a125721d90efb63e5a1dfa565d31b889", + "User-Agent": "azsdk-net-ResourceManager.Automation/1.1.0-alpha.20230524.1 (.NET 7.0.5; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "2b691f36c508910c5c1625cad294be94", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "510", + "Content-Length": "512", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 23 May 2023 08:22:40 GMT", + "Date": "Wed, 24 May 2023 06:08:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "7ecfac28-4218-406d-87f3-7a810bbeb7ef", - "x-ms-ratelimit-remaining-subscription-reads": "11990", - "x-ms-request-id": "55c6dca6-54bd-4e59-acf5-efbe3a1fe331", - "x-ms-routing-request-id": "SOUTHEASTASIA:20230523T082241Z:7ecfac28-4218-406d-87f3-7a810bbeb7ef" + "x-ms-correlation-request-id": "da6395cb-8d00-4182-b07c-1b52e4b1f138", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "b5225d6f-9cd8-4437-8286-b7e738210ff1", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230524T060841Z:da6395cb-8d00-4182-b07c-1b52e4b1f138" }, "ResponseBody": { "value": [ { - "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-2059/providers/Microsoft.Automation/automationAccounts/automation2745/webhooks/webhook1067", - "name": "webhook1067", + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c/resourceGroups/testRG-3051/providers/Microsoft.Automation/automationAccounts/automation1670/webhooks/webhook8001", + "name": "webhook8001", "properties": { "isEnabled": false, - "expiryTime": "2023-05-24T08:22:36.5228154\u002B00:00", + "expiryTime": "2023-05-25T06:08:34.0928233\u002B00:00", "runbook": { - "name": "runbook6422" + "name": "runbook7879" }, "lastInvokedTime": null, "runOn": null, "parameters": null, "uri": null, - "creationTime": "2023-05-23T08:22:39.237267\u002B00:00", + "creationTime": "2023-05-24T06:08:37.4961829\u002B00:00", "lastModifiedBy": "", - "lastModifiedTime": "2023-05-23T08:22:39.237267\u002B00:00" + "lastModifiedTime": "2023-05-24T06:08:37.4961829\u002B00:00" } } ] @@ -520,9 +520,9 @@ ], "Variables": { "AZURE_AUTHORITY_HOST": "https://login.microsoftonline.com", - "DateTimeOffsetNow": "2023-05-23T16:22:36.5228154\u002B08:00", + "DateTimeOffsetNow": "2023-05-24T14:08:34.0928233\u002B08:00", "LOCATION": "eastus", - "RandomSeed": "776078516", + "RandomSeed": "1394050418", "RESOURCE_MANAGER_URL": null, "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" } diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs index f3859e8ad1a71..0d308875373fb 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs @@ -47,11 +47,14 @@ private async Task CreateWebhook(string webhookName) } [RecordedTest] + [LiveOnly]// Uri contains Credential info should be sanitized, and public async Task CreateOrUpdateExistGetGetAll() { // CreateOrUpdate string webhookName = Recording.GenerateAssetName("webhook"); var webhook = await CreateWebhook(webhookName); + ValidateWebhook(webhook.Data, webhookName); + Assert.IsNotNull(webhook.Data.Uri); // Exist var flag = await _webhookCollection.ExistsAsync(webhookName); @@ -60,11 +63,13 @@ public async Task CreateOrUpdateExistGetGetAll() // Get var getwebhook = await _webhookCollection.GetAsync(webhookName); ValidateWebhook(getwebhook.Value.Data, webhookName); + Assert.IsNull(getwebhook.Value.Data.Uri); // GetAll var list = await _webhookCollection.GetAllAsync().ToEnumerableAsync(); Assert.IsNotEmpty(list); ValidateWebhook(list.FirstOrDefault().Data, webhookName); + Assert.IsNull(list.FirstOrDefault().Data.Uri); } private void ValidateWebhook(AutomationWebhookData webhook, string webhookName) @@ -73,7 +78,6 @@ private void ValidateWebhook(AutomationWebhookData webhook, string webhookName) Assert.IsNotEmpty(webhook.Id); Assert.AreEqual(webhookName, webhook.Name); Assert.AreEqual(_runbook.Data.Name, webhook.RunbookName); - Assert.IsTrue(string.IsNullOrWhiteSpace(webhook.UriString)); } } } From 8afa47d6caa94aac2f059ca190cc8886eed89d9b Mon Sep 17 00:00:00 2001 From: Chengming Date: Wed, 24 May 2023 14:32:51 +0800 Subject: [PATCH 7/7] update --- .../api/Azure.ResourceManager.Automation.netstandard2.0.cs | 3 --- .../Azure.ResourceManager.Automation/src/autorest.md | 2 -- .../tests/TestCase/WebhookTests.cs | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs index a4aaeb4b315e6..6e605b438817b 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs @@ -854,10 +854,7 @@ public AutomationWebhookData() { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public string RunbookName { get { throw null; } set { } } public string RunOn { get { throw null; } set { } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This property has been replaced by UriString", false)] public System.Uri Uri { get { throw null; } set { } } - public string UriString { get { throw null; } set { } } } public partial class AutomationWebhookResource : Azure.ResourceManager.ArmResource { diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md index aa2d739bb10d5..200780db1012f 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md +++ b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md @@ -222,8 +222,6 @@ no-property-type-replacement: models-to-treat-empty-string-as-null: - AutomationWebhookData - # - Webhook.properties.uri - # : uriString request-path-to-resource-name: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields: AutomationAccountResource diff --git a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs index 0d308875373fb..b2e68e960bd26 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/tests/TestCase/WebhookTests.cs @@ -47,7 +47,7 @@ private async Task CreateWebhook(string webhookName) } [RecordedTest] - [LiveOnly]// Uri contains Credential info should be sanitized, and + [LiveOnly]// Uri contains Credential info that should be sanitized, and `new Uri("Sanitized")` cannot pass the playback. public async Task CreateOrUpdateExistGetGetAll() { // CreateOrUpdate