diff --git a/TestMappings.json b/TestMappings.json index 947a42f1e382..8b4b74c24515 100644 --- a/TestMappings.json +++ b/TestMappings.json @@ -105,6 +105,9 @@ ".\\src\\ResourceManager\\MarketplaceOrdering\\Commands.MarketplaceOrdering.Test\\bin\\Debug\\Microsoft.Azure.Commands.MarketplaceOrdering.Test.dll" ], "src/ResourceManager/Media/": [], + "src/ResourceManager/ManagementGroups/": [ + ".\\src\\ResourceManager\\ManagementGroups\\Commands.ManagementGroups.Test\\bin\\Debug\\Microsoft.Azure.Commands.ManagementGroups.Test.dll" + ], "src/ResourceManager/Network/": [ ".\\src\\ResourceManager\\Compute\\Commands.Compute.Test\\bin\\Debug\\Microsoft.Azure.Commands.Compute.Test.dll", ".\\src\\ResourceManager\\Network\\Commands.Network.Test\\bin\\Debug\\Microsoft.Azure.Commands.Network.Test.dll", diff --git a/src/ResourceManager/EventHub/Commands.EventHub/help/Get-AzureRmEventHubGeoDRConfiguration.md b/src/ResourceManager/EventHub/Commands.EventHub/help/Get-AzureRmEventHubGeoDRConfiguration.md index 6c0d161e0859..f80b01928bbc 100644 --- a/src/ResourceManager/EventHub/Commands.EventHub/help/Get-AzureRmEventHubGeoDRConfiguration.md +++ b/src/ResourceManager/EventHub/Commands.EventHub/help/Get-AzureRmEventHubGeoDRConfiguration.md @@ -11,7 +11,6 @@ schema: 2.0.0 Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace ## SYNTAX - ### GeoDRParameterSet (Default) ``` Get-AzureRmEventHubGeoDRConfiguration [-ResourceGroupName] [-Namespace] [-Name ] diff --git a/src/ResourceManager/ManagementGroups/AzureRM.ManagementGroups.psd1 b/src/ResourceManager/ManagementGroups/AzureRM.ManagementGroups.psd1 new file mode 100644 index 000000000000..e045f12da936 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/AzureRM.ManagementGroups.psd1 @@ -0,0 +1,128 @@ +# +# Module manifest for module 'PSGet_AzureRM.ManagementGroups' +# +# Generated by: Microsoft Corporation +# +# Generated on: 11/3/2017 +# + +@{ + +# Script module or binary module file associated with this manifest. +# RootModule = '' + +# Version number of this module. +ModuleVersion = '0.0.1' + +# Supported PSEditions +# CompatiblePSEditions = @() + +# ID used to uniquely identify this module +GUID = 'e903bf84-9519-4ff8-a1bf-83f6d2761b84' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - GroupsRP cmdlets for Azure Resource Manager' + +# Minimum version of the Windows PowerShell engine required by this module +PowerShellVersion = '3.0' + +# Name of the Windows PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the Windows PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.5.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +CLRVersion = '4.0' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.3.0'; }) + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = '.\Microsoft.Azure.Management.ManagementGroups.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = '.\Microsoft.Azure.Commands.ManagementGroups.Format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @('.\Microsoft.Azure.Commands.ManagementGroups.dll') + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Get-AzureRmManagementGroup', 'New-AzureRmManagementGroup', 'Update-AzureRmManagementGroup', 'Remove-AzureRmManagementGroup', 'New-AzureRmManagementGroupSubscription', 'Remove-AzureRmManagementGroupSubscription' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = @() + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','GroupsRP', 'Management', 'Management Groups' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = 'First Preview Release of MangementGroups Powershell' + + # External dependent modules of this module + # ExternalModuleDependencies = '' + + Prerelease = 'preview' + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/Commands.ManagementGroups.Test.csproj b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/Commands.ManagementGroups.Test.csproj new file mode 100644 index 000000000000..7452e9779679 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/Commands.ManagementGroups.Test.csproj @@ -0,0 +1,276 @@ + + + + + + + Debug + AnyCPU + {B0671436-C487-4CD4-AF06-28B4BE57D9E6} + Library + Properties + Microsoft.Azure.Commands.ManagementGroups.Test + Microsoft.Azure.Commands.ManagementGroups.Test + v4.5.2 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\Hyak.Common.1.0.3\lib\net45\Hyak.Common.dll + True + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + True + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + True + + + ..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll + True + + + ..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll + True + + + ..\..\..\packages\Microsoft.Azure.Management.ManagementGroups.1.0.0-preview\lib\net452\Microsoft.Azure.Management.ManagementGroups.dll + True + + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + True + + + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6179.26854-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + True + + + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.8.1\lib\net452\Microsoft.Azure.Test.HttpRecorder.dll + True + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + True + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.5.1-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll + True + + + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + True + + + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + True + + + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + True + + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll + True + + + ..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + True + + + + + False + C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + ..\..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\..\..\packages\Microsoft.Net.Http.2.2.22\lib\net45\System.Net.Http.Primitives.dll + True + + + + + + + + + + ..\..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll + True + + + ..\..\..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll + True + + + ..\..\..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll + True + + + ..\..\..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll + True + + + + + + + + + + + + + + {70527617-7598-4aef-b5bd-db9186b8184b} + Commands.Common.Authentication.Abstractions + + + {d3804b64-c0d3-48f8-82ec-1f632f833c9e} + Commands.Common.Authentication + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {3819d8a7-c62c-4c47-8ddd-0332d9ce1252} + Commands.ResourceManager.Common + + + {3436a126-edc9-4060-8952-9a1be34cdd95} + Commands.ScenarioTests.ResourceManager.Common + + + {8058d403-06e3-4bed-8924-d166ce303961} + Commands.Resources.Rest + + + {119c7b00-03e7-481d-a74f-cf6ce3920cb8} + Commands.ManagementGroups + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..688eea1b78b5 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Commands.ManagementGroups.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Commands.ManagementGroups.Test")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b0671436-c487-4cd4-af06-28b4be57d9e6")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.1")] +[assembly: AssemblyFileVersion("0.0.1")] diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GetAzureRmManagementGroupTests.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GetAzureRmManagementGroupTests.cs new file mode 100644 index 000000000000..005da4fdf65a --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GetAzureRmManagementGroupTests.cs @@ -0,0 +1,54 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Commands.ManagementGroups.Test.ScenarioTests +{ + public class GetAzureRmManagementGroupTests + { + private readonly Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger; + + public GetAzureRmManagementGroupTests(Xunit.Abstractions.ITestOutputHelper output) + { + _logger = new Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor(output); + Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger); + TestExecutionHelpers.SetUpSessionAndProfile(); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetManagementGroup() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-GetManagementGroup"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetManagementGroupWithExpand() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-GetManagementGroupWithExpand"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetManagementGroupWithExpandAndRecurse() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-GetManagementGroupWithExpandAndRecurse"); + } + + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GetAzureRmManagementGroupTests.ps1 b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GetAzureRmManagementGroupTests.ps1 new file mode 100644 index 000000000000..42b682eb0b16 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GetAzureRmManagementGroupTests.ps1 @@ -0,0 +1,128 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Test Get-AzureRmManagementGroup +#> + +function Test-GetManagementGroup +{ + New-AzureRmManagementGroup -GroupName TestPSGetGroup1 + New-AzureRmManagementGroup -GroupName TestPSGetGroup2 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1" + + $response = Get-AzureRmManagementGroup -GroupName TestPSGetGroup2 + + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup2 + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup1 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2" + $expectedName = "TestPSGetGroup2" + $expectedDisplayName = "TestPSGetGroup2" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1" + $expectedParentDisplayName = "TestPSGetGroup1" + + Assert-NotNull $response + Assert-Null $response.Children + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName +} + +function Test-GetManagementGroupWithExpand +{ + New-AzureRmManagementGroup -GroupName TestPSGetGroup1 + New-AzureRmManagementGroup -GroupName TestPSGetGroup2 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1" + New-AzureRmManagementGroup -GroupName TestPSGetGroup3 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2" + + $response = Get-AzureRmManagementGroup -GroupName TestPSGetGroup2 -Expand + + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup3 + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup2 + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup1 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2" + $expectedName = "TestPSGetGroup2" + $expectedDisplayName = "TestPSGetGroup2" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1" + $expectedParentDisplayName = "TestPSGetGroup1" + + $expectedChild0Id = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3" + $expectedChild0DisplayName = "TestPSGetGroup3" + + + Assert-NotNull $response + Assert-NotNull $response.Children + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName + + Assert-AreEqual $response.Children[0].ChildId $expectedChild0Id + Assert-AreEqual $response.Children[0].DisplayName $expectedChild0DisplayName +} + +function Test-GetManagementGroupWithExpandAndRecurse +{ + New-AzureRmManagementGroup -GroupName TestPSGetGroup1 + New-AzureRmManagementGroup -GroupName TestPSGetGroup2 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1" + New-AzureRmManagementGroup -GroupName TestPSGetGroup3 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2" + New-AzureRmManagementGroup -GroupName TestPSGetGroup4 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3" + + $response = Get-AzureRmManagementGroup -GroupName TestPSGetGroup2 -Expand -Recurse + + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup4 + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup3 + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup2 + Remove-AzureRmManagementGroup -GroupName TestPSGetGroup1 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2" + $expectedName = "TestPSGetGroup2" + $expectedDisplayName = "TestPSGetGroup2" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1" + $expectedParentDisplayName = "TestPSGetGroup1" + + $expectedChild0Id = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3" + $expectedChild0DisplayName = "TestPSGetGroup3" + + $expectedChild0Child0Id = "/providers/Microsoft.Management/managementGroups/TestPSGetGroup4" + $expectedChild0Child0DisplayName = "TestPSGetGroup4" + + + Assert-NotNull $response + Assert-NotNull $response.Children + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName + + Assert-AreEqual $response.Children[0].ChildId $expectedChild0Id + Assert-AreEqual $response.Children[0].DisplayName $expectedChild0DisplayName + + Assert-AreEqual $response.Children[0].Children[0].ChildId $expectedChild0Child0Id + Assert-AreEqual $response.Children[0].Children[0].DisplayName $expectedChild0Child0DisplayName +} + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GroupSubscriptionOperationsTests.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GroupSubscriptionOperationsTests.cs new file mode 100644 index 000000000000..c1b45dcd83f3 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GroupSubscriptionOperationsTests.cs @@ -0,0 +1,39 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Commands.ManagementGroups.Test.ScenarioTests +{ + public class GroupSubscriptionOperationsTests + { + private readonly Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger; + + public GroupSubscriptionOperationsTests(Xunit.Abstractions.ITestOutputHelper output) + { + _logger = new Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor(output); + Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger); + TestExecutionHelpers.SetUpSessionAndProfile(); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestNewRemoveManagementGroupSubscription() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-NewRemoveManagementGroupSubscription"); + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GroupSubscriptionOperationsTests.ps1 b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GroupSubscriptionOperationsTests.ps1 new file mode 100644 index 000000000000..1b29fbe6f25c --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/GroupSubscriptionOperationsTests.ps1 @@ -0,0 +1,31 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Test GroupSubscriptionOperations +#> + +function Test-NewRemoveManagementGroupSubscription +{ + New-AzureRmManagementGroup -GroupName TestSubGroup + + $response1 = New-AzureRmManagementGroupSubscription -GroupName TestSubGroup -SubscriptionId 8158c3e6-0c47-4d68-af4c-d521343aa3f8 + $response2 = Remove-AzureRmManagementGroupSubscription -GroupName TestSubGroup -SubscriptionId 8158c3e6-0c47-4d68-af4c-d521343aa3f8 + + Remove-AzureRmManagementGroup -GroupName TestSubGroup + + Assert-Null $response1 + Assert-Null $response2 +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/NewAzureRmManagementGroupTests.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/NewAzureRmManagementGroupTests.cs new file mode 100644 index 000000000000..102daf48bb4a --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/NewAzureRmManagementGroupTests.cs @@ -0,0 +1,60 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Commands.ManagementGroups.Test.ScenarioTests +{ + public class NewAzureRmManagementGroupTests + { + private readonly Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger; + + public NewAzureRmManagementGroupTests(Xunit.Abstractions.ITestOutputHelper output) + { + _logger = new Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor(output); + Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger); + TestExecutionHelpers.SetUpSessionAndProfile(); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestNewManagementGroup() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-NewManagementGroup"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestNewManagementGroupWithDisplayName() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-NewManagementGroupWithDisplayName"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestNewManagementGroupWithParentId() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-NewManagementGroupWithParentId"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestNewManagementGroupWithDisplayNameAndParentId() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-NewManagementGroupWithDisplayNameAndParentId"); + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/NewAzureRmManagementGroupTests.ps1 b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/NewAzureRmManagementGroupTests.ps1 new file mode 100644 index 000000000000..c1557e7cb4ca --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/NewAzureRmManagementGroupTests.ps1 @@ -0,0 +1,100 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Test New-AzureRmManagementGroup +#> + +function Test-NewManagementGroup +{ + $response = New-AzureRmManagementGroup -GroupName TestPSNewGroup + Remove-AzureRmManagementGroup -GroupName TestPSNewGroup + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSNewGroup" + $expectedName = "TestPSNewGroup" + $expectedDisplayName = "TestPSNewGroup" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-NotNull $response.ParentId + Assert-NotNull $response.ParentDisplayName + +} + +function Test-NewManagementGroupWithDisplayName +{ + $response = New-AzureRmManagementGroup -GroupName TestPSNewGroup2 -DisplayName TestDisplayName + Remove-AzureRmManagementGroup -GroupName TestPSNewGroup2 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSNewGroup2" + $expectedName = "TestPSNewGroup2" + $expectedDisplayName = "TestDisplayName" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-NotNull $response.ParentId + Assert-NotNull $response.ParentDisplayName +} + +function Test-NewManagementGroupWithParentId +{ + New-AzureRmManagementGroup -GroupName TestParent5 + $response = New-AzureRmManagementGroup -GroupName TestPSNewGroup5 -ParentId /providers/Microsoft.Management/managementGroups/TestParent5 + Remove-AzureRmManagementGroup -GroupName TestPSNewGroup5 + Remove-AzureRmManagementGroup -GroupName TestParent5 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSNewGroup5" + $expectedName = "TestPSNewGroup5" + $expectedDisplayName = "TestPSNewGroup5" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestParent5" + $expectedParentDisplayName = "TestParent5" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName +} + +function Test-NewManagementGroupWithDisplayNameAndParentId +{ + New-AzureRmManagementGroup -GroupName TestParent4 + $response = New-AzureRmManagementGroup -GroupName TestPSGroup4 -DisplayName TestDisplayName -ParentId /providers/Microsoft.Management/managementGroups/TestParent4 + Remove-AzureRmManagementGroup -GroupName TestPSGroup4 + Remove-AzureRmManagementGroup -GroupName TestParent4 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSGroup4" + $expectedName = "TestPSGroup4" + $expectedDisplayName = "TestDisplayName" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestParent4" + $expectedParentDisplayName = "TestParent4" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName +} + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/RemoveAzureRmManagementGroupTests.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/RemoveAzureRmManagementGroupTests.cs new file mode 100644 index 000000000000..ba66013d2a38 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/RemoveAzureRmManagementGroupTests.cs @@ -0,0 +1,39 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Commands.ManagementGroups.Test.ScenarioTests +{ + public class RemoveAzureRmManagementGroupTests + { + private readonly Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger; + + public RemoveAzureRmManagementGroupTests(Xunit.Abstractions.ITestOutputHelper output) + { + _logger = new Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor(output); + Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger); + TestExecutionHelpers.SetUpSessionAndProfile(); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestRemoveManagementGroup() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-RemoveManagementGroup"); + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/RemoveAzureRmManagementGroupTests.ps1 b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/RemoveAzureRmManagementGroupTests.ps1 new file mode 100644 index 000000000000..2f92a4233d8f --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/RemoveAzureRmManagementGroupTests.ps1 @@ -0,0 +1,27 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Test Remove-AzureRmManagementGroup +#> + +function Test-RemoveManagementGroup +{ + New-AzureRmManagementGroup -GroupName TestPSRemoveGroup + $response = Remove-AzureRmManagementGroup -GroupName TestPSRemoveGroup + + Assert-Null $response +} + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/TestController.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/TestController.cs new file mode 100644 index 000000000000..adca4ddd164d --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/TestController.cs @@ -0,0 +1,187 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.Azure.Commands.Common.Authentication; +using Microsoft.Azure.Gallery; +using Microsoft.Azure.Management.Authorization; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Test; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; +using ResourceManagementClient = Microsoft.Azure.Management.Resources.ResourceManagementClient; +using SubscriptionClient = Microsoft.Azure.Subscriptions.SubscriptionClient; +using TestBase = Microsoft.Azure.Test.TestBase; +using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory; +using TestUtilities = Microsoft.Azure.Test.TestUtilities; + +namespace Commands.ManagementGroups.Test.ScenarioTests +{ + public class TestController : RMTestBase + { + private CSMTestEnvironmentFactory _csmTestFactory; + + private readonly EnvironmentSetupHelper _helper; + + public Microsoft.Azure.Management.Resources.ResourceManagementClient ResourceManagementClient { get; private set; } + + public Microsoft.Azure.Subscriptions.SubscriptionClient SubscriptionClient { get; private set; } + + public GalleryClient GalleryClient { get; private set; } + + public AuthorizationManagementClient AuthorizationManagementClient { get; private set; } + + public ManagementGroupsAPIClient ManagementGroupsApiClient { get; private set; } + + public static TestController NewInstance + { + get + { + return new TestController(); + } + } + + protected TestController() + { + _helper = new EnvironmentSetupHelper(); + } + + protected void SetupManagementClients(MockContext context) + { + ResourceManagementClient = GetResourceManagementClient(); + SubscriptionClient = GetSubscriptionClient(); + GalleryClient = GetGalleryClient(); + AuthorizationManagementClient = GetAuthorizationManagementClient(); + ManagementGroupsApiClient = GetManagementGroupsApiClient(context); + + _helper.SetupManagementClients( + ManagementGroupsApiClient, + ResourceManagementClient, + SubscriptionClient, + GalleryClient, + AuthorizationManagementClient); + } + + public void RunPowerShellTest(Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts) + { + var callingClassType = TestUtilities.GetCallingClass(2); + var mockName = TestUtilities.GetCurrentMethodName(2); + + _helper.TracingInterceptor = logger; + RunPsTestWorkflow( + () => scripts, + // no custom initializer + null, + // no custom cleanup + null, + callingClassType, + mockName); + } + + public void RunPsTestWorkflow( + Func scriptBuilder, + Action initialize, + Action cleanup, + string callingClassType, + string mockName) + { + + var providers = new Dictionary(); + providers.Add("Microsoft.Resources", null); + providers.Add("Microsoft.Features", null); + providers.Add("Microsoft.Authorization", null); + providers.Add("Microsoft.Compute", null); + + var providersToIgnore = new Dictionary(); + providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01"); + HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, providers, providersToIgnore); + + HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords"); + + using (var context = MockContext.Start(callingClassType, mockName)) + { + + _csmTestFactory = new CSMTestEnvironmentFactory(); + + if (initialize != null) + { + initialize(_csmTestFactory); + } + + SetupManagementClients(context); + + _helper.SetupEnvironment(AzureModule.AzureResourceManager); + + var callingClassName = callingClassType + .Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries) + .Last(); + + _helper.SetupModules(AzureModule.AzureResourceManager, + _helper.RMProfileModule, + @"AzureRM.ManagementGroups.psd1", + "ScenarioTests\\" + callingClassName + ".ps1"); + try + { + if (scriptBuilder != null) + { + var psScripts = scriptBuilder(); + + if (psScripts != null) + { + _helper.RunPowerShellTest(psScripts); + } + } + } + finally + { + if (cleanup != null) + { + cleanup(); + } + } + } + } + + + protected ResourceManagementClient GetResourceManagementClient() + { + return TestBase.GetServiceClient(_csmTestFactory); + } + + protected AuthorizationManagementClient GetAuthorizationManagementClient() + { + return TestBase.GetServiceClient(_csmTestFactory); + } + + protected SubscriptionClient GetSubscriptionClient() + { + return TestBase.GetServiceClient(_csmTestFactory); + } + + protected GalleryClient GetGalleryClient() + { + return TestBase.GetServiceClient(_csmTestFactory); + } + + protected ManagementGroupsAPIClient GetManagementGroupsApiClient(MockContext context) + { + return context.GetServiceClient(TestEnvironmentFactory.GetTestEnvironment()); + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/UpdateAzureRmManagementGroupTests.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/UpdateAzureRmManagementGroupTests.cs new file mode 100644 index 000000000000..baaa8ae7bc49 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/UpdateAzureRmManagementGroupTests.cs @@ -0,0 +1,53 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Commands.ManagementGroups.Test.ScenarioTests +{ + public class UpdateAzureRmManagementGroupTests + { + private readonly Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger; + + public UpdateAzureRmManagementGroupTests(Xunit.Abstractions.ITestOutputHelper output) + { + _logger = new Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor(output); + Microsoft.Azure.ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger); + TestExecutionHelpers.SetUpSessionAndProfile(); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestUpdateManagementGroupWithDisplayName() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-UpdateManagementGroupWithDisplayName"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestUpdateManagementGroupWithParentId() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-UpdateManagementGroupWithParentId"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestUpdateManagementGroupWithDisplayNameAndParentId() + { + TestController.NewInstance.RunPowerShellTest(_logger, @"Test-UpdateManagementGroupWithDisplayNameAndParentId"); + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/UpdateAzureRmManagementGroupTests.ps1 b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/UpdateAzureRmManagementGroupTests.ps1 new file mode 100644 index 000000000000..37b629c11507 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/ScenarioTests/UpdateAzureRmManagementGroupTests.ps1 @@ -0,0 +1,82 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Test Update-AzureRmManagementGroup +#> + +function Test-UpdateManagementGroupWithDisplayName +{ + New-AzureRmManagementGroup -GroupName TestPSUpdateGroup1 + $response = Update-AzureRmManagementGroup -GroupName TestPSUpdateGroup1 -DisplayName TestDisplayName + Remove-AzureRmManagementGroup -GroupName TestPSUpdateGroup1 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup1" + $expectedName = "TestPSUpdateGroup1" + $expectedDisplayName = "TestDisplayName" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName +} + +function Test-UpdateManagementGroupWithParentId +{ + New-AzureRmManagementGroup -GroupName TestPSUpdateGroupParent2 + New-AzureRmManagementGroup -GroupName TestPSUpdateGroup2 + $response = Update-AzureRmManagementGroup -GroupName TestPSUpdateGroup2 -ParentId /providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2 + Remove-AzureRmManagementGroup -GroupName TestPSUpdateGroup2 + Remove-AzureRmManagementGroup -GroupName TestPSUpdateGroupParent2 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup2" + $expectedName = "TestPSUpdateGroup2" + $expectedDisplayName = "TestPSUpdateGroup2" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2" + $expectedParentDisplayName = "TestPSUpdateGroupParent2" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName +} + +function Test-UpdateManagementGroupWithDisplayNameAndParentId +{ + New-AzureRmManagementGroup -GroupName TestPSUpdateGroupParent3 + New-AzureRmManagementGroup -GroupName TestPSUpdateGroup3 + $response = Update-AzureRmManagementGroup -GroupName TestPSUpdateGroup3 -DisplayName TestDisplayName -ParentId /providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3 + Remove-AzureRmManagementGroup -GroupName TestPSUpdateGroup3 + Remove-AzureRmManagementGroup -GroupName TestPSUpdateGroupParent3 + + $expectedType = "/providers/Microsoft.Management/managementGroups" + $expectedId = "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup3" + $expectedName = "TestPSUpdateGroup3" + $expectedDisplayName = "TestDisplayName" + $expectedParentId = "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3" + $expectedParentDisplayName = "TestPSUpdateGroupParent3" + + Assert-AreEqual $response.Type $expectedType + Assert-AreEqual $response.Id $expectedId + Assert-AreEqual $response.Name $expectedName + Assert-AreEqual $response.DisplayName $expectedDisplayName + Assert-AreEqual $response.ParentId $expectedParentId + Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName +} + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroup.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroup.json new file mode 100644 index 000000000000..b19576bd1f43 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroup.json @@ -0,0 +1,413 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "4e09a922-9401-45ce-868b-39bcd1b11507" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup1\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup1\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:53:21.8990141Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "536" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1184" + ], + "x-ms-request-id": [ + "westus:574dce14-0049-46a6-8c66-feadaf8c4fc4" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "06a7af9c-6ad4-4281-9c8a-1da85120108f" + ], + "x-ms-correlation-request-id": [ + "44ea6b17-9985-4847-bbea-04153613338e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005324Z:44ea6b17-9985-4847-bbea-04153613338e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:23 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "86" + ], + "x-ms-client-request-id": [ + "e79dedb4-0d79-42d3-8dff-1bedc939a5b6" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup2\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:53:25.7074356Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"displayName\": \"TestPSGetGroup1\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "494" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1183" + ], + "x-ms-request-id": [ + "westus:1f6e3078-f3ec-47f2-ada0-bdbee8eb8a89" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "aed9277c-3fa3-4005-a09d-eca79a810f25" + ], + "x-ms-correlation-request-id": [ + "a7aa4eb5-6b84-49db-b190-e13cb9c13622" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005327Z:a7aa4eb5-6b84-49db-b190-e13cb9c13622" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:26 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview&$recurse=false", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXcmJHJlY3Vyc2U9ZmFsc2U=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "05adbd30-28dc-46ff-8427-2e6186447d51" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup2\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:53:25.7074356Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"displayName\": \"TestPSGetGroup1\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "494" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14969" + ], + "x-ms-request-id": [ + "westus:4536d55b-1f5b-469d-95b3-c1dd547f2450" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "c1b69dc4-7d38-4fa2-b72f-d3510bb06516" + ], + "x-ms-correlation-request-id": [ + "5ab3f94c-7f08-4c01-9b38-eb6df04194f1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005327Z:5ab3f94c-7f08-4c01-9b38-eb6df04194f1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:26 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8d6ff26d-e787-4454-bc79-d68b81c853c6" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:00f6fd49-dd23-42bd-9388-ff0a3b718fc5" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "16be8239-1922-41bb-b4e6-c50c9117d314" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1182" + ], + "x-ms-correlation-request-id": [ + "f8079ce6-2110-486d-8a3b-8d12264665da" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005330Z:f8079ce6-2110-486d-8a3b-8d12264665da" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:30 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "012fbd4a-cbb1-4841-8e87-cf11be0eb5fe" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:2ab29145-9071-4b17-99ed-3686ce95542a" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "e5ea919d-d499-4250-9b05-9cb29d786e9d" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1181" + ], + "x-ms-correlation-request-id": [ + "ff9c6be8-2bf3-42f5-b073-69d11dbd0a99" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005332Z:ff9c6be8-2bf3-42f5-b073-69d11dbd0a99" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:31 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroupWithExpand.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroupWithExpand.json new file mode 100644 index 000000000000..ecc580b281ba --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroupWithExpand.json @@ -0,0 +1,575 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "57b053a0-ab32-4dfb-9b26-00f802f57530" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup1\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup1\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:53:43.0200193Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "536" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1185" + ], + "x-ms-request-id": [ + "westus:a7bc6a7b-4cca-4e7c-a389-b689d432ba4a" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "76356266-348e-4cd9-b239-9426bc512843" + ], + "x-ms-correlation-request-id": [ + "d71afa5f-a116-4b46-88f5-baeb2047a650" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005346Z:d71afa5f-a116-4b46-88f5-baeb2047a650" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:45 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "86" + ], + "x-ms-client-request-id": [ + "2f62b694-118e-4774-838c-bc43ad3b0c46" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup2\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:53:46.445194Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"displayName\": \"TestPSGetGroup1\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "493" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1184" + ], + "x-ms-request-id": [ + "westus:649520bf-722c-4995-bd8f-2d5a6000140b" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "5562a52c-efd6-4400-bcbf-0e08d76095cf" + ], + "x-ms-correlation-request-id": [ + "21d64a38-ff4c-4fcf-b07b-1429e3b57feb" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005348Z:21d64a38-ff4c-4fcf-b07b-1429e3b57feb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:47 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "86" + ], + "x-ms-client-request-id": [ + "60169652-b854-4798-b225-2c0c40ea46a3" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup3\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup3\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup3\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:53:48.7377449Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"displayName\": \"TestPSGetGroup2\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "494" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1183" + ], + "x-ms-request-id": [ + "westus:abfa9d3d-3af5-44f2-8d05-b33363a49c42" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "202e83a7-8d60-45fc-a4ae-1b808418bc14" + ], + "x-ms-correlation-request-id": [ + "8c698625-aba4-43ed-83c8-38a1a33ceef3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005350Z:8c698625-aba4-43ed-83c8-38a1a33ceef3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:49 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview&$expand=children&$recurse=false", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXcmJGV4cGFuZD1jaGlsZHJlbiYkcmVjdXJzZT1mYWxzZQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "05cc4136-ffc2-4b83-a20b-887760fa87a4" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup2\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:53:46.445194Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"displayName\": \"TestPSGetGroup1\"\r\n }\r\n },\r\n \"children\": [\r\n {\r\n \"childType\": \"/managementGroup\",\r\n \"childId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup3\",\r\n \"displayName\": \"TestPSGetGroup3\"\r\n }\r\n ]\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "648" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14965" + ], + "x-ms-request-id": [ + "westus:88b53bb5-3e7b-48c8-92da-f3f1806b34f8" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "dea58232-d787-4007-aaca-d49160a4e613" + ], + "x-ms-correlation-request-id": [ + "70f152ae-cb38-43b4-a8df-6d946096b071" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005350Z:70f152ae-cb38-43b4-a8df-6d946096b071" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:49 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1f27e203-9e2e-4653-8fa6-ee13aa993a15" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:65a875be-f254-48a0-aaa1-eb8251cbb34b" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "788a857f-2648-4faf-870c-5639a514f815" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1182" + ], + "x-ms-correlation-request-id": [ + "23aa5a79-d608-4691-a767-828dc907d430" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005352Z:23aa5a79-d608-4691-a767-828dc907d430" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:51 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "281dc23d-1c51-480d-80e5-5f8fce933d25" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:63ae92e7-1ffd-466c-a477-045f10eb1320" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "44209540-596a-4193-b221-9a010669aed5" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1181" + ], + "x-ms-correlation-request-id": [ + "696ad0fd-ab64-4989-a331-2f87cf535b51" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005354Z:696ad0fd-ab64-4989-a331-2f87cf535b51" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:54 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "82444800-1305-4624-9d0d-00946e206ee0" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:35303932-7978-4337-a68a-12142a0de1d7" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "4541e95b-6ed9-402a-9f94-f560d5bcf4a2" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1180" + ], + "x-ms-correlation-request-id": [ + "aeb26c30-e1a8-431c-be22-19cdb6e9c2f1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005356Z:aeb26c30-e1a8-431c-be22-19cdb6e9c2f1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:53:56 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroupWithExpandAndRecurse.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroupWithExpandAndRecurse.json new file mode 100644 index 000000000000..ae2ff9d90f8c --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GetAzureRmManagementGroupTests/TestGetManagementGroupWithExpandAndRecurse.json @@ -0,0 +1,737 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "ebc33598-dd0c-4f04-8495-b81464568b99" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup1\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup1\",\r\n \"details\": {\r\n \"version\": 3,\r\n \"updatedTime\": \"2018-02-14T00:54:07.8285412Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "536" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1179" + ], + "x-ms-request-id": [ + "westus:0ee9a4ef-4800-4dc3-8dbb-5e4147a0e075" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "ac237c72-824c-4790-b83d-59df7486acb6" + ], + "x-ms-correlation-request-id": [ + "360af3e5-eb87-4be1-8139-885d19a70f1c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005409Z:360af3e5-eb87-4be1-8139-885d19a70f1c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:09 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "86" + ], + "x-ms-client-request-id": [ + "64a2e6b4-45dc-4f60-95ee-c5c18e535fdc" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup2\",\r\n \"details\": {\r\n \"version\": 3,\r\n \"updatedTime\": \"2018-02-14T00:54:09.833416Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"displayName\": \"TestPSGetGroup1\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "493" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1178" + ], + "x-ms-request-id": [ + "westus:83430d32-3a5b-483f-b1ed-2cb15fa7e5d1" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "a380d1aa-c8fa-48aa-8890-b03a4db1ef72" + ], + "x-ms-correlation-request-id": [ + "4e3cae85-4510-4196-a765-d21fc8e01747" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005411Z:4e3cae85-4510-4196-a765-d21fc8e01747" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:11 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "86" + ], + "x-ms-client-request-id": [ + "d264a088-9c43-4eb6-bef1-329fe8522b24" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup3\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup3\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup3\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:54:12.1802027Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"displayName\": \"TestPSGetGroup2\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "494" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1177" + ], + "x-ms-request-id": [ + "westus:0c629ab5-24b4-46d8-8592-7a5ad657b2fd" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "e6b93439-708c-4e2b-b9d2-cac7d6fd4c1e" + ], + "x-ms-correlation-request-id": [ + "ee7d90cf-4854-407e-9bb4-4c415c36745f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005414Z:ee7d90cf-4854-407e-9bb4-4c415c36745f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:13 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup4?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwND9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup3\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "86" + ], + "x-ms-client-request-id": [ + "4ad11d6b-6a5f-4471-9dca-4dc817cc241b" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup4\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup4\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup4\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:54:14.5003156Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup3\",\r\n \"displayName\": \"TestPSGetGroup3\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "494" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1176" + ], + "x-ms-request-id": [ + "westus:ffa3b2f2-d6fb-45d4-999c-51a4884fe95f" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "9d073d4b-eba5-4c60-a3a0-a1d60663f9d3" + ], + "x-ms-correlation-request-id": [ + "f1381840-4c55-4e54-b810-5e614609a38b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005416Z:f1381840-4c55-4e54-b810-5e614609a38b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:16 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview&$expand=children&$recurse=true", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXcmJGV4cGFuZD1jaGlsZHJlbiYkcmVjdXJzZT10cnVl", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e507869a-e5eb-424d-ba5b-0368a15247aa" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGetGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSGetGroup2\",\r\n \"details\": {\r\n \"version\": 3,\r\n \"updatedTime\": \"2018-02-14T00:54:09.833416Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup1\",\r\n \"displayName\": \"TestPSGetGroup1\"\r\n }\r\n },\r\n \"children\": [\r\n {\r\n \"childType\": \"/managementGroup\",\r\n \"childId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup3\",\r\n \"displayName\": \"TestPSGetGroup3\",\r\n \"children\": [\r\n {\r\n \"childType\": \"/managementGroup\",\r\n \"childId\": \"/providers/Microsoft.Management/managementGroups/TestPSGetGroup4\",\r\n \"displayName\": \"TestPSGetGroup4\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "803" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14962" + ], + "x-ms-request-id": [ + "westus:90bcf11e-9d3a-4d1d-9ac3-cbdcabb28580" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "04cdbf4e-f16c-4410-9488-1a919061f69c" + ], + "x-ms-correlation-request-id": [ + "ff69f9d6-c2ee-408c-8e2d-d4d140f71ab2" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005417Z:ff69f9d6-c2ee-408c-8e2d-d4d140f71ab2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:16 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup4?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwND9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e2ebb468-8476-44d5-8762-32cad362a1f5" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:0fe39327-1758-4571-9fac-e6363ae8c6a6" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "20c4efdc-4172-41c3-af62-e127c5c3cb27" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1175" + ], + "x-ms-correlation-request-id": [ + "80879148-0a6a-4917-b262-190b538801ba" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005418Z:80879148-0a6a-4917-b262-190b538801ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:18 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "df12c56f-491d-4841-9bf2-1ba3a6dfb057" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:2c3dbbe5-879c-4f31-8b65-ea40ac63778d" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "32022100-cb4c-46fc-ae46-5468e0701d01" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1174" + ], + "x-ms-correlation-request-id": [ + "6b663eef-ae3d-4224-b16a-6c7183805e78" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005420Z:6b663eef-ae3d-4224-b16a-6c7183805e78" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:19 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7d9c2fd1-77c0-431b-8bcf-e4bb16463aa9" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:913ad0be-a7b9-4042-a5da-f19a0142cdfc" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "51f822cb-c5c4-46b1-b101-1014695d0c10" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1173" + ], + "x-ms-correlation-request-id": [ + "b9b39520-4d1b-4a91-a133-3b455bebe0da" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005422Z:b9b39520-4d1b-4a91-a133-3b455bebe0da" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:22 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dldEdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a1d3437b-0172-4777-b81f-b940543c1491" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:3f10e98a-f362-448b-a0c6-4dbaf535e558" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "1db6082e-e9a5-49b7-a436-b0e465d4f4df" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1172" + ], + "x-ms-correlation-request-id": [ + "b5b60d8c-e305-41c8-b4d5-1da264d5e147" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005424Z:b5b60d8c-e305-41c8-b4d5-1da264d5e147" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:54:23 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GroupSubscriptionOperationsTests/TestNewRemoveManagementGroupSubscription.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GroupSubscriptionOperationsTests/TestNewRemoveManagementGroupSubscription.json new file mode 100644 index 000000000000..012a6208c13c --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.GroupSubscriptionOperationsTests/TestNewRemoveManagementGroupSubscription.json @@ -0,0 +1,314 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestSubGroup?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RTdWJHcm91cD9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "8167a3e3-efce-46cb-aea4-26f6e0efc6f1" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestSubGroup\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestSubGroup\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestSubGroup\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:51:17.3555006Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "527" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1186" + ], + "x-ms-request-id": [ + "westus:cae6bfbb-822e-4f27-8a5d-ef0f546c80c9" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "28bee0b3-58d7-4d0a-8493-ce6cfe11d63a" + ], + "x-ms-correlation-request-id": [ + "66a8455a-cbde-4b94-95da-17a02da979de" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005119Z:66a8455a-cbde-4b94-95da-17a02da979de" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:51:18 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestSubGroup/subscriptions/8158c3e6-0c47-4d68-af4c-d521343aa3f8?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RTdWJHcm91cC9zdWJzY3JpcHRpb25zLzgxNThjM2U2LTBjNDctNGQ2OC1hZjRjLWQ1MjEzNDNhYTNmOD9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "81c0d2d0-1c34-4ff6-8e29-b8d575ee437f" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:7b1807db-b2f7-4e8c-9445-d8405e317771" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "06864eb6-269c-404e-a36c-fb36030c9cfc" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1182" + ], + "x-ms-correlation-request-id": [ + "c5333d9f-07ac-4757-8ffd-377ff78b948f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005122Z:c5333d9f-07ac-4757-8ffd-377ff78b948f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:51:21 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestSubGroup/subscriptions/8158c3e6-0c47-4d68-af4c-d521343aa3f8?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RTdWJHcm91cC9zdWJzY3JpcHRpb25zLzgxNThjM2U2LTBjNDctNGQ2OC1hZjRjLWQ1MjEzNDNhYTNmOD9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "db73908b-9960-4465-9ca8-74de47b21d64" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:a49e7da9-e8a2-4b6a-8930-140e67469447" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "32028d19-7078-4feb-a0c4-d902b4bf00b8" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "9998ae34-f98e-4e1f-a17b-d7cc7430c261" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005124Z:9998ae34-f98e-4e1f-a17b-d7cc7430c261" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:51:24 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestSubGroup?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RTdWJHcm91cD9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9a211625-b440-4d0d-bd87-2ef584e8fdc1" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:60083ebd-fc91-46cb-a9e0-5e58de06de61" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "162bf023-9dd2-4d1a-8ebc-eab3f881b6c3" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "05dd312a-4d0f-4a43-b50f-d0f0994c82d6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T005126Z:05dd312a-4d0f-4a43-b50f-d0f0994c82d6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:51:26 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroup.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroup.json new file mode 100644 index 000000000000..339c933ed6c9 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroup.json @@ -0,0 +1,170 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSNewGroup?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU05ld0dyb3VwP2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "42ada7c6-c89e-4ddb-a168-8aee2ca02186" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSNewGroup\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSNewGroup\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSNewGroup\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:32:44.3497352Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "533" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1168" + ], + "x-ms-request-id": [ + "westus:7aca309f-a4d8-4e73-9e0f-2bfd46addb68" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "c5bc24ce-7051-4d5b-a6f3-92cd53495753" + ], + "x-ms-correlation-request-id": [ + "e831893e-0a64-48a9-8836-c413e2b7a382" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003246Z:e831893e-0a64-48a9-8836-c413e2b7a382" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:32:46 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSNewGroup?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU05ld0dyb3VwP2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "714debdd-b167-4d4b-b123-35ed0562e52b" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:32174f3b-0791-43ce-bb68-82c89e939673" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "c99a9a7e-b3f4-406e-b48b-7411c45ac381" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1167" + ], + "x-ms-correlation-request-id": [ + "b52c8f09-1b9e-43dc-b77f-d0e0d6467921" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003248Z:b52c8f09-1b9e-43dc-b77f-d0e0d6467921" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:32:48 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithDisplayName.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithDisplayName.json new file mode 100644 index 000000000000..bb117f2df036 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithDisplayName.json @@ -0,0 +1,170 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSNewGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU05ld0dyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"displayName\": \"TestDisplayName\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "40" + ], + "x-ms-client-request-id": [ + "bba96ff9-81eb-44e9-810b-84abbedd49d9" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSNewGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSNewGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestDisplayName\",\r\n \"details\": {\r\n \"version\": 8,\r\n \"updatedTime\": \"2018-02-14T00:27:53.8080334Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "536" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1176" + ], + "x-ms-request-id": [ + "westus:b4b62b09-b745-410e-8da2-555806e918e4" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "fea4f4e5-75bb-45fb-a59e-bca8da0e7ec4" + ], + "x-ms-correlation-request-id": [ + "aef3029b-77d3-4bc6-8fd2-ae17d9e01ade" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T002757Z:aef3029b-77d3-4bc6-8fd2-ae17d9e01ade" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:27:56 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSNewGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU05ld0dyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3cf5b55c-8f8b-4b12-b24b-201410e42fbe" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:aad6418a-c9b4-436a-97b6-1c498390d4cd" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "782042a1-04c1-458c-94ea-57781d01fdb0" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1175" + ], + "x-ms-correlation-request-id": [ + "e35deab0-8661-4e58-b5fb-6236aaad9967" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T002759Z:e35deab0-8661-4e58-b5fb-6236aaad9967" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:27:58 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithDisplayNameAndParentId.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithDisplayNameAndParentId.json new file mode 100644 index 000000000000..1ee29c5619fd --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithDisplayNameAndParentId.json @@ -0,0 +1,332 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestParent4?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQYXJlbnQ0P2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "7fd62b4a-e44b-429f-a1f8-e708e8f86365" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestParent4\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestParent4\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestParent4\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:28:07.7119205Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "524" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1174" + ], + "x-ms-request-id": [ + "westus:c7810c81-5ce1-4263-a29e-3eb82ccdb6a2" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "60e09497-7653-49f9-83b6-84ef13ecf991" + ], + "x-ms-correlation-request-id": [ + "da392910-de8a-4408-bce1-46d40d165d5e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T002810Z:da392910-de8a-4408-bce1-46d40d165d5e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:28:10 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGroup4?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dyb3VwND9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"displayName\": \"TestDisplayName\",\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestParent4\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "119" + ], + "x-ms-client-request-id": [ + "6dab1188-b79f-4d73-b48a-0eedd82b9fc3" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSGroup4\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSGroup4\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestDisplayName\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:28:11.6112909Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestParent4\",\r\n \"displayName\": \"TestParent4\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "480" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1173" + ], + "x-ms-request-id": [ + "westus:82ea1a55-cae1-4794-b59a-d2b8ecac0fb8" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "d872d10b-145a-4cf8-8c90-f512476c3b72" + ], + "x-ms-correlation-request-id": [ + "6241b267-bfd9-45be-99ea-71d40e7cc330" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T002814Z:6241b267-bfd9-45be-99ea-71d40e7cc330" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:28:14 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSGroup4?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU0dyb3VwND9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8812faae-208b-4b49-a6ef-b03c8994be67" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:a3bdde39-e286-4d21-bd27-d48c6f6665b7" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "4e966c88-2baa-4d22-ad71-8353e101b0c3" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1172" + ], + "x-ms-correlation-request-id": [ + "129e38b3-1bf5-4db0-8bba-0189f9281a3b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T002816Z:129e38b3-1bf5-4db0-8bba-0189f9281a3b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:28:16 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestParent4?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQYXJlbnQ0P2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "574da241-7104-464d-a867-491ed422286e" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:ef66750b-5117-48de-985c-02f6016c4497" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "38cb3e38-2071-4ce5-af01-7ce2f09b59c0" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1171" + ], + "x-ms-correlation-request-id": [ + "bd4ee5f4-5e42-411b-824a-ceadd581dbde" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T002818Z:bd4ee5f4-5e42-411b-824a-ceadd581dbde" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:28:18 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithParentId.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithParentId.json new file mode 100644 index 000000000000..e3f030716f8d --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.NewAzureRmManagementGroupTests/TestNewManagementGroupWithParentId.json @@ -0,0 +1,332 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestParent5?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQYXJlbnQ1P2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "9c571d03-59d6-446a-bee6-f4b61b0a1237" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestParent5\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestParent5\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestParent5\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:37:07.134062Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "523" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1177" + ], + "x-ms-request-id": [ + "westus:31957032-36bc-44c0-abbc-64f002ad2200" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "850963ed-4249-4af8-8761-cb15f2e56f3d" + ], + "x-ms-correlation-request-id": [ + "8c695d75-dc6d-46f4-98bc-4fdfed2db3b5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003709Z:8c695d75-dc6d-46f4-98bc-4fdfed2db3b5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:37:08 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSNewGroup5?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU05ld0dyb3VwNT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestParent5\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "82" + ], + "x-ms-client-request-id": [ + "db6b37a0-3f01-4285-b680-f44ebc68a289" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSNewGroup5\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSNewGroup5\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSNewGroup5\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:37:11.9374445Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestParent5\",\r\n \"displayName\": \"TestParent5\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "486" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1176" + ], + "x-ms-request-id": [ + "westus:00072ffb-206d-42b9-95ab-872e9db0057f" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "a2411ec8-e122-440e-8d54-aa8ec5dc3f45" + ], + "x-ms-correlation-request-id": [ + "3f6acdb8-7dac-475a-ae64-1c975ded8db7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003714Z:3f6acdb8-7dac-475a-ae64-1c975ded8db7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:37:14 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSNewGroup5?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU05ld0dyb3VwNT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "be655d4b-bc42-472f-a24f-fbaf2738207d" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:51020edf-250e-49f9-813c-d9d6644a3bc3" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "3dee1a11-80e6-4579-99eb-af2a7af6a086" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1175" + ], + "x-ms-correlation-request-id": [ + "aa048be2-fbf6-494e-ac0a-ccc8261ed821" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003716Z:aa048be2-fbf6-494e-ac0a-ccc8261ed821" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:37:16 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestParent5?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQYXJlbnQ1P2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b1564c10-0d32-4ceb-aca7-d4533f170005" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:96d5857b-c738-4347-9d5e-d27e50c835f3" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "c971e98a-1ba2-4784-9626-ad1b14137531" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1174" + ], + "x-ms-correlation-request-id": [ + "5ffe276c-51a7-492b-8a7f-45d52e24f036" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003718Z:5ffe276c-51a7-492b-8a7f-45d52e24f036" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:37:17 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.RemoveAzureRmManagementGroupTests/TestRemoveManagementGroup.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.RemoveAzureRmManagementGroupTests/TestRemoveManagementGroup.json new file mode 100644 index 000000000000..b44deb14fa6d --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.RemoveAzureRmManagementGroupTests/TestRemoveManagementGroup.json @@ -0,0 +1,170 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSRemoveGroup?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1JlbW92ZUdyb3VwP2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "6f0cd287-5442-4295-97f7-f43d862a7107" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSRemoveGroup\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSRemoveGroup\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSRemoveGroup\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:38:52.0477792Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "542" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1166" + ], + "x-ms-request-id": [ + "westus:3ba447e7-df26-4dbc-8f90-d2861e70302e" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "0762cef8-9bf5-4a2e-baef-670441ec2316" + ], + "x-ms-correlation-request-id": [ + "1eabaa0f-02ea-48a1-b8ca-1a86e5423b23" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003855Z:1eabaa0f-02ea-48a1-b8ca-1a86e5423b23" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:38:55 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSRemoveGroup?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1JlbW92ZUdyb3VwP2FwaS12ZXJzaW9uPTIwMTctMTEtMDEtcHJldmlldw==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "153349bd-cf39-4f63-b460-9116ac9e3756" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:0480e08a-14ba-4408-9e17-ecc1fbbf04cb" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "36f952c6-0893-4aa7-a336-bebdeb364543" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1165" + ], + "x-ms-correlation-request-id": [ + "1e7dc3eb-0f60-470c-a2e5-5ee3260e4593" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T003857Z:1e7dc3eb-0f60-470c-a2e5-5ee3260e4593" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:38:56 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithDisplayName.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithDisplayName.json new file mode 100644 index 000000000000..dca650908e34 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithDisplayName.json @@ -0,0 +1,257 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "64f027ae-f679-421a-8c79-482675d56db0" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup1\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroup1\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSUpdateGroup1\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:46:06.6871871Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "545" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1183" + ], + "x-ms-request-id": [ + "westus:b3bb53a8-8af6-4c60-bad9-7f5a0715dc4e" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "655a46be-f5d6-4186-b466-e0d8e5e96e14" + ], + "x-ms-correlation-request-id": [ + "a95200e2-137a-4d73-ab2d-2236ac89b56a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004608Z:a95200e2-137a-4d73-ab2d-2236ac89b56a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:08 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"displayName\": \"TestDisplayName\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "40" + ], + "x-ms-client-request-id": [ + "c9568158-bc44-4476-9f1a-f36812fc0eb6" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup1\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroup1\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestDisplayName\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:46:09.6872741Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "542" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1182" + ], + "x-ms-request-id": [ + "westus:8f66ce93-bea8-4442-91ac-a243806a781b" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "e438b1fe-924c-48a7-a8f8-62bf7cf36d4a" + ], + "x-ms-correlation-request-id": [ + "64781675-bb8f-41a5-bd79-6894f786aa78" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004609Z:64781675-bb8f-41a5-bd79-6894f786aa78" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:08 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup1?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMT9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "60713704-4d09-4aa0-a218-c68cceac9b5f" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:4ccdd1ce-db9c-4b46-b656-720269497cd6" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "73864399-5161-41de-8389-0ec7ba7d3877" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1181" + ], + "x-ms-correlation-request-id": [ + "82c54a52-eaa0-4fc1-9f66-16fd0bf70375" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004611Z:82c54a52-eaa0-4fc1-9f66-16fd0bf70375" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:10 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithDisplayNameAndParentId.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithDisplayNameAndParentId.json new file mode 100644 index 000000000000..1c40c4afa90e --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithDisplayNameAndParentId.json @@ -0,0 +1,419 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwUGFyZW50Mz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "360e4e12-fe2b-4514-ae52-9aea4e82f353" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroupParent3\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSUpdateGroupParent3\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:47:16.4787685Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "563" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1195" + ], + "x-ms-request-id": [ + "westus:567a401f-b2fb-4832-a5b1-8db4ed1092bb" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "67e03873-319e-4de1-b06d-19a58ebb9705" + ], + "x-ms-correlation-request-id": [ + "705f87aa-9854-4cde-a6fa-affd69eb9ad9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004717Z:705f87aa-9854-4cde-a6fa-affd69eb9ad9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:47:17 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "761e0dc2-7df9-4911-bd19-6cc4a145a336" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup3\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroup3\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSUpdateGroup3\",\r\n \"details\": {\r\n \"version\": 3,\r\n \"updatedTime\": \"2018-02-14T00:47:19.056193Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "544" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1194" + ], + "x-ms-request-id": [ + "westus:2e133a3b-b87d-446f-b3a7-73c4a61ef7ba" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "d1a00fe9-118d-4cc3-9edb-9d771ca813a5" + ], + "x-ms-correlation-request-id": [ + "b6747451-8e3c-4f12-9a0d-bdfb113a1c43" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004720Z:b6747451-8e3c-4f12-9a0d-bdfb113a1c43" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:47:19 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"displayName\": \"TestDisplayName\",\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "132" + ], + "x-ms-client-request-id": [ + "1a877bc3-a157-4831-9e2c-708a4c5a90ff" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup3\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroup3\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestDisplayName\",\r\n \"details\": {\r\n \"version\": 4,\r\n \"updatedTime\": \"2018-02-14T00:47:21.7478404Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3\",\r\n \"displayName\": \"TestPSUpdateGroupParent3\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "518" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1193" + ], + "x-ms-request-id": [ + "westus:58c4a6e5-d4f0-4984-bf8a-c6086a7cfc87" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "b20d0a86-c1a9-4517-aee7-4bb482998710" + ], + "x-ms-correlation-request-id": [ + "d31fa71c-0e48-4faf-9dec-b4f5bd26ae1c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004721Z:d31fa71c-0e48-4faf-9dec-b4f5bd26ae1c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:47:21 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a1fb42c9-e7d3-454b-b214-19d70a810bdc" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:ddc5c7a1-1c15-493c-8f80-f982604b839f" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "3d7210f7-3d01-4027-ac22-ff0b6e105b47" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "a3bc5a6f-90fd-4bf7-bf14-71a7ac1b83b9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004723Z:a3bc5a6f-90fd-4bf7-bf14-71a7ac1b83b9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:47:22 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent3?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwUGFyZW50Mz9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "98d2abe0-8c78-4970-ace6-108ecb940140" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:8e864c0d-230b-44c8-b236-fc9c3a13ca22" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "9ce06bd8-e88b-4773-9e4d-5fa2b09cda47" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1191" + ], + "x-ms-correlation-request-id": [ + "a34779f5-76a3-46fe-b72e-bdafd8a61425" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004724Z:a34779f5-76a3-46fe-b72e-bdafd8a61425" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:47:24 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithParentId.json b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithParentId.json new file mode 100644 index 000000000000..d98f7f5816ed --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/SessionRecords/Commands.ManagementGroups.Test.ScenarioTests.UpdateAzureRmManagementGroupTests/TestUpdateManagementGroupWithParentId.json @@ -0,0 +1,419 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwUGFyZW50Mj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "24523e21-5aba-4732-a065-a367b0b745a3" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroupParent2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSUpdateGroupParent2\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:46:21.7510808Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "563" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1181" + ], + "x-ms-request-id": [ + "westus:080172a4-ad74-42ce-8ebc-a6af8061a8bc" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "57555a88-8752-46ab-9064-8ca44a13ba66" + ], + "x-ms-correlation-request-id": [ + "eb6b4225-8ee4-4800-a9e8-6e23a4cdcf6b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004623Z:eb6b4225-8ee4-4800-a9e8-6e23a4cdcf6b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:22 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "x-ms-client-request-id": [ + "67dc9c51-8c03-4ed5-bb64-25594b285d29" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSUpdateGroup2\",\r\n \"details\": {\r\n \"version\": 1,\r\n \"updatedTime\": \"2018-02-14T00:46:24.1349484Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "545" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1180" + ], + "x-ms-request-id": [ + "westus:86b66953-8ae8-4437-a911-f2e3fe61a4a6" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "2cf80e92-24cf-46db-807a-94fde11a2d53" + ], + "x-ms-correlation-request-id": [ + "3661bc6d-1b9b-4340-b143-70db3f8f39a2" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004625Z:3661bc6d-1b9b-4340-b143-70db3f8f39a2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:25 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "95" + ], + "x-ms-client-request-id": [ + "093159ed-2ad1-45a5-a59c-3b753f56078a" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup2\",\r\n \"type\": \"/providers/Microsoft.Management/managementGroups\",\r\n \"name\": \"TestPSUpdateGroup2\",\r\n \"properties\": {\r\n \"tenantId\": \"6b2064b9-34bd-46e6-9092-52f2dd5f7fc0\",\r\n \"displayName\": \"TestPSUpdateGroup2\",\r\n \"details\": {\r\n \"version\": 2,\r\n \"updatedTime\": \"2018-02-14T00:46:27.0038089Z\",\r\n \"updatedBy\": \"8b8f2464-6ad0-4327-b9da-5cc8ac2c650d\",\r\n \"parent\": {\r\n \"parentId\": \"/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2\",\r\n \"displayName\": \"TestPSUpdateGroupParent2\"\r\n }\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "521" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1179" + ], + "x-ms-request-id": [ + "westus:a454997d-b436-4c5f-b12b-799cbf758e11" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "32d613be-088c-4d00-9ccc-d412eb1f7317" + ], + "x-ms-correlation-request-id": [ + "5cb2c6b0-9a78-4952-b619-1e3191dc1593" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004626Z:5cb2c6b0-9a78-4952-b619-1e3191dc1593" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:26 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroup2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwMj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "de496d0f-ef02-4992-8667-9d0d54b71234" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:94a1f8c5-ec82-43b4-91cc-09b2f8891a14" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "e2fd3434-cb44-4168-8bb7-c81f1518feed" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1178" + ], + "x-ms-correlation-request-id": [ + "e7051506-eccb-458b-a1f9-2768c1db66ca" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004628Z:e7051506-eccb-458b-a1f9-2768c1db66ca" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:27 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/providers/Microsoft.Management/managementGroups/TestPSUpdateGroupParent2?api-version=2017-11-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuTWFuYWdlbWVudC9tYW5hZ2VtZW50R3JvdXBzL1Rlc3RQU1VwZGF0ZUdyb3VwUGFyZW50Mj9hcGktdmVyc2lvbj0yMDE3LTExLTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "61e36df8-6f34-4740-9741-c1f207a82238" + ], + "Cache-Control": [ + "no-cache" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.2600.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.16299", + "Microsoft.Azure.Management.ManagementGroups.ManagementGroupsAPIClient/1.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:1fae9d0a-6f52-428d-b414-82e2422018b9" + ], + "x-ba-restapi": [ + "1.0.3.524" + ], + "request-id": [ + "eea91a2d-86ed-4fa8-9018-60e8e2db7015" + ], + "x-ms-ratelimit-remaining-tenant-writes": [ + "1177" + ], + "x-ms-correlation-request-id": [ + "af2ee93d-c2c6-4e17-912b-957ceff30570" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20180214T004629Z:af2ee93d-c2c6-4e17-912b-957ceff30570" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 14 Feb 2018 00:46:29 GMT" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "394ae65d-9e71-4462-930f-3332dedf845c" + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/packages.config b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/packages.config new file mode 100644 index 000000000000..b75bbdf46203 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups.Test/packages.config @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/GetAzureRmManagementGroup.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/GetAzureRmManagementGroup.cs new file mode 100644 index 000000000000..25486ed45f19 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/GetAzureRmManagementGroup.cs @@ -0,0 +1,71 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Commands.ManagementGroups.Common; +using Microsoft.Azure.Commands.ManagementGroups.Models; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Cmdlets +{ + using System.Linq; + + /// + /// Get-AzureRmManagementGroup Cmdlet + /// + [Cmdlet(VerbsCommon.Get,"AzureRmManagementGroup", DefaultParameterSetName = Constants.ParameterSetNames.ListParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSManagementGroupInfo), typeof(PSManagementGroup), typeof(string))] + public class GetAzureRmManagementGroup : AzureManagementGroupsCmdletBase + { + /// + /// Get-AzureRmManagementGroup Cmdlet + /// + [Parameter(ParameterSetName = Constants.ParameterSetNames.GetParameterSet, Mandatory = true, HelpMessage = Constants.HelpMessages.GroupName, Position = 0)] + public string GroupName { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GetParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.Expand)] + public SwitchParameter Expand; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GetParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.Recurse)] + public SwitchParameter Recurse; + + public override void ExecuteCmdlet() + { + try + { + PreregisterSubscription(); + + if (!string.IsNullOrEmpty(GroupName)) + { + var response = ManagementGroupsApiClient.ManagementGroups.Get(GroupName, Expand.IsPresent?"children":null, Recurse.IsPresent); + WriteObject(new PSManagementGroup(response)); + } + else + { + var response = ManagementGroupsApiClient.ManagementGroups.List(); + var items = response.Select(managementGroup => new PSManagementGroupInfo(managementGroup)) + .ToList(); + WriteObject(items, true); + } + } + catch (ErrorResponseException ex) + { + Utility.HandleErrorResponseException(ex); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/NewAzureRmManagementGroup.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/NewAzureRmManagementGroup.cs new file mode 100644 index 000000000000..95846a1d74dc --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/NewAzureRmManagementGroup.cs @@ -0,0 +1,78 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Commands.ManagementGroups.Common; +using Microsoft.Azure.Commands.ManagementGroups.Models; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Cmdlets +{ + /// + /// New-AzureRmManagementGroup Cmdlet + /// + [Cmdlet(VerbsCommon.New, "AzureRmManagementGroup", DefaultParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSManagementGroup))] + public class NewAzureRmManagementGroup : AzureManagementGroupsCmdletBase + { + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, HelpMessage = Constants.HelpMessages.GroupName, Position = 0)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.ParentObject)] + [ValidateNotNullOrEmpty] + public string GroupName { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.DisplayName)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.DisplayName, ValueFromPipeline = false)] + [ValidateNotNullOrEmpty] + public string DisplayName { get; set; } = null; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.ParentId)] + [ValidateNotNullOrEmpty] + public string ParentId { get; set; } = null; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.ParentObject, ValueFromPipeline = false)] + public PSManagementGroup ParentObject; + + public override void ExecuteCmdlet() + { + try + { + if (ParameterSetName.Equals(Constants.ParameterSetNames.ParentGroupParameterSet)) + { + ParentId = ParentObject.Id; + } + + if (ShouldProcess( + string.Format(Resource.NewManagementGroupShouldProcessTarget, GroupName), + string.Format(Resource.NewManagementGroupShouldProcessAction, GroupName))) + { + PreregisterSubscription(); + + CreateManagementGroupRequest createGroupRequest = new CreateManagementGroupRequest(DisplayName, ParentId); + var response = ManagementGroupsApiClient.ManagementGroups.CreateOrUpdate(GroupName, createGroupRequest); + WriteObject(new PSManagementGroup(response)); + } + } + catch (ErrorResponseException ex) + { + Utility.HandleErrorResponseException(ex); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/NewAzureRmManagementGroupSubscription.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/NewAzureRmManagementGroupSubscription.cs new file mode 100644 index 000000000000..a2ef9cc38f98 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/NewAzureRmManagementGroupSubscription.cs @@ -0,0 +1,70 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System; +using System.Management.Automation; +using Microsoft.Azure.Commands.ManagementGroups.Common; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Management.ManagementGroups.Models; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; + +namespace Microsoft.Azure.Commands.ManagementGroups.Cmdlets +{ + /// + /// Add-AzureRmManagementGroupSubscription Cmdlet + /// + [Cmdlet(VerbsCommon.New, "AzureRmManagementGroupSubscription", + DefaultParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, + SupportsShouldProcess = true), OutputType(typeof(bool))] + public class NewAzureRmManagementGroupSubscription : AzureManagementGroupsCmdletBase + { + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.GroupName, Position = 0)] + [ValidateNotNullOrEmpty] + public string GroupName { get; set; } = null; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.SubscriptionId, Position = 1)] + [ValidateNotNullOrEmpty] + public Guid SubscriptionId { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false)] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteCmdlet() + { + try + { + if (ShouldProcess( + string.Format(Resource.NewManagementGroupSubShouldProcessTarget, SubscriptionId, GroupName), + string.Format(Resource.NewManagementGroupSubShouldProcessAction, SubscriptionId, GroupName))) + { + PreregisterSubscription(); + PreregisterSubscription(SubscriptionId.ToString()); + + ManagementGroupsApiClient.ManagementGroupSubscriptions.Create(GroupName, SubscriptionId.ToString()); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } + catch (ErrorResponseException ex) + { + Utility.HandleErrorResponseException(ex); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/RemoveAzureRmManagementGroup.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/RemoveAzureRmManagementGroup.cs new file mode 100644 index 000000000000..6cf5a23cbff3 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/RemoveAzureRmManagementGroup.cs @@ -0,0 +1,74 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Commands.ManagementGroups.Common; +using Microsoft.Azure.Commands.ManagementGroups.Models; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Cmdlets +{ + /// + /// Remove-AzureRmManagementGroup Cmdlet + /// + [Cmdlet(VerbsCommon.Remove, "AzureRmManagementGroup", + DefaultParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, + SupportsShouldProcess = true), OutputType(typeof(bool))] + public class RemoveAzureRmManagementGroup : AzureManagementGroupsCmdletBase + { + + [Parameter(ParameterSetName = Constants.ParameterSetNames.ManagementGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.InputObject, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public PSManagementGroup InputObject { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.GroupName, Position = 0)] + [ValidateNotNullOrEmpty] + public string GroupName { get; set; } = null; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false)] + public SwitchParameter PassThru { get; set; } + + public override void ExecuteCmdlet() + { + try + { + if (ParameterSetName.Equals(Constants.ParameterSetNames.ManagementGroupParameterSet)) + { + GroupName = InputObject.Name; + } + + if (ShouldProcess( + string.Format(Resource.RemoveManagementGroupShouldProcessTarget, GroupName), + string.Format(Resource.RemoveManagementGroupShouldProcessAction, GroupName))) + { + PreregisterSubscription(); + + ManagementGroupsApiClient.ManagementGroups.Delete(GroupName); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } + catch (ErrorResponseException ex) + { + Utility.HandleErrorResponseException(ex); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/RemoveAzureRmManagementGroupSubscription.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/RemoveAzureRmManagementGroupSubscription.cs new file mode 100644 index 000000000000..3ff98a9f2663 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/RemoveAzureRmManagementGroupSubscription.cs @@ -0,0 +1,71 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Commands.ManagementGroups.Common; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Cmdlets +{ + /// + /// Remove-AzureRmManagementGroupSubscription Cmdlet + /// + [Cmdlet(VerbsCommon.Remove, "AzureRmManagementGroupSubscription", + DefaultParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, + SupportsShouldProcess = true), OutputType(typeof(bool))] + public class RemoveAzureRmManagementGroupSubscription : AzureManagementGroupsCmdletBase + { + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.GroupName, Position = 0)] + [ValidateNotNullOrEmpty] + public string GroupName { get; set; } = null; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.SubscriptionId, Position = 1)] + [ValidateNotNullOrEmpty] + public Guid SubscriptionId { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false)] + public SwitchParameter PassThru { get; set; } + + + public override void ExecuteCmdlet() + { + try + { + if (ShouldProcess( + string.Format(Resource.RemoveManagementGroupSubShouldProcessTarget, SubscriptionId,GroupName), + string.Format(Resource.RemoveManagementGroupSubShouldProcessAction, SubscriptionId, GroupName))) + { + PreregisterSubscription(); + PreregisterSubscription(SubscriptionId.ToString()); + + ManagementGroupsApiClient.ManagementGroupSubscriptions.Delete(GroupName, SubscriptionId.ToString()); + + if (PassThru.IsPresent) + { + WriteObject(true); + } + } + } + catch (ErrorResponseException ex) + { + Utility.HandleErrorResponseException(ex); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/UpdateAzureRmManagementGroup.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/UpdateAzureRmManagementGroup.cs new file mode 100644 index 000000000000..ac6236e4642f --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Cmdlets/UpdateAzureRmManagementGroup.cs @@ -0,0 +1,98 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Commands.ManagementGroups.Common; +using Microsoft.Azure.Commands.ManagementGroups.Models; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Cmdlets +{ + [Cmdlet("Update", "AzureRmManagementGroup", DefaultParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSManagementGroup))] + public class UpdateAzureRmManagementGroup : AzureManagementGroupsCmdletBase + { + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupAndManagementGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.InputObject, ValueFromPipeline = true)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.ManagementGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.InputObject, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public PSManagementGroup InputObject { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.InputObject, ValueFromPipeline = false)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = true, HelpMessage = Constants.HelpMessages.GroupName, Position = 0)] + [ValidateNotNullOrEmpty] + public string GroupName { get; set; } + + [Parameter(ParameterSetName = Constants.ParameterSetNames.ManagementGroupParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.DisplayName)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.DisplayName)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.DisplayName, ValueFromPipeline = false)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupAndManagementGroupParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.InputObject, ValueFromPipeline = false)] + [ValidateNotNullOrEmpty] + public string DisplayName { get; set; } = null; + + [Parameter(ParameterSetName = Constants.ParameterSetNames.ManagementGroupParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.ParentId)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.GroupOperationsParameterSet, Mandatory = false, + HelpMessage = Constants.HelpMessages.ParentId)] + [ValidateNotNullOrEmpty] + public string ParentId { get; set; } = null; + + + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupAndManagementGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.InputObject, ValueFromPipeline = false)] + [Parameter(ParameterSetName = Constants.ParameterSetNames.ParentGroupParameterSet, Mandatory = true, + HelpMessage = Constants.HelpMessages.ParentObject, ValueFromPipeline = false)] + [ValidateNotNullOrEmpty] + public PSManagementGroup ParentObject; + + public override void ExecuteCmdlet() + { + try + { + if (ParameterSetName.Equals(Constants.ParameterSetNames.ManagementGroupParameterSet) + || ParameterSetName.Equals(Constants.ParameterSetNames.ParentGroupAndManagementGroupParameterSet)) + { + GroupName = InputObject.Name; + } + + if (ParameterSetName.Equals(Constants.ParameterSetNames.ParentGroupParameterSet) + || ParameterSetName.Equals(Constants.ParameterSetNames.ParentGroupAndManagementGroupParameterSet)) + { + ParentId = ParentObject.Id; + } + + if (ShouldProcess( + string.Format(Resource.UpdateManagementGroupShouldProcessTarget, GroupName), + string.Format(Resource.UpdateManagementGroupShouldProcessAction, GroupName))) + { + PreregisterSubscription(); + + CreateManagementGroupRequest createGroupRequest = new CreateManagementGroupRequest(DisplayName, ParentId); + var response = ManagementGroupsApiClient.ManagementGroups.Update(GroupName, createGroupRequest); + WriteObject(new PSManagementGroup(response)); + } + } + catch (ErrorResponseException ex) + { + Utility.HandleErrorResponseException(ex); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Commands.ManagementGroups.csproj b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Commands.ManagementGroups.csproj new file mode 100644 index 000000000000..abcbcbfd55a3 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Commands.ManagementGroups.csproj @@ -0,0 +1,118 @@ + + + + + Debug + AnyCPU + {119C7B00-03E7-481D-A74F-CF6CE3920CB8} + Library + Properties + Microsoft.Azure.Commands.ManagementGroups + Microsoft.Azure.Commands.ManagementGroups + v4.5.2 + 512 + + + true + full + false + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.ManagementGroups + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.ManagementGroups + TRACE;SIGN + true + MSSharedLibKey.snk + true + prompt + 4 + + + + ..\..\..\packages\Microsoft.Azure.Management.ManagementGroups.1.0.0-preview\lib\net452\Microsoft.Azure.Management.ManagementGroups.dll + True + + + + + False + C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + + + + + + + + + + + + + + + + + + True + True + Resource.resx + + + + + {70527617-7598-4aef-b5bd-db9186b8184b} + Commands.Common.Authentication.Abstractions + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {3819d8a7-c62c-4c47-8ddd-0332d9ce1252} + Commands.ResourceManager.Common + + + + + AzureRM.ManagementGroups.psd1 + PreserveNewest + + + PreserveNewest + + + + + + + + + ResXFileCodeGenerator + Resource.Designer.cs + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/AzureManagementGroupsCmdletBase.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/AzureManagementGroupsCmdletBase.cs new file mode 100644 index 000000000000..933ef798ecc3 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/AzureManagementGroupsCmdletBase.cs @@ -0,0 +1,146 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System; +using System.Collections.Generic; +using Microsoft.Azure.Commands.Common.Authentication; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Commands.ResourceManager.Common; +using Microsoft.Azure.Management.Internal.Resources; +using Microsoft.Azure.Management.Internal.Resources.Models; +using Microsoft.Azure.Management.ManagementGroups; +using Microsoft.Rest.Azure; +using Microsoft.WindowsAzure.Commands.Utilities.Common; + +namespace Microsoft.Azure.Commands.ManagementGroups.Common +{ + /// + /// Base class of Azure Management Groups Cmdlet. + /// + public abstract class AzureManagementGroupsCmdletBase : AzureRMCmdlet + { + private IManagementGroupsAPIClient _managementGroupsApiClient; + + private Dictionary> _defaultRequestHeaders; + + /// + /// Gets or sets the Groups RP client. + /// + public IManagementGroupsAPIClient ManagementGroupsApiClient + { + get + { + return _managementGroupsApiClient ?? + (_managementGroupsApiClient = + AzureSession.Instance.ClientFactory.CreateArmClient( + DefaultProfile.DefaultContext, + AzureEnvironment.Endpoint.ResourceManager)); + } + set { _managementGroupsApiClient = value; } + + } + + public void PreregisterSubscription(string subscriptionId) + { + IAzureContext context; + if (TryGetDefaultContext(out context) + && context.Account != null + && context.Subscription != null) + { + if (subscriptionId == context.Subscription.Id) + { + return; + } + + short RetryCount = 10; + string providerName = "Microsoft.Management"; + try + { + var rmclient = new ResourceManagementClient( + context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager), + AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(context, AzureEnvironment.Endpoint.ResourceManager)) + { + SubscriptionId = subscriptionId + }; + var provider = rmclient.Providers.Get(providerName); + if (provider.RegistrationState != RegistrationState.Registered) + { + short retryCount = 0; + do + { + if (retryCount++ > RetryCount) + { + throw new TimeoutException(); + } + provider = rmclient.Providers.Register(providerName); + TestMockSupport.Delay(2000); + } while (provider.RegistrationState != RegistrationState.Registered); + } + } + catch (Exception e) + { + if (e.Message?.IndexOf("does not have authorization") >= 0 && e.Message?.IndexOf("register/action", + StringComparison.InvariantCultureIgnoreCase) >= 0) + { + throw new CloudException(e.Message); + } + } + } + } + + public void PreregisterSubscription() + { + IAzureContext context; + if (TryGetDefaultContext(out context) + && context.Account != null + && context.Subscription != null) + { + short RetryCount = 10; + string providerName = "Microsoft.Management"; + try + { + var rmclient = new ResourceManagementClient( + context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager), + AzureSession.Instance.AuthenticationFactory.GetServiceClientCredentials(context, AzureEnvironment.Endpoint.ResourceManager)) + { + SubscriptionId = context.Subscription.Id + }; + var provider = rmclient.Providers.Get(providerName); + if (provider.RegistrationState != RegistrationState.Registered) + { + short retryCount = 0; + do + { + if (retryCount++ > RetryCount) + { + throw new TimeoutException(); + } + provider = rmclient.Providers.Register(providerName); + TestMockSupport.Delay(2000); + } while (provider.RegistrationState != RegistrationState.Registered); + } + } + catch (Exception e) + { + if (e.Message?.IndexOf("does not have authorization") >= 0 && e.Message?.IndexOf("register/action", + StringComparison.InvariantCultureIgnoreCase) >= 0) + { + throw new CloudException(e.Message); + } + } + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/Constants.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/Constants.cs new file mode 100644 index 000000000000..70be37bf8c65 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/Constants.cs @@ -0,0 +1,44 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.ManagementGroups.Common +{ + class Constants + { + public class ParameterSetNames + { + public const string GetParameterSet = "GetOperation"; + public const string ListParameterSet = "ListOperation"; + public const string GroupOperationsParameterSet = "GroupOperations"; + public const string SubscriptionOperationsParameterSet = "SubscriptionOperations"; + public const string ManagementGroupParameterSet = "ManagementGroupObject"; + public const string ParentGroupParameterSet = "ParentGroupObject"; + public const string ParentGroupAndManagementGroupParameterSet = "ParentAndManagementGroupObject"; + } + + public class HelpMessages + { + public const string SubscriptionId = "Subscription Id of the subscription associated witht the management"; + public const string GroupId = "Management Group Id"; + public const string Recurse = "Recursively list the children of the management group"; + public const string ParentId = "Parent Id of the management group"; + public const string GroupName = "Management Group Id"; + public const string DisplayName = "Display Name of the management group"; + public const string Expand = "Expand the output to list the children of the management group"; + public const string Force = "Force the action and skip confirmations"; + public const string InputObject = "Input Object from the Get call"; + public const string ParentObject = "Parent Object"; + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/Utility.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/Utility.cs new file mode 100644 index 000000000000..8dc15d87fc28 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Common/Utility.cs @@ -0,0 +1,69 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System; +using System.Management.Automation; +using Microsoft.Azure.Management.ManagementGroups.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Microsoft.Azure.Commands.ManagementGroups.Common +{ + using System.Collections.Generic; + using Microsoft.Rest.Azure; + using Microsoft.Azure.Management.Internal.Resources; + using Microsoft.Azure.Management.Internal.Resources.Models; + using Microsoft.Azure.Commands.Common.Authentication; + using Microsoft.Azure.Commands.Common.Authentication.Abstractions; + + static class Utility + { + // TODO (sepancha 12/9/2017) - This is temporary until I can figure out a better way to deal with error handling. + public static void HandleErrorResponseException(ErrorResponseException ex) + { + if (!string.IsNullOrEmpty(ex.Response.Content)) + { + Dictionary content; + try + { + content = JsonConvert.DeserializeObject>(ex.Response.Content); + } + catch + { + throw ex; + } + + if (content.ContainsKey("Message")) + { + throw new CloudException(content["Message"].ToString()); + } + + if (content.ContainsKey("error")) + { + JObject errorResponse = (JObject)content["error"]; + JToken errorMessage; + if (errorResponse.TryGetValue("message", StringComparison.InvariantCultureIgnoreCase, out errorMessage)) + { + throw new CloudException(errorMessage.ToString()); + } + } + } + else + { + throw ex; + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/MSSharedLibKey.snk b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/MSSharedLibKey.snk differ diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Microsoft.Azure.Commands.ManagementGroups.Format.ps1xml b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Microsoft.Azure.Commands.ManagementGroups.Format.ps1xml new file mode 100644 index 000000000000..c41410f72ac5 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Microsoft.Azure.Commands.ManagementGroups.Format.ps1xml @@ -0,0 +1,127 @@ + + + + + Microsoft.Azure.Commands.ManagementGroups.Models.PSManagementGroup + + Microsoft.Azure.Commands.ManagementGroups.Models.PSManagementGroup + + + + + + + + Id + + + + Type + + + + Name + + + + TenantId + + + + DisplayName + + + + UpdatedTime + + + + UpdatedBy + + + + ParentId + + + + ParentDisplayName + + + + $_.Children -ne $null + $displayNames=@(); foreach ($child in $_.Children){$displayNames+=$child.DisplayName}; $displayNames + + + + + + + + Microsoft.Azure.Commands.ManagementGroups.Models.PSManagementGroupChildInfo + + Microsoft.Azure.Commands.ManagementGroups.Models.PSManagementGroupChildInfo + + + + + + + + ChildType + + + + ChildId + + + + DisplayName + + + + + $_.Children -ne $null + + $displayNames=@(); foreach ($child in $_.Children){$displayNames+=$child.DisplayName}; $displayNames + + + + + + + + Microsoft.Azure.Commands.ManagementGroups.Models.PSManagementGroupInfo + + Microsoft.Azure.Commands.ManagementGroups.Models.PSManagementGroupInfo + + + + + + + + Id + + + + Type + + + + Name + + + + TenantId + + + + DisplayName + + + + + + + + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroup.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroup.cs new file mode 100644 index 000000000000..67a36bb76d17 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroup.cs @@ -0,0 +1,79 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Collections.Generic; +using System.Linq; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Models +{ + public class PSManagementGroup + { + public string Id { get; private set; } + + public string Type { get; private set; } + + public string Name { get; private set; } + + public string TenantId { get; private set; } + + public string DisplayName { get; private set; } + + public System.DateTime? UpdatedTime { get; set; } + + public string UpdatedBy { get; set; } + + public string ParentId { get; set; } + + public string ParentDisplayName { get; set; } + + public IList Children { get; private set; } + + + public PSManagementGroup() + { + } + + public PSManagementGroup(ManagementGroup managementGroup) + { + if (managementGroup != null) + { + Id = managementGroup.Id; + Type = managementGroup.Type; + Name = managementGroup.Name; + TenantId = managementGroup.TenantId; + DisplayName = managementGroup.DisplayName; + UpdatedTime = managementGroup.Details.UpdatedTime; + UpdatedBy = managementGroup.Details.UpdatedBy; + + if (managementGroup.Details.Parent != null) + { + if (managementGroup.Details.Parent.ParentId != null) + { + ParentId = managementGroup.Details.Parent.ParentId; + } + if (managementGroup.Details.Parent.DisplayName != null) + { + ParentDisplayName = managementGroup.Details.Parent.DisplayName; + } + } + + if (managementGroup.Children != null) + { + this.Children = managementGroup.Children.Select(child => new PSManagementGroupChildInfo(child)).ToList(); + } + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroupChildInfo.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroupChildInfo.cs new file mode 100644 index 000000000000..64f80e2497d5 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroupChildInfo.cs @@ -0,0 +1,48 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Collections.Generic; +using System.Linq; +using Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Models +{ + public class PSManagementGroupChildInfo + { + public string ChildType { get; set; } + public string DisplayName { get; set; } + public string ChildId { get; set; } + + public IList Children { get; set; } + + public PSManagementGroupChildInfo() + { + + } + + public PSManagementGroupChildInfo(ManagementGroupChildInfo childInfo) + { + if (childInfo != null) + { + this.ChildType = childInfo.ChildType; + this.DisplayName = childInfo.DisplayName; + this.ChildId = childInfo.ChildId; + if (childInfo.Children != null) + { + this.Children = childInfo.Children.Select(child => new PSManagementGroupChildInfo(child)).ToList(); + } + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroupInfo.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroupInfo.cs new file mode 100644 index 000000000000..2bae55bf6ed2 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSManagementGroupInfo.cs @@ -0,0 +1,47 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Models +{ + public class PSManagementGroupInfo + { + public string Id { get; private set; } + + public string Type { get; private set; } + + public string Name { get; private set; } + + public string TenantId { get; private set; } + + public string DisplayName { get; private set; } + + public PSManagementGroupInfo() + { + } + + public PSManagementGroupInfo(ManagementGroupInfo managementGroupInfo) + { + if (managementGroupInfo != null) + { + Id = managementGroupInfo.Id; + Type = managementGroupInfo.Type; + Name = managementGroupInfo.Name; + TenantId = managementGroupInfo.TenantId; + DisplayName = managementGroupInfo.DisplayName; + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSParentGroupInfo.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSParentGroupInfo.cs new file mode 100644 index 000000000000..d0e78ec5e957 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Models/PSParentGroupInfo.cs @@ -0,0 +1,39 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.Azure.Management.ManagementGroups.Models; + +namespace Microsoft.Azure.Commands.ManagementGroups.Models +{ + public class PSParentGroupInfo + { + public string ParentId { get; set; } + + public string DisplayName { get; set; } + + public PSParentGroupInfo() + { + + } + + public PSParentGroupInfo(ParentGroupInfo parentGroupInfo) + { + if (parentGroupInfo != null) + { + this.ParentId = parentGroupInfo.ParentId; + this.DisplayName = parentGroupInfo.DisplayName; + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Properties/AssemblyInfo.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..a9d0a4ac65ee --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Commands.ManagementGroups")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Commands.ManagementGroups")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("119c7b00-03e7-481d-a74f-cf6ce3920cb8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.1")] +[assembly: AssemblyFileVersion("0.0.1")] diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Resource.Designer.cs b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Resource.Designer.cs new file mode 100644 index 000000000000..a7b6125dc55a --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Resource.Designer.cs @@ -0,0 +1,153 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.ManagementGroups { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Commands.ManagementGroups.Resource", typeof(Resource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to create a new management group named "{0}"?. + /// + internal static string NewManagementGroupShouldProcessAction { + get { + return ResourceManager.GetString("NewManagementGroupShouldProcessAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating management group "{0}". + /// + internal static string NewManagementGroupShouldProcessTarget { + get { + return ResourceManager.GetString("NewManagementGroupShouldProcessTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to add subscription {0} to group "{1}"?. + /// + internal static string NewManagementGroupSubShouldProcessAction { + get { + return ResourceManager.GetString("NewManagementGroupSubShouldProcessAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Adding subscription {0} to group "{1}". + /// + internal static string NewManagementGroupSubShouldProcessTarget { + get { + return ResourceManager.GetString("NewManagementGroupSubShouldProcessTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing management group "{0}". + /// + internal static string RemoveManagementGroupShouldProcessAction { + get { + return ResourceManager.GetString("RemoveManagementGroupShouldProcessAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove management group "{0}"?. + /// + internal static string RemoveManagementGroupShouldProcessTarget { + get { + return ResourceManager.GetString("RemoveManagementGroupShouldProcessTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription {0} from group "{1}". + /// + internal static string RemoveManagementGroupSubShouldProcessAction { + get { + return ResourceManager.GetString("RemoveManagementGroupSubShouldProcessAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription {0} from group "{1}"?. + /// + internal static string RemoveManagementGroupSubShouldProcessTarget { + get { + return ResourceManager.GetString("RemoveManagementGroupSubShouldProcessTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating management group "{0}". + /// + internal static string UpdateManagementGroupShouldProcessAction { + get { + return ResourceManager.GetString("UpdateManagementGroupShouldProcessAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to update management group "{0}"?. + /// + internal static string UpdateManagementGroupShouldProcessTarget { + get { + return ResourceManager.GetString("UpdateManagementGroupShouldProcessTarget", resourceCulture); + } + } + } +} diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Resource.resx b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Resource.resx new file mode 100644 index 000000000000..1b954d34bc01 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/Resource.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Are you sure you want to create a new management group named "{0}"? + + + Creating management group "{0}" + + + Are you sure you want to add subscription {0} to group "{1}"? + + + Adding subscription {0} to group "{1}" + + + Removing management group "{0}" + + + Are you sure you want to remove management group "{0}"? + + + Removing subscription {0} from group "{1}" + + + Are you sure you want to remove subscription {0} from group "{1}"? + + + Updating management group "{0}" + + + Are you sure you want to update management group "{0}"? + + \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/AzureRM.ManagementGroups.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/AzureRM.ManagementGroups.md new file mode 100644 index 000000000000..b2d3c96c2939 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/AzureRM.ManagementGroups.md @@ -0,0 +1,31 @@ +--- +Module Name: AzureRM.ManagementGroups +Module Guid: {{ Update Module Guid }} +Download Help Link: {{ Update Download Link }} +Help Version: {{ Update Help Version }} +Locale: {{ Update Locale }} +--- + +# AzureRM.ManagementGroups Module +## Description +Powershell Module for Management Groups. + +## AzureRM.ManagementGroups Cmdlets +### [Get-AzureRmManagementGroup](Get-AzureRmManagementGroup.md) +Gets Management Group(s) + +### [New-AzureRmManagementGroup](New-AzureRmManagementGroup.md) +Creates a Management Group + +### [New-AzureRmManagementGroupSubscription](New-AzureRmManagementGroupSubscription.md) +Adds a Subscription to a Management Group. + +### [Remove-AzureRmManagementGroup](Remove-AzureRmManagementGroup.md) +Removes a Management Group + +### [Remove-AzureRmManagementGroupSubscription](Remove-AzureRmManagementGroupSubscription.md) +Removes a Subscription from a Management Group. + +### [Update-AzureRmManagementGroup](Update-AzureRmManagementGroup.md) +Updates a Management Group + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Get-AzureRmManagementGroup.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Get-AzureRmManagementGroup.md new file mode 100644 index 000000000000..e23554928b82 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Get-AzureRmManagementGroup.md @@ -0,0 +1,227 @@ +--- +external help file: Microsoft.Azure.Commands.ManagementGroups.dll-Help.xml +Module Name: AzureRM.ManagementGroups +online version: +schema: 2.0.0 +--- + +# Get-AzureRmManagementGroup + +## SYNOPSIS +Gets Management Group(s) + +## SYNTAX + +### ListOperation (Default) +``` +Get-AzureRmManagementGroup [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### GetOperation +``` +Get-AzureRmManagementGroup [-GroupName] [-DefaultProfile ] [-Expand] + [-Recurse] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Get-AzureRMManagementGroup cmdlet Gets all or a specific Management Group. + +## EXAMPLES + +### Example 1: Get all Management Groups +``` +PS C:\> Get-AzureRmManagementGroup + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestGroupDisplayName + +Id : /providers/Microsoft.Management/managementGroups/TestGroupChild +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroupChild +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestGroupChildDisplayName +``` + +### Example 2: Get specific Management Group +``` +PS C:\> Get-AzureRmManagementGroup -GroupName TestGroup + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestGroupDisplayName +UpdatedTime : 2/1/2018 11:16:12 AM +UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9 +ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent +ParentDisplayName : +``` + +### Example 3: Get specific Management Group and first level of hierarchy +``` +PS C:\> $reponse = Get-AzureRmManagementGroup -GroupName TestGroupParent -Expand +PS C:\> $response + +Id : /providers/Microsoft.Management/managementGroups/TestGroupParent +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroupParent +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestGroupParent +UpdatedTime : 2/1/2018 11:15:46 AM +UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9 +ParentId : /providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +ParentDisplayName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +Children : {TestGroup1DisplayName, TestGroup2DisplayName} + +PS C:\> $response.Children[0] + +ChildType : /managementGroup +ChildId : /providers/Microsoft.Management/managementGroups/TestGroup1 +DisplayName : TestGroup1DisplayName +Children : +``` + +With the `Expand` flag, one can navigate through the `Children` array and get details for each child. For example, `Children[0]` will give details for the group with display name `TestGroup1DisplayName`. + +### Example 4: Get specific Management Group and all levels of hiearchy +``` +PS C:\> $response = Get-AzureRmManagementGroup -GroupName TestGroupParent -Expand -Recurse +PS C:\> $response + +Id : /providers/Microsoft.Management/managementGroups/TestGroupParent +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroupParent +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestGroupParent +UpdatedTime : 2/1/2018 11:15:46 AM +UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9 +ParentId : /providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +ParentDisplayName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +Children : {TestGroup1DisplayName, TestGroup2DisplayName} + +PS C:\> $response.Children[0] + +ChildType : /managementGroup +ChildId : /providers/Microsoft.Management/managementGroups/TestGroup1 +DisplayName : TestGroup1DisplayName +Children : {TestRecurseChild} + +PS C:\> $response.Children[0].Children[0] + +ChildType : /managementGroup +ChildId : /providers/Microsoft.Management/managementGroups/TestRecurseChild +DisplayName : TestRecurseChild +Children : +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Expand the output to list the children of the management group + +```yaml +Type: SwitchParameter +Parameter Sets: GetOperation +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Management Group Id + +```yaml +Type: String +Parameter Sets: GetOperation +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Recurse +Recursively list the children of the management group + +```yaml +Type: SwitchParameter +Parameter Sets: GetOperation +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/New-AzureRmManagementGroup.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/New-AzureRmManagementGroup.md new file mode 100644 index 000000000000..b6dd93f8490a --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/New-AzureRmManagementGroup.md @@ -0,0 +1,225 @@ +--- +external help file: Microsoft.Azure.Commands.ManagementGroups.dll-Help.xml +Module Name: AzureRM.ManagementGroups +online version: +schema: 2.0.0 +--- + +# New-AzureRmManagementGroup + +## SYNOPSIS +Creates a Management Group + +## SYNTAX + +### GroupOperations (Default) +``` +New-AzureRmManagementGroup [-GroupName] [[-DisplayName] ] [[-ParentId] ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ParentGroupObject +``` +New-AzureRmManagementGroup [-GroupName] [[-DisplayName] ] + [-DefaultProfile ] -ParentObject [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **New-AzureRMManagementGroup** cmdlet creates a management group. + +## EXAMPLES + +### Example 1: Create a Management Group +``` +PS C:\> New-AzureRmManagementGroup -GroupName "TestGroup" + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30 +DisplayName : TestGroup +UpdatedTime : 2/1/2018 11:06:27 AM +UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentId : /providers/Microsoft.Management/managementGroups/14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentDisplayName : 14307de0-5e6f-46cf-b2ba-64a062964d30 +``` + +Creation of a new group with `DisplayName` and `ParentId` set to `null`. The `DisplayName` will be same as the `GroupName` and the parent of the group will be the tenant. + +### Example 2: Create a Management Group with a display name +``` +PS C:\> New-AzureRmManagementGroup -GroupName "TestGroup" -DisplayName "TestGroupDisplayName" + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30 +DisplayName : TestGroup +UpdatedTime : 2/1/2018 11:06:27 AM +UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentId : /providers/Microsoft.Management/managementGroups/14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentDisplayName : 14307de0-5e6f-46cf-b2ba-64a062964d30 +``` + +In this case, the parent of the group will be the tenant and the `DisplayName` will be set to the value given. + +### Example 3: Create a Management Group with a parent and a display name +``` +PS C:\> New-AzureRmManagementGroup -GroupName "TestGroup" -DisplayName "TestGroupDisplayName" -ParentId "/providers/Microsoft.Management/managementGroups/TestGroupParent" + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30 +DisplayName : TestGroupDisplayName +UpdatedTime : 2/1/2018 11:16:12 AM +UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent +ParentDisplayName : TestGroupParent +``` + +### Example 4: Create a Management Group with a parent (using a parent object) +``` +PS C:\> $parentObject = Get-AzureRmManagementGroup -GroupName "TestGroupParent" +PS C:\> New-AzureRmManagementGroup -GroupName "TestGroup" -ParentObject $parentObject + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30 +DisplayName : TestGroupDisplayName +UpdatedTime : 2/1/2018 11:16:12 AM +UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent +ParentDisplayName : TestGroupParent +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisplayName +Display Name of the management group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Management Group Id + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentId +Parent Id of the management group + +```yaml +Type: String +Parameter Sets: GroupOperations +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentObject +Parent Object + +```yaml +Type: PSManagementGroup +Parameter Sets: ParentGroupObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + +[Remove-AzureRMManagementGroup](./Remove-AzureRMManagementGroup.md) + +[Update-AzureRmManagementGroup](./Update-AzureRmManagementGroup.md) + +[Get-AzureRmManagementGroup](./Get-AzureRmManagementGroup.md) \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/New-AzureRmManagementGroupSubscription.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/New-AzureRmManagementGroupSubscription.md new file mode 100644 index 000000000000..a1257b810675 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/New-AzureRmManagementGroupSubscription.md @@ -0,0 +1,137 @@ +--- +external help file: Microsoft.Azure.Commands.ManagementGroups.dll-Help.xml +Module Name: AzureRM.ManagementGroups +online version: +schema: 2.0.0 +--- + +# New-AzureRmManagementGroupSubscription + +## SYNOPSIS +Adds a Subscription to a Management Group. + +## SYNTAX + +``` +New-AzureRmManagementGroupSubscription [-GroupName] [-SubscriptionId] [-PassThru] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **New-AzureRMManagementGroupSubscription** cmdlet adds a Subscription to a Management Group. + +## EXAMPLES + +### Example 1: Add Subscription to a Management Group +``` +PS C:\> New-AzureRMManagementGroupSubscription -GroupName "TestGroup" -SubscriptionId 2120692d-35c3-44c8-81f5-631fa7351726 +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Management Group Id + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Return `true` on successful execution + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription Id of the subscription associated witht the management + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Remove-AzureRmManagementGroup.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Remove-AzureRmManagementGroup.md new file mode 100644 index 000000000000..1470948c0eeb --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Remove-AzureRmManagementGroup.md @@ -0,0 +1,149 @@ +--- +external help file: Microsoft.Azure.Commands.ManagementGroups.dll-Help.xml +Module Name: AzureRM.ManagementGroups +online version: +schema: 2.0.0 +--- + +# Remove-AzureRmManagementGroup + +## SYNOPSIS +Removes a Management Group + +## SYNTAX + +### GroupOperations (Default) +``` +Remove-AzureRmManagementGroup [-GroupName] [-PassThru] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + +### ManagementGroupObject +``` +Remove-AzureRmManagementGroup -InputObject [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Remove-AzureRmManagementGroup** cmdlet deletes a Management Group. + +## EXAMPLES + +### Example 1 - Remove a Management Group +``` +PS C:\> Remove-AzureRmManagementGroup -GroupName "TestGroup" +``` + +### Example 2 - Remove a Management Group by piping PSManagementGroup Object +``` +PS C:\> Get-Remove-AzureRmManagementGroup -GroupName "TestGroup" | Remove-AzureRmManagementGroup +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Management Group Id + +```yaml +Type: String +Parameter Sets: GroupOperations +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Input Object from the Get call + +```yaml +Type: PSManagementGroup +Parameter Sets: ManagementGroupObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Return `true` on successful execution + +```yaml +Type: SwitchParameter +Parameter Sets: GroupOperations +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Remove-AzureRmManagementGroupSubscription.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Remove-AzureRmManagementGroupSubscription.md new file mode 100644 index 000000000000..9e41353d6e8d --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Remove-AzureRmManagementGroupSubscription.md @@ -0,0 +1,137 @@ +--- +external help file: Microsoft.Azure.Commands.ManagementGroups.dll-Help.xml +Module Name: AzureRM.ManagementGroups +online version: +schema: 2.0.0 +--- + +# Remove-AzureRmManagementGroupSubscription + +## SYNOPSIS +Removes a Subscription from a Management Group. + +## SYNTAX + +``` +Remove-AzureRmManagementGroupSubscription [-GroupName] [-SubscriptionId] [-PassThru] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Remove-AzureRmManagementGroupSubscription** cmdlet removes a Subscription from a Management Group. + +## EXAMPLES + +### Example 1 - Remove Subscription from a Management Group +``` +PS C:\> Remove-AzureRmManagementGroupSubscription -GroupName "TestGroup" -SubscriptionId 2120692d-35c3-44c8-81f5-631fa7351726 +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Management Group Id + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Return `true` on successful execution + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Subscription Id of the subscription associated witht the management + +```yaml +Type: Guid +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Update-AzureRmManagementGroup.md b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Update-AzureRmManagementGroup.md new file mode 100644 index 000000000000..74e81287fd52 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/help/Update-AzureRmManagementGroup.md @@ -0,0 +1,256 @@ +--- +external help file: Microsoft.Azure.Commands.ManagementGroups.dll-Help.xml +Module Name: AzureRM.ManagementGroups +online version: +schema: 2.0.0 +--- + +# Update-AzureRmManagementGroup + +## SYNOPSIS +Updates a Management Group + +## SYNTAX + +### GroupOperations (Default) +``` +Update-AzureRmManagementGroup [-GroupName] [[-DisplayName] ] [[-ParentId] ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ParentAndManagementGroupObject +``` +Update-AzureRmManagementGroup -InputObject [-DisplayName] + [-DefaultProfile ] -ParentObject [-WhatIf] [-Confirm] + [] +``` + +### ManagementGroupObject +``` +Update-AzureRmManagementGroup -InputObject [[-DisplayName] ] [[-ParentId] ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### ParentGroupObject +``` +Update-AzureRmManagementGroup [-GroupName] [[-DisplayName] ] + [-DefaultProfile ] -ParentObject [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **Update-AzureRMManagementGroup** cmdlet updates the **ParentId** or **DisplayName** for a Management Group. + +## EXAMPLES + +### Example 1: Update a Management Group's Display Name +``` +PS C:\> Update-AzureRMManagementGroup -Group "TestGroup" -DisplayName "New Display Name" + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : New Display Name +UpdatedTime : 2/1/2018 12:03:37 PM +UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9 +ParentId : /providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +ParentDisplayName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +``` + +### Example 2: Update a Management Group's Parent +``` +PS C:\> Update-AzureRMManagementGroup -Group "TestGroup" -ParentId "/providers/Microsoft.Management/managementGroups/TestGroupParent" + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestGroup +UpdatedTime : 2/1/2018 12:03:37 PM +UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9 +ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent +ParentDisplayName : TestGroupParent +``` + +### Example 3: Update a Management Group by piping PSManagementGroup Object +``` +PS C:\> Get-AzureRmManagementGroup -GroupName "TestGroup" | Update-AzureRMManagementGroup -DisplayName "TestDisplayName" -ParentId "/providers/Microsoft.Management/managementGroups/TestGroupParent" + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0 +DisplayName : TestDisplayName +UpdatedTime : 2/1/2018 12:03:37 PM +UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9 +ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent +ParentDisplayName : TestGroupParent +``` + +### Example 4: Update a Management Group's parent using the ParentObject +``` +PS C:\> $parentObject = Get-AzureRmManagementGroup -GroupName "TestGroupParent" +PS C:\> Update-AzureRmManagementGroup -GroupName "TestGroup" -ParentObject $parentObject + +Id : /providers/Microsoft.Management/managementGroups/TestGroup +Type : /providers/Microsoft.Management/managementGroups +Name : TestGroup +TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30 +DisplayName : TestGroupDisplayName +UpdatedTime : 2/1/2018 11:16:12 AM +UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30 +ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent +ParentDisplayName : TestGroupParent +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisplayName +Display Name of the management group + +```yaml +Type: String +Parameter Sets: GroupOperations, ManagementGroupObject, ParentGroupObject +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: ParentAndManagementGroupObject +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupName +Management Group Id + +```yaml +Type: String +Parameter Sets: GroupOperations, ParentGroupObject +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Input Object from the Get call + +```yaml +Type: PSManagementGroup +Parameter Sets: ParentAndManagementGroupObject, ManagementGroupObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ParentId +Parent Id of the management group + +```yaml +Type: String +Parameter Sets: GroupOperations, ManagementGroupObject +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ParentObject +Input Object from the Get call + +```yaml +Type: PSManagementGroup +Parameter Sets: ParentAndManagementGroupObject, ParentGroupObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS + diff --git a/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/packages.config b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/packages.config new file mode 100644 index 000000000000..6289c0407c21 --- /dev/null +++ b/src/ResourceManager/ManagementGroups/Commands.ManagementGroups/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/ResourceManager/ManagementGroups/ManagementGroups.sln b/src/ResourceManager/ManagementGroups/ManagementGroups.sln new file mode 100644 index 000000000000..e16c502a98ef --- /dev/null +++ b/src/ResourceManager/ManagementGroups/ManagementGroups.sln @@ -0,0 +1,122 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ManagementGroups", "Commands.ManagementGroups\Commands.ManagementGroups.csproj", "{119C7B00-03E7-481D-A74F-CF6CE3920CB8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication", "..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj", "{D3804B64-C0D3-48F8-82EC-1F632F833C9E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.Abstractions", "..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj", "{70527617-7598-4AEF-B5BD-DB9186B8184B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.ResourceManager", "..\Common\Commands.Common.Authentication.ResourceManager\Commands.Common.Authentication.ResourceManager.csproj", "{69C2EB6B-CD63-480A-89A0-C489706E9299}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authorization", "..\..\Common\Commands.Common.Authorization\Commands.Common.Authorization.csproj", "{24508E26-154D-47F1-80EE-439BF0710996}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Graph.RBAC", "..\..\Common\Commands.Common.Graph.RBAC\Commands.Common.Graph.RBAC.csproj", "{269ACF73-0A34-42DC-AB9C-4B15931A489D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Common", "..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj", "{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Common", "..\..\Common\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj", "{C1BDA476-A5CC-4394-914D-48B0EC31A710}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{8C4827CD-E3F0-466B-85AE-7185ED1CC7EC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ManagementGroups.Test", "Commands.ManagementGroups.Test\Commands.ManagementGroups.Test.csproj", "{B0671436-C487-4CD4-AF06-28B4BE57D9E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Resources\Commands.Resources\Commands.Resources.csproj", "{E1F5201D-6067-430E-B303-4E367652991B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {119C7B00-03E7-481D-A74F-CF6CE3920CB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {119C7B00-03E7-481D-A74F-CF6CE3920CB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {119C7B00-03E7-481D-A74F-CF6CE3920CB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {119C7B00-03E7-481D-A74F-CF6CE3920CB8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU + {D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Release|Any CPU.Build.0 = Release|Any CPU + {70527617-7598-4AEF-B5BD-DB9186B8184B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {70527617-7598-4AEF-B5BD-DB9186B8184B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {70527617-7598-4AEF-B5BD-DB9186B8184B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {70527617-7598-4AEF-B5BD-DB9186B8184B}.Release|Any CPU.Build.0 = Release|Any CPU + {69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.Build.0 = Release|Any CPU + {24508E26-154D-47F1-80EE-439BF0710996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24508E26-154D-47F1-80EE-439BF0710996}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24508E26-154D-47F1-80EE-439BF0710996}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24508E26-154D-47F1-80EE-439BF0710996}.Release|Any CPU.Build.0 = Release|Any CPU + {269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.Build.0 = Release|Any CPU + {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.Build.0 = Release|Any CPU + {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Release|Any CPU.Build.0 = Release|Any CPU + {B0671436-C487-4CD4-AF06-28B4BE57D9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0671436-C487-4CD4-AF06-28B4BE57D9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0671436-C487-4CD4-AF06-28B4BE57D9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0671436-C487-4CD4-AF06-28B4BE57D9E6}.Release|Any CPU.Build.0 = Release|Any CPU + {E1F5201D-6067-430E-B303-4E367652991B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1F5201D-6067-430E-B303-4E367652991B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1F5201D-6067-430E-B303-4E367652991B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1F5201D-6067-430E-B303-4E367652991B}.Release|Any CPU.Build.0 = Release|Any CPU + {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B0671436-C487-4CD4-AF06-28B4BE57D9E6} = {8C4827CD-E3F0-466B-85AE-7185ED1CC7EC} + {E1F5201D-6067-430E-B303-4E367652991B} = {8C4827CD-E3F0-466B-85AE-7185ED1CC7EC} + {8058D403-06E3-4BED-8924-D166CE303961} = {8C4827CD-E3F0-466B-85AE-7185ED1CC7EC} + {3436A126-EDC9-4060-8952-9A1BE34CDD95} = {8C4827CD-E3F0-466B-85AE-7185ED1CC7EC} + {CFF09E81-1E31-444E-B4D4-A21E946C29E2} = {8C4827CD-E3F0-466B-85AE-7185ED1CC7EC} + {2493A8F7-1949-4F29-8D53-9D459046C3B8} = {8C4827CD-E3F0-466B-85AE-7185ED1CC7EC} + EndGlobalSection +EndGlobal diff --git a/src/ResourceManager/ManagementGroups/NuGet.Config b/src/ResourceManager/ManagementGroups/NuGet.Config new file mode 100644 index 000000000000..d9ed7455d05d --- /dev/null +++ b/src/ResourceManager/ManagementGroups/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/CreateMappings_rules.json b/tools/CreateMappings_rules.json index 2b23612c513f..d89b1de25fe1 100644 --- a/tools/CreateMappings_rules.json +++ b/tools/CreateMappings_rules.json @@ -128,6 +128,8 @@ { "regex": "AD", "group": "Resources", "alias": "Active Directory" }, { "regex": "Resources", "group": "Resources", "alias": "Resources" }, + { "regex": "ManagementGroups", "alias": "Management Groups"}, + { "regex": "LocationBasedServices", "alias": "Location Based Services" }, { "regex": "Kubernetes", "group": "Kubernetes", "alias": "Kubernetes" } ]