From 0f3a57b3191ab946f50f44bb616026e26b768acc Mon Sep 17 00:00:00 2001 From: yanfa317 <53584318+yanfa317@users.noreply.github.com> Date: Sun, 27 Mar 2022 22:54:20 -0700 Subject: [PATCH] Add SetNetworkManager (#17624) * Add SetNetworkManager * add sessiondata * add example * fix --- .../ScenarioTests/NetworkManagerTests.ps1 | 5 + .../TestNetworkManagerCRUD.json | 306 +++++++++++++----- src/Network/Network/Az.Network.psd1 | 2 +- src/Network/Network/ChangeLog.md | 3 +- .../SetAzNetworkManagerCommand.cs | 68 ++++ .../Network/help/Set-AzNetworkManager.md | 176 ++++++++++ 6 files changed, 471 insertions(+), 89 deletions(-) create mode 100644 src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs create mode 100644 src/Network/Network/help/Set-AzNetworkManager.md diff --git a/src/Network/Network.Test/ScenarioTests/NetworkManagerTests.ps1 b/src/Network/Network.Test/ScenarioTests/NetworkManagerTests.ps1 index 51f74dac3ed5..3b4bab71b769 100644 --- a/src/Network/Network.Test/ScenarioTests/NetworkManagerTests.ps1 +++ b/src/Network/Network.Test/ScenarioTests/NetworkManagerTests.ps1 @@ -44,6 +44,11 @@ function Test-NetworkManagerCRUD Assert-AreEqual $networkmanager.NetworkManagerScopeAccesses[0] "Connectivity"; Assert-AreEqual $networkManager.NetworkManagerScopes.Subscriptions[0] $subscriptionId; + $networkManager.NetworkManagerScopeAccesses.Add("SecurityAdmin"); + $newNetworkManager = Set-AzNetworkManager -ResourceGroupName $rgname -NetworkManager $networkManager + Assert-AreEqual $networkmanager.NetworkManagerScopeAccesses[0] "Connectivity"; + Assert-AreEqual $networkmanager.NetworkManagerScopeAccesses[1] "SecurityAdmin"; + $job = Remove-AzNetworkManager -ResourceGroupName $rgname -Name $networkManagerName -PassThru -Force -AsJob; $job | Wait-Job; $removeResult = $job | Receive-Job; diff --git a/src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkManagerTests/TestNetworkManagerCRUD.json b/src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkManagerTests/TestNetworkManagerCRUD.json index 55f67023b3ed..f423bdc1946d 100644 --- a/src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkManagerTests/TestNetworkManagerCRUD.json +++ b/src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkManagerTests/TestNetworkManagerCRUD.json @@ -1,22 +1,22 @@ { "Entries": [ { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourcegroups/ps3449?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlZ3JvdXBzL3BzMzQ0OT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourcegroups/ps2054?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlZ3JvdXBzL3BzMjA1ND9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", "RequestMethod": "PUT", "RequestBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"testtag\": \"testval\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "d3a861f2-2f1b-42c9-b620-e9dbd05b8731" + "a8d7ecce-3b84-4911-988a-bd4725b63a52" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.47" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.56" ], "Content-Type": [ "application/json; charset=utf-8" @@ -36,13 +36,13 @@ "1199" ], "x-ms-request-id": [ - "a5769b57-f717-4798-b327-6e60ffca0fb2" + "b52a37b7-1d02-4553-99dc-e07dba512257" ], "x-ms-correlation-request-id": [ - "a5769b57-f717-4798-b327-6e60ffca0fb2" + "b52a37b7-1d02-4553-99dc-e07dba512257" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214734Z:a5769b57-f717-4798-b327-6e60ffca0fb2" + "WESTUS:20220325T223054Z:b52a37b7-1d02-4553-99dc-e07dba512257" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -51,7 +51,7 @@ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:47:34 GMT" + "Fri, 25 Mar 2022 22:30:54 GMT" ], "Content-Length": [ "201" @@ -63,26 +63,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449\",\r\n \"name\": \"ps3449\",\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"testtag\": \"testval\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054\",\r\n \"name\": \"ps2054\",\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"testtag\": \"testval\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449/providers/Microsoft.Network/networkManagers/ps3847?api-version=2021-02-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMzQ0OS9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzMzg0Nz9hcGktdmVyc2lvbj0yMDIxLTAyLTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzNTMyNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "5e1095c9-64b5-4909-9644-d394221cdc39" + "575c0c55-f4ef-476b-94a4-a39a5d512f22" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.1" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.2" ] }, "ResponseHeaders": { @@ -96,13 +96,13 @@ "gateway" ], "x-ms-request-id": [ - "4c9bea4d-e92f-4e61-b45f-1c98ca731af5" + "9d331fb4-80c9-4506-82e8-ba3d01f00466" ], "x-ms-correlation-request-id": [ - "4c9bea4d-e92f-4e61-b45f-1c98ca731af5" + "9d331fb4-80c9-4506-82e8-ba3d01f00466" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214736Z:4c9bea4d-e92f-4e61-b45f-1c98ca731af5" + "WESTUS:20220325T223054Z:9d331fb4-80c9-4506-82e8-ba3d01f00466" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -111,7 +111,7 @@ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:47:36 GMT" + "Fri, 25 Mar 2022 22:30:54 GMT" ], "Content-Type": [ "application/json; charset=utf-8" @@ -123,26 +123,26 @@ "218" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Network/networkManagers/ps3847' under resource group 'ps3449' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Network/networkManagers/ps5327' under resource group 'ps2054' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"\r\n }\r\n}", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449/providers/Microsoft.Network/networkManagers/ps3847?api-version=2021-02-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMzQ0OS9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzMzg0Nz9hcGktdmVyc2lvbj0yMDIxLTAyLTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzNTMyNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "d7ff73ca-bd24-457d-abc7-afb403ab175a" + "270f7886-92bf-4e85-b8f2-6840396f81d2" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.1" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.2" ] }, "ResponseHeaders": { @@ -162,22 +162,22 @@ "Kestrel" ], "x-ms-request-id": [ - "b6627971-696d-4231-941d-cb9d21b0b345" + "5cc85620-f00c-41a9-800e-c4dc8eae111c" ], "x-ms-correlation-request-id": [ - "b6627971-696d-4231-941d-cb9d21b0b345" + "5cc85620-f00c-41a9-800e-c4dc8eae111c" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214745Z:b6627971-696d-4231-941d-cb9d21b0b345" + "WESTUS:20220325T223101Z:5cc85620-f00c-41a9-800e-c4dc8eae111c" ], "X-Content-Type-Options": [ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:47:45 GMT" + "Fri, 25 Mar 2022 22:31:01 GMT" ], "Content-Length": [ - "840" + "881" ], "Content-Type": [ "application/json; charset=utf-8" @@ -186,26 +186,89 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"ps3847\",\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449/providers/Microsoft.Network/networkManagers/ps3847\",\r\n \"location\": \"centraluseuap\",\r\n \"type\": \"Microsoft.Network/networkManagers\",\r\n \"tags\": {},\r\n \"etag\": \"\\\"2a00e1d7-0000-3300-0000-616deb800000\\\"\",\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ]\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\"\r\n ],\r\n \"resourceGuid\": \"c8375c84-777d-4683-8c67-fcb1479a2614\"\r\n },\r\n \"systemData\": {\r\n \"createdBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"createdByType\": \"Application\",\r\n \"createdAt\": \"10/18/2021 21:47:40\",\r\n \"lastModifiedBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"lastModifiedByType\": \"Application\",\r\n \"lastModifiedAt\": \"10/18/2021 21:47:40\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"name\": \"ps5327\",\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327\",\r\n \"location\": \"centraluseuap\",\r\n \"type\": \"Microsoft.Network/networkManagers\",\r\n \"tags\": {},\r\n \"etag\": \"\\\"03006695-0000-3300-0000-623e42a40000\\\"\",\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ],\r\n \"multiTenantScopes\": []\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\"\r\n ],\r\n \"resourceGuid\": \"b9fcf087-dfbb-4313-8b2f-20c15e085942\"\r\n },\r\n \"systemData\": {\r\n \"createdBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"createdByType\": \"Application\",\r\n \"createdAt\": \"2022-03-25T22:30:58.0890643Z\",\r\n \"lastModifiedBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"lastModifiedByType\": \"Application\",\r\n \"lastModifiedAt\": \"2022-03-25T22:30:58.0890643Z\"\r\n }\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449/providers/Microsoft.Network/networkManagers/ps3847?api-version=2021-02-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMzQ0OS9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzMzg0Nz9hcGktdmVyc2lvbj0yMDIxLTAyLTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzNTMyNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d694603c-7795-4b20-b0c2-8134423267a1" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.2" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "31e2a22e-e58e-423a-9287-f5c5f2313333" + ], + "x-ms-correlation-request-id": [ + "31e2a22e-e58e-423a-9287-f5c5f2313333" + ], + "x-ms-routing-request-id": [ + "WESTUS:20220325T223121Z:31e2a22e-e58e-423a-9287-f5c5f2313333" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 25 Mar 2022 22:31:20 GMT" + ], + "Content-Length": [ + "881" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"ps5327\",\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327\",\r\n \"location\": \"centraluseuap\",\r\n \"type\": \"Microsoft.Network/networkManagers\",\r\n \"tags\": {},\r\n \"etag\": \"\\\"03006695-0000-3300-0000-623e42a40000\\\"\",\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ],\r\n \"multiTenantScopes\": []\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\"\r\n ],\r\n \"resourceGuid\": \"b9fcf087-dfbb-4313-8b2f-20c15e085942\"\r\n },\r\n \"systemData\": {\r\n \"createdBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"createdByType\": \"Application\",\r\n \"createdAt\": \"2022-03-25T22:30:58.0890643Z\",\r\n \"lastModifiedBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"lastModifiedByType\": \"Application\",\r\n \"lastModifiedAt\": \"2022-03-25T22:30:58.0890643Z\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzNTMyNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ]\r\n },\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\"\r\n ]\r\n },\r\n \"location\": \"centraluseuap\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "5e1095c9-64b5-4909-9644-d394221cdc39" + "575c0c55-f4ef-476b-94a4-a39a5d512f22" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.1" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.2" ], "Content-Type": [ "application/json; charset=utf-8" @@ -231,22 +294,91 @@ "Kestrel" ], "x-ms-request-id": [ - "9439c94d-8c74-4df6-9606-f4073f67f37f" + "07f9cec0-a4d3-47b2-90cc-62d59aa8928a" + ], + "x-ms-correlation-request-id": [ + "07f9cec0-a4d3-47b2-90cc-62d59aa8928a" + ], + "x-ms-routing-request-id": [ + "WESTUS:20220325T223101Z:07f9cec0-a4d3-47b2-90cc-62d59aa8928a" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 25 Mar 2022 22:31:01 GMT" + ], + "Content-Length": [ + "841" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"ps5327\",\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327\",\r\n \"location\": \"centraluseuap\",\r\n \"type\": \"Microsoft.Network/networkManagers\",\r\n \"tags\": {},\r\n \"etag\": \"\",\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ],\r\n \"multiTenantScopes\": []\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\"\r\n ],\r\n \"resourceGuid\": \"b9fcf087-dfbb-4313-8b2f-20c15e085942\"\r\n },\r\n \"systemData\": {\r\n \"createdBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"createdByType\": \"Application\",\r\n \"createdAt\": \"2022-03-25T22:30:58.0890643Z\",\r\n \"lastModifiedBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"lastModifiedByType\": \"Application\",\r\n \"lastModifiedAt\": \"2022-03-25T22:30:58.0890643Z\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzNTMyNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ]\r\n },\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\",\r\n \"SecurityAdmin\"\r\n ]\r\n },\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327\",\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {}\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d694603c-7795-4b20-b0c2-8134423267a1" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.700.22.11601", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.2" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "519" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Server": [ + "Kestrel" + ], + "x-ms-request-id": [ + "02c9d59a-e0b3-4d3f-96f6-c28d0b2e1b20" ], "x-ms-correlation-request-id": [ - "9439c94d-8c74-4df6-9606-f4073f67f37f" + "02c9d59a-e0b3-4d3f-96f6-c28d0b2e1b20" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214745Z:9439c94d-8c74-4df6-9606-f4073f67f37f" + "WESTUS:20220325T223124Z:02c9d59a-e0b3-4d3f-96f6-c28d0b2e1b20" ], "X-Content-Type-Options": [ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:47:45 GMT" + "Fri, 25 Mar 2022 22:31:23 GMT" ], "Content-Length": [ - "816" + "857" ], "Content-Type": [ "application/json; charset=utf-8" @@ -255,26 +387,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"name\": \"ps3847\",\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449/providers/Microsoft.Network/networkManagers/ps3847\",\r\n \"location\": \"centraluseuap\",\r\n \"type\": \"Microsoft.Network/networkManagers\",\r\n \"tags\": {},\r\n \"etag\": \"\",\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ]\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\"\r\n ],\r\n \"resourceGuid\": \"c8375c84-777d-4683-8c67-fcb1479a2614\"\r\n },\r\n \"systemData\": {\r\n \"createdBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"createdByType\": \"Application\",\r\n \"createdAt\": \"2021-10-18T21:47:40.635446Z\",\r\n \"lastModifiedBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"lastModifiedByType\": \"Application\",\r\n \"lastModifiedAt\": \"2021-10-18T21:47:40.635446Z\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"name\": \"ps5327\",\r\n \"id\": \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327\",\r\n \"location\": \"centraluseuap\",\r\n \"type\": \"Microsoft.Network/networkManagers\",\r\n \"tags\": {},\r\n \"etag\": \"\",\r\n \"properties\": {\r\n \"displayName\": \"\",\r\n \"description\": \"\",\r\n \"networkManagerScopes\": {\r\n \"managementGroups\": [],\r\n \"subscriptions\": [\r\n \"/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52\"\r\n ],\r\n \"multiTenantScopes\": []\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n \"networkManagerScopeAccesses\": [\r\n \"Connectivity\",\r\n \"SecurityAdmin\"\r\n ],\r\n \"resourceGuid\": \"b9fcf087-dfbb-4313-8b2f-20c15e085942\"\r\n },\r\n \"systemData\": {\r\n \"createdBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"createdByType\": \"Application\",\r\n \"createdAt\": \"2022-03-25T22:30:58.0890643Z\",\r\n \"lastModifiedBy\": \"3d35ae98-0bbc-4e0d-89b7-a926b109b6da\",\r\n \"lastModifiedByType\": \"Application\",\r\n \"lastModifiedAt\": \"2022-03-25T22:31:22.5113704Z\"\r\n }\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps3449/providers/Microsoft.Network/networkManagers/ps3847?api-version=2021-02-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMzQ0OS9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzMzg0Nz9hcGktdmVyc2lvbj0yMDIxLTAyLTAxLXByZXZpZXc=", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourceGroups/ps2054/providers/Microsoft.Network/networkManagers/ps5327?api-version=2021-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlR3JvdXBzL3BzMjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvbmV0d29ya01hbmFnZXJzL3BzNTMyNz9hcGktdmVyc2lvbj0yMDIxLTA1LTAxLXByZXZpZXc=", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "46ea2b80-0b3f-45a9-b0cf-d67f014c811a" + "c9e4756a-6f7b-4e41-8d26-cf26482d6c7a" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.1" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Network.NetworkManagementClient/20.6.1.0.Beta.2" ] }, "ResponseHeaders": { @@ -294,19 +426,19 @@ "14999" ], "x-ms-request-id": [ - "8f62f211-f1fc-4a9b-84eb-dd9a12f07be4" + "cdb8e056-c96e-435f-aee2-846495fc9f85" ], "x-ms-correlation-request-id": [ - "8f62f211-f1fc-4a9b-84eb-dd9a12f07be4" + "cdb8e056-c96e-435f-aee2-846495fc9f85" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214748Z:8f62f211-f1fc-4a9b-84eb-dd9a12f07be4" + "WESTUS:20220325T223133Z:cdb8e056-c96e-435f-aee2-846495fc9f85" ], "X-Content-Type-Options": [ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:47:48 GMT" + "Fri, 25 Mar 2022 22:31:33 GMT" ], "Expires": [ "-1" @@ -319,22 +451,22 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourcegroups/ps3449?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlZ3JvdXBzL3BzMzQ0OT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/resourcegroups/ps2054?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL3Jlc291cmNlZ3JvdXBzL3BzMjA1ND9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "559f0b64-c9b6-4b13-8872-6ad37b03552b" + "e2c304ed-1876-4095-80b2-093aa2fc32df" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.47" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.56" ] }, "ResponseHeaders": { @@ -345,7 +477,7 @@ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzM0NDktQ0VOVFJBTFVTRVVBUCIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzZXVhcCJ9?api-version=2016-09-01" + "https://management.azure.com/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzIwNTQtQ0VOVFJBTFVTRVVBUCIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzZXVhcCJ9?api-version=2016-09-01" ], "Retry-After": [ "15" @@ -354,13 +486,13 @@ "14999" ], "x-ms-request-id": [ - "c516b4d3-96eb-483d-a9b1-e088fe075ddc" + "ce33bd3f-d61c-464d-9ad7-f5a3653b1e92" ], "x-ms-correlation-request-id": [ - "c516b4d3-96eb-483d-a9b1-e088fe075ddc" + "ce33bd3f-d61c-464d-9ad7-f5a3653b1e92" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214749Z:c516b4d3-96eb-483d-a9b1-e088fe075ddc" + "WESTUS:20220325T223134Z:ce33bd3f-d61c-464d-9ad7-f5a3653b1e92" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -369,7 +501,7 @@ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:47:48 GMT" + "Fri, 25 Mar 2022 22:31:34 GMT" ], "Expires": [ "-1" @@ -382,16 +514,16 @@ "StatusCode": 202 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzM0NDktQ0VOVFJBTFVTRVVBUCIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzZXVhcCJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpNME5Ea3RRMFZPVkZKQlRGVlRSVlZCVUNJc0ltcHZZa3h2WTJGMGFXOXVJam9pWTJWdWRISmhiSFZ6WlhWaGNDSjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzIwNTQtQ0VOVFJBTFVTRVVBUCIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzZXVhcCJ9?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpJd05UUXRRMFZPVkZKQlRGVlRSVlZCVUNJc0ltcHZZa3h2WTJGMGFXOXVJam9pWTJWdWRISmhiSFZ6WlhWaGNDSjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.47" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.56" ] }, "ResponseHeaders": { @@ -405,13 +537,13 @@ "11999" ], "x-ms-request-id": [ - "e95ba3c7-4f56-4bac-8265-0c7e3d301fa8" + "fc4d54a8-cc9e-4363-8771-e253ccc47948" ], "x-ms-correlation-request-id": [ - "e95ba3c7-4f56-4bac-8265-0c7e3d301fa8" + "fc4d54a8-cc9e-4363-8771-e253ccc47948" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214804Z:e95ba3c7-4f56-4bac-8265-0c7e3d301fa8" + "WESTUS:20220325T223150Z:fc4d54a8-cc9e-4363-8771-e253ccc47948" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -420,7 +552,7 @@ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:48:03 GMT" + "Fri, 25 Mar 2022 22:31:49 GMT" ], "Expires": [ "-1" @@ -433,16 +565,16 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzM0NDktQ0VOVFJBTFVTRVVBUCIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzZXVhcCJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpNME5Ea3RRMFZPVkZKQlRGVlRSVlZCVUNJc0ltcHZZa3h2WTJGMGFXOXVJam9pWTJWdWRISmhiSFZ6WlhWaGNDSjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestUri": "/subscriptions/08615b4b-bc9c-4a70-be1b-2ea10bc97b52/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QUzIwNTQtQ0VOVFJBTFVTRVVBUCIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzZXVhcCJ9?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMDg2MTViNGItYmM5Yy00YTcwLWJlMWItMmVhMTBiYzk3YjUyL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVXpJd05UUXRRMFZPVkZKQlRGVlRSVlZCVUNJc0ltcHZZa3h2WTJGMGFXOXVJam9pWTJWdWRISmhiSFZ6WlhWaGNDSjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.30411.01", + "FxVersion/4.700.22.11601", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.47" + "OSVersion/Microsoft.Windows.10.0.19044", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.56" ] }, "ResponseHeaders": { @@ -456,13 +588,13 @@ "11998" ], "x-ms-request-id": [ - "90ca6ac9-72e6-4149-8025-75f3a3d4abac" + "d4b691a9-8db5-465b-a7ef-17323ad15bf6" ], "x-ms-correlation-request-id": [ - "90ca6ac9-72e6-4149-8025-75f3a3d4abac" + "d4b691a9-8db5-465b-a7ef-17323ad15bf6" ], "x-ms-routing-request-id": [ - "WESTCENTRALUS:20211018T214805Z:90ca6ac9-72e6-4149-8025-75f3a3d4abac" + "WESTUS:20220325T223150Z:d4b691a9-8db5-465b-a7ef-17323ad15bf6" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -471,7 +603,7 @@ "nosniff" ], "Date": [ - "Mon, 18 Oct 2021 21:48:04 GMT" + "Fri, 25 Mar 2022 22:31:49 GMT" ], "Expires": [ "-1" @@ -486,8 +618,8 @@ ], "Names": { "Test-NetworkManagerCRUD": [ - "ps3449", - "ps3847" + "ps2054", + "ps5327" ] }, "Variables": { diff --git a/src/Network/Network/Az.Network.psd1 b/src/Network/Network/Az.Network.psd1 index f1d50761ea0c..d6454afb5690 100644 --- a/src/Network/Network/Az.Network.psd1 +++ b/src/Network/Network/Az.Network.psd1 @@ -550,7 +550,7 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate', 'Remove-AzVirtualHubBgpConnection', 'New-AzPrivateEndpointIpConfiguration', 'Update-AzVirtualHubBgpConnection', 'Get-AzNetworkManager', - 'New-AzNetworkManager', 'Remove-AzNetworkManager', + 'New-AzNetworkManager', 'Remove-AzNetworkManager', 'Set-AzNetworkManager', 'Get-AzNetworkManagerGroup', 'New-AzNetworkManagerGroup', 'Remove-AzNetworkManagerGroup', 'Set-AzNetworkManagerGroup', 'Get-AzNetworkManagerConnectivityConfiguration', diff --git a/src/Network/Network/ChangeLog.md b/src/Network/Network/ChangeLog.md index 7a71f7a8179b..d3d2dbb01def 100644 --- a/src/Network/Network/ChangeLog.md +++ b/src/Network/Network/ChangeLog.md @@ -22,7 +22,8 @@ * Onboard Azure Virtual Network Manager Cmdlets for preview - `Get-AzNetworkManager` - `New-AzNetworkManager` - - `Remove-AzNetworkManager` + - `Remove-AzNetworkManager` + - `Set-AzNetworkManager` - `Get-AzNetworkManagerGroup` - `New-AzNetworkManagerGroup` - `Remove-AzNetworkManagerGroup` diff --git a/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs b/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs new file mode 100644 index 000000000000..1380c62bf12b --- /dev/null +++ b/src/Network/Network/NetworkManager/SetAzNetworkManagerCommand.cs @@ -0,0 +1,68 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using AutoMapper; +using Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Commands.Network.Models.NetworkManager; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; +using Microsoft.Azure.Management.Network; +using System; +using System.Management.Automation; +using MNM = Microsoft.Azure.Management.Network.Models; + +namespace Microsoft.Azure.Commands.Network +{ + [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "NetworkManager", SupportsShouldProcess = true), OutputType(typeof(PSNetworkManager))] + public class SetAzNetworkManagerCommand : NetworkManagerBaseCmdlet + { + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public virtual string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipeline = true, + HelpMessage = "The Network Manager")] + public PSNetworkManager NetworkManager { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void Execute() + { + if (this.ShouldProcess(this.NetworkManager.Name, VerbsLifecycle.Restart)) + { + base.Execute(); + + if (!this.IsNetworkManagerPresent(this.ResourceGroupName, this.NetworkManager.Name)) + { + throw new ArgumentException(string.Format(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound, this.NetworkManager.Name)); + } + + // Map to the sdk object + var networkManagerModel = NetworkResourceManagerProfile.Mapper.Map(this.NetworkManager); + + // Execute the PUT NetworkManagerGroup call + var networkManagerResponse = this.NetworkManagerClient.CreateOrUpdate(networkManagerModel, this.ResourceGroupName, this.NetworkManager.Name); + var psNetworkManager = this.ToPsNetworkManager(networkManagerResponse); + WriteObject(psNetworkManager); + } + } + } +} diff --git a/src/Network/Network/help/Set-AzNetworkManager.md b/src/Network/Network/help/Set-AzNetworkManager.md new file mode 100644 index 000000000000..0744036bf2cd --- /dev/null +++ b/src/Network/Network/help/Set-AzNetworkManager.md @@ -0,0 +1,176 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml +Module Name: Az.Network +online version: https://docs.microsoft.com/powershell/module/az.network/set-aznetworkmanager +schema: 2.0.0 +--- + +# Set-AzNetworkManager + +## SYNOPSIS +Updates a network manager. + +## SYNTAX + +``` +Set-AzNetworkManager -ResourceGroupName -NetworkManager [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Set-AzNetworkManager** cmdlet updates a network manager. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> $networkManager = Get-AzNetworkManager -ResourceGroupName "TestResourceGroup" -Name "TestNM" +PS C:\> $networkManager.Description = "Sample Description" +PS C:\> Set-AzNetworkManager -ResourceGroupName "TestResourceGroup" -NetworkManager $networkManager + +DisplayName : +Description : Sample Description +Location : eastus2euap +Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestResourceGroup/provider + s/Microsoft.Network/networkManagers/TestNM +Type : Microsoft.Network/networkManagers +Tag : {} +ProvisioningState : Succeeded +NetworkManagerScopeAccesses : [ + "SecurityAdmin", + "SecurityUser" + ] +NetworkManagerScopes : { + "ManagementGroups": [], + "Subscriptions": [ + "/subscriptions/00000000-0000-0000-0000-000000000000" + ] + } +SystemData : { + "CreatedBy": "user@microsoft.com", + "CreatedByType": "User", + "CreatedAt": "2021-10-05T04:15:42", + "LastModifiedBy": "user@microsoft.com", + "LastModifiedByType": "User", + "LastModifiedAt": "2021-10-05T04:15:42" + } +Name : TestNM +Etag : W/"00000000-0000-0000-0000-000000000000" +``` +Example to update the description of a network manager TestNM + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkManager +The Network Manager + +```yaml +Type: PSNetworkManager +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManager + +## OUTPUTS + +### Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManager + +## NOTES + +## RELATED LINKS + +[New-AzNetworkManager](./New-AzNetworkManager.md) + +[Get-AzNetworkManager](./Get-AzNetworkManager.md) + +[Remove-AzNetworkManager](./Remove-AzNetworkManager.md) \ No newline at end of file