diff --git a/ChangeLog.md b/ChangeLog.md index 1b85a50847f4..210d9da70c5f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,26 @@ -## 2016.02.02 version 1.1.1 -* Azure RemoteApp: Organizational Unit in Azure RemoteApp RDFE cmdlets now accepts Unicode characters. +## 2016.02.03 version 1.2.0 +* Azure RemoteApp: + * Organizational Unit in Azure RemoteApp RDFE cmdlets now accepts Unicode characters. +* Azure Stack Admin: + * New module for the management of azure stack administrative resources such as plan, offer, subscription, resource provider and + gallery items. +* Azure Stack Storage Admin: + * New module for the management of azure stack storage administrative resources such as configuration, infrastructure and health. +* Azure Operational Insights new cmdlets: + * Get-AzureRmOperationalInsightsSavedSearch + * Get-AzureRmOperationalInsightsSavedSeearchResults + * Get-AzureRmOperationalInsightsSavedSearches + * Get-AzureRmOperationalInsightsSchema + * Get-AzureRmOperationalInsightsSearchResult + * Get-AzureRmOperationalInsightsSearchResultUpdate + * Remove-AzureRmOperationalInsightsSavedSearch + * Remove-AzureRmOperationalInsightsSavedSearch + * Set-AzureRmOperationalInsightsSavedSearch +* Add-AzureRmAccount fixed issue with wrong credential message +* Get-AzureRmSubscription cmdlet now returns paginated results +* Update-AzureRM now only updates when need unless -Force is used +* Added telemetry to ARM and ASM cmdlets + ## 2016.01.12 version 1.1.0 * Azure SQL Database: Threat Detection policies: * Using new Threat Detection Types diff --git a/setup/azurecmd.wxs b/setup/azurecmd.wxs index a4d9d7660211..e25ce2bdf2f6 100644 --- a/setup/azurecmd.wxs +++ b/setup/azurecmd.wxs @@ -1,11 +1,11 @@  - + - + - - - @@ -202,9 +199,6 @@ - - - @@ -298,6 +292,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -457,9 +596,6 @@ - - - @@ -519,9 +655,6 @@ - - - @@ -537,9 +670,6 @@ - - - @@ -549,9 +679,6 @@ - - - @@ -1060,9 +1187,6 @@ - - - @@ -1126,9 +1250,6 @@ - - - @@ -1209,9 +1330,6 @@ - - - @@ -1399,9 +1517,6 @@ - - - @@ -1895,9 +2010,6 @@ - - - @@ -2207,9 +2319,6 @@ - - - @@ -2260,9 +2369,6 @@ - - - @@ -2953,9 +3059,6 @@ - - - @@ -3096,9 +3199,6 @@ - - - @@ -3331,9 +3431,6 @@ - - - @@ -3372,9 +3469,6 @@ - - - @@ -3477,9 +3571,6 @@ - - - @@ -3650,9 +3741,6 @@ - - - @@ -4064,9 +4152,6 @@ - - - @@ -4488,9 +4573,6 @@ - - - @@ -4614,9 +4696,6 @@ - - - @@ -4819,9 +4898,6 @@ - - - @@ -4876,7 +4952,6 @@ - @@ -4915,7 +4990,6 @@ - @@ -4946,6 +5020,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4998,7 +5119,6 @@ - @@ -5018,17 +5138,14 @@ - - - @@ -5195,7 +5312,6 @@ - @@ -5217,7 +5333,6 @@ - @@ -5244,7 +5359,6 @@ - @@ -5306,7 +5420,6 @@ - @@ -5468,7 +5581,6 @@ - @@ -5570,7 +5682,6 @@ - @@ -5587,7 +5698,6 @@ - @@ -5812,7 +5922,6 @@ - @@ -5859,7 +5968,6 @@ - @@ -5936,7 +6044,6 @@ - @@ -5949,7 +6056,6 @@ - @@ -5984,7 +6090,6 @@ - @@ -6041,7 +6146,6 @@ - @@ -6167,7 +6271,6 @@ - @@ -6297,7 +6400,6 @@ - @@ -6339,7 +6441,6 @@ - @@ -6406,7 +6507,6 @@ - diff --git a/src/Common/Commands.Common/AzurePowerShell.cs b/src/Common/Commands.Common/AzurePowerShell.cs index 246882fd07d2..ca6942e92c28 100644 --- a/src/Common/Commands.Common/AzurePowerShell.cs +++ b/src/Common/Commands.Common/AzurePowerShell.cs @@ -29,7 +29,7 @@ public class AzurePowerShell public const string AssemblyVersion = "1.0.0"; - public const string AssemblyFileVersion = "1.0.2"; + public const string AssemblyFileVersion = "1.0.4"; public const string ProfileFile = "AzureProfile.json"; diff --git a/src/Common/Storage/Azure.Storage.psd1 b/src/Common/Storage/Azure.Storage.psd1 index 4456847a3e7b..36b405c28855 100644 --- a/src/Common/Storage/Azure.Storage.psd1 +++ b/src/Common/Storage/Azure.Storage.psd1 @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '00612bca-fa22-401d-a671-9cc48b010e3b' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj b/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj index d516eb171740..58c120ec8b32 100644 --- a/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj +++ b/src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj @@ -125,9 +125,9 @@ ..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll - + False - ..\..\..\packages\Microsoft.Azure.Storage.DataMovement.0.2.0\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll + ..\..\..\lib\Microsoft.WindowsAzure.Storage.DataMovement.dll ..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll @@ -281,4 +281,4 @@ - + \ No newline at end of file diff --git a/src/Common/Storage/Commands.Storage.Test/packages.config b/src/Common/Storage/Commands.Storage.Test/packages.config index e0c934bf1e82..4275b79bf2d5 100644 --- a/src/Common/Storage/Commands.Storage.Test/packages.config +++ b/src/Common/Storage/Commands.Storage.Test/packages.config @@ -5,7 +5,6 @@ - diff --git a/src/Common/Storage/Commands.Storage/Commands.Storage.csproj b/src/Common/Storage/Commands.Storage/Commands.Storage.csproj index be8d84979a6e..de06b915084c 100644 --- a/src/Common/Storage/Commands.Storage/Commands.Storage.csproj +++ b/src/Common/Storage/Commands.Storage/Commands.Storage.csproj @@ -53,7 +53,7 @@ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.6.1-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll True - + False ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -105,9 +105,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll @@ -115,9 +112,9 @@ False ..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll - + False - ..\..\..\packages\Microsoft.Azure.Storage.DataMovement.0.2.0\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll + ..\..\..\lib\Microsoft.WindowsAzure.Storage.DataMovement.dll False @@ -325,4 +322,4 @@ powershell.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)\PostBuild.ps1" "..\..\..\ResourceManager\AzureResourceManager" - + \ No newline at end of file diff --git a/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs b/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs index eb4145ace49f..50b5ad188983 100644 --- a/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs +++ b/src/Common/Storage/Commands.Storage/Properties/AssemblyInfo.cs @@ -44,8 +44,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Storage.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/Common/Storage/Commands.Storage/packages.config b/src/Common/Storage/Commands.Storage/packages.config index 66c72bd1ca16..bfe594a9d55b 100644 --- a/src/Common/Storage/Commands.Storage/packages.config +++ b/src/Common/Storage/Commands.Storage/packages.config @@ -5,7 +5,6 @@ - @@ -17,7 +16,6 @@ - diff --git a/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1 b/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1 index 9cbfb58dbe63..aaf71d7802fd 100644 --- a/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1 +++ b/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.ApiManagement' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'f875725d-8ce4-423f-a6af-ea880bc63f13' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj index 12cb2bcf65d1..9f2b1c647b40 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj @@ -100,10 +100,6 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs index d2b83cb5b7bf..df98f530fac8 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs @@ -42,5 +42,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config index 9eae2206e148..a338a30cc6b2 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/packages.config @@ -18,7 +18,6 @@ - diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs index 6720afcce6df..0f1e0c47cea1 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Properties/AssemblyInfo.cs @@ -41,5 +41,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj index a47dc1d6a7f0..e92a5fdb3261 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.csproj @@ -115,10 +115,6 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Properties/AssemblyInfo.cs index 3c0e2407765d..9e68ad3db749 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/Properties/AssemblyInfo.cs @@ -41,5 +41,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config b/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config index 9eae2206e148..a338a30cc6b2 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement/packages.config @@ -18,7 +18,6 @@ - diff --git a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs index a07ee955a6f1..421201341f40 100644 --- a/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/ApiManagement/Commands.SMAPI.Test/Properties/AssemblyInfo.cs @@ -41,5 +41,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Automation/AzureRM.Automation.psd1 b/src/ResourceManager/Automation/AzureRM.Automation.psd1 index 34d0dd5470e2..a6172536bf69 100644 --- a/src/ResourceManager/Automation/AzureRM.Automation.psd1 +++ b/src/ResourceManager/Automation/AzureRM.Automation.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Automation' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'bcea1c70-a32b-48c3-a05c-323e1c02f4d3' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs index 88f8580c2f54..3aa7667b4209 100644 --- a/src/ResourceManager/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs @@ -42,6 +42,6 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] diff --git a/src/ResourceManager/Automation/Commands.Automation/Properties/AssemblyInfo.cs b/src/ResourceManager/Automation/Commands.Automation/Properties/AssemblyInfo.cs index 4c69fa36505d..9035ff3833a4 100644 --- a/src/ResourceManager/Automation/Commands.Automation/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Automation/Commands.Automation/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.ResourceManager.Automation.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1 b/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1 index ce23e9946e36..c813e6fd375f 100644 --- a/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1 +++ b/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.AzureBackup' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '0b1d76f5-a928-4b8f-9c83-df26947568d4' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Properties/AssemblyInfo.cs index 66ffec4279b1..52407357aef0 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Properties/AssemblyInfo.cs @@ -46,5 +46,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj index 775135474c41..869841b46df9 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj @@ -197,7 +197,10 @@ AzureRM.Backup.psd1 PreserveNewest - + + Never + Designer + Always Designer diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/AssemblyInfo.cs index d610329fd4c0..7e8012eceb90 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1 b/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1 index 962306420e69..fa0b51962059 100644 --- a/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1 +++ b/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Batch' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'a8f00f40-1c1a-49b5-9db3-24076b75c3cf' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/AzureBatch/Commands.Batch.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureBatch/Commands.Batch.Test/Properties/AssemblyInfo.cs index 1c7d55b10fef..01521d1531d7 100644 --- a/src/ResourceManager/AzureBatch/Commands.Batch.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/AzureBatch/Commands.Batch.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj index f36533825d5d..752352fe3a0c 100644 --- a/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj +++ b/src/ResourceManager/AzureBatch/Commands.Batch/Commands.Batch.csproj @@ -100,9 +100,6 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll True diff --git a/src/ResourceManager/AzureBatch/Commands.Batch/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureBatch/Commands.Batch/Properties/AssemblyInfo.cs index b4496e975a60..e20109ef7143 100644 --- a/src/ResourceManager/AzureBatch/Commands.Batch/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/AzureBatch/Commands.Batch/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("ed102280-3577-49bf-93dd-11b6e3a44a57")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Batch.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/AzureBatch/Commands.Batch/packages.config b/src/ResourceManager/AzureBatch/Commands.Batch/packages.config index 6930addce351..6acc16624739 100644 --- a/src/ResourceManager/AzureBatch/Commands.Batch/packages.config +++ b/src/ResourceManager/AzureBatch/Commands.Batch/packages.config @@ -18,7 +18,6 @@ - diff --git a/src/ResourceManager/AzureStackAdmin/AzureRM.AzureStackAdmin.psd1 b/src/ResourceManager/AzureStackAdmin/AzureRM.AzureStackAdmin.psd1 new file mode 100644 index 000000000000..e26e79b5e86e --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/AzureRM.AzureStackAdmin.psd1 @@ -0,0 +1,86 @@ +# +# Module manifest for module 'AzureRM.AzureStackAdmin' +# +# Generated by: Microsoft Corporation +# +# Updated on: 10/27/2015 +# + +@{ + +# Script module or binary module file associated with this manifest +ModuleToProcess = 'Microsoft.AzureStack.Commands.dll' + +# Version number of this module. +ModuleVersion = '0.9.1' + +# ID used to uniquely identify this module +GUID = '0e691e0a-ce16-40f2-af84-86fb0d82fb29' + +# 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 Stack Administration Module' + +# 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 the .NET Framework required by this module +DotNetFrameworkVersion = '4.5' + +# Minimum version of the common language runtime (CLR) required by this module +CLRVersion = '4.0' + +# Processor architecture (None, X86, Amd64, IA64) required by this module +ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) + +# Assemblies that must be loaded prior to importing this module +# RequiredAssemblies = @() + +# Type files (.ps1xml) to be loaded when importing this module +TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +# FormatsToProcess = @('AzureStackAdmin.format.ps1xml') + +# Modules to import as nested modules of the module specified in ModuleToProcess +NestedModules = @() + +# Functions to export from this module +FunctionsToExport = '*' + +# Cmdlets to export from this module +CmdletsToExport = '*' + +# Variables to export from this module +VariablesToExport = '*' + +# Aliases to export from this module +AliasesToExport = '*' + +# 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 ModuleToProcess +PrivateData = '' +} + diff --git a/src/ResourceManager/AzureStackAdmin/AzureStackAdmin.sln b/src/ResourceManager/AzureStackAdmin/AzureStackAdmin.sln new file mode 100644 index 000000000000..02e822dc775a --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/AzureStackAdmin.sln @@ -0,0 +1,39 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +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.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" +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.AzureStackAdmin", "Commands.AzureStackAdmin\Commands.AzureStackAdmin.csproj", "{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {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 + {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 + {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 + {0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/AdminApiCmdlet.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/AdminApiCmdlet.cs new file mode 100644 index 000000000000..a140d5b1a842 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/AdminApiCmdlet.cs @@ -0,0 +1,200 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using System.Net; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.Azure.Common.Authentication; + using Microsoft.Azure.Common.Authentication.Models; + using Microsoft.Azure; + using Microsoft.AzureStack.Management; + + /// + /// Base Admin API cmdlet class + /// + public abstract class AdminApiCmdlet : AzureRMCmdlet + { + /// + /// The default API version. + /// + private const string DefaultApiVersion = "1.0"; + + /// + /// Gets or sets the admin base URI + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + [ValidateAbsoluteUri] + public Uri AdminUri { get; set; } + + /// + /// Gets or sets the authentication token + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string Token { get; set; } + + /// + /// Gets or sets the API version. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string ApiVersion { get; set; } + + /// + /// Gets or sets a value indicating whether to disable certificate validation. + /// + [Parameter] + public SwitchParameter DisableCertificateValidation { get; set; } + + /// + /// Gets the current default context. overriding it here since DefaultContext could be null for Windows Auth/ADFS environments + /// + protected override AzureContext DefaultContext + { + get + { + if (DefaultProfile == null) + { + return null; + } + + return DefaultProfile.Context; + } + } + + /// + /// Execute this cmdlet. + /// + /// + /// Descendant classes must override this methods instead of Cmdlet.ProcessRecord, so + /// we can have a unique place where log all errors. + /// + protected override void ProcessRecord() + { + var originalValidateCallback = ServicePointManager.ServerCertificateValidationCallback; + object result; + + this.ValidateParameters(); + + try + { + // Note: (bryanr) Adding the tracing interceptor requires using a message pump and action queue. See relevant thread in PowerShell Discussions. + ////CloudContext.Configuration.Tracing.AddTracingInterceptor(this); + + // TODO (bryanr) - Evaluate if this should be removed entirely + if (this.DisableCertificateValidation) + { + this.WriteWarning(Resources.WarningDisableCertificateValidation); + ServicePointManager.ServerCertificateValidationCallback = (s, certificate, chain, sslPolicyErrors) => true; + } + + // Initialize parameters bound from the pipeline + this.ApiVersion = this.ApiVersion ?? DefaultApiVersion; + + // Execute the API call(s) for the current cmdlet + result = this.ExecuteCore(); + } + finally + { + if (this.DisableCertificateValidation) + { + ServicePointManager.ServerCertificateValidationCallback = originalValidateCallback; + } + + ////CloudContext.Configuration.Tracing.RemoveTracingInterceptor(this); + } + + // Write the object to the pipeline only after the certificate validation callback has been restored. + // This will prevent other cmdlets in the pipeline from inheriting this security vulnerability. + if (result != null) + { + this.WriteObject(result, enumerateCollection: true); + } + } + + private void ValidateParameters() + { + // if Token is empty, make sure that we have a valid azure profile + if (string.IsNullOrEmpty(this.Token)) + { + if (this.DefaultContext == null) + { + throw new ApplicationException(Resources.InvalidProfile); + } + } + else + { + // if token is specified, AdminUri is required as well + if (this.AdminUri == null) + { + throw new ApplicationException(Resources.TokenAndAdminUriRequired); + } + } + } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected abstract object ExecuteCore(); + + /// + /// Gets the Azure Stack management client. + /// + /// The subscription identifier. + protected AzureStackClient GetAzureStackClient(string subscriptionId = null) + { + if (string.IsNullOrEmpty(this.Token)) + { + return GetAzureStackClientThruAzureSession(); + } + + if (string.IsNullOrEmpty(subscriptionId)) + { + return new AzureStackClient( + baseUri: this.AdminUri, + credentials: new TokenCloudCredentials(token: this.Token), + apiVersion: this.ApiVersion); + } + else + { + return new AzureStackClient( + baseUri: this.AdminUri, + credentials: new TokenCloudCredentials(subscriptionId: subscriptionId, token: this.Token), + apiVersion: this.ApiVersion); + } + } + + /// + /// Gets the Azures Stack management client. + /// + /// The subscription identifier. + protected AzureStackClient GetAzureStackClient(Guid subscriptionId) + { + return this.GetAzureStackClient(subscriptionId.ToString()); + } + + private AzureStackClient GetAzureStackClientThruAzureSession() + { + var armUri = this.DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager); + var credentials = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(this.DefaultContext); + + return AzureSession.ClientFactory.CreateCustomClient(armUri, credentials, this.ApiVersion); + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/ArgumentValidator.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/ArgumentValidator.cs new file mode 100644 index 000000000000..b9fad6b16e31 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/ArgumentValidator.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. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.AzureStack.Commands +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Microsoft.WindowsAzure.Commands.Common.Properties; + + /// + /// Argument Validation Methods + /// + public static class ArgumentValidator + { + /// + /// Checks if argument is null. + /// + /// Name of the property. + /// The value. + public static void ValidateNotNull(string paramName, object value) + { + if (value == null) + { + throw new ArgumentNullException(paramName); + } + } + + /// + /// Checks if argument is empty. + /// + /// Name of the property. + /// The value. + public static void ValidateNotEmpty(string paramName, string value) + { + if (value == null) + { + throw new ArgumentNullException(paramName); + } + + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException(Resources.ExpectedNotEmptyValue, paramName: paramName); + } + } + + /// + /// Checks if argument is null or empty collection. + /// + /// Type of items in the collection + /// Name of the property. + /// The collection. + public static void ValidateNotEmpty(string paramName, IEnumerable collection) + { + if (collection == null) + { + throw new ArgumentNullException(paramName); + } + + if (!collection.Any()) + { + throw new ArgumentException(Resources.ExpectedNotEmptyCollection, paramName: paramName); + } + } + + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Commands.AzureStackAdmin.csproj b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Commands.AzureStackAdmin.csproj new file mode 100644 index 000000000000..f5cff5d125c9 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Commands.AzureStackAdmin.csproj @@ -0,0 +1,184 @@ + + + + + Debug + AnyCPU + {0B02390C-8AA9-4D99-8AA8-2A9D2D39682F} + Library + Properties + Microsoft.AzureStack.Commands + Microsoft.AzureStack.Commands + v4.5 + 512 + ..\..\..\ + true + /assemblyCompareMode:StrongNameIgnoringVersion + + + true + full + false + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\ + TRACE;DEBUG + prompt + 4 + true + true + false + + + ..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\ + TRACE;SIGN + true + pdbonly + AnyCPU + bin\Release\Microsoft.AzureStack.Commands.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets + ;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules + true + true + MSSharedLibKey.snk + true + false + + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + + + + + + + + ..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + + + ..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + + + + + + + + + ..\..\..\packages\Microsoft.AzureStack.Management.0.9.1-preview\lib\net45\Microsoft.AzureStack.Management.dll + + + ..\..\..\packages\Hyak.Common.1.0.3\lib\net40\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.6.1-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.0.11.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll + True + + + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {3819d8a7-c62c-4c47-8ddd-0332d9ce1252} + Commands.ResourceManager.Common + + + + + + + + + AzureRM.AzureStackAdmin.psd1 + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + Always + + + Designer + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + PreserveNewest + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/CommonPSConst.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/CommonPSConst.cs new file mode 100644 index 000000000000..ba6e66d21cd3 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/CommonPSConst.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + /// + /// Common constants for all PowerShell modules + /// + public static class CommonPSConst + { + /// + /// Parameter set names + /// + public static class ParameterSet + { + /// + /// Parameter set for property base parameters. + /// + public const string ByProperty = "ByProperty"; + + /// + /// Parameter set for full object base parameters. + /// + public const string ByObject = "ByObject"; + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/MSSharedLibKey.snk b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/MSSharedLibKey.snk differ diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.AzureStack.Commands.dll-help.psd1 b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.AzureStack.Commands.dll-help.psd1 new file mode 100644 index 000000000000..7bd34f5212b2 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.AzureStack.Commands.dll-help.psd1 @@ -0,0 +1,88 @@ +# +# Module manifest for module 'Microsoft.AzureStack.Commands.Admin' +# +# Generated by: Microsoft Corporation +# +# Generated on: 04/01/2015 +# + +@{ + +# Version number of this module. +ModuleVersion = '0.9.1' + +# ID used to uniquely identify this module +GUID = 'F237EAAA-BD3A-4965-AD4A-BF38598BFEF7' + +# 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 = '' + +# 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 the .NET Framework required by this module +DotNetFrameworkVersion = '4.5' + +# Minimum version of the common language runtime (CLR) required by this module +CLRVersion='4.0' + +# Processor architecture (None, X86, Amd64, IA64) required by this module +ProcessorArchitecture = 'None' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = @() + +# 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 = @() + +# Modules to import as nested modules of the module specified in ModuleToProcess +NestedModules = @( + '.\Microsoft.AzureStack.Commands.dll' +) + +# Functions to export from this module +FunctionsToExport = '*' + +# Cmdlets to export from this module +CmdletsToExport = '*' + +# Variables to export from this module +VariablesToExport = '*' + +# Aliases to export from this module +AliasesToExport = @() + +# 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 ModuleToProcess +PrivateData = '' + +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.AzureStack.Commands.dll-help.xml b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.AzureStack.Commands.dll-help.xml new file mode 100644 index 000000000000..88d7f77aa009 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.AzureStack.Commands.dll-help.xml @@ -0,0 +1,7126 @@ + + + + + Add-AzureRMGalleryItem + + Adds a new Gallery Item to the Gallery Service. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Add + AzureRMGalleryItem + + + + + + + + Add-AzureRMGalleryItem + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to uploading the Gallery Item + + Guid + + + Path + + Path to the azpkg file + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to uploading the Gallery Item + + Guid + + Guid + + + + + + Path + + Path to the azpkg file + + String + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add-AzureRMResourceProviderRegistration + + Enables you to add a custom Resource Provider to Resource Manager. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Add + AzureRMResourceProviderRegistration + + + + + + + + Add-AzureRMResourceProviderRegistration + + ArmLocation + + + + String + + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + DisplayName + + Display Name for the Resource Provider + + String + + + Location + + The Location to which you'd like to register the Resource Provider. It should be a value that already exists in the system. + + String + + + ManifestEndpoint + + The endpoint of the Manifest for the Resource Provider that needs to be registered with Azure Stack + + Uri + + + UserName + + UserName for the Manifest endpoint + + String + + + Password + + Password for the Manifest endpoint + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Add-AzureRMResourceProviderRegistration + + ProviderRegistration + + Provider Registration Object + + ProviderRegistrationModel + + + ArmLocation + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + ArmLocation + + + + String + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + DisplayName + + Display Name for the Resource Provider + + String + + String + + + + + + Location + + The Location to which you'd like to register the Resource Provider. It should be a value that already exists in the system. + + String + + String + + + + + + ManifestEndpoint + + The endpoint of the Manifest for the Resource Provider that needs to be registered with Azure Stack + + Uri + + Uri + + + + + + UserName + + UserName for the Manifest endpoint + + String + + String + + + + + + Password + + Password for the Manifest endpoint + + String + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + ProviderRegistration + + Provider Registration Object + + ProviderRegistrationModel + + ProviderRegistrationModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMGalleryItem + + fetches a Gallery Item from the Gallery Service. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Get + AzureRMGalleryItem + + + + + + + + Get-AzureRMGalleryItem + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMManagedLocation + + Gets all the regions registered in the cloud. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Get + AzureRMManagedLocation + + + + + + + + Get-AzureRMManagedLocation + + Name + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMManagedSubscription + + Gets a list of all Tenant Subscriptions in the system managed by the admin user. + + + + + Get + AzureRMManagedSubscription + + + + + + + + Get-AzureRMManagedSubscription + + TargetSubscriptionId + + + + Guid + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + TargetSubscriptionId + + + + Guid + + Guid + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMOffer + + Gets the list of all Offers in the system. When the Offer Id or Name is mentioned, it fetches the specific Offer. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Get + AzureRMOffer + + + + + + + + Get-AzureRMOffer + + Provider + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Get-AzureRMOffer + + OfferId + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Get-AzureRMOffer + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + Managed + + + + SwitchParameter + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Provider + + + + String + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + OfferId + + + + String + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + Managed + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMPlan + + Gets the list of all Plans in the system. When the Plan Name is mentioned, it fetches the specific Plan. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Get + AzureRMPlan + + + + + + + + Get-AzureRMPlan + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Get-AzureRMPlan + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + Managed + + + + SwitchParameter + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Get-AzureRMPlan + + Name + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + Managed + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMResourceProviderRegistration + + Gets all the Resource Provider registered to the cloud. This cmdlet is applicable only to Microsoft Azure Stack Environments. + + + + + Get + AzureRMResourceProviderRegistration + + + + + + + + Get-AzureRMResourceProviderRegistration + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRMTenantSubscription + + Gets a list of Subscriptions that a user has access to.. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Get + AzureRMTenantSubscription + + + + + + + + Get-AzureRMTenantSubscription + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureStackToken + + Gets a token for a specified user. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Get + AzureStackToken + + + + + + + + Get-AzureStackToken + + Authority + + + + String + + + Resource + + + + String + + + ClientId + + + + String + + + Credential + + + + PSCredential + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Get-AzureStackToken + + Authority + + + + String + + + Resource + + + + String + + + AadTenantId + + + + String + + + ClientId + + + + String + + + Credential + + + + PSCredential + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Authority + + + + String + + String + + + + + + Resource + + + + String + + String + + + + + + ClientId + + + + String + + String + + + + + + Credential + + + + PSCredential + + PSCredential + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + AadTenantId + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureRMManagedLocation + + Adds a region to the cloud. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + New + AzureRMManagedLocation + + + + + + + + New-AzureRMManagedLocation + + Name + + + + String + + + DisplayName + + + + String + + + Latitude + + + + Double + + + Longitude + + + + Double + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + DisplayName + + + + String + + String + + + + + + Latitude + + + + Double + + Double + + + + + + Longitude + + + + Double + + Double + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureRMManagedSubscription + + Adds a new Subscription for the current user. This is applicable only to users with access to the Subscriptions.Admin namespace. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + New + AzureRMManagedSubscription + + + + + + + + New-AzureRMManagedSubscription + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + Owner + + + + String + + + OfferId + + + + String + + + DisplayName + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + Owner + + + + String + + String + + + + + + OfferId + + + + String + + String + + + + + + DisplayName + + + + String + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureRMOffer + + Creates a new Offer. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + New + AzureRMOffer + + + + + + + + New-AzureRMOffer + + Name + + + + String + + + DisplayName + + + + String + + + State + + + + AccessibilityState + + + BasePlans + + + + AdminPlanModel[] + + + ArmLocation + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + DisplayName + + + + String + + String + + + + + + State + + + + AccessibilityState + + AccessibilityState + + + + + + BasePlans + + + + AdminPlanModel[] + + AdminPlanModel[] + + + + + + ArmLocation + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureRMPlan + + Creates a new Plan. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + New + AzureRMPlan + + + + + + + + New-AzureRMPlan + + Name + + + + String + + + DisplayName + + + + String + + + State + + + + AccessibilityState + + + ArmLocation + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + DisplayName + + + + String + + String + + + + + + State + + + + AccessibilityState + + AccessibilityState + + + + + + ArmLocation + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureRMTenantSubscription + + Creates a new Tenant Subscription. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + New + AzureRMTenantSubscription + + + + + + + + New-AzureRMTenantSubscription + + Owner + + + + String + + + OfferId + + + + String + + + DisplayName + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Owner + + + + String + + String + + + + + + OfferId + + + + String + + String + + + + + + DisplayName + + + + String + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMGalleryItem + + Removes a Gallery Item from the Gallery Service. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Remove + AzureRMGalleryItem + + + + + + + + Remove-AzureRMGalleryItem + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMManagedLocation + + Removes a region from the cloud. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Remove + AzureRMManagedLocation + + + + + + + + Remove-AzureRMManagedLocation + + Name + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMManagedSubscription + + Removes a Subscription from the current user. This is applicable only to users with access to the Subscriptions.Admin namespace + + + + + Remove + AzureRMManagedSubscription + + + + + + + + Remove-AzureRMManagedSubscription + + SubscriptionId + + + + Guid + + + TargetSubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + SubscriptionId + + + + Guid + + Guid + + + + + + TargetSubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMOffer + + Removes an Offer. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Remove + AzureRMOffer + + + + + + + + Remove-AzureRMOffer + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMPlan + + Removes a Plan. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Remove + AzureRMPlan + + + + + + + + Remove-AzureRMPlan + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMResourceProviderRegistration + + Removes a custom Resource Provider from the cloud. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Remove + AzureRMResourceProviderRegistration + + + + + + + + Remove-AzureRMResourceProviderRegistration + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRMTenantSubscription + + Removes a Tenant Subscription. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Remove + AzureRMTenantSubscription + + + + + + + + Remove-AzureRMTenantSubscription + + TargetSubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + TargetSubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRMManagedLocation + + Updates a region in the cloud. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Set + AzureRMManagedLocation + + + + + + + + Set-AzureRMManagedLocation + + Location + + + + Location + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Location + + + + Location + + Location + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRMManagedSubscription + + Updates a Subscription for the current user. This cmdlet can be used only by users with access to the Subscriptions.Admin namespace. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Set + AzureRMManagedSubscription + + + + + + + + Set-AzureRMManagedSubscription + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + Subscription + + + + SubscriptionDefinition + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + Subscription + + + + SubscriptionDefinition + + SubscriptionDefinition + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRMOffer + + Updates an Offer. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Set + AzureRMOffer + + + + + + + + Set-AzureRMOffer + + Offer + + + + AdminOfferModel + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Offer + + + + AdminOfferModel + + AdminOfferModel + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRMPlan + + Updates a Plan. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Set + AzureRMPlan + + + + + + + + Set-AzureRMPlan + + Plan + + + + AdminPlanModel + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Plan + + + + AdminPlanModel + + AdminPlanModel + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRMResourceProviderRegistration + + Updates a Resource Provider Registration. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Set + AzureRMResourceProviderRegistration + + + + + + + + Set-AzureRMResourceProviderRegistration + + ArmLocation + + + + String + + + Name + + + + String + + + ResourceGroup + + + + String + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + + DisplayName + + + + String + + + Location + + + + String + + + ManifestEndpoint + + + + Uri + + + UserName + + + + String + + + Password + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + Set-AzureRMResourceProviderRegistration + + ProviderRegistration + + + + ProviderRegistrationModel + + + ArmLocation + + + + String + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + ArmLocation + + + + String + + String + + + + + + Name + + + + String + + String + + + + + + ResourceGroup + + + + String + + String + + + + + + SubscriptionId + + The Id of the subscription that has access to the required namespace to complete the operation + + Guid + + Guid + + + + + + DisplayName + + + + String + + String + + + + + + Location + + + + String + + String + + + + + + ManifestEndpoint + + + + Uri + + Uri + + + + + + UserName + + + + String + + String + + + + + + Password + + + + String + + String + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + ProviderRegistration + + + + ProviderRegistrationModel + + ProviderRegistrationModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRMTenantSubscription + + Updates a tenant subscription. This cmdlet is applicable only to Microsoft Azure Stack Environments + + + + + Set + AzureRMTenantSubscription + + + + + + + + Set-AzureRMTenantSubscription + + Subscription + + + + SubscriptionDefinition + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + + ApiVersion + + Version of the API for this request + + String + + + DisableCertificateValidation + + + + SwitchParameter + + + InformationAction + + + + ActionPreference + + + InformationVariable + + + + String + + + + + + Subscription + + + + SubscriptionDefinition + + SubscriptionDefinition + + + + + + AdminUri + + URI of the Azure Resource Manager endpoint + + Uri + + Uri + + + + + + Token + + A valid Security token for a user/principal that has access to the Subscription + + String + + String + + + + + + ApiVersion + + Version of the API for this request + + String + + String + + + + + + DisableCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + InformationAction + + + + ActionPreference + + ActionPreference + + + + + + InformationVariable + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/AddGalleryItem.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/AddGalleryItem.cs new file mode 100644 index 000000000000..79a46759df3e --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/AddGalleryItem.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. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.AzureStack.Commands +{ + using System; + using System.IO; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Gallery Item Cmdlet + /// + [Cmdlet(VerbsCommon.Add, Nouns.GalleryItem)] + [OutputType(typeof(AzureOperationResponse))] + public class AddGalleryItem : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription identifier. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateNotNull] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets the path. TODO - support directory and file path. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateNotNull] + public string Path { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + this.WriteVerbose(Resources.AddingGalleryItem.FormatArgs(this.Name)); + + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + using (var filestream = File.Open(this.Path, FileMode.Open, FileAccess.Read)) + { + var manifest = client.Package.CreateOrUpdate(this.ResourceGroup, Guid.NewGuid().ToString(), filestream); + var uploadParameters = new GalleryItemCreateOrUpdateParameters() { Manifest = manifest.Manifest }; + return client.GalleryItem.CreateOrUpdate(this.ResourceGroup, this.Name, uploadParameters); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/GetGalleryItem.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/GetGalleryItem.cs new file mode 100644 index 000000000000..297ce31e64f1 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/GetGalleryItem.cs @@ -0,0 +1,80 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Gallery Item Cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.GalleryItem)] + [OutputType(typeof(GalleryItemModel))] + public class GetGalleryItem : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription identifier. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateNotNull] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + if (string.IsNullOrEmpty(this.Name)) + { + this.WriteVerbose(Resources.ListingGalleryItems); + + return string.IsNullOrEmpty(this.ResourceGroup) + ? client.GalleryItem.ListWithoutResourceGroup().GalleryItems + : client.GalleryItem.List(this.ResourceGroup).GalleryItems; + } + else if (string.IsNullOrEmpty(this.ResourceGroup)) + { + throw new ValidationMetadataException(Resources.ResourceGroupCannotBeEmpty); + } + else + { + this.WriteVerbose(Resources.GettingGalleryItem.FormatArgs(this.Name)); + return client.GalleryItem.Get(this.ResourceGroup, this.Name).GalleryItem; + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/RemoveGalleryItem.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/RemoveGalleryItem.cs new file mode 100644 index 000000000000..87cc4829d1bd --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Gallery/GalleryItems/RemoveGalleryItem.cs @@ -0,0 +1,64 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + + /// + /// Gallery Item Cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.GalleryItem)] + [OutputType(typeof(AzureOperationResponse))] + public class RemoveGalleryItem : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription identifier. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateNotNull] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + return client.GalleryItem.Delete(this.ResourceGroup, this.Name); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/GetManagedLocation.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/GetManagedLocation.cs new file mode 100644 index 000000000000..dca7bd457b92 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/GetManagedLocation.cs @@ -0,0 +1,66 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Remove managed location cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.Location)] + [OutputType(typeof(Location))] + public class GetManagedLocation : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter] + [ValidateLength(1, 128)] + [ValidateNotNull] + [ValidatePattern("^[0-9a-z]+$")] + public string Name { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets the managed location + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + if (string.IsNullOrEmpty(this.Name)) + { + this.WriteVerbose(Resources.ListingManagedLocations); + return client.ManagedLocations.List().Locations; + } + else + { + this.WriteVerbose(Resources.GettingManagedLocation.FormatArgs(this.Name)); + return client.ManagedLocations.Get(this.Name).Location; + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/NewManagedLocation.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/NewManagedLocation.cs new file mode 100644 index 000000000000..0e18a05863ea --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/NewManagedLocation.cs @@ -0,0 +1,101 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// New managed location cmdlet + /// + [Cmdlet(VerbsCommon.New, Nouns.Location)] + [OutputType(typeof(Location))] + public class NewManagedLocation : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + [ValidatePattern("^[0-9a-z]+$")] + public string Name { get; set; } + + /// + /// Gets or sets the display name. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string DisplayName { get; set; } + + /// + /// Gets or sets the latitude of location in signed degrees format. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + [ValidateRange(-90.0, 90.0)] + public double Latitude { get; set; } + + /// + /// Gets or sets the longitude of location in signed degrees format. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + [ValidateRange(-180.0, 180.0)] + public double Longitude { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Creates a new location + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.CreatingNewManagedLocation.FormatArgs(this.Name)); + var parameters = new ManagedLocationCreateOrUpdateParameters() + { + Location = new Location() + { + DisplayName = this.DisplayName, + Latitude = this.Latitude.ToString(CultureInfo.InvariantCulture), + Longitude = this.Longitude.ToString(CultureInfo.InvariantCulture), + Name = this.Name + } + }; + + if (client.ManagedLocations.List() + .Locations.Any(location => location.Name.EqualsInsensitively(parameters.Location.Name))) + { + throw new PSInvalidOperationException(Resources.ManagedLocationAlreadyExists.FormatArgs(parameters.Location.Name)); + } + + return client.ManagedLocations.CreateOrUpdate(parameters).Location; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/RemoveManagedLocation.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/RemoveManagedLocation.cs new file mode 100644 index 000000000000..0cd75526f60c --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/RemoveManagedLocation.cs @@ -0,0 +1,59 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.Azure; + using Microsoft.WindowsAzure; + using Microsoft.AzureStack.Management; + + /// + /// Remove managed location cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.Location)] + [OutputType(typeof(AzureOperationResponse))] + public class RemoveManagedLocation : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + [ValidatePattern("^[0-9a-z]+$")] + public string Name { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Removes the specified location + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.RemovingManagedLocation.FormatArgs(this.Name)); + return client.ManagedLocations.Delete(this.Name); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/SetManagedLocation.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/SetManagedLocation.cs new file mode 100644 index 000000000000..8cb6372aa5fa --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ManagedLocations/SetManagedLocation.cs @@ -0,0 +1,57 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Set managed location cmdlet + /// + [Cmdlet(VerbsCommon.Set, Nouns.Location)] + [OutputType(typeof(Location))] + public class SetManagedLocation : AdminApiCmdlet + { + /// + /// Gets or sets the managed location. + /// + [Parameter(ValueFromPipeline = true, Mandatory = true)] + [ValidateNotNull] + public Location Location { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Updates the managed location with new values + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.UpdatingManagedLocation.FormatArgs(this.Location.Name)); + var parameters = new ManagedLocationCreateOrUpdateParameters(this.Location); + return client.ManagedLocations.CreateOrUpdate(parameters).Location; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/GetOffer.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/GetOffer.cs new file mode 100644 index 000000000000..2425306b6cd3 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/GetOffer.cs @@ -0,0 +1,122 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Get Offer cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.Offer, DefaultParameterSetName = "TenantList")] + [OutputType(typeof(OfferDefinition))] + [OutputType(typeof(AdminOfferModel))] + public class GetOffer : AdminApiCmdlet + { + /// + /// Gets or sets the offer identifier used in the tenant get flow. + /// + [Parameter(ParameterSetName = "TenantGet", Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string OfferId { get; set; } + + /// + /// Gets or sets the provider name. + /// + [Parameter(ParameterSetName = "TenantList")] + [ValidateNotNull] + public string Provider { get; set; } + + /// + /// Gets or sets the Offer name used in the Admin get flow. + /// + [Parameter(ParameterSetName = "Admin")] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ParameterSetName = "Admin", Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, ParameterSetName = "Admin", Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets a switch indicating whether to return managed offers. + /// + [Parameter(ParameterSetName = "Admin", Mandatory = true)] + public SwitchParameter Managed { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + if (this.Managed.IsPresent) + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + if (string.IsNullOrEmpty(this.Name)) + { + this.WriteVerbose(Resources.ListingManagedOffers.FormatArgs(this.ResourceGroup)); + return client.ManagedOffers.List(this.ResourceGroup, includeDetails: true).Offers; + } + else + { + this.WriteVerbose(Resources.GettingManagedOffer.FormatArgs(this.Name, this.ResourceGroup)); + return client.ManagedOffers.Get(this.ResourceGroup, this.Name).Offer; + } + } + } + else + { + using (var client = this.GetAzureStackClient()) + { + if (string.IsNullOrEmpty(this.OfferId)) + { + if (string.IsNullOrEmpty(this.Provider)) + { + this.WriteVerbose(Resources.ListingOffers.FormatArgs("")); + return client.Offers.ListUnderRootProvider().Offers; + } + else + { + this.WriteVerbose(Resources.ListingOffers.FormatArgs(this.Provider)); + return client.Offers.List(this.Provider).Offers; + } + } + else + { + this.WriteVerbose(Resources.GettingOffer.FormatArgs(this.OfferId)); + return client.Offers.Get(this.OfferId).Offer; + } + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/NewOffer.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/NewOffer.cs new file mode 100644 index 000000000000..bb7d98a948a6 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/NewOffer.cs @@ -0,0 +1,131 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// New Offer cmdlet + /// + [Cmdlet(VerbsCommon.New, Nouns.Offer)] + [OutputType(typeof(AdminOfferModel))] + public class NewOffer : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the display name. + /// + [Parameter] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string DisplayName { get; set; } + + /// + /// Gets or sets the state of the offer. + /// + [Parameter] + public AccessibilityState State { get; set; } + + /// + /// Gets or sets the base plans. + /// + [Parameter(ValueFromPipeline = true)] + [ValidateNotNull] + public AdminPlanModel[] BasePlans { get; set; } + + /// + /// Gets or sets the resource manager location. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + public string ArmLocation { get; set; } // TODO - use API to get CSM location? + + /// + /// Gets or sets the resource group. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + this.WriteVerbose(Resources.CreatingNewOffer.FormatArgs(this.Name, this.ResourceGroup)); + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + // Ensure the resource group is created + client.ResourceGroups.CreateOrUpdate(new ResourceGroupCreateOrUpdateParameters() + { + ResourceGroup = new ResourceGroupDefinition() + { + Location = this.ArmLocation, + Name = this.ResourceGroup, + } + }); + + var parameters = new ManagedOfferCreateOrUpdateParameters() + { + Offer = new AdminOfferModel() + { + Name = this.Name, + Location = this.ArmLocation, + Properties = new AdminOfferDefinition() + { + Name = this.Name, + DisplayName = this.DisplayName, + State = this.State, + } + } + }; + + if (this.BasePlans != null && this.BasePlans.Length > 0) + { + parameters.Offer.Properties.BasePlans = this.BasePlans.Select(plan => plan.Properties).ToArray(); + } + + if (client.ManagedOffers.List(this.ResourceGroup, includeDetails: false).Offers + .Any(offer => string.Equals(offer.Properties.Name, parameters.Offer.Properties.Name, StringComparison.OrdinalIgnoreCase))) + { + throw new PSInvalidOperationException(Resources.ManagedOfferAlreadyExists.FormatArgs(parameters.Offer.Properties.Name, this.ResourceGroup)); + } + + return client.ManagedOffers.CreateOrUpdate(this.ResourceGroup, parameters).Offer; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/RemoveOffer.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/RemoveOffer.cs new file mode 100644 index 000000000000..ef05e409042b --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/RemoveOffer.cs @@ -0,0 +1,65 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + + /// + /// Remove Offer cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.Offer)] + [OutputType(typeof(AzureOperationResponse))] + public class RemoveOffer : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.RemovingManagedOffer.FormatArgs(this.Name, this.ResourceGroup)); + return client.ManagedOffers.Delete(this.ResourceGroup, this.Name); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/SetOffer.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/SetOffer.cs new file mode 100644 index 000000000000..0c632aef8b22 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Offers/SetOffer.cs @@ -0,0 +1,65 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Set Offer cmdlet + /// + [Cmdlet(VerbsCommon.Set, Nouns.Offer)] + [OutputType(typeof(AdminOfferModel))] + public class SetOffer : AdminApiCmdlet + { + /// + /// Gets or sets the offer. + /// + [Parameter(ValueFromPipeline = true, Mandatory = true)] + [ValidateNotNull] + public AdminOfferModel Offer { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.UpdatingOffer.FormatArgs(this.Offer.Name, this.ResourceGroup)); + var parameters = new ManagedOfferCreateOrUpdateParameters(this.Offer); + return client.ManagedOffers.CreateOrUpdate(this.ResourceGroup, parameters).Offer; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/GetPlan.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/GetPlan.cs new file mode 100644 index 000000000000..ab549b101f77 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/GetPlan.cs @@ -0,0 +1,101 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Get Plan cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.Plan, DefaultParameterSetName = "TenantList")] + [OutputType(typeof(AdminPlanModel))] + ////[OutputType(typeof(PlanDefinition))] + public class GetPlan : AdminApiCmdlet + { + /// + /// Gets or sets the Offer name. + /// + [Parameter(ParameterSetName = "TenantGet", Mandatory = true)] + [Parameter(ParameterSetName = "Admin")] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ParameterSetName = "Admin", Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, ParameterSetName = "Admin", Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets a switch indicating whether to return managed plans. + /// + [Parameter(ParameterSetName = "Admin", Mandatory = true)] + public SwitchParameter Managed { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + if (this.Managed.IsPresent) + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + if (string.IsNullOrEmpty(this.Name)) + { + this.WriteVerbose(Resources.ListingManagedPlans.FormatArgs(this.ResourceGroup)); + return client.ManagedPlans.List(this.ResourceGroup, includeDetails: true).Plans; + } + else + { + this.WriteVerbose(Resources.GettingManagedPlan.FormatArgs(this.Name, this.ResourceGroup)); + return client.ManagedPlans.Get(this.ResourceGroup, this.Name).Plan; + } + } + } + else + { + throw new PSNotSupportedException("This API is not supported at this time. Please use the -Managed switch to get managed plans."); + + ////using (var client = this.GetAzureStackClient()) + ////{ + //// if (string.IsNullOrEmpty(this.Name)) + //// { + //// this.WriteVerbose(Resources.ListingPlans); + //// return client.Plans.List(includeDetails: true).Plans; + //// } + //// else + //// { + //// this.WriteVerbose(Resources.GettingPlan.FormatArgs(this.Name)); + //// return client.Plans.Get(this.Name).Plan; + //// } + ////} + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/NewPlan.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/NewPlan.cs new file mode 100644 index 000000000000..0960b62a0994 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/NewPlan.cs @@ -0,0 +1,120 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Linq; + using Microsoft.WindowsAzure.Commands.Common; + using System.Management.Automation; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// New Plan cmdlet + /// + [Cmdlet(VerbsCommon.New, Nouns.Plan, DefaultParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [OutputType(typeof(AdminPlanModel))] + public class NewPlan : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the display name. + /// + [Parameter] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string DisplayName { get; set; } + + /// + /// Gets or sets the state of the offer. + /// + [Parameter] + public AccessibilityState State { get; set; } + + /// + /// Gets or sets the resource manager location. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + public string ArmLocation { get; set; } // TODO - use API to get CSM location? + + /// + /// Gets or sets the resource group. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + this.WriteVerbose(Resources.CreatingNewPlan.FormatArgs(this.Name, this.ResourceGroup)); + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + // Ensure the resource group is created + client.ResourceGroups.CreateOrUpdate(new ResourceGroupCreateOrUpdateParameters() + { + ResourceGroup = new ResourceGroupDefinition() + { + Location = this.ArmLocation, + Name = this.ResourceGroup, + } + }); + + // TODO - determine what properties are needed + var parameters = new ManagedPlanCreateOrUpdateParameters() + { + Plan = new AdminPlanModel() + { + Name = this.Name, + Location = this.ArmLocation, + Properties = new AdminPlanDefinition() + { + Name = this.Name, + DisplayName = this.DisplayName, + State = this.State, + ServiceQuotas = new ServiceQuotaDefinition[0], + } + } + }; + + if (client.ManagedPlans.List(this.ResourceGroup, includeDetails: false).Plans + .Any(p => string.Equals(p.Properties.Name, parameters.Plan.Properties.Name, StringComparison.OrdinalIgnoreCase))) + { + throw new PSInvalidOperationException(Resources.ManagedPlanAlreadyExists.FormatArgs(parameters.Plan.Properties.Name, this.ResourceGroup)); + } + + return client.ManagedPlans.CreateOrUpdate(this.ResourceGroup, parameters).Plan; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/RemovePlan.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/RemovePlan.cs new file mode 100644 index 000000000000..11ebb42b0f9c --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/RemovePlan.cs @@ -0,0 +1,65 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + + /// + /// Remove Plan cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.Plan)] + [OutputType(typeof(AzureOperationResponse))] + public class RemovePlan : AdminApiCmdlet + { + /// + /// Gets or sets the name. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.RemovingManagedPlan.FormatArgs(this.Name, this.ResourceGroup)); + return client.ManagedPlans.Delete(this.ResourceGroup, this.Name); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/SetPlan.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/SetPlan.cs new file mode 100644 index 000000000000..58f2db219a85 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Plans/SetPlan.cs @@ -0,0 +1,65 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Linq; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Set Plan cmdlet + /// + [Cmdlet(VerbsCommon.Set, Nouns.Plan)] + [OutputType(typeof(AdminPlanModel))] + public class SetPlan : AdminApiCmdlet + { + /// + /// Gets or sets the plan. + /// + [Parameter(ValueFromPipeline = true, Mandatory = true)] + [ValidateNotNull] + public AdminPlanModel Plan { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.UpdatingPlan.FormatArgs(this.Plan.Name, this.ResourceGroup)); + var parameters = new ManagedPlanCreateOrUpdateParameters(this.Plan); + return client.ManagedPlans.CreateOrUpdate(this.ResourceGroup, parameters).Plan; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/AddResourceProviderRegistration.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/AddResourceProviderRegistration.cs new file mode 100644 index 000000000000..06e8aee9d04e --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/AddResourceProviderRegistration.cs @@ -0,0 +1,62 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Linq; + using System.Management.Automation; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + using Microsoft.WindowsAzure.Commands.Common; + + /// + /// Add Resource Provider Registration Cmdlet + /// + [Cmdlet(VerbsCommon.Add, Nouns.ResourceProviderRegistration, DefaultParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [OutputType(typeof(ProviderRegistrationModel))] + public class AddResourceProviderRegistration : SetResourceProviderRegistration + { + /// + /// Validates the prerequisites. + /// + /// The client. + /// The parameters. + protected override void ValidatePrerequisites(AzureStackClient client, ProviderRegistrationCreateOrUpdateParameters parameters) + { + ArgumentValidator.ValidateNotNull("client", client); + ArgumentValidator.ValidateNotNull("parameters", parameters); + + client.ResourceGroups.CreateOrUpdate(new ResourceGroupCreateOrUpdateParameters() + { + ResourceGroup = new ResourceGroupDefinition() + { + Location = this.ArmLocation, + Name = this.ResourceGroup, + } + }); + + var name = parameters.ProviderRegistration.Properties.Name; + var location = parameters.ProviderRegistration.Properties.Location; + + if (client.ProviderRegistrations.List(this.ResourceGroup).ProviderRegistrations + .Any(p => + string.Equals(p.Properties.Manifest.Namespace, name, StringComparison.OrdinalIgnoreCase) + && string.Equals(p.Properties.Location, location, StringComparison.OrdinalIgnoreCase))) + { + throw new PSInvalidOperationException(Resources.ProviderRegistrationAlreadyExists.FormatArgs(name, location)); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/GetResourceProviderRegistration.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/GetResourceProviderRegistration.cs new file mode 100644 index 000000000000..aa314344f518 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/GetResourceProviderRegistration.cs @@ -0,0 +1,73 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Resource Provider Registration Cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.ResourceProviderRegistration)] + [OutputType(typeof(ProviderRegistrationModel))] + public class GetResourceProviderRegistration : AdminApiCmdlet + { + /// + /// Gets or sets the resource provider registration name. + /// + [Parameter] + [ValidateLength(1, 128)] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateNotNull] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + if (string.IsNullOrEmpty(this.Name)) + { + this.WriteVerbose(Resources.ListingResourceProviderRegistration); + return client.ProviderRegistrations.List(this.ResourceGroup).ProviderRegistrations; + } + else + { + this.WriteVerbose(Resources.GettingResourceProviderRegistration.FormatArgs(this.Name)); + return client.ProviderRegistrations.Get(this.ResourceGroup, this.Name).ProviderRegistration; + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/RemoveResourceProviderRegistration.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/RemoveResourceProviderRegistration.cs new file mode 100644 index 000000000000..ad4c3351725c --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/RemoveResourceProviderRegistration.cs @@ -0,0 +1,65 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.WindowsAzure; + using Microsoft.AzureStack.Management; + + /// + /// Resource Provider Registration Cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.ResourceProviderRegistration)] + [OutputType(typeof(AzureOperationResponse))] + public class RemoveResourceProviderRegistration : AdminApiCmdlet + { + /// + /// Gets or sets the resource provider registration name. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateNotNull] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.RemovingResourceProviderRegistration.FormatArgs(this.Name)); + return client.ProviderRegistrations.Delete(this.ResourceGroup, this.Name); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/SetResourceProviderRegistration.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/SetResourceProviderRegistration.cs new file mode 100644 index 000000000000..dc4d9c9e1ac0 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/ProviderRegistrations/SetResourceProviderRegistration.cs @@ -0,0 +1,172 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Linq; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Resource Provider Registration Cmdlet + /// + [Cmdlet(VerbsCommon.Set, Nouns.ResourceProviderRegistration, DefaultParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [OutputType(typeof(ProviderRegistrationModel))] + public class SetResourceProviderRegistration : AdminApiCmdlet + { + /// + /// Gets or sets the provider registration. + /// + [Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = CommonPSConst.ParameterSet.ByObject)] + [ValidateNotNull] + public ProviderRegistrationModel ProviderRegistration { get; set; } + + /// + /// Gets or sets the resource manager location. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + public string ArmLocation { get; set; } // TODO - use API to get CSM location? + + /// + /// Gets or sets the resource provider registration name. + /// + [Parameter(Mandatory = true, ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Name { get; set; } + + /// + /// Gets or sets the resource group. + /// + [Parameter(Mandatory = true, ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string ResourceGroup { get; set; } + + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false, ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateNotNull] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets the resource provider registration display name. + /// + [Parameter(Mandatory = true, ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string DisplayName { get; set; } + + /// + /// Gets or sets the resource provider registration location (region). + /// + [Parameter(Mandatory = true, ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateNotNull] + public string Location { get; set; } + + /// + /// Gets or sets the resource provider registration manifest endpoint. + /// + [Parameter(Mandatory = true, ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateAbsoluteUri] + [ValidateNotNull] + public Uri ManifestEndpoint { get; set; } + + /// + /// Gets or sets the resource provider registration user name. + /// + [Parameter(ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateNotNull] + public string UserName { get; set; } + + /// + /// Gets or sets the resource provider registration password. + /// + [Parameter(ParameterSetName = CommonPSConst.ParameterSet.ByProperty)] + [ValidateNotNull] + public string Password { get; set; } + + /// + /// Executes the API call(s) against Azure Resource Management API(s). + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + var parameters = new ProviderRegistrationCreateOrUpdateParameters() + { + ProviderRegistration = this.ProviderRegistration ?? new ProviderRegistrationModel() + { + Name = this.Name, + Location = this.ArmLocation, + Properties = new ProviderRegistrationDefinition() + { + Name = this.Name, + DisplayName = this.DisplayName, + Enabled = true, + Location = this.Location, + ManifestEndpoint = new ResourceProviderEndpoint() + { + EndpointUri = this.ManifestEndpoint.AbsoluteUri, + AuthenticationUsername = this.UserName, + AuthenticationPassword = this.Password, + } + } + } + }; + + this.WriteVerbose(Resources.AddingResourceProviderRegistration.FormatArgs(parameters.ProviderRegistration.Properties.Name)); + + this.ValidatePrerequisites(client, parameters); + + return client.ProviderRegistrations + .CreateOrUpdate(this.ResourceGroup, parameters) + .ProviderRegistration; + } + } + + /// + /// Validates the prerequisites. + /// + /// The client. + /// The parameters. + protected virtual void ValidatePrerequisites(AzureStackClient client, ProviderRegistrationCreateOrUpdateParameters parameters) + { + ArgumentValidator.ValidateNotNull("client", client); + ArgumentValidator.ValidateNotNull("parameters", parameters); + + if (!client.ResourceGroups.List().ResourceGroups.Any(r => string.Equals(r.Name, this.ResourceGroup, StringComparison.OrdinalIgnoreCase))) + { + throw new PSInvalidOperationException(Resources.ResourceGroupDoesNotExist.FormatArgs(this.ResourceGroup)); + } + + var name = parameters.ProviderRegistration.Properties.Name; + var location = parameters.ProviderRegistration.Properties.Location; + + if (!client.ProviderRegistrations.List(this.ResourceGroup).ProviderRegistrations + .Any(p => + string.Equals(p.Properties.Manifest.Namespace, name, StringComparison.OrdinalIgnoreCase) + && string.Equals(p.Properties.Location, location, StringComparison.OrdinalIgnoreCase))) + { + throw new PSInvalidOperationException(Resources.ProviderRegistrationDoesNotExist.FormatArgs(name, location)); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/GetManagedSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/GetManagedSubscription.cs new file mode 100644 index 000000000000..8e8477712dac --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/GetManagedSubscription.cs @@ -0,0 +1,63 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Get Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.ManagedSubscription)] + [OutputType(typeof(SubscriptionDefinition))] + public class GetManagedSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public Guid TargetSubscriptionId { get; set; } // Allow for empty GUID for list scenario + + /// + /// Gets or sets the admin subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Performs the API operation(s) against managed subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + if (this.TargetSubscriptionId == Guid.Empty) + { + this.WriteVerbose(Resources.ListingManagedSubscriptions); + return client.ManagedSubscriptions.List(includeDetails: true).Subscriptions; + } + else + { + this.WriteVerbose(Resources.GettingSubscriptionByID.FormatArgs(this.TargetSubscriptionId)); + return client.ManagedSubscriptions.Get(this.TargetSubscriptionId.ToString()).Subscription; + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/GetTenantSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/GetTenantSubscription.cs new file mode 100644 index 000000000000..b7f1d8447b16 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/GetTenantSubscription.cs @@ -0,0 +1,55 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Get Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.TenantSubscription)] + [OutputType(typeof(SubscriptionDefinition))] + public class GetTenantSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription id. + /// + public Guid SubscriptionId { get; set; } // Allow for empty GUID for list scenario + + /// + /// Performs the API operation(s) against tenant subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient()) + { + if (this.SubscriptionId == Guid.Empty) + { + this.WriteVerbose(Resources.ListingSubscriptions); + return client.Subscriptions.List(true).Subscriptions; + } + else + { + this.WriteVerbose(Resources.GettingSubscriptionByID.FormatArgs(this.SubscriptionId)); + return client.Subscriptions.Get(this.SubscriptionId.ToString()).Subscription; + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/NewManagedSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/NewManagedSubscription.cs new file mode 100644 index 000000000000..86ca34874dd9 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/NewManagedSubscription.cs @@ -0,0 +1,115 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// New Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.New, Nouns.ManagedSubscription)] + [OutputType(typeof(SubscriptionDefinition))] + public class NewManagedSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets the owner. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Owner { get; set; } + + /// + /// Gets or sets the identifier of the offer. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string OfferId { get; set; } + + /// + /// Gets or sets the display name. + /// + [Parameter] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string DisplayName { get; set; } + + /// + /// Gets the subscription definition. + /// + protected SubscriptionDefinition GetSubscriptionDefinition() + { + // TODO: determine any extra properties which could / should be set + return new SubscriptionDefinition() + { + SubscriptionId = Guid.NewGuid().ToString(), + DisplayName = this.DisplayName, + OfferId = this.OfferId, + OfferName = GetAndValidateOfferName(this.OfferId), + Owner = this.Owner, + State = SubscriptionState.Enabled, + }; + } + + /// + /// Performs the API operation(s) against managed subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.CreatingNewSubscription.FormatArgs(this.Owner, this.OfferId, this.DisplayName)); + var parameters = new ManagedSubscriptionCreateOrUpdateParameters(this.GetSubscriptionDefinition()); + return client.ManagedSubscriptions.CreateOrUpdate(parameters).Subscription; + } + } + + /// + /// Gets and validates the name of the offer. + /// + /// The offer identifier. + private static string GetAndValidateOfferName(string offerId) + { + ArgumentValidator.ValidateNotNull("offerId", offerId); + + var parts = offerId.Trim('/').Split('/'); + + if (parts.Length != 4 + || !"delegatedProviders".EqualsInsensitively(parts[0]) + || !"offers".EqualsInsensitively(parts[2]) + || string.IsNullOrWhiteSpace(parts[1]) + || string.IsNullOrWhiteSpace(parts[3])) + { + throw new ArgumentException( + message: "Invalid offer identifier; must be of the form '/delegatedProviders/{providerId}/offers/{offerName}'", + paramName: "offerId"); + } + + return parts[3]; + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/NewTenantSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/NewTenantSubscription.cs new file mode 100644 index 000000000000..21b06a5fbc94 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/NewTenantSubscription.cs @@ -0,0 +1,108 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// New Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.New, Nouns.TenantSubscription)] + [OutputType(typeof(SubscriptionDefinition))] + public class NewTenantSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the owner. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string Owner { get; set; } + + /// + /// Gets or sets the identifier of the offer. + /// + [Parameter(Mandatory = true)] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string OfferId { get; set; } + + /// + /// Gets or sets the display name. + /// + [Parameter] + [ValidateLength(1, 128)] + [ValidateNotNull] + public string DisplayName { get; set; } + + /// + /// Gets the subscription definition. + /// + protected SubscriptionDefinition GetSubscriptionDefinition() + { + // TODO: determine any extra properties which could / should be set + return new SubscriptionDefinition() + { + SubscriptionId = Guid.NewGuid().ToString(), + DisplayName = this.DisplayName, + OfferId = this.OfferId, + OfferName = GetAndValidateOfferName(this.OfferId), + Owner = this.Owner, + State = SubscriptionState.Enabled, + }; + } + + /// + /// Performs the API operation(s) against tenant subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient()) + { + this.WriteVerbose(Resources.CreatingNewSubscription.FormatArgs(this.Owner, this.OfferId, this.DisplayName)); + var parameters = new SubscriptionCreateOrUpdateParameters(this.GetSubscriptionDefinition()); + return client.Subscriptions.CreateOrUpdate(parameters).Subscription; + } + } + + /// + /// Gets and validates the name of the offer. + /// + /// The offer identifier. + private static string GetAndValidateOfferName(string offerId) + { + ArgumentValidator.ValidateNotNull("offerId", offerId); + + var parts = offerId.Trim('/').Split('/'); + + if (parts.Length != 4 + || !"delegatedProviders".EqualsInsensitively(parts[0]) + || !"offers".EqualsInsensitively(parts[2]) + || string.IsNullOrWhiteSpace(parts[1]) + || string.IsNullOrWhiteSpace(parts[3])) + { + throw new ArgumentException( + message: "Invalid offer identifier; must be of the form '/delegatedProviders/{providerId}/offers/{offerName}'", + paramName: "offerId"); + } + + return parts[3]; + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/RemoveManagedSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/RemoveManagedSubscription.cs new file mode 100644 index 000000000000..a55fd56cda63 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/RemoveManagedSubscription.cs @@ -0,0 +1,57 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.ManagedSubscription)] + [OutputType(typeof(AzureOperationResponse))] + public class RemoveManagedSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription id. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets the subscription ID to be deleted. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateGuidNotEmpty] + public Guid TargetSubscriptionId { get; set; } + + /// + /// Performs the API operation(s) against managed subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose(Resources.DeletingSubscription.FormatArgs(this.TargetSubscriptionId)); + return client.ManagedSubscriptions.Delete(this.TargetSubscriptionId.ToString()); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/RemoveTenantSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/RemoveTenantSubscription.cs new file mode 100644 index 000000000000..bb9d1f36e05e --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/RemoveTenantSubscription.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.Azure; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.Remove, Nouns.TenantSubscription)] + [OutputType(typeof(AzureOperationResponse))] + public class RemoveTenantSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription ID to be deleted. + /// + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] + [ValidateGuidNotEmpty] + public Guid TargetSubscriptionId { get; set; } + + /// + /// Performs the API operation(s) against tenant subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient()) + { + this.WriteVerbose(Resources.DeletingSubscription.FormatArgs(this.TargetSubscriptionId)); + return client.Subscriptions.Delete(this.TargetSubscriptionId.ToString()); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/SetManagedSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/SetManagedSubscription.cs new file mode 100644 index 000000000000..5ead39a1b456 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/SetManagedSubscription.cs @@ -0,0 +1,61 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + /// + /// Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.Set, Nouns.ManagedSubscription)] + [OutputType(typeof(SubscriptionDefinition))] + public class SetManagedSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription id. + /// + [Parameter(Mandatory = false)] + [ValidateGuidNotEmpty] + public Guid SubscriptionId { get; set; } + + /// + /// Gets or sets the subscription to be updated. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + public SubscriptionDefinition Subscription { get; set; } + + /// + /// Performs the API operation(s) against managed subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient(this.SubscriptionId)) + { + this.WriteVerbose( + Resources.UpdatingManagedSubscription.FormatArgs( + this.Subscription.SubscriptionId, + this.Subscription.Owner, + this.SubscriptionId)); + + var parameters = new ManagedSubscriptionCreateOrUpdateParameters(this.Subscription); + return client.ManagedSubscriptions.CreateOrUpdate(parameters).Subscription; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/SetTenantSubscription.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/SetTenantSubscription.cs new file mode 100644 index 000000000000..09ea58409ea1 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Microsoft.Subscriptions/Subscriptions/SetTenantSubscription.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common; + using Microsoft.AzureStack.Management; + using Microsoft.AzureStack.Management.Models; + + /// + /// Subscription Cmdlet + /// + [Cmdlet(VerbsCommon.Set, Nouns.TenantSubscription)] + [OutputType(typeof(SubscriptionDefinition))] + public class SetTenantSubscription : AdminApiCmdlet + { + /// + /// Gets or sets the subscription to be updated. + /// + [Parameter(Mandatory = true)] + [ValidateNotNull] + public SubscriptionDefinition Subscription { get; set; } + + /// + /// Performs the API operation(s) against tenant subscriptions. + /// + protected override object ExecuteCore() + { + using (var client = this.GetAzureStackClient()) + { + this.WriteVerbose(Resources.UpdatingSubscription.FormatArgs(this.Subscription.SubscriptionId, this.Subscription.Owner)); + var parameters = new SubscriptionCreateOrUpdateParameters(this.Subscription); + return client.Subscriptions.CreateOrUpdate(parameters).Subscription; + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Nouns.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Nouns.cs new file mode 100644 index 000000000000..b7af401d29c8 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Nouns.cs @@ -0,0 +1,68 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.AzureStack.Commands +{ + /// + /// All the nouns used in cmdlets. + /// + internal static class Nouns + { + /// + /// The prefix for cmdlet names. + /// + private const string Prefix = "AzureRM"; + + + /// + /// The noun for operations on Gallery Items. + /// + public const string GalleryItem = Prefix + "GalleryItem"; + + /// + /// The noun for operations on Resource Provider Registration. + /// + public const string ResourceProviderRegistration = Prefix + "ResourceProviderRegistration"; + + /// + /// The noun for operations on Tenant Subscriptions. + /// + public const string TenantSubscription = Prefix + "TenantSubscription"; + + /// + /// The noun for operations on Subscriptions as an administrator. + /// + public const string ManagedSubscription = Prefix + "ManagedSubscription"; + + /// + /// The noun for operations on Offers. + /// + public const string Offer = Prefix + "Offer"; + + /// + /// The noun for operations on Plans. + /// + public const string Plan = Prefix + "Plan"; + + /// + /// The noun for operations on Locations. + /// + public const string Location = Prefix + "ManagedLocation"; + + /// + /// The noun for operations on tokens. + /// + public const string Token = "AzureStackToken"; + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..fc2dc57a7897 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +// ---------------------------------------------------------------------------------- +// +// 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.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("Microsoft AzureStack Powershell ")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] + +[assembly: Guid("0B02390C-8AA9-4D99-8AA8-2A9D2D39682F")] + +[assembly: AssemblyVersion("0.9.1")] +[assembly: AssemblyFileVersion("0.9.1")] \ No newline at end of file diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/Resources.Designer.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..f77b7b7e76c9 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/Resources.Designer.cs @@ -0,0 +1,549 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.AzureStack.Commands { + 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()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AzureStack.Commands.Properties.Resources", typeof(Resources).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)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Adding gallery item with name "{0}".. + /// + public static string AddingGalleryItem { + get { + return ResourceManager.GetString("AddingGalleryItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Adding resource provider registration with name "{0}".. + /// + public static string AddingResourceProviderRegistration { + get { + return ResourceManager.GetString("AddingResourceProviderRegistration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating new managed location "{0}".. + /// + public static string CreatingNewManagedLocation { + get { + return ResourceManager.GetString("CreatingNewManagedLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating a new offer with name "{0}" in resource group "{1}".. + /// + public static string CreatingNewOffer { + get { + return ResourceManager.GetString("CreatingNewOffer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating a new plan with name "{0}" in resource group "{1}".. + /// + public static string CreatingNewPlan { + get { + return ResourceManager.GetString("CreatingNewPlan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating a new subscription for owner "{0}" to offer "{1}" with display name "{2}".. + /// + public static string CreatingNewSubscription { + get { + return ResourceManager.GetString("CreatingNewSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting subscription "{0}".. + /// + public static string DeletingSubscription { + get { + return ResourceManager.GetString("DeletingSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected not empty collection.. + /// + public static string ExpectedNotEmptyCollection { + get { + return ResourceManager.GetString("ExpectedNotEmptyCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected not empty value.. + /// + public static string ExpectedNotEmptyValue { + get { + return ResourceManager.GetString("ExpectedNotEmptyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting gallery item with name "{0}".. + /// + public static string GettingGalleryItem { + get { + return ResourceManager.GetString("GettingGalleryItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting managed location "{0}".. + /// + public static string GettingManagedLocation { + get { + return ResourceManager.GetString("GettingManagedLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting managed offer "{0}" in resource group "{1}".. + /// + public static string GettingManagedOffer { + get { + return ResourceManager.GetString("GettingManagedOffer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting managed plan "{0}" in resource group "{1}".. + /// + public static string GettingManagedPlan { + get { + return ResourceManager.GetString("GettingManagedPlan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting managed Subscription with SubscriptionId "{0}".. + /// + public static string GettingManagedSubscriptionByID { + get { + return ResourceManager.GetString("GettingManagedSubscriptionByID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting offer "{0}".. + /// + public static string GettingOffer { + get { + return ResourceManager.GetString("GettingOffer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting plan "{0}".. + /// + public static string GettingPlan { + get { + return ResourceManager.GetString("GettingPlan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting resource provider registration with name "{0}".. + /// + public static string GettingResourceProviderRegistration { + get { + return ResourceManager.GetString("GettingResourceProviderRegistration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting Subscription with SubscriptionId "{0}".. + /// + public static string GettingSubscriptionByID { + get { + return ResourceManager.GetString("GettingSubscriptionByID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Azure profile is invalid, Make sure that you are in the Azure context with the Login-AzureRMAccount cmdlets.. + /// + public static string InvalidProfile { + get { + return ResourceManager.GetString("InvalidProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all gallery items.. + /// + public static string ListingGalleryItems { + get { + return ResourceManager.GetString("ListingGalleryItems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all managed locations.. + /// + public static string ListingManagedLocations { + get { + return ResourceManager.GetString("ListingManagedLocations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all managed offers in resource group "{0}".. + /// + public static string ListingManagedOffers { + get { + return ResourceManager.GetString("ListingManagedOffers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all managed plans in resource group "{0}".. + /// + public static string ListingManagedPlans { + get { + return ResourceManager.GetString("ListingManagedPlans", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all managed subscriptions.. + /// + public static string ListingManagedSubscriptions { + get { + return ResourceManager.GetString("ListingManagedSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing offers for provider "{0}".. + /// + public static string ListingOffers { + get { + return ResourceManager.GetString("ListingOffers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all plans.. + /// + public static string ListingPlans { + get { + return ResourceManager.GetString("ListingPlans", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all resource provider registrations.. + /// + public static string ListingResourceProviderRegistration { + get { + return ResourceManager.GetString("ListingResourceProviderRegistration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Listing all subscriptions.. + /// + public static string ListingSubscriptions { + get { + return ResourceManager.GetString("ListingSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A managed location with name "{0}" already exists.. + /// + public static string ManagedLocationAlreadyExists { + get { + return ResourceManager.GetString("ManagedLocationAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A managed offer with name "{0}" already exists in resource group "{1}".. + /// + public static string ManagedOfferAlreadyExists { + get { + return ResourceManager.GetString("ManagedOfferAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A managed offer with name "{0}" does not exist in resource group "{1}".. + /// + public static string ManagedOfferDoesNotExist { + get { + return ResourceManager.GetString("ManagedOfferDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A managed plan with name "{0}" and region "{1}" already exists.. + /// + public static string ManagedPlanAlreadyExists { + get { + return ResourceManager.GetString("ManagedPlanAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A managed plan with name "{0}" does not exist in resource group "{1}".. + /// + public static string ManagedPlanDoesNotExist { + get { + return ResourceManager.GetString("ManagedPlanDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource provider registration with name "{0}" and region "{1}" already exists.. + /// + public static string ProviderRegistrationAlreadyExists { + get { + return ResourceManager.GetString("ProviderRegistrationAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource provider registration with name "{0}" and region "{1}" does not exist.. + /// + public static string ProviderRegistrationDoesNotExist { + get { + return ResourceManager.GetString("ProviderRegistrationDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing gallery item with name "{0}".. + /// + public static string RemovingGalleryItem { + get { + return ResourceManager.GetString("RemovingGalleryItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing managed location "{0}".. + /// + public static string RemovingManagedLocation { + get { + return ResourceManager.GetString("RemovingManagedLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing managed offer "{0}" in resource group "{1}".. + /// + public static string RemovingManagedOffer { + get { + return ResourceManager.GetString("RemovingManagedOffer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing managed plan "{0}" in resource group "{1}".. + /// + public static string RemovingManagedPlan { + get { + return ResourceManager.GetString("RemovingManagedPlan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing resource provider registration with name "{0}".. + /// + public static string RemovingResourceProviderRegistration { + get { + return ResourceManager.GetString("RemovingResourceProviderRegistration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource group cannot be empty.. + /// + public static string ResourceGroupCannotBeEmpty { + get { + return ResourceManager.GetString("ResourceGroupCannotBeEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource group with Name "{0}" does not exist.. + /// + public static string ResourceGroupDoesNotExist { + get { + return ResourceManager.GetString("ResourceGroupDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Both the parameters Token and AdminUri are required.. + /// + public static string TokenAndAdminUriRequired { + get { + return ResourceManager.GetString("TokenAndAdminUriRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating managed location "{0}".. + /// + public static string UpdatingManagedLocation { + get { + return ResourceManager.GetString("UpdatingManagedLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating managed subscription with id "{0}" and owner "{1}" under provider subscription '{2}'.. + /// + public static string UpdatingManagedSubscription { + get { + return ResourceManager.GetString("UpdatingManagedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating offer with name "{0}" in resource group "{1}".. + /// + public static string UpdatingOffer { + get { + return ResourceManager.GetString("UpdatingOffer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating plan with name "{0}" in resource group "{1}".. + /// + public static string UpdatingPlan { + get { + return ResourceManager.GetString("UpdatingPlan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating subscription with id "{0}" and owner "{1}".. + /// + public static string UpdatingSubscription { + get { + return ResourceManager.GetString("UpdatingSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argument must be an absolute URI.. + /// + public static string ValidateAbsoluteUriNotAbsolute { + get { + return ResourceManager.GetString("ValidateAbsoluteUriNotAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ValidateAbsoluteUri attribute was defined on property of type {0}. System.Uri type is expected.. + /// + public static string ValidateAbsoluteUriWrongType { + get { + return ResourceManager.GetString("ValidateAbsoluteUriWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argument must not be an empty GUID.. + /// + public static string ValidateGuidEmpty { + get { + return ResourceManager.GetString("ValidateGuidEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argument must be a GUID.. + /// + public static string ValidateGuidWrongType { + get { + return ResourceManager.GetString("ValidateGuidWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Disabling certificate validation may allow others to intercept and decrypt this web request.. + /// + public static string WarningDisableCertificateValidation { + get { + return ResourceManager.GetString("WarningDisableCertificateValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Stack PowerShell. + /// + public static string WindowTitle { + get { + return ResourceManager.GetString("WindowTitle", resourceCulture); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/Resources.resx b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/Resources.resx new file mode 100644 index 000000000000..52d2930f4f11 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Properties/Resources.resx @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Azure Stack PowerShell + + + Getting gallery item with name "{0}". + + + Listing all gallery items. + + + Adding gallery item with name "{0}". + + + Removing gallery item with name "{0}". + + + Adding resource provider registration with name "{0}". + + + Getting resource provider registration with name "{0}". + + + Listing all resource provider registrations. + + + Removing resource provider registration with name "{0}". + + + A resource provider registration with name "{0}" and region "{1}" already exists. + + + A resource provider registration with name "{0}" and region "{1}" does not exist. + + + A resource group with Name "{0}" does not exist. + + + Getting Subscription with SubscriptionId "{0}". + + + Listing all subscriptions. + + + Resource group cannot be empty. + + + Getting managed offer "{0}" in resource group "{1}". + + + Listing all managed offers in resource group "{0}". + + + Listing all managed subscriptions. + + + Removing managed offer "{0}" in resource group "{1}". + + + Getting offer "{0}". + + + Listing offers for provider "{0}". + + + Getting managed plan "{0}" in resource group "{1}". + + + Getting plan "{0}". + + + Listing all managed plans in resource group "{0}". + + + Listing all plans. + + + A managed offer with name "{0}" already exists in resource group "{1}". + + + A managed offer with name "{0}" does not exist in resource group "{1}". + + + A managed plan with name "{0}" and region "{1}" already exists. + + + A managed plan with name "{0}" does not exist in resource group "{1}". + + + Removing managed plan "{0}" in resource group "{1}". + + + Creating a new offer with name "{0}" in resource group "{1}". + + + Creating a new plan with name "{0}" in resource group "{1}". + + + Creating a new subscription for owner "{0}" to offer "{1}" with display name "{2}". + + + Deleting subscription "{0}". + + + Getting managed Subscription with SubscriptionId "{0}". + + + Updating offer with name "{0}" in resource group "{1}". + + + Updating plan with name "{0}" in resource group "{1}". + + + Updating managed subscription with id "{0}" and owner "{1}" under provider subscription '{2}'. + + + Updating subscription with id "{0}" and owner "{1}". + + + Disabling certificate validation may allow others to intercept and decrypt this web request. + + + A managed location with name "{0}" already exists. + + + Creating new managed location "{0}". + + + Getting managed location "{0}". + + + Listing all managed locations. + + + Removing managed location "{0}". + + + Updating managed location "{0}". + + + The Azure profile is invalid, Make sure that you are in the Azure context with the Login-AzureRMAccount cmdlets. + + + Both the parameters Token and AdminUri are required. + + + Expected not empty collection. + + + Expected not empty value. + + + Argument must be an absolute URI. + + + ValidateAbsoluteUri attribute was defined on property of type {0}. System.Uri type is expected. + + + Argument must not be an empty GUID. + ValidationMetadataException + + + Argument must be a GUID. + ValidationMetadataException + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/StringExtensions.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/StringExtensions.cs new file mode 100644 index 000000000000..2ad977dea878 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/StringExtensions.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. +// ---------------------------------------------------------------------------------- + + +namespace Microsoft.AzureStack.Commands +{ + using System; + using System.Globalization; + + /// + /// String Extension Methods + /// + public static class StringExtensions + { + /// + /// Formats a string with given args and current culture. + /// + /// The format. + /// The args. + /// Formatted string + public static string FormatArgs(this string format, params object[] args) + { + return string.Format(CultureInfo.CurrentCulture, format, args); + } + + /// + /// Formats a string with given args and invariant culture. + /// + /// The format. + /// The args. + /// Formatted string + public static string FormatArgsInvariant(this string format, params object[] args) + { + return string.Format(CultureInfo.InvariantCulture, format, args); + } + + /// + /// Compares two string values insensitively. + /// + /// The original string. + /// The other string. + public static bool EqualsInsensitively(this string original, string otherString) + { + return string.Equals(original, otherString, StringComparison.InvariantCultureIgnoreCase); + } + + /// + /// Compares start of string insensitively. + /// + /// The original string. + /// The prefix to compare. + public static bool StartsWithInsensitively(this string original, string prefix) + { + return original.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase); + } + + /// + /// Compares end of string insensitively. + /// + /// The original string. + /// The suffix to compare. + public static bool EndsWithInsensitively(this string original, string suffix) + { + return original.EndsWith(suffix, StringComparison.InvariantCultureIgnoreCase); + } + + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/AuthenticationContextExtensions.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/AuthenticationContextExtensions.cs new file mode 100644 index 000000000000..88f963503957 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/AuthenticationContextExtensions.cs @@ -0,0 +1,195 @@ +//----------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +//----------------------------------------------------------------------------- + +namespace Microsoft.AzureStack.Commands.Security +{ + using System; + using System.Collections.Generic; + using System.Collections.Specialized; + using System.Globalization; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + using Microsoft.IdentityModel.Clients.ActiveDirectory; + + /// + /// Authentication context extension methods. + /// + public static class AuthenticationContextExtensions + { + /// + /// The endpoint template URI + /// + private static readonly UriTemplate EndpointTemplateUri = new UriTemplate("/oauth2/{endpoint}"); + + /// + /// The token endpoint bindings + /// + private static readonly NameValueCollection TokenEndpointBindings = new NameValueCollection() + { + { "endpoint", "token" } + }; + + /// + /// Acquires token via non-interactive flow. + /// + /// The authority. + /// The resource. + /// The client identifier. + /// The user credential. + /// + /// We use reflection to call ADAL.NET internals to handle token acquisition, since the library does not support ADFS yet. + /// + public static AuthenticationResult AcquireTokenForAdfs(string authority, string resource, string clientId, UserCredential userCredential) + { + // BUG: 2384273 - [PowerShell]: Remove AuthenticationContextExtensions class and integrate support of non-interactive flow via legitimate APIs of ADAL.NET + var context = new AuthenticationContext(authority: authority, validateAuthority: false, tokenCache: TokenCache.DefaultShared); + var parameters = GetNewInstanceOfRequestParameters(resource, clientId, userCredential); + var handler = GetNewInstanceOfNonInteractiveHandler(context, resource, clientId, userCredential); + return handler.SendHttpMessage(parameters: parameters); + } + + /// + /// Sends the HTTP message. + /// + /// The handler. + /// The parameters. + private static AuthenticationResult SendHttpMessage(this object handler, object parameters) + { + var handlerType = handler.GetType(); + var methodInfo = handlerType.BaseType.GetMethod("SendHttpMessageAsync", BindingFlags.NonPublic | BindingFlags.Instance); + var taskResult = (Task)methodInfo.Invoke(obj: handler, parameters: new object[] { parameters }); + var result = taskResult.Result; + return result; + } + + /// + /// Authenticators the specified context. + /// + /// The context. + private static object Authenticator(this AuthenticationContext context) + { + return context.GetInstanceFieldValue("Authenticator", BindingFlags.NonPublic); + } + + /// + /// Sets the token URI. + /// + /// The authenticator. + /// The URI string. + private static void TokenUri(this object authenticator, string uriString) + { + authenticator.SetInstancePropertyValue("TokenUri", uriString, BindingFlags.Public); + } + + /// + /// Adds the secure parameter. + /// + /// The instance. + /// The key. + /// The secure string. + private static void AddSecureParameter(this Dictionary instance, string key, object secureString) + { + var typeOfInstance = instance.GetType(); + var methodInfo = typeOfInstance.GetMethod("AddSecureParameter", BindingFlags.Instance | BindingFlags.Public); + var parameters = new object[] { key, secureString }; + methodInfo.Invoke(obj: instance, parameters: parameters); + } + + /// + /// Secures the password. + /// + /// The credential. + private static object SecurePassword(this UserCredential credential) + { + return credential.GetInstancePropertyValue("SecurePassword", BindingFlags.NonPublic); + } + + /// + /// Gets the new instance of request parameters. + /// + /// The resource. + /// The client identifier. + /// The user credential. + private static object GetNewInstanceOfRequestParameters(string resource, string clientId, UserCredential userCredential) + { + var builder = new StringBuilder(); + var typeOfParameters = Type.GetType("Microsoft.IdentityModel.Clients.ActiveDirectory.RequestParameters, Microsoft.IdentityModel.Clients.ActiveDirectory"); + var arguments = new object[] { builder }; + var instanceOfParameters = (Dictionary)Activator.CreateInstance(type: typeOfParameters, args: arguments); + + // Prepare request parameters to be sent over the wire + instanceOfParameters.Add("grant_type", "password"); + instanceOfParameters.Add("resource", resource); + instanceOfParameters.Add("username", userCredential.UserName); + instanceOfParameters.AddSecureParameter("password", userCredential.SecurePassword()); + instanceOfParameters.Add("client_id", clientId); + + return instanceOfParameters; + } + + /// + /// Gets the new instance of non interactive handler. + /// + /// The context. + /// The resource. + /// The client identifier. + /// The user credential. + private static object GetNewInstanceOfNonInteractiveHandler(AuthenticationContext context, string resource, string clientId, UserCredential userCredential) + { + var uriString = EndpointTemplateUri.BindByName(new Uri(context.Authority), TokenEndpointBindings).OriginalString; + var cache = context.TokenCache; + var callAsync = false; + + // Retrieve and configure authenticator + var authenticator = context.Authenticator(); + authenticator.TokenUri(uriString); + + var typeOfObject = Type.GetType("Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenNonInteractiveHandler, Microsoft.IdentityModel.Clients.ActiveDirectory"); + var ctorArguments = new object[] { authenticator, cache, resource, clientId, userCredential, callAsync }; + var instanceOfHandler = Activator.CreateInstance(type: typeOfObject, args: ctorArguments); + return instanceOfHandler; + } + + /// + /// Gets the instance field value. + /// + /// The instance. + /// The name. + /// The visibility. + private static object GetInstanceFieldValue(this object instance, string name, BindingFlags visibility) + { + var typeOfInstance = instance.GetType(); + var fieldInfo = typeOfInstance.GetField(name, BindingFlags.Instance | visibility); + return fieldInfo.GetValue(instance); + } + + /// + /// Gets the instance property value. + /// + /// The instance. + /// The name. + /// The visibility. + private static object GetInstancePropertyValue(this object instance, string name, BindingFlags visibility) + { + var typeOfInstance = instance.GetType(); + var propertyInfo = typeOfInstance.GetProperty(name, BindingFlags.Instance | visibility); + return propertyInfo.GetValue(instance); + } + + /// + /// Sets the instance property value. + /// + /// The instance. + /// The name. + /// The value. + /// The visibility. + private static void SetInstancePropertyValue(this object instance, string name, object value, BindingFlags visibility) + { + var typeOfInstance = instance.GetType(); + var propertyInfo = typeOfInstance.GetProperty(name, BindingFlags.Instance | visibility); + propertyInfo.SetValue(instance, value); + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/GetToken.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/GetToken.cs new file mode 100644 index 000000000000..1fcccad3cf7c --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/GetToken.cs @@ -0,0 +1,210 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands.Security +{ + using System; + using System.Collections.Specialized; + using System.Management.Automation; + using System.Net; + using Microsoft.Azure.Commands.ResourceManager.Common; + using Microsoft.IdentityModel.Clients.ActiveDirectory; + + /// + /// Get Token Cmdlet + /// + [Cmdlet(VerbsCommon.Get, Nouns.Token, ConfirmImpact = ConfirmImpact.Low, DefaultParameterSetName = "ADFS")] + public class GetToken : Cmdlet + { + //// TODO: Some of these properties are configurable in customer environments; resolve design + + /// + /// The cmdlet behavior. + /// + private const PromptBehavior CmdletBehavior = PromptBehavior.Always; + + /// + /// Indicates whether to validate the authority. + /// + private const bool ValidateAuthority = false; + + /// + /// The authority template URI. + /// + private static readonly UriTemplate AuthorityTemplateUri = new UriTemplate("/{authority_type}/"); + + /// + /// The authority bindings. + /// + private static readonly NameValueCollection AuthorityBindings = new NameValueCollection() + { + { "authority_type", "adfs" } + }; + + /// + /// The redirect URI. + /// + private static readonly Uri NoOpRedirectUri = new Uri(SharedConstants.AzureStackPowerShell.RedirectUri); + + /// + /// Gets or sets URI of the issuing authority. + /// + [Parameter(Mandatory = true, Position = 0)] + [ValidateNotNull] + public string Authority { get; set; } + + /// + /// Gets or sets the resource. + /// + [Parameter] + [ValidateNotNull] + public string Resource { get; set; } + + /// + /// Gets or sets the tenant identifier. + /// + [Parameter(ParameterSetName = "AAD", Mandatory = true)] + [ValidateNotNull] + public string AadTenantId { get; set; } + + /// + /// Gets or sets the client identifier. + /// + [Parameter] + [ValidateNotNull] + public string ClientId { get; set; } + + /// + /// Gets or sets credentials used to request access token. + /// + [Parameter] + [ValidateNotNull] + public PSCredential Credential { get; set; } + + /// + /// Gets or sets a value indicating whether to disable certificate validation. + /// + [Parameter] + public SwitchParameter DisableCertificateValidation { get; set; } + + /// + /// Executes the cmdlet. + /// + protected override void ProcessRecord() + { + var originalValidateCallback = ServicePointManager.ServerCertificateValidationCallback; + AuthenticationResult result; + + try + { + // TODO (bryanr) - Evaluate if this should be removed entirely + if (this.DisableCertificateValidation) + { + this.WriteWarning(Resources.WarningDisableCertificateValidation); + ServicePointManager.ServerCertificateValidationCallback = (s, certificate, chain, sslPolicyErrors) => true; + } + + this.Resource = this.Resource ?? SharedConstants.ResourceManager.ClientId; + this.ClientId = this.ClientId ?? SharedConstants.AzureStackPowerShell.ClientId; + + if (this.IsInteractiveTokenRequest()) + { + result = this.GetSecurityTokenWithInteractiveFlow(); + } + else + { + result = this.GetSecurityTokenWithNonInteractiveFlow(); + } + } + finally + { + if (this.DisableCertificateValidation) + { + ServicePointManager.ServerCertificateValidationCallback = originalValidateCallback; + } + } + + // Write the object to the pipeline only after the certificate validation callback has been restored. + // This will prevent other cmdlets in the pipeline from inheriting this security vulnerability. + this.WriteObject(result.AccessToken); + } + + /// + /// Gets the security token with non interactive flow. + /// + private AuthenticationResult GetSecurityTokenWithNonInteractiveFlow() + { + var uriString = this.BuildAuthorityUriString(); + var userCredential = new UserCredential(this.Credential.UserName, this.Credential.Password); + var result = default(AuthenticationResult); + + if (this.IsRequestForAadToken()) + { + var context = new AuthenticationContext(authority: uriString, validateAuthority: ValidateAuthority); + result = context.AcquireToken(resource: this.Resource, clientId: this.ClientId, userCredential: userCredential); + } + else + { + // NOTE: This is a case of using non-public APIs of ADAL.NET via reflection to acquire token (not officially supported by ADAL.NET team). + result = AuthenticationContextExtensions.AcquireTokenForAdfs(authority: uriString, resource: this.Resource, clientId: this.ClientId, userCredential: userCredential); + } + return result; + } + + /// + /// Determines whether this is an interactive token request. + /// + private bool IsInteractiveTokenRequest() + { + return this.Credential == null; + } + + /// + /// Gets the security token with interactive flow. + /// + private AuthenticationResult GetSecurityTokenWithInteractiveFlow() + { + var uriString = this.BuildAuthorityUriString(); + var context = new AuthenticationContext(authority: uriString, validateAuthority: ValidateAuthority); + var result = context.AcquireToken(resource: this.Resource, clientId: this.ClientId, redirectUri: NoOpRedirectUri, promptBehavior: CmdletBehavior); + return result; + } + + /// + /// Builds the authority URI string. + /// + private string BuildAuthorityUriString() + { + var baseAddressUri = new Uri(this.Authority); + + if (this.IsRequestForAadToken()) + { + return new UriTemplate("/{tenant_id}/").BindByPosition(baseAddressUri, this.AadTenantId).OriginalString; + } + else + { + return AuthorityTemplateUri.BindByName(baseAddressUri, AuthorityBindings).OriginalString; + } + } + + /// + /// Determines whether we are retrieving a token for AAD. + /// + private bool IsRequestForAadToken() + { + return !string.IsNullOrEmpty(this.AadTenantId); + } + + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/Shared.Authorization.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/Shared.Authorization.cs new file mode 100644 index 000000000000..4fa7c1d702a2 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/Shared.Authorization.cs @@ -0,0 +1,67 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands.Security +{ + /// + /// constant strings and values + /// + public static class SharedConstants + { + /// + /// Application settings for Azure Stack PowerShell authorization configuration. + /// + public static class AzureStackPowerShell + { + /// + /// The Azure Stack PowerShell client identifier. + /// + /// We use a hardcoded string with a guid value to be consistent with Azure Active Directory + /// and their client application registration procedure (each client app is assigned a string with unique identifier). + public const string ClientId = "445ace50-bb67-4e02-9371-3d69ced8c25a"; + + /// + /// The redirect uri which is a well-known string for native applications. + /// + public const string RedirectUri = "urn:ietf:wg:oauth:2.0:oob"; + } + + /// + /// Application settings for Azure PowerShell authorization configuration. + /// + public static class AzurePowerShell + { + /// + /// The Azure PowerShell client identifier. + /// + public const string ClientId = "1950a258-227b-4e31-a9cf-717495945fc2"; + + /// + /// The redirect uri which is a well-known string for native applications. + /// + public const string RedirectUri = AzureStackPowerShell.RedirectUri; + } + + /// + /// Application settings for Frontdoor authorization configuration. + /// + public static class ResourceManager + { + /// + /// The Azure Stack Frontdoor client identifier. + /// + public const string ClientId = "3795ab9c-1aa9-4258-97b5-79b402cafa8c"; + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/readme.txt b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/readme.txt new file mode 100644 index 000000000000..e71e7fb6117c --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/Token/readme.txt @@ -0,0 +1,24 @@ + +*** BRIEF GUIDE *** +Here are sample snippets of supported arguments/modes by the cmdlet: + +# PSCredential mode [upn-style] (aka. Resource Owner Password Credentials Grant flow) +$secpasswd = ConvertTo-SecureString "password_goes_here" -AsPlainText -Force +$mycreds = New-Object System.Management.Automation.PSCredential ("username@domain.com", $secpasswd) +Get-AzureRMToken -Authority https://ip_or_hostname_of_winauthsite:12998/ -Credential $mycreds + + +# PSCredential mode [domain\username-style] (aka. Resource Owner Password Credentials Grant flow) +$secpasswd = ConvertTo-SecureString "password_goes_here" -AsPlainText -Force +$mycreds = New-Object System.Management.Automation.PSCredential ("domain\username", $secpasswd) +Get-AzureRMToken -Authority https://ip_or_hostname_of_winauthsite:12998/ -Credential $mycreds + + +# PSCredential mode [username-style, ONLY available when WinAuthSite runs in LocalMachine mode] (aka. Resource Owner Password Credentials Grant flow) +$secpasswd = ConvertTo-SecureString "password_goes_here" -AsPlainText -Force +$mycreds = New-Object System.Management.Automation.PSCredential ("local_machine_username", $secpasswd) +Get-AzureRMToken -Authority https://ip_or_hostname_of_winauthsite:12998/ -Credential $mycreds + + +# Interactive mode [with UX prompt to collect credentials] (aka. Authorization Code Grant flow) +Get-AzureRMToken -Authority https://ip_or_hostname_of_winauthsite:12998/ \ No newline at end of file diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/ValidateAbsoluteUriAttribute.cs b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/ValidateAbsoluteUriAttribute.cs new file mode 100644 index 000000000000..d9ac3d57bd65 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/ValidateAbsoluteUriAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands +{ + using System; + using System.Management.Automation; + using Microsoft.WindowsAzure.Commands.Common.Properties; + + /// + /// Validation for URI parameters in cmdlets + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public sealed class ValidateAbsoluteUriAttribute : ValidateArgumentsAttribute + { + /// + /// Do the validation + /// + /// The args + /// The intrinsics + protected override void Validate(object arguments, EngineIntrinsics engineIntrinsics) + { + if (arguments == null) + { + return; + } + + var uri = arguments as Uri; + + if (uri == null) + { + throw new ValidationMetadataException(Resources.ValidateAbsoluteUriWrongType.FormatArgs(arguments.GetType().Name)); + } + + if (!uri.IsAbsoluteUri) + { + throw new ValidationMetadataException(Resources.ValidateAbsoluteUriNotAbsolute); + } + } + } +} diff --git a/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/packages.config b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/packages.config new file mode 100644 index 000000000000..00c10cb245c9 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/Commands.AzureStackAdmin/packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackAdmin/NuGet.Config b/src/ResourceManager/AzureStackAdmin/NuGet.Config new file mode 100644 index 000000000000..2de911013532 --- /dev/null +++ b/src/ResourceManager/AzureStackAdmin/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/ResourceManager/AzureStackStorage/.nuget/packages.config b/src/ResourceManager/AzureStackStorage/.nuget/packages.config new file mode 100644 index 000000000000..091917678945 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/.nuget/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/AzureRM.AzureStackStorage.psd1 b/src/ResourceManager/AzureStackStorage/AzureRM.AzureStackStorage.psd1 new file mode 100644 index 000000000000..01c0259eb067 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/AzureRM.AzureStackStorage.psd1 @@ -0,0 +1,88 @@ +# +# Module manifest for module 'Microsoft.Azure.Commands.Insights' +# +# Generated by: Microsoft Corporation +# +# Generated on: 9/19/2015 +# + +@{ + +# Version number of this module. +ModuleVersion = '0.9.2' + +# ID used to uniquely identify this module +GUID = 'DA5816B5-97A6-4301-9AA0-72CC68C79F20' + +# 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 - Storage management cmdlets for Azure Stack' + +# 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 the .NET Framework required by this module +DotNetFrameworkVersion = '4.0' + +# Minimum version of the common language runtime (CLR) required by this module +CLRVersion='4.0' + +# Processor architecture (None, X86, Amd64, IA64) required by this module +ProcessorArchitecture = 'None' + +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = @() + +# 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 = @() + +# Modules to import as nested modules of the module specified in ModuleToProcess +NestedModules = @( + '.\Microsoft.AzureStack.Commands.StorageAdmin.dll' +) + +# Functions to export from this module +FunctionsToExport = '*' + +# Cmdlets to export from this module +CmdletsToExport = '*' + +# Variables to export from this module +VariablesToExport = '*' + +# Aliases to export from this module +AliasesToExport = @() + +# 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 ModuleToProcess +PrivateData = '' + +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/AzureStackStorage.sln b/src/ResourceManager/AzureStackStorage/AzureStackStorage.sln new file mode 100644 index 000000000000..531d737e6baa --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/AzureStackStorage.sln @@ -0,0 +1,86 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}" +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.AzureStackStorage", "Commands.AzureStackStorage\Commands.AzureStackStorage.csproj", "{D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackStorage.Test", "Commands.AzureStackStorage.Tests\Commands.AzureStackStorage.Test.csproj", "{D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}" +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.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.Common.Storage", "..\..\Common\Commands.Common.Storage\Commands.Common.Storage.csproj", "{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}" +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.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.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{7865F5ED-E0F3-45CD-87BA-214FE8A27061}" + ProjectSection(SolutionItems) = preProject + .nuget\packages.config = .nuget\packages.config + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {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 + {D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791}.Release|Any CPU.Build.0 = Release|Any CPU + {D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B}.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 + {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 + {65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.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 + {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 + {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 + {D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} + {3436A126-EDC9-4060-8952-9A1BE34CDD95} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} + EndGlobalSection +EndGlobal diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj new file mode 100644 index 000000000000..52aef5d3932f --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Commands.AzureStackStorage.Test.csproj @@ -0,0 +1,306 @@ + + + + + + Debug + AnyCPU + {D4EDAD6F-6A1D-4295-9A88-CD3F69EAD42B} + Library + Properties + Microsoft.AzureStack.Commands.StorageAdmin.Test + Microsoft.AzureStack.Commands.StorageAdmin.Test + v4.5 + 512 + + ..\..\..\ + true + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + d7bcc31d + + + true + MSSharedLibKey.snk + true + true + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + + + bin\Release\ + TRACE;SIGN + true + pdbonly + AnyCPU + prompt + false + + + + ..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.6.1-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + True + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5799.28345-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5799.28345-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll + + + False + ..\..\..\packages\Microsoft.AzureStack.Management.Storage.0.9.2-preview\lib\net45\Microsoft.AzureStack.Management.Storage.dll + + + False + ..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\..\..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll + + + False + ..\..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + + ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + False + ..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll + + + False + ..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + + + + + False + C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + + False + ..\..\..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll + + + ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll + True + + + ..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll + True + + + + + + + + + + + + + + + + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {3819d8a7-c62c-4c47-8ddd-0332d9ce1252} + Commands.ResourceManager.Common + + + {3436a126-edc9-4060-8952-9a1be34cdd95} + Commands.ScenarioTests.ResourceManager.Common + + + {d4ca0cc1-cd0a-4ce2-a40d-2d8a082d8791} + Commands.AzureStackStorage + + + + + + Designer + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/MSSharedLibKey.snk b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/MSSharedLibKey.snk differ diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..409808df0caf --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +// ---------------------------------------------------------------------------------- +// +// 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.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("Microsoft.Azure.Commands.Resources.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Microsoft.Azure.Commands.Resources.Test")] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("5802D147-3EE9-4352-A0B1-1C16B6DBCA7C")] + +[assembly: AssemblyVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyVersion)] +[assembly: AssemblyFileVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyFileVersion)] diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/BlobServicesTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/BlobServicesTests.cs new file mode 100644 index 000000000000..268980a885af --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/BlobServicesTests.cs @@ -0,0 +1,37 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class BlobServicesTests:RMTestBase + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetBlobService() + { + TestsController.NewInstance.RunPsTest("Test-GetBlobService"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestSetBlobService() + { + TestsController.NewInstance.RunPsTest("Test-SetBlobService"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/BlobServicesTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/BlobServicesTests.ps1 new file mode 100644 index 000000000000..fca4f8f60264 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/BlobServicesTests.ps1 @@ -0,0 +1,88 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single farm for a resource group with admin subscription id. +#> +function Test-GetBlobService +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $orgin = Get-ACSBlobService -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + Assert-AreEqual $orgin.HealthStatus "Unknown" + Assert-AreEqual $orgin.FarmName "82ba752f-0fac-47e2-8477-5731f9f5db34" + Assert-AreEqual $orgin.Id "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/82ba752f-0fac-47e2-8477-5731f9f5db34/tableservices/default" + Assert-AreEqual $orgin.Location "redmond" + Assert-AreEqual $orgin.Name "82ba752f-0fac-47e2-8477-5731f9f5db34/default" + Assert-AreEqual $orgin.Type "Microsoft.Storage.Admin/farms/tableservices" + Assert-AreEqual $orgin.version "1.0" + + Assert-AreEqual $orgin.Settings.frontEndHttpListenPort "11002" + Assert-AreEqual $orgin.Settings.frontEndHttpsListenPort "11102" + Assert-AreEqual $orgin.Settings.frontEndCallbackThreadsCount "1800" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingEnabled "true" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold "100" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle "10" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds "20" + Assert-AreEqual $orgin.Settings.frontEndMemoryThrottlingEnabled "true" + Assert-AreEqual $orgin.Settings.frontEndMaxMillisecondsBetweenMemorySamples "10000" + Assert-AreEqual $orgin.Settings.frontEndMemoryThrottleThresholdSettings "5,100,0;7,50,0;10,25,0;15,0,25;" + #Assert-AreEqual $orgin.Settings.frontEndMinThreadPoolThreads "1600" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAliveIOCompletionThreshold "1500" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAliveWorkerThreadThreshold "1500" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAliveMonitorIntervalInSeconds "30" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAlivePercentage "10" + Assert-AreEqual $orgin.Settings.frontEndUseSlaTimeInAvailability "true" + + $actual = $orgin | Set-ACSBlobService -FrontEndCpuBasedKeepAliveThrottlingEnabled $false + Assert-AreEqual $actual.Settings.frontEndCpuBasedKeepAliveThrottlingEnabled $false + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing farms in a resource group with admin subscription id. +#> +function Test-SetBlobService +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Set-ACSBlobService -FarmName $farmName ` + -SubscriptionId $subscriptionId -ResourceGroupName $rgname -SkipCertificateValidation ` + -FrontEndCpuBasedKeepAliveThrottlingEnabled $true ` + -FrontEndMemoryThrottlingEnabled $true + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/Common.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/Common.ps1 new file mode 100644 index 000000000000..a49ecd290e12 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/Common.ps1 @@ -0,0 +1,65 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Gets valid resource group name +#> +function Get-ResourceGroupName +{ + return getAssetName +} + +<# +.SYNOPSIS +Gets valid resource name +#> +function Get-ResourceName +{ + return getAssetName +} + +<# +.SYNOPSIS +Gets the default location for a provider +#> +function Get-ProviderLocation($provider) +{ + $location = Get-AzureLocation | where {$_.Name -eq $provider} + if ($location -eq $null) { + "West US" + } else { + $location.Locations[0] + } +} + +<# +.SYNOPSIS +Gets valid application display name +#> +function Get-ApplicatonDisplayName +{ + return getAssetName +} + +<# +.SYNOPSIS +Cleans the created resource groups +#> +function Clean-ResourceGroup($rgname) +{ + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { + Remove-AzureResourceGroup -Name $rgname -Force + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/EventsTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/EventsTests.ps1 new file mode 100644 index 000000000000..987644a345fa --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/EventsTests.ps1 @@ -0,0 +1,143 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting the logs associated to a correlation Id. +#> +function Test-GetAzureCorrelationIdLog +{ + # Setup + $correlation = '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.insights/alertrules/checkrule3-4b135401-a30c-4224-ae21-fa53a5bd253d/incidents/L3N1YnNjcmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2ViLUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBjLTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NjA5MjE5ODU0NzQ1NDI0' + + try + { + # Test + $actual = Get-AzureCorrelationIdLog -CorrelationId $correlation -starttime 2015-03-02T10:00:00 -endtime 2015-03-02T12:00:00 -detailedOutput + + # Assert TODO add more asserts + Assert-AreEqual $actual.Count 2 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests getting the logs associated to a resource group. +#> +function Test-GetAzureResourceGroupLog +{ + # Setup + $rgname = 'Default-Web-EastUS' + + try + { + $actual = Get-AzureResourceGroupLog -ResourceGroup $rgname -starttime 2015-01-15T04:30:00 -endtime 2015-01-15T12:30:00 + + # Assert TODO add more asserts + Assert-AreEqual $actual.Count 2 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests getting the logs associated to a resource Id. +#> +function Test-GetAzureResourceLog +{ + # Setup + $rname = '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.insights/alertrules/checkrule3-4b135401-a30c-4224-ae21-fa53a5bd253d' + + try + { + $actual = Get-AzureResourceLog -ResourceId $rname -startTime 2015-03-03T15:42:50Z -endTime 2015-03-03T16:42:50Z + + # Assert TODO add more asserts + # Assert-Throws { Set-AzureResourceGroup -Name $rgname -Tags @{"testtag" = "testval"} } "Invalid tag format. Expect @{Name = `"tagName`"} or @{Name = `"tagName`"; Value = `"tagValue`"}" + Assert-AreEqual $actual.Count 2 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests getting the logs associated to a resource provider. +#> +function Test-GetAzureResourceProviderLog +{ + # Setup + $rpname = 'microsoft.insights' + + try + { + $actual = Get-AzureResourceProviderLog -ResourceProvider $rpname -startTime 2015-03-03T15:42:50Z -endTime 2015-03-03T16:42:50Z + + # Assert + Assert-AreEqual $actual.Count 2 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests getting the logs for a subscription Id. +#> +function Test-GetAzureSubscriptionIdLog +{ + # No Setup needed + + try + { + # Test + $actual = Get-AzureSubscriptionIdLog -starttime 2015-01-15T04:30:00 -endtime 2015-01-15T12:30:00 + + # Assert + Assert-AreEqual $actual.Count 1 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FarmsTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FarmsTests.cs new file mode 100644 index 000000000000..e4c991a23e67 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FarmsTests.cs @@ -0,0 +1,57 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class FarmsTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetFarm() + { + TestsController.NewInstance.RunPsTest("Test-GetFarm"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestListFarms() + { + TestsController.NewInstance.RunPsTest("Test-ListFarms"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestSetFarm() + { + TestsController.NewInstance.RunPsTest("Test-SetFarm"); + } + + //[Fact] + //[Trait(Category.AcceptanceType, Category.CheckIn)] + //public void TestGetFarms() + //{ + // TestsController.NewInstance.RunPsTest("Test-GetFarms"); + //} + + //[Fact] + //[Trait(Category.AcceptanceType, Category.CheckIn)] + //public void TestGetAlertHistory() + //{ + // TestsController.NewInstance.RunPsTest("Test-GetAlertHistory"); + //} + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FarmsTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FarmsTests.ps1 new file mode 100644 index 000000000000..3d5133e7b95d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FarmsTests.ps1 @@ -0,0 +1,105 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single farm for a resource group with admin subscription id. +#> +function Test-GetFarm +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $orgin = Get-ACSFarm -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + Assert-AreEqual $orgin.HealthStatus "Warning" + Assert-AreEqual $orgin.SettingsStore "anypath" + Assert-AreEqual $orgin.FarmName "farm_01" + Assert-AreEqual $orgin.Id "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/farm_01" + Assert-AreEqual $orgin.Location "west us" + Assert-AreEqual $orgin.Name "farm_01" + Assert-AreEqual $orgin.Type "Microsoft.Storage.Admin/farms" + + Assert-AreEqual $orgin.Settings.HostStyleHttpPort "80" + Assert-AreEqual $orgin.Settings.HostStyleHttpsPort "443" + Assert-AreEqual $orgin.Settings.SettingsPollingIntervalInSecond "60" + Assert-AreEqual $orgin.Settings.CorsAllowedOriginsList "http://manage.wossportal.com;http://www.example.com" + Assert-AreEqual $orgin.Settings.DataCenterUriHostSuffixes "contoso.com" + + $corsAllowedOriginsList = 'http://manage.wossportal.com;http://www.example.com' + $settingsPullingInterval = 90 + + $actual = $orgin | Set-ACSFarm -SettingsPollingIntervalInSecond $settingsPullingInterval -CorsAllowedOriginsList $corsAllowedOriginsList + Assert-AreEqual $actual.Settings.SettingsPollingIntervalInSecond $settingsPullingInterval + Assert-AreEqual $actual.Settings.CorsAllowedOriginsList $corsAllowedOriginsList + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing farms in a resource group with admin subscription id. +#> +function Test-ListFarms +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + + try + { + $actual = Get-ACSFarm -ResourceGroupName $rgname -SubscriptionId $subscriptionId + + # Assert TODO add more asserts + Assert-AreEqual $actual.Count 1 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests set farm settings in a resource group with admin subscription id. +#> +function Test-SetFarm +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $corsAllowedOriginsList = 'http://manage.wossportal.com;http://www.example.com' + $settingsPullingInterval = 90 + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Set-ACSFarm -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -SettingsPollingIntervalInSecond $settingsPullingInterval -CorsAllowedOriginsList $corsAllowedOriginsList + Assert-AreEqual $actual.HealthStatus "Unknown" + } + finally + { + # Cleanup + # No cleanup needed for now + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FaultsTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FaultsTests.cs new file mode 100644 index 000000000000..91d4c7f58a73 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FaultsTests.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class FaultsTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetFault() + { + TestsController.NewInstance.RunPsTest("Test-GetFault"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetHistoricFaults() + { + TestsController.NewInstance.RunPsTest("Test-GetHistoricFaults"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetCurrentFaults() + { + TestsController.NewInstance.RunPsTest("Test-GetCurrentFaults"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestResolveFault() + { + TestsController.NewInstance.RunPsTest("Test-ResolveFault"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FaultsTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FaultsTests.ps1 new file mode 100644 index 000000000000..8470bbacb8e5 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/FaultsTests.ps1 @@ -0,0 +1,158 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single fault for a resource group with admin subscription id. +#> +function Test-GetFault +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $faultId = 'D64F6195-93FE-40AF-B0A7-D8EA10506028' + + try + { + $actual = Get-ACSFault -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -FaultId $faultId + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual.ActivatedTime.ToString("yyyy-MM-dd HH:mm:ss") "2015-05-18 18:02:00" + Assert-AreEqual $actual.AssociatedDataType 'Metrics' + Assert-AreEqual $actual.AssociatedEventQuery $null + Assert-AreEqual $actual.AssociatedMetricsName 'MetricsName' + Assert-AreEqual $actual.Description 'TBD' + Assert-AreEqual $actual.FaultId 'D64F6195-93FE-40AF-B0A7-D8EA10506028' + Assert-AreEqual $actual.FaultRuleName 'faultRule1' + Assert-AreEqual $actual.ResolutionText 'TBD' + Assert-AreEqual $actual.ResolvedTime $null + Assert-AreEqual $actual.ResourceUri '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableserverinstances/woss-node1' + Assert-AreEqual $actual.Severity 'Critical' + Assert-AreEqual $actual.ResourceGroupName $rgname + Assert-AreEqual $actual.FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Dismiss a fault for a resource group with admin subscription id. +#> +function Test-ResolveFault +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $faultId = 'D64F6195-93FE-40AF-B0A7-D8EA10506028' + + try + { + $actual = Resolve-ACSFault -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -FaultId $faultId -Force + + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + + +<# +.SYNOPSIS +Tests get historic faults within a time period in a resource group with admin subscription id. +#> +function Test-GetHistoricFaults +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $startTime = [DateTime]'1/1/2015' + $endTime = [DateTime]'1/2/2015' + + $actual = Get-ACSFault ` + -FarmName $farmName -SubscriptionId $subscriptionId -ResourceGroupName $rgname -SkipCertificateValidation ` + -StartTime $startTime -EndTime $endTime + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual.ActivatedTime.ToString("yyyy-MM-dd HH:mm:ss") "2015-05-18 18:02:00" + Assert-AreEqual $actual.AssociatedDataType 'Metrics' + Assert-AreEqual $actual.AssociatedEventQuery $null + Assert-AreEqual $actual.AssociatedMetricsName 'MetricsName' + Assert-AreEqual $actual.Description 'TBD' + Assert-AreEqual $actual.FaultId 'D64F6195-93FE-40AF-B0A7-D8EA10506028' + Assert-AreEqual $actual.FaultRuleName 'faultRule1' + Assert-AreEqual $actual.ResolutionText 'TBD' + Assert-AreEqual $actual.ResolvedTime $null + Assert-AreEqual $actual.ResourceUri '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableserverinstances/woss-node1' + Assert-AreEqual $actual.Severity 'Critical' + Assert-AreEqual $actual.ResourceGroupName $rgname + Assert-AreEqual $actual.FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests get current faults for a specific resource in a resource group with admin subscription id. +#> +function Test-GetCurrentFaults +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $resourceUri = '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/farms/03768357-B4F2-4C3C-AA75-574209B03D49' + $actual = Get-ACSFault ` + -FarmName $farmName -SubscriptionId $subscriptionId -ResourceGroupName $rgname -SkipCertificateValidation ` + -ResourceUri $resourceUri + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual.ActivatedTime.ToString("yyyy-MM-dd HH:mm:ss") "2015-05-18 18:02:00" + Assert-AreEqual $actual.AssociatedDataType 'Metrics' + Assert-AreEqual $actual.AssociatedEventQuery $null + Assert-AreEqual $actual.AssociatedMetricsName 'MetricsName' + Assert-AreEqual $actual.Description 'TBD' + Assert-AreEqual $actual.FaultId 'D64F6195-93FE-40AF-B0A7-D8EA10506028' + Assert-AreEqual $actual.FaultRuleName 'faultRule1' + Assert-AreEqual $actual.ResolutionText 'TBD' + Assert-AreEqual $actual.ResolvedTime $null + Assert-AreEqual $actual.ResourceUri '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableserverinstances/woss-node1' + Assert-AreEqual $actual.Severity 'Critical' + Assert-AreEqual $actual.ResourceGroupName $rgname + Assert-AreEqual $actual.FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/ManagementServicesTest.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/ManagementServicesTest.cs new file mode 100644 index 000000000000..d225e1d5be30 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/ManagementServicesTest.cs @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class ManagementServicesTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetManagementService() + { + TestsController.NewInstance.RunPsTest("Test-GetManagementService"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestSetManagementService() + { + TestsController.NewInstance.RunPsTest("Test-SetManagementService"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/ManagementServicesTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/ManagementServicesTests.ps1 new file mode 100644 index 000000000000..54a13ff9473b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/ManagementServicesTests.ps1 @@ -0,0 +1,62 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single farm for a resource group with admin subscription id. +#> +function Test-GetManagementService +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Get-ACSManagementService -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + + # Assert TODO add more asserts for detail payload check + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing farms in a resource group with admin subscription id. +#> +function Test-SetManagementService +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Set-ACSManagementService -FarmName $farmName ` + -SubscriptionId $subscriptionId -ResourceGroupName $rgname -SkipCertificateValidation ` + -WacContainerGcFullScanIntervalInSeconds 3600 ` + -WacAccountGcFullScanIntervalInSeconds 3600 ` + } + finally + { + # Cleanup + # No cleanup needed for now + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/NodesTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/NodesTests.cs new file mode 100644 index 000000000000..59282fd947b2 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/NodesTests.cs @@ -0,0 +1,51 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class NodesTests : RMTestBase + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetNode() + { + TestsController.NewInstance.RunPsTest("Test-GetNode"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestListNodes() + { + TestsController.NewInstance.RunPsTest("Test-ListNodes"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestDisableNode() + { + TestsController.NewInstance.RunPsTest("Test-DisableNode"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestEnableNode() + { + TestsController.NewInstance.RunPsTest("Test-EnableNode"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/NodesTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/NodesTests.ps1 new file mode 100644 index 000000000000..a05f3ccacdc8 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/NodesTests.ps1 @@ -0,0 +1,152 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single node for a resource group with admin subscription id. +#> +function Test-GetNode +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $nodeName = 'woss-node-1' + + try + { + $orgin = Get-ACSNode -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -NodeName $nodeName + Assert-AreEqual $orgin.HealthState "Critical" + Assert-AreEqual $orgin.FarmName "03768357-B4F2-4C3C-AA75-574209B03D49" + Assert-AreEqual $orgin.Id "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1" + Assert-AreEqual $orgin.Location "West_US" + Assert-AreEqual $orgin.Name "03768357-B4F2-4C3C-AA75-574209B03D49/woss-node-1" + Assert-AreEqual $orgin.Type "Microsoft.Storage.Admin/farms/nodes" + Assert-AreEqual $orgin.codeVersion "3.0.1414.9492" + Assert-AreEqual $orgin.configVersion "1.0" + Assert-AreEqual $orgin.faultDomain "fd:/woss-node-1" + Assert-AreEqual $orgin.configVersion "1.0" + Assert-AreEqual $orgin.upgradeDomain "WOSS_U1" + Assert-AreEqual $orgin.runningInstanceUris.count 2 + Assert-AreEqual $orgin.runningInstanceUris[0] "subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/tableserverinstances/woss-node-1" + Assert-AreEqual $orgin.runningInstanceUris[1] "subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/accountcontainerserverinstances/woss-node-1" + + $actual = $orgin | Disable-ACSNode + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing nodes in a resource group with admin subscription id. +#> +function Test-ListNodes +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Get-ACSNode -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + + # Assert TODO add more asserts + Assert-AreEqual $actual.Count 1 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests disabling a single node in cluster in a resource group with admin subscription id. +#> +function Test-EnableNode +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Enable-ACSNode -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + + # Assert TODO add more asserts + Assert-AreEqual $actual.Count 1 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests disabling a single node in cluster in a resource group with admin subscription id. +#> +function Test-DisableNode +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $nodeName = 'woss-node-1' + + try + { + $actual = Disable-ACSNode -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -NodeName $nodeName + + # Assert TODO add more asserts + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests enabling a single node in cluster in a resource group with admin subscription id. +#> +function Test-EnableNode +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $nodeName = 'woss-node-1' + + try + { + $actual = Enable-ACSNode -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -NodeName $nodeName + + # Assert TODO add more asserts + } + finally + { + # Cleanup + # No cleanup needed for now + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/RoleInstancesTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/RoleInstancesTests.cs new file mode 100644 index 000000000000..bcb07aec7682 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/RoleInstancesTests.cs @@ -0,0 +1,64 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class RoleInstancesTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetRoleInstance() + { + TestsController.NewInstance.RunPsTest("Test-GetRoleInstance"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestListRoleInstances() + { + TestsController.NewInstance.RunPsTest("Test-ListRoleInstances"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestRestartRoleInstance() + { + TestsController.NewInstance.RunPsTest("Test-RestartRoleInstance"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestStartRoleInstance() + { + TestsController.NewInstance.RunPsTest("Test-StartRoleInstance"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestStopRoleInstance() + { + TestsController.NewInstance.RunPsTest("Test-StopRoleInstance"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestRoleInstancePipeline() + { + TestsController.NewInstance.RunPsTest("Test-RoleInstancePipeline"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/RoleInstancesTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/RoleInstancesTests.ps1 new file mode 100644 index 000000000000..15d453f65228 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/RoleInstancesTests.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Tests getting a single role instance for a resource group with admin subscription id. +#> +function Test-GetRoleInstance +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '3c62b865-d397-47fe-99ed-6dda536a1a69' + $roleInstanceId = 'D11180COL0' + + try + { + $result = Get-ACSRoleInstance ` + -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -RoleType TableServer ` + -InstanceId $roleInstanceId + + Assert-AreEqual $result.HealthStatus "Healthy" + Assert-AreEqual $result.NodeUri "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL0" + Assert-AreEqual $result.InstanceId $roleInstanceId + Assert-AreEqual $result.Status "Active" + + $settings = $result.settings + Assert-AreEqual $settings.TableServerMaxConnections 100 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing role instances in a resource group with admin subscription id. +#> +function Test-ListRoleInstances +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '3c62b865-d397-47fe-99ed-6dda536a1a69' + + try + { + $results = Get-ACSRoleInstance ` + -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -RoleType TableServer + + # Assert TODO add more asserts + Assert-AreEqual $results.Count 6 + Assert-AreEqual $results[0].HealthStatus "Healthy" + Assert-AreEqual $results[0].NodeUri "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL0" + Assert-AreEqual $results[0].InstanceId "D11180COL0" + Assert-AreEqual $results[0].Status "Active" + + $settings = $results[0].settings + Assert-AreEqual $settings.TableServerMaxConnections 100 + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests restarting a role instance in cluster in a resource group with admin subscription id. +#> +function Test-RestartRoleInstance +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '3c62b865-d397-47fe-99ed-6dda536a1a69' + $roleInstanceId = 'D11180COL0' + + try + { + $actual = Restart-ACSRoleInstance ` + -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -RoleType TableServer ` + -InstanceId $roleInstanceId + + # Assert TODO add more asserts + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests starting a role instance in cluster in a resource group with admin subscription id. +#> +function Test-StartRoleInstance +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '3c62b865-d397-47fe-99ed-6dda536a1a69' + $roleInstanceId = 'D11180COL0' + + try + { + $actual = Start-ACSBlobServerRoleInstance ` + -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -InstanceId $roleInstanceId + + # Assert TODO add more asserts + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests stop a role instance in cluster in a resource group with admin subscription id. +#> +function Test-StopRoleInstance +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '3c62b865-d397-47fe-99ed-6dda536a1a69' + $roleInstanceId = 'D11180COL0' + + try + { + $actual = Stop-ACSBlobServerRoleInstance ` + -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -InstanceId $roleInstanceId + + # Assert TODO add more asserts + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests role instance pipeline. Get a roleinstance, then restart it thru pipeline. +#> +function Test-RoleInstancePipeline +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '3c62b865-d397-47fe-99ed-6dda536a1a69' + + try + { + $results = Get-ACSRoleInstance ` + -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -RoleType TableServer | Select-Object -First 1 | Restart-ACSRoleInstance + } + finally + { + # Cleanup + # No cleanup needed for now + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/SharesTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/SharesTests.cs new file mode 100644 index 000000000000..4dd79031170e --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/SharesTests.cs @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class SharesTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetShare() + { + TestsController.NewInstance.RunPsTest("Test-GetShare"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestListShares() + { + TestsController.NewInstance.RunPsTest("Test-ListShares"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/SharesTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/SharesTests.ps1 new file mode 100644 index 000000000000..4b7465a34510 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/SharesTests.ps1 @@ -0,0 +1,76 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single share for a resource group with admin subscription id. +#> +function Test-GetShare +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $shareName = '||smb|share1' + + try + { + $actual = Get-ACSShare -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -ShareName $shareName + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual.FreeCapacity 460 + Assert-AreEqual $actual.HealthStatus 'Warning' + Assert-AreEqual $actual.ShareName $shareName + Assert-AreEqual $actual.TotalCapacity 500 + Assert-AreEqual $actual.UncPath $shareName + Assert-AreEqual $actual.UsedCapacity 40 + Assert-AreEqual $actual.FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing shares in a resource group with admin subscription id. +#> +function Test-ListShares +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Get-ACSShare -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual[0].FreeCapacity 460 + Assert-AreEqual $actual[0].HealthStatus 'Warning' + Assert-AreEqual $actual[0].ShareName '||smb|share1' + Assert-AreEqual $actual[0].TotalCapacity 500 + Assert-AreEqual $actual[0].UncPath '||smb|share1' + Assert-AreEqual $actual[0].UsedCapacity 40 + Assert-AreEqual $actual[0].FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/StorageAccountsTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/StorageAccountsTests.cs new file mode 100644 index 000000000000..7458d90eb358 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/StorageAccountsTests.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class StorageAccountsTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetStorageAccount() + { + TestsController.NewInstance.RunPsTest("Test-GetStorageAccount"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestListStorageAccounts() + { + TestsController.NewInstance.RunPsTest("Test-ListStorageAccounts"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestUndoStorageAccountDeletion() + { + TestsController.NewInstance.RunPsTest("Test-UndoStorageAccountDeletion"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestStorageAccountPipeline() + { + TestsController.NewInstance.RunPsTest("Test-StorageAccountPipeline"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/StorageAccountsTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/StorageAccountsTests.ps1 new file mode 100644 index 000000000000..0b27df9d7813 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/StorageAccountsTests.ps1 @@ -0,0 +1,169 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single storage account with account ID given for a resource group with admin subscription id. +#> +function Test-GetStorageAccount +{ + # Setup + $rgname = 'system' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $accountId = 1 + + try + { + $actual = Get-ACSStorageAccount -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -AccountId $accountId -Detail + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual.AccountId 1 + Assert-AreEqual $actual.AdminViewId '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1' + Assert-AreEqual $actual.TenantViewId '/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007' + Assert-AreEqual $actual.AccountType 'StandardGRS' + Assert-AreEqual $actual.State 'Created' + Assert-AreEqual $actual.PrimaryEndpoints['blob'] 'https://host:11100/demo007' + Assert-AreEqual $actual.PrimaryEndpoints['queue'] 'https://host:11101/demo007' + Assert-AreEqual $actual.PrimaryEndpoints['table'] 'https://host:11102/demo007' + + #TODO: should the type of CreationTime be DateTime? + Assert-AreEqual $actual.CreationTime 'Tue, 13 Oct 2015 05:42:48 GMT' + Assert-AreEqual $actual.AlternateName $null + Assert-AreEqual $actual.StatusOfPrimary 'Available' + Assert-AreEqual $actual.TenantSubscriptionId '177fbbce-fd6a-4f11-bfa4-52c2f3a21918' + Assert-AreEqual $actual.TenantAccountName 'demo007' + Assert-AreEqual $actual.TenantResourceGroupName $rgname + Assert-AreEqual $actual.CurrentOperation 'None' + Assert-AreEqual $actual.CustomDomain $null + Assert-AreEqual $actual.AcquisitionOperationCount 0 + Assert-AreEqual $actual.DeletedTime $null + Assert-AreEqual $actual.AccountStatus 'Active' + Assert-AreEqual $actual.RecoveredTime.ToString("yyyy-MM-dd HH:mm:ss") '2015-10-13 05:44:29' + Assert-AreEqual $actual.RecycledTime $null + Assert-AreEqual $actual.Permissions $null + #TODO: verify WacAccountId, WacInternalState etc + Assert-AreEqual $actual.FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing storage accounts with partial/full storage account name given in a resource group with admin subscription id. +#> +function Test-ListStorageAccounts +{ + # Setup + $rgname = 'system' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $partialAccountName = 'acc' + $tenantSubscriptionId = 'DB3972C4-90B4-4A11-9209-D6C12060F6FC' + + try + { + $actual = Get-ACSStorageAccount -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -PartialAccountName $partialAccountName ` + -TenantSubscriptionId $tenantSubscriptionId + + Assert-AreEqual $actual.Count 1 + Assert-AreEqual $actual[0].AccountId 1 + Assert-AreEqual $actual[0].AdminViewId '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1' + Assert-AreEqual $actual[0].TenantViewId '/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007' + Assert-AreEqual $actual[0].AccountType 'StandardGRS' + Assert-AreEqual $actual[0].State 'Created' + Assert-AreEqual $actual[0].PrimaryEndpoints['blob'] 'https://host:11100/demo007' + Assert-AreEqual $actual[0].PrimaryEndpoints['queue'] 'https://host:11101/demo007' + Assert-AreEqual $actual[0].PrimaryEndpoints['table'] 'https://host:11102/demo007' + + #TODO: should the type of CreationTime be DateTime? + Assert-AreEqual $actual[0].CreationTime 'Tue, 13 Oct 2015 05:42:48 GMT' + Assert-AreEqual $actual[0].AlternateName $null + Assert-AreEqual $actual[0].StatusOfPrimary 'Available' + Assert-AreEqual $actual[0].TenantSubscriptionId '177fbbce-fd6a-4f11-bfa4-52c2f3a21918' + Assert-AreEqual $actual[0].TenantAccountName 'demo007' + Assert-AreEqual $actual[0].TenantResourceGroupName $rgname + Assert-AreEqual $actual[0].CurrentOperation 'None' + Assert-AreEqual $actual[0].CustomDomain $null + Assert-AreEqual $actual[0].AcquisitionOperationCount 0 + Assert-AreEqual $actual[0].DeletedTime $null + Assert-AreEqual $actual[0].AccountStatus 'Active' + Assert-AreEqual $actual[0].RecoveredTime.ToString("yyyy-MM-dd HH:mm:ss") '2015-10-13 05:44:29' + Assert-AreEqual $actual[0].RecycledTime $null + Assert-AreEqual $actual[0].Permissions $null + #TODO: verify WacAccountId, WacInternalState etc + Assert-AreEqual $actual[0].FarmName $farmName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests undo the deletion of a storage account with account ID given in a resource group with admin subscription id. +#> +function Test-UndoStorageAccountDeletion +{ + # Setup + $rgname = 'system' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $accountId = 1 + $tenantSubscriptionId = 'DB3972C4-90B4-4A11-9209-D6C12060F6FC' + $newAccountName = 'acc_new_name' + + try + { + $actual = Undo-ACSStorageAccountDeletion -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName ` + -AccountId $accountId -NewAccountName $newAccountName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests pipeline. Get an account first, then undo deletion. +#> +function Test-StorageAccountPipeline +{ + # Setup + $rgname = 'system' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + $accountId = 1 + $newAccountName = 'acc_new_name' + + try + { + $actual = Get-ACSStorageAccount -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName -AccountId $accountId -Detail ` + | Undo-ACSStorageAccountDeletion -NewAccountName $newAccountName + } + finally + { + # Cleanup + # No cleanup needed for now + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TableServicesTests.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TableServicesTests.cs new file mode 100644 index 000000000000..76caea401fa7 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TableServicesTests.cs @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------------- +// +// 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.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public class TableServicesTests + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestGetTableService() + { + TestsController.NewInstance.RunPsTest("Test-GetTableService"); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestSetTableService() + { + TestsController.NewInstance.RunPsTest("Test-SetTableService"); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TableServicesTests.ps1 b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TableServicesTests.ps1 new file mode 100644 index 000000000000..3562f6c83351 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TableServicesTests.ps1 @@ -0,0 +1,85 @@ +# ---------------------------------------------------------------------------------- +# +# 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 +Tests getting a single farm for a resource group with admin subscription id. +#> +function Test-GetTableService +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $orgin = Get-ACSTableService -ResourceGroupName $rgname -SubscriptionId $subscriptionId -FarmName $farmName + Assert-AreEqual $orgin.HealthStatus "Unknown" + Assert-AreEqual $orgin.FarmName "82ba752f-0fac-47e2-8477-5731f9f5db34" + Assert-AreEqual $orgin.Id "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/82ba752f-0fac-47e2-8477-5731f9f5db34/tableservices/default" + Assert-AreEqual $orgin.Location "redmond" + Assert-AreEqual $orgin.Name "82ba752f-0fac-47e2-8477-5731f9f5db34/default" + Assert-AreEqual $orgin.Type "Microsoft.Storage.Admin/farms/tableservices" + Assert-AreEqual $orgin.version "1.0" + + Assert-AreEqual $orgin.Settings.frontEndHttpListenPort "11002" + Assert-AreEqual $orgin.Settings.frontEndHttpsListenPort "11102" + Assert-AreEqual $orgin.Settings.frontEndCallbackThreadsCount "1800" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingEnabled "true" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold "100" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle "10" + Assert-AreEqual $orgin.Settings.frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds "20" + Assert-AreEqual $orgin.Settings.frontEndMemoryThrottlingEnabled "true" + Assert-AreEqual $orgin.Settings.frontEndMaxMillisecondsBetweenMemorySamples "10000" + Assert-AreEqual $orgin.Settings.frontEndMemoryThrottleThresholdSettings "5,100,0;7,50,0;10,25,0;15,0,25;" + #Assert-AreEqual $orgin.Settings.frontEndMinThreadPoolThreads "1600" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAliveIOCompletionThreshold "1500" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAliveWorkerThreadThreshold "1500" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAliveMonitorIntervalInSeconds "30" + Assert-AreEqual $orgin.Settings.frontEndThreadPoolBasedKeepAlivePercentage "10" + Assert-AreEqual $orgin.Settings.frontEndUseSlaTimeInAvailability "true" + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + +<# +.SYNOPSIS +Tests listing farms in a resource group with admin subscription id. +#> +function Test-SetTableService +{ + # Setup + $rgname = 'Default-Web-EastUS' + $subscriptionId = 'a93fb07c-6c93-40be-bf3b-4f0deba10f4b' + $farmName = '03768357-B4F2-4C3C-AA75-574209B03D49' + + try + { + $actual = Set-ACSTableService -FarmName $farmName ` + -SubscriptionId $subscriptionId -ResourceGroupName $rgname -SkipCertificateValidation ` + -FrontEndCpuBasedKeepAliveThrottlingEnabled $true ` + -FrontEndMemoryThrottlingEnabled $true + } + finally + { + # Cleanup + # No cleanup needed for now + } +} + diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TestsController.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TestsController.cs new file mode 100644 index 000000000000..07e41b0a1902 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/ScenarioTests/TestsController.cs @@ -0,0 +1,154 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------------- +// +// 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.Common.Authentication; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Microsoft.Azure.Test; +using System; +using System.Linq; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; + +namespace Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests +{ + public sealed class TestsController : RMTestBase + { + private CSMTestEnvironmentFactory csmTestFactory; + private EnvironmentSetupHelper helper; + + public string UserDomain { get; private set; } + + public static TestsController NewInstance + { + get + { + return new TestsController(); + } + } + + public TestsController() + { + helper = new EnvironmentSetupHelper(); + } + + public void RunPsTest(params string[] scripts) + { + var callingClassType = TestUtilities.GetCallingClass(2); + var mockName = TestUtilities.GetCurrentMethodName(2); + + 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) + { + using (UndoContext context = UndoContext.Current) + { + context.Start(callingClassType, mockName); + + this.csmTestFactory = new CSMTestEnvironmentFactory(); + + if(initialize != null) + { + initialize(this.csmTestFactory); + } + + SetupManagementClients(); + + helper.SetupEnvironment(AzureModule.AzureResourceManager); + + var callingClassName = callingClassType + .Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries) + .Last(); + helper.SetupModules( + AzureModule.AzureResourceManager, + "ScenarioTests\\Common.ps1", + "ScenarioTests\\" + callingClassName + ".ps1", + helper.RMProfileModule, + helper.GetRMModulePath("AzureRM.AzureStackStorage.psd1")); + + try + { + if (scriptBuilder != null) + { + var psScripts = scriptBuilder(); + + if (psScripts != null) + { + helper.RunPowerShellTest(psScripts); + } + } + } + finally + { + if(cleanup !=null) + { + cleanup(); + } + } + } + } + + private void SetupManagementClients() + { + var storageAdminClient = GetStorageManagementClient(); + + helper.SetupManagementClients(storageAdminClient); + } + + private IStorageAdminManagementClient GetStorageManagementClient() + { + return TestBase.GetServiceClient(this.csmTestFactory); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.BlobServicesTests/TestGetBlobService.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.BlobServicesTests/TestGetBlobService.json new file mode 100644 index 000000000000..bc76856c652b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.BlobServicesTests/TestGetBlobService.json @@ -0,0 +1,113 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/blobservices/default?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/82ba752f-0fac-47e2-8477-5731f9f5db34/tableservices/default\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34/default\",\"type\":\"Microsoft.Storage.Admin/farms/tableservices\",\"location\":\"redmond\",\"properties\":{\"settings\":{\"frontEndHttpListenPort\":11002,\"frontEndHttpsListenPort\":11102,\"frontEndCallbackThreadsCount\":1800,\"frontEndCpuBasedKeepAliveThrottlingEnabled\":true,\"frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold\":100,\"frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle\":10,\"frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds\":20,\"frontEndMemoryThrottlingEnabled\":true,\"frontEndMaxMillisecondsBetweenMemorySamples\":10000,\"frontEndMemoryThrottleThresholdSettings\":\"5,100,0;7,50,0;10,25,0;15,0,25;\",\"frontEndMinThreadPoolThreads\":1600,\"frontEndThreadPoolBasedKeepAliveIOCompletionThreshold\":1500,\"frontEndThreadPoolBasedKeepAliveWorkerThreadThreshold\":1500,\"frontEndThreadPoolBasedKeepAliveMonitorIntervalInSeconds\":30,\"frontEndThreadPoolBasedKeepAlivePercentage\":10,\"frontEndUseSlaTimeInAvailability\":true},\"version\":\"1.0\",\"healthStatus\":\"Unknown\"}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/82ba752f-0fac-47e2-8477-5731f9f5db34/blobservices/default?api-version=2015-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"frontEndCpuBasedKeepAliveThrottlingEnabled\":false}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/82ba752f-0fac-47e2-8477-5731f9f5db34/tableservices/default\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34/default\",\"type\":\"Microsoft.Storage.Admin/farms/tableservices\",\"location\":\"redmond\",\"properties\":{\"settings\":{\"frontEndHttpListenPort\":11002,\"frontEndHttpsListenPort\":11102,\"frontEndCallbackThreadsCount\":1800,\"frontEndCpuBasedKeepAliveThrottlingEnabled\":false,\"frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold\":100,\"frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle\":10,\"frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds\":20,\"frontEndMemoryThrottlingEnabled\":true,\"frontEndMaxMillisecondsBetweenMemorySamples\":10000,\"frontEndMemoryThrottleThresholdSettings\":\"5,100,0;7,50,0;10,25,0;15,0,25;\",\"frontEndMinThreadPoolThreads\":1600,\"frontEndThreadPoolBasedKeepAliveIOCompletionThreshold\":1500,\"frontEndThreadPoolBasedKeepAliveWorkerThreadThreshold\":1500,\"frontEndThreadPoolBasedKeepAliveMonitorIntervalInSeconds\":30,\"frontEndThreadPoolBasedKeepAlivePercentage\":10,\"frontEndUseSlaTimeInAvailability\":true},\"version\":\"1.0\",\"healthStatus\":\"Unknown\"}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-GetTableService": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.BlobServicesTests/TestSetBlobService.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.BlobServicesTests/TestSetBlobService.json new file mode 100644 index 000000000000..9e95f9889d52 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.BlobServicesTests/TestSetBlobService.json @@ -0,0 +1,62 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/blobservices/default?api-version=2015-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"frontEndCallbackThreadsCount\":1800,\"frontEndCpuBasedKeepAliveThrottlingEnabled\":true,\"frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold\":100,\"frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle\":10,\"frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds\":20,\"frontEndMemoryThrottlingEnabled\":true}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"redmond\",\"properties\":{\"farmId\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"version\":\"2015-12-01-preview\",\"settingsStore\":\"file://172.17.145.159/SMB/Settings/ObjectStorageService/Settings\",\"healthStatus\":\"Unknown\",\"settings\":{\"settingsPollingIntervalInSecond\":90,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"}}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-SetTableService": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestGetFarm.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestGetFarm.json new file mode 100644 index 000000000000..fd9d2cf026a4 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestGetFarm.json @@ -0,0 +1,113 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/farm_01\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"west us\",\"name\":\"farm_01\",\"properties\":{\"settings\":{\"settingsPollingIntervalInSecond\":60,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"},\"settingsStore\":\"anypath\",\"healthStatus\":\"Warning\"}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/farm_01?api-version=2015-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"settingsPollingIntervalInSecond\":90,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\"}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"redmond\",\"properties\":{\"farmId\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"version\":\"2015-12-01-preview\",\"settingsStore\":\"file://172.17.145.159/SMB/Settings/ObjectStorageService/Settings\",\"healthStatus\":\"Unknown\",\"settings\":{\"settingsPollingIntervalInSecond\":90,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"}}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-GetFarm": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestListFarms.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestListFarms.json new file mode 100644 index 000000000000..621041f941bc --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestListFarms.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/rg1/providers/Microsoft.Storage.Admin/farms/farm_01\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"west us\",\"name\":\"farm_01\",\"properties\":{\"settings\":{\"settingsPollingIntervalInSecond\":60,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"},\"settingsStore\":\"anypath\",\"healthStatus\":\"Warning\"}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-ListFarms": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestSetFarm.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestSetFarm.json new file mode 100644 index 000000000000..39f6ff51542e --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FarmsTests/TestSetFarm.json @@ -0,0 +1,62 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49?api-version=2015-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"settingsPollingIntervalInSecond\":90,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\"}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"redmond\",\"properties\":{\"farmId\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"version\":\"2015-12-01-preview\",\"settingsStore\":\"file://172.17.145.159/SMB/Settings/ObjectStorageService/Settings\",\"healthStatus\":\"Unknown\",\"settings\":{\"settingsPollingIntervalInSecond\":90,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"}}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-SetFarm": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetCurrentFaults.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetCurrentFaults.json new file mode 100644 index 000000000000..4dac049256a6 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetCurrentFaults.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults?api-version=2015-12-01-preview&$filter=resourceUri%20eq%20'%2Fsubscriptions%2Fa93fb07c-6c93-40be-bf3b-4f0deba10f4b%2Fresourcegroups%2FDefault-Web-EastUS%2Ffarms%2F03768357-B4F2-4C3C-AA75-574209B03D49'", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults/D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"type\":\"Microsoft.Storage.Admin/farms/faults\",\"location\":\"EAST US\",\"properties\":{\"faultId\":\"D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"faultRuleName\":\"faultRule1\",\"description\":\"TBD\",\"resourceUri\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableserverinstances/woss-node1\",\"severity\":\"Critical\",\"activatedTime\":\"2015-05-18T18:02:00Z\",\"resolvedTime\":null,\"resolutionText\":\"TBD\",\"associatedDataType\":\"Metrics\",\"associatedMetricsName\":\"MetricsName\"}}]", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetFault.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetFault.json new file mode 100644 index 000000000000..e34bb073c2c2 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetFault.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults/D64F6195-93FE-40AF-B0A7-D8EA10506028?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults/D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"type\":\"Microsoft.Storage.Admin/farms/faults\",\"location\":\"EAST US\",\"properties\":{\"faultId\":\"D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"faultRuleName\":\"faultRule1\",\"description\":\"TBD\",\"resourceUri\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableserverinstances/woss-node1\",\"severity\":\"Critical\",\"activatedTime\":\"2015-05-18T18:02:00Z\",\"resolvedTime\":null,\"resolutionText\":\"TBD\",\"associatedDataType\":\"Metrics\",\"associatedMetricsName\":\"MetricsName\"}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetHistoricFaults.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetHistoricFaults.json new file mode 100644 index 000000000000..b634a6b5dae5 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestGetHistoricFaults.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults?api-version=2015-12-01-preview&$filter=startTime%20eq%20'2015-01-01T00%3A00%3A00.0000000'%20and%20endTime%20eq%20'2015-01-02T00%3A00%3A00.0000000'", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults/D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"type\":\"Microsoft.Storage.Admin/farms/faults\",\"location\":\"EAST US\",\"properties\":{\"faultId\":\"D64F6195-93FE-40AF-B0A7-D8EA10506028\",\"faultRuleName\":\"faultRule1\",\"description\":\"TBD\",\"resourceUri\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableserverinstances/woss-node1\",\"severity\":\"Critical\",\"activatedTime\":\"2015-05-18T18:02:00Z\",\"resolvedTime\":null,\"resolutionText\":\"TBD\",\"associatedDataType\":\"Metrics\",\"associatedMetricsName\":\"MetricsName\"}}]", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestResolveFault.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestResolveFault.json new file mode 100644 index 000000000000..bc1c76b18081 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.FaultsTests/TestResolveFault.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/faults/D64F6195-93FE-40AF-B0A7-D8EA10506028/dismiss?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.ManagementServicesTests/TestGetManagementService.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.ManagementServicesTests/TestGetManagementService.json new file mode 100644 index 000000000000..3493e9af14d7 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.ManagementServicesTests/TestGetManagementService.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/managementservices/default?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/managementservices/default\",\"name\":\"6fc55539-11fa-4a2d-aa19-a88cd546ef45/default\",\"type\":\"Microsoft.Storage.Admin/farms/managementservices\",\"location\":\"redmond\",\"properties\":{\"settings\":{\"wacContainerGcFullScanIntervalInSeconds\":3600,\"wacAccountGcFullScanIntervalInSeconds\":3600,\"wacGcWaitPeriodInMilliseconds\":32000,\"wacHoldingPeriodInHours\":336,\"wacMaxGcThreadNumber\":10,\"wacMaxCacheSize\":2097152,\"wacMaxConnections\":2000,\"healthAccountName\":\"monitoringaccount\",\"healthAccountKey\":\"zN8d5l/m+h2DmGDYEoTpz0wPHPdRzP8R+sVTFSzdwjCYWIt4hzA7JN6Gcjto2ZuFt7JbCqP7oU80tGRm6F1GTQ==\",\"healthHistoryDays\":7,\"metricsBucketCount\":8,\"metricsAccountName\":\"metricaccount\",\"metricsAccountKey\":\"IwULNjunNhFEfI6p53MpW1lb16h9+TRfHzrlcF/3t3csuOBG/7c4RSagXSSL975bfKSX049t2oARdqM4Xz+8mg==\"},\"version\":\"1.0\",\"healthStatus\":\"Healthy\"}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-GetTableService": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.ManagementServicesTests/TestSetManagementService.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.ManagementServicesTests/TestSetManagementService.json new file mode 100644 index 000000000000..8d8ae94ed2b0 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.ManagementServicesTests/TestSetManagementService.json @@ -0,0 +1,62 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/managementservices/default?api-version=2015-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"wacContainerGcFullScanIntervalInSeconds\":3600,\"wacAccountGcFullScanIntervalInSeconds\":3600,\"wacGcWaitPeriodInMilliseconds\":32000,\"wacHoldingPeriodInHours\":336,\"wacMaxGcThreadNumber\":10,\"wacMaxCacheSize\":2097152,\"wacMaxConnections\":2000,\"healthAccountName\":\"monitoringaccount\",\"healthAccountKey\":\"zN8d5l/m+h2DmGDYEoTpz0wPHPdRzP8R+sVTFSzdwjCYWIt4hzA7JN6Gcjto2ZuFt7JbCqP7oU80tGRm6F1GTQ==\",\"healthHistoryDays\":7,\"metricsBucketCount\":8,\"metricsAccountName\":\"metricsaccount\",\"metricsAccountKey\":\"IwULNjunNhFEfI6p53MpW1lb16h9+TRfHzrlcF/3t3csuOBG/7c4RSagXSSL975bfKSX049t2oARdqM4Xz+8mg==\"}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"redmond\",\"properties\":{\"farmId\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"version\":\"2015-12-01-preview\",\"settingsStore\":\"file://172.17.145.159/SMB/Settings/ObjectStorageService/Settings\",\"healthStatus\":\"Unknown\",\"settings\":{\"settingsPollingIntervalInSecond\":90,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"}}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-SetTableService": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestDisableNode.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestDisableNode.json new file mode 100644 index 000000000000..c0a5fd467596 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestDisableNode.json @@ -0,0 +1,215 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/offline?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-DisableNode": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestEnableNode.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestEnableNode.json new file mode 100644 index 000000000000..6349939eddc7 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestEnableNode.json @@ -0,0 +1,215 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/online?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-DisableNode": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestGetNode.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestGetNode.json new file mode 100644 index 000000000000..e8ca0eb38ce6 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestGetNode.json @@ -0,0 +1,216 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/woss-node-1\",\"type\":\"Microsoft.Storage.Admin/farms/nodes\",\"location\":\"West_US\",\"properties\":{\"codeVersion\":\"3.0.1414.9492\",\"configVersion\":\"1.0\",\"faultDomain\":\"fd:/woss-node-1\",\"healthStatus\":\"Critical\",\"ipAddressOrFqdn\":\"woss-node-1\",\"isSeedNode\":true,\"nodeId\":\"c8e6bfe487b4b8eceb5dc36ff6a2452\",\"nodeName\":\"woss-node-1\",\"nodeStatus\":\"Up\",\"nodeType\":\"Common\",\"nodeUpTime\":\"PT1H\",\"upgradeDomain\":\"WOSS_U1\",\"runningInstanceUris\":[\"subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/tableserverinstances/woss-node-1\",\"subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/accountcontainerserverinstances/woss-node-1\"]}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/offline?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/6368ed38-3570-481f-b4fa-1d0a6e8d3f3b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1/operationresults/491b11bf-fffc-4990-81c2-e6693627d5e2?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-GetNode": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b", + "TenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "Domain": "microsoft.com" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestListNodes.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestListNodes.json new file mode 100644 index 000000000000..f8c0dda6841c --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestListNodes.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/woss-node-1\",\"type\":\"Microsoft.Storage.Admin/farms/nodes\",\"location\":\"West_US\",\"properties\":{\"codeVersion\":\"3.0.1414.9492\",\"configVersion\":\"1.0\",\"faultDomain\":\"fd:/woss-node-1\",\"healthState\":\"Ok\",\"ipAddressOrFqdn\":\"woss-node-1\",\"isSeedNode\":true,\"nodeId\":\"c8e6bfe487b4b8eceb5dc36ff6a2452\",\"nodeName\":\"woss-node-1\",\"nodeStatus\":\"Up\",\"nodeType\":\"Common\",\"nodeUpTime\":\"PT1H\",\"upgradeDomain\":\"WOSS_U1\",\"runningInstanceUris\":[\"subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/tableserverinstances/woss-node-1\",\"subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/accountcontainerserverinstances/woss-node-1\"]}}]", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-ListNodes": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestSetFarm.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestSetFarm.json new file mode 100644 index 000000000000..9be6dec5715b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.NodesTests/TestSetFarm.json @@ -0,0 +1,62 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49?api-version=2014-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"settingsPollingIntervalInSecond\":90,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\"}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"redmond\",\"properties\":{\"farmId\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"version\":\"2014-12-01-preview\",\"settingsStore\":\"file://172.17.145.159/SMB/Settings/ObjectStorageService/Settings\",\"healthStatus\":\"Unknown\",\"settings\":{\"settingsPollingIntervalInSecond\":90,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"}}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-SetFarm": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestGetRoleInstance.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestGetRoleInstance.json new file mode 100644 index 000000000000..c791614ae51a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestGetRoleInstance.json @@ -0,0 +1,84 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{ + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL0\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL0\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL0\", + \"historyInfos\": [] + } +}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestListRoleInstances.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestListRoleInstances.json new file mode 100644 index 000000000000..9cb83afd484a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestListRoleInstances.json @@ -0,0 +1,211 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "[ + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL0\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL0\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL0\", + \"historyInfos\": [] + } + }, + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL1\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL1\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL1\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL1\", + \"historyInfos\": [] + } + }, + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL2\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL2\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL2\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL2\", + \"historyInfos\": [] + } + }, + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL3\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL3\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL3\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL3\", + \"historyInfos\": [] + } + }, + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL4\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL4\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL4\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL4\", + \"historyInfos\": [] + } + }, + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL5\", + \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL5\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", + \"location\": \"redmond\", + \"properties\": { + \"settings\": { + \"tableServerMaxCacheSize\": 917504, + \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, + \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, + \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, + \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL5\", + \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", + \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL5\", + \"historyInfos\": [] + } + } +]", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestRestartRoleInstance.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestRestartRoleInstance.json new file mode 100644 index 000000000000..c162bed5dee6 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestRestartRoleInstance.json @@ -0,0 +1,159 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/restart?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestRoleInstancePipeline.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestRoleInstancePipeline.json new file mode 100644 index 000000000000..621f2c876031 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestRoleInstancePipeline.json @@ -0,0 +1,264 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "[ + { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0\", \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL0\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", \"location\": \"redmond\", + \"properties\": { \"settings\": { + \"tableServerMaxCacheSize\": 917504, \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" + }, + \"roleIdentifier\": \"D11180COL0\", \"version\": \"2015-12-01-preview\", + \"status\": \"Active\", \"healthStatus\": \"Healthy\", + \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL0\", \"historyInfos\": [] + } +}, { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL1\", \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL1\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", \"location\": \"redmond\", + \"properties\": { \"settings\": { + \"tableServerMaxCacheSize\": 917504, \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" +}, \"roleIdentifier\": \"D11180COL1\", \"version\": \"2015-12-01-preview\", \"status\": \"Active\", \"healthStatus\": \"Healthy\", \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL1\", \"historyInfos\": [] } }, { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL2\", \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL2\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", \"location\": \"redmond\", + \"properties\": { \"settings\": { + \"tableServerMaxCacheSize\": 917504, \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" +}, \"roleIdentifier\": \"D11180COL2\", \"version\": \"2015-12-01-preview\", \"status\": \"Active\", \"healthStatus\": \"Healthy\", \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL2\", \"historyInfos\": [] } }, { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL3\", \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL3\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", \"location\": \"redmond\", + \"properties\": { \"settings\": { + \"tableServerMaxCacheSize\": 917504, \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" +}, \"roleIdentifier\": \"D11180COL3\", \"version\": \"2015-12-01-preview\", \"status\": \"Active\", \"healthStatus\": \"Healthy\", \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL3\", \"historyInfos\": [] } }, { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL4\", \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL4\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", \"location\": \"redmond\", + \"properties\": { \"settings\": { + \"tableServerMaxCacheSize\": 917504, \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" +}, \"roleIdentifier\": \"D11180COL4\", \"version\": \"2015-12-01-preview\", \"status\": \"Active\", \"healthStatus\": \"Healthy\", \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL4\", \"historyInfos\": [] } }, { + \"id\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL5\", \"name\": \"3c62b865-d397-47fe-99ed-6dda536a1a69/D11180COL5\", + \"type\": \"Microsoft.Storage.Admin/farms/tableserverinstances\", \"location\": \"redmond\", + \"properties\": { \"settings\": { + \"tableServerMaxCacheSize\": 917504, \"tableServerMaxConnections\": 100, + \"tableServerCpuUsagePercentageThrottling\": 0.8, \"tableServerCpuUsageThrottlingThreshold\": 90, + \"tableServerMaxThrottlingProbabilityForAccount\": 0.9, \"tableServerPendingRequestCountThrottlingThreshold\": 5000, + \"tableServerScanThrottlingThreshold\": 10, \"settingsPollingIntervalInSeconds\": 60, + \"settingsTimestamp\": \"20151117T195500\" +}, \"roleIdentifier\": \"D11180COL5\", \"version\": \"2015-12-01-preview\", \"status\": \"Active\", \"healthStatus\": \"Healthy\", \"nodeUri\": \"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/nodes/D11180COL5\", \"historyInfos\": [] } } ]", "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] +}, "StatusCode": 200 }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/restart?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, +{ + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/tableserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 +} + ], "Names": { +}, "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" +} } diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestStartRoleInstance.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestStartRoleInstance.json new file mode 100644 index 000000000000..9c48ea040555 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestStartRoleInstance.json @@ -0,0 +1,159 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/online?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestStopRoleInstance.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestStopRoleInstance.json new file mode 100644 index 000000000000..3a3a240c282c --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.RoleInstancesTests/TestStopRoleInstance.json @@ -0,0 +1,159 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/offline?api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1190" + ], + "x-ms-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-correlation-request-id": [ + "1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:1fccaffa-7dd6-4fd0-8ebf-bdf8523ae631" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31991" + ], + "x-ms-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-correlation-request-id": [ + "f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004139Z:f62f23d6-0868-4e9e-ada8-f31ca9538c1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:41:39 GMT" + ], + "Location": [ + "https://management.azure.com/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/3c62b865-d397-47fe-99ed-6dda536a1a69/blobserverinstances/D11180COL0/operationresults/8006fda9-6397-4a93-8d10-d5dd36b20c93?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-12-01-preview" + ], + "User-Agent": [ + "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31988" + ], + "x-ms-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-correlation-request-id": [ + "514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150218T004225Z:514a2b94-333d-4837-a70f-e7bc4572d6ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Wed, 18 Feb 2015 00:42:25 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.SharesTests/TestGetShare.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.SharesTests/TestGetShare.json new file mode 100644 index 000000000000..fab64152f234 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.SharesTests/TestGetShare.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/shares/%7C%7Csmb%7Cshare1?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/shares/smb|share1\",\"type\":\"Microsoft.Storage.Admin/farms/shares\",\"location\":\"west us\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/smb|share1\",\"properties\":{\"shareName\":\"||smb|share1\",\"uncPath\":\"||smb|share1\",\"healthStatus\":\"Warning\",\"totalCapacity\":500,\"freeCapacity\":460,\"usedCapacity\":40}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.SharesTests/TestListShares.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.SharesTests/TestListShares.json new file mode 100644 index 000000000000..4026a850c8ac --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.SharesTests/TestListShares.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/shares?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/shares/smb|share1\",\"type\":\"Microsoft.Storage.Admin/farms/shares\",\"location\":\"west us\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/smb|share1\",\"properties\":{\"shareName\":\"||smb|share1\",\"uncPath\":\"||smb|share1\",\"healthStatus\":\"Warning\",\"totalCapacity\":500,\"freeCapacity\":460,\"usedCapacity\":40}}]", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestGetStorageAccount.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestGetStorageAccount.json new file mode 100644 index 000000000000..b2f40ac7ff81 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestGetStorageAccount.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts?api-version=2015-12-01-preview&$filter=VersionedAccountName%20eq%20%271%27&summary=false", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1\",\"type\":\"Microsoft.Storage.Admin/storageaccounts\",\"name\":\"1\",\"location\":\"redmond\",\"tags\":{},\"properties\":{\"provisioningState\":\"Succeeded\",\"primaryEndpoints\":{\"blob\":\"https://host:11100/demo007\",\"queue\":\"https://host:11101/demo007\",\"table\":\"https://host:11102/demo007\"},\"primaryLocation\":\"redmond\",\"statusOfPrimary\":\"Available\",\"tenantViewId\":\"/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007\",\"tenantSubscriptionId\":\"177fbbce-fd6a-4f11-bfa4-52c2f3a21918\",\"tenantStorageAccountName\":\"demo007\",\"tenantResourceGroupName\":\"system\",\"currentOperation\":\"None\",\"acquisitionOperationCount\":0,\"accountStatus\":\"Active\",\"recoveredTime\":\"2015-10-13T05:44:29.743\",\"accountType\":\"Standard_GRS\",\"creationTime\":\"Tue, 13 Oct 2015 05:42:48 GMT\"}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestListStorageAccounts.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestListStorageAccounts.json new file mode 100644 index 000000000000..d00f8650e5ce --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestListStorageAccounts.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts?api-version=2015-12-01-preview&$filter=TenantSubscriptionId%20eq%20%27DB3972C4-90B4-4A11-9209-D6C12060F6FC%27%20and%20PartialAccountName%20eq%20%27acc%27&summary=true", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1\",\"type\":\"Microsoft.Storage.Admin/storageaccounts\",\"name\":\"1\",\"location\":\"redmond\",\"tags\":{},\"properties\":{\"provisioningState\":\"Succeeded\",\"primaryEndpoints\":{\"blob\":\"https://host:11100/demo007\",\"queue\":\"https://host:11101/demo007\",\"table\":\"https://host:11102/demo007\"},\"primaryLocation\":\"redmond\",\"statusOfPrimary\":\"Available\",\"tenantViewId\":\"/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007\",\"tenantSubscriptionId\":\"177fbbce-fd6a-4f11-bfa4-52c2f3a21918\",\"tenantStorageAccountName\":\"demo007\",\"tenantResourceGroupName\":\"system\",\"currentOperation\":\"None\",\"acquisitionOperationCount\":0,\"accountStatus\":\"Active\",\"recoveredTime\":\"2015-10-13T05:44:29.743\",\"accountType\":\"Standard_GRS\",\"creationTime\":\"Tue, 13 Oct 2015 05:42:48 GMT\"}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestStorageAccountPipeLine.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestStorageAccountPipeLine.json new file mode 100644 index 000000000000..0a13cdb366c3 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestStorageAccountPipeLine.json @@ -0,0 +1,213 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts?api-version=2015-12-01-preview&$filter=VersionedAccountName%20eq%20%271%27&summary=false", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1\",\"type\":\"Microsoft.Storage.Admin/storageaccounts\",\"name\":\"1\",\"location\":\"redmond\",\"tags\":{},\"properties\":{\"provisioningState\":\"Succeeded\",\"primaryEndpoints\":{\"blob\":\"https://host:11100/demo007\",\"queue\":\"https://host:11101/demo007\",\"table\":\"https://host:11102/demo007\"},\"primaryLocation\":\"redmond\",\"statusOfPrimary\":\"Available\",\"tenantViewId\":\"/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007\",\"tenantSubscriptionId\":\"177fbbce-fd6a-4f11-bfa4-52c2f3a21918\",\"tenantStorageAccountName\":\"demo007\",\"tenantResourceGroupName\":\"system\",\"currentOperation\":\"None\",\"acquisitionOperationCount\":0,\"accountStatus\":\"Active\",\"recoveredTime\":\"2015-10-13T05:44:29.743\",\"accountType\":\"Standard_GRS\",\"creationTime\":\"Tue, 13 Oct 2015 05:42:48 GMT\"}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1?action=undelete&api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "{\"newAccountName\":\"acc_new_name\",\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts?api-version=2015-12-01-preview&$filter=%7Bversionedaccountname%20eq%20%271%27%7D&summary=true", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1\",\"type\":\"Microsoft.Storage.Admin/storageaccounts\",\"name\":\"1\",\"location\":\"redmond\",\"tags\":{},\"properties\":{\"provisioningState\":\"Succeeded\",\"primaryEndpoints\":{\"blob\":\"https://host:11100/demo007\",\"queue\":\"https://host:11101/demo007\",\"table\":\"https://host:11102/demo007\"},\"primaryLocation\":\"redmond\",\"statusOfPrimary\":\"Available\",\"tenantViewId\":\"/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007\",\"tenantSubscriptionId\":\"177fbbce-fd6a-4f11-bfa4-52c2f3a21918\",\"tenantStorageAccountName\":\"demo007\",\"tenantResourceGroupName\":\"system\",\"currentOperation\":\"None\",\"acquisitionOperationCount\":0,\"accountStatus\":\"Active\",\"recoveredTime\":\"2015-10-13T05:44:29.743\",\"accountType\":\"Standard_GRS\",\"creationTime\":\"Tue, 13 Oct 2015 05:42:48 GMT\"}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/providers/Microsoft.Resources.Admin/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourceGroups/system/SynchronizeResources?api-version=1.0", + "RequestMethod": "POST", + "RequestBody": "{\"apiVersion\":\"2015-06-15\",\"resourceLocation\":\"redmond\",\"targetOperation\":\"Create\",\"id\":\"subscriptions/177FBBCE-FD6A-4F11-BFA4-52C2F3A21918/resourceGroups/system/providers/Microsoft.Storage/StorageAccounts/acc_new_name\",\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"correlationId\":\"4ec418ca-5acd-47da-83bb-0aefbe8f365e\",\"frontdoorLocation\":\"redmond\",\"timestamp\":\"2015-10-19T05:51:43.9138942Z\",\"message\":\"Resource group synchronization jobs started successfully.\",\"data\":{\"targetNamespaces\":[\"Microsoft.Authorization\",\"Microsoft.Insights\",\"Microsoft.Gallery\",\"Microsoft.Sql\",\"Microsoft.Sql.Admin\",\"Microsoft.Subscriptions\",\"Microsoft.Subscriptions.Admin\",\"Microsoft.Commerce\",\"Microsoft.Storage\",\"Microsoft.Storage.Admin\"]}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestUndoStorageAccountDeletion.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestUndoStorageAccountDeletion.json new file mode 100644 index 000000000000..75b53bf6fc19 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.StorageAccountsTests/TestUndoStorageAccountDeletion.json @@ -0,0 +1,161 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1?action=undelete&api-version=2015-12-01-preview", + "RequestMethod": "POST", + "RequestBody": "{\"newAccountName\":\"acc_new_name\",\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts?api-version=2015-12-01-preview&$filter=%7Bversionedaccountname%20eq%20%271%27%7D&summary=true", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/storageaccounts/1\",\"type\":\"Microsoft.Storage.Admin/storageaccounts\",\"name\":\"1\",\"location\":\"redmond\",\"tags\":{},\"properties\":{\"provisioningState\":\"Succeeded\",\"primaryEndpoints\":{\"blob\":\"https://host:11100/demo007\",\"queue\":\"https://host:11101/demo007\",\"table\":\"https://host:11102/demo007\"},\"primaryLocation\":\"redmond\",\"statusOfPrimary\":\"Available\",\"tenantViewId\":\"/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourcegroups/system/providers/Microsoft.Storage/storageaccounts/demo007\",\"tenantSubscriptionId\":\"177fbbce-fd6a-4f11-bfa4-52c2f3a21918\",\"tenantStorageAccountName\":\"demo007\",\"tenantResourceGroupName\":\"system\",\"currentOperation\":\"None\",\"acquisitionOperationCount\":0,\"accountStatus\":\"Active\",\"recoveredTime\":\"2015-10-13T05:44:29.743\",\"accountType\":\"Standard_GRS\",\"creationTime\":\"Tue, 13 Oct 2015 05:42:48 GMT\"}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/providers/Microsoft.Resources.Admin/subscriptions/177fbbce-fd6a-4f11-bfa4-52c2f3a21918/resourceGroups/system/SynchronizeResources?api-version=1.0", + "RequestMethod": "POST", + "RequestBody": "{\"apiVersion\":\"2015-06-15\",\"resourceLocation\":\"redmond\",\"targetOperation\":\"Create\",\"id\":\"subscriptions/177FBBCE-FD6A-4F11-BFA4-52C2F3A21918/resourceGroups/system/providers/Microsoft.Storage/StorageAccounts/acc_new_name\",\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"correlationId\":\"4ec418ca-5acd-47da-83bb-0aefbe8f365e\",\"frontdoorLocation\":\"redmond\",\"timestamp\":\"2015-10-19T05:51:43.9138942Z\",\"message\":\"Resource group synchronization jobs started successfully.\",\"data\":{\"targetNamespaces\":[\"Microsoft.Authorization\",\"Microsoft.Insights\",\"Microsoft.Gallery\",\"Microsoft.Sql\",\"Microsoft.Sql.Admin\",\"Microsoft.Subscriptions\",\"Microsoft.Subscriptions.Admin\",\"Microsoft.Commerce\",\"Microsoft.Storage\",\"Microsoft.Storage.Admin\"]}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestGetTableService.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestGetTableService.json new file mode 100644 index 000000000000..d86f4ab1a435 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestGetTableService.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableservices/default?api-version=2015-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/82ba752f-0fac-47e2-8477-5731f9f5db34/tableservices/default\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34/default\",\"type\":\"Microsoft.Storage.Admin/farms/tableservices\",\"location\":\"redmond\",\"properties\":{\"settings\":{\"frontEndHttpListenPort\":11002,\"frontEndHttpsListenPort\":11102,\"frontEndCallbackThreadsCount\":1800,\"frontEndCpuBasedKeepAliveThrottlingEnabled\":true,\"frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold\":100,\"frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle\":10,\"frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds\":20,\"frontEndMemoryThrottlingEnabled\":true,\"frontEndMaxMillisecondsBetweenMemorySamples\":10000,\"frontEndMemoryThrottleThresholdSettings\":\"5,100,0;7,50,0;10,25,0;15,0,25;\",\"frontEndMinThreadPoolThreads\":1600,\"frontEndThreadPoolBasedKeepAliveIOCompletionThreshold\":1500,\"frontEndThreadPoolBasedKeepAliveWorkerThreadThreshold\":1500,\"frontEndThreadPoolBasedKeepAliveMonitorIntervalInSeconds\":30,\"frontEndThreadPoolBasedKeepAlivePercentage\":10,\"frontEndUseSlaTimeInAvailability\":true},\"version\":\"1.0\",\"healthStatus\":\"Unknown\"}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-GetTableService": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestListNodes.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestListNodes.json new file mode 100644 index 000000000000..71b0d19f3bc9 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestListNodes.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes?api-version=2014-12-01-preview", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ + "Microsoft.AzureStack.Management.StorageAdmin/0.9.0.0 AzurePowershell/v0.8.14" + ] + }, + "ResponseBody": "{\"value\":[{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/nodes/woss-node-1\",\"name\":\"03768357-B4F2-4C3C-AA75-574209B03D49/woss-node-1\",\"type\":\"Microsoft.Storage.Admin/farms/nodes\",\"location\":\"West_US\",\"properties\":{\"codeVersion\":\"3.0.1414.9492\",\"configVersion\":\"1.0\",\"faultDomain\":\"fd:/woss-node-1\",\"healthState\":\"Ok\",\"ipAddressOrFqdn\":\"woss-node-1\",\"isSeedNode\":true,\"nodeId\":\"c8e6bfe487b4b8eceb5dc36ff6a2452\",\"nodeName\":\"woss-node-1\",\"nodeStatus\":\"Up\",\"nodeType\":\"Common\",\"nodeUpTime\":\"PT1H\",\"upgradeDomain\":\"WOSS_U1\",\"runningInstanceUris\":[\"subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/tableserverinstances/woss-node-1\",\"subscriptions/serviceAdmin/resourcegroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/accountcontainerserverinstances/woss-node-1\"]}}]}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "Content-Length": [ + "8232" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "31998" + ], + "x-ms-request-id": [ + "WestUS_d9e73d2735f24797a08dda5d8228e509_635609224343322694" + ], + "x-ms-correlation-request-id": [ + "45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150302T194714Z:45888041-1ede-478b-949f-13aa6e47e0ba" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-ListFarms": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestSetTableService.json b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestSetTableService.json new file mode 100644 index 000000000000..2d5a9cd4cb5f --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/SessionRecords/Microsoft.AzureStack.Commands.StorageAdmin.Test.ScenarioTests.TableServicesTests/TestSetTableService.json @@ -0,0 +1,62 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourcegroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49/tableservices/default?api-version=2015-12-01-preview", + "RequestMethod": "PATCH", + "RequestBody": "{\"properties\":{\"settings\":{\"frontEndCallbackThreadsCount\":1800,\"frontEndCpuBasedKeepAliveThrottlingEnabled\":true,\"frontEndCpuBasedKeepAliveThrottlingPercentCpuThreshold\":100,\"frontEndCpuBasedKeepAliveThrottlingPercentRequestsToThrottle\":10,\"frontEndCpuBasedKeepAliveThrottlingCpuMonitorIntervalInSeconds\":20,\"frontEndMemoryThrottlingEnabled\":true}},\"tags\":{}}", + "RequestHeaders": { + "Accept": [ "application/json" ], + "User-Agent": [ "Microsoft.Azure.Insights.InsightsClient/0.9.0.0 AzurePowershell/v0.8.14" ], + "Content-Length": [ "1217" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Connection": [ "Keep-Alive" ], + "Expect": [ "100-continue" ] + }, + "ResponseBody": "{\"id\":\"/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/Microsoft.Storage.Admin/farms/03768357-B4F2-4C3C-AA75-574209B03D49\",\"name\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"type\":\"Microsoft.Storage.Admin/farms\",\"location\":\"redmond\",\"properties\":{\"farmId\":\"82ba752f-0fac-47e2-8477-5731f9f5db34\",\"version\":\"2015-12-01-preview\",\"settingsStore\":\"file://172.17.145.159/SMB/Settings/ObjectStorageService/Settings\",\"healthStatus\":\"Unknown\",\"settings\":{\"settingsPollingIntervalInSecond\":90,\"hostStyleHttpPort\":80,\"hostStyleHttpsPort\":443,\"corsAllowedOriginsList\":\"http://manage.wossportal.com;http://www.example.com\",\"dataCenterUriHostSuffixes\":\"contoso.com\"}}}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 03 Mar 2015 00:07:07 GMT" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "1612" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "47af504c-88a1-49c5-9766-e397d54e490b" + ], + "x-ms-correlation-request-id": [ + "e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "x-ms-routing-request-id": [ + "WESTUS:20150303T190828Z:e223e5fa-7d3c-4d2c-a2e9-aed3011aefb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "Test-SetTableService": [ + "" + ] + }, + "Variables": { + "SubscriptionId": "a93fb07c-6c93-40be-bf3b-4f0deba10f4b" + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config new file mode 100644 index 000000000000..6a7452687e4b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage.Tests/packages.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminCmdlet.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminCmdlet.cs new file mode 100644 index 000000000000..feb3bda45a9d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminCmdlet.cs @@ -0,0 +1,232 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Net; +using System.Net.Security; +using Microsoft.Azure; +using Microsoft.Azure.Commands.ResourceManager.Common; +using Microsoft.Azure.Common.Authentication; +using Microsoft.Azure.Common.Authentication.Models; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.WindowsAzure.Commands.Utilities.Common; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Admin cmdlet base + /// + public abstract class AdminCmdlet : AzureRMCmdlet, IDisposable + { + private bool disposed; + + /// + /// Storage Admin Management Client + /// + public StorageAdminManagementClient Client + { + get; + set; + } + + /// + /// Subscription identifier + /// + [Parameter(Position = 0, ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string SubscriptionId { get; set; } + + /// + /// Authentication token + /// + [Parameter(Position = 1, ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string Token { get; set; } + + /// + /// Azure package admin URL + /// + [Parameter(Position = 2, ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + [ValidateAbsoluteUri] + public Uri AdminUri { get; set; } + + /// + /// Resource group name + /// + [Parameter(Position = 3, Mandatory = true, ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string ResourceGroupName { get; set; } + + /// + /// Disable certification validation + /// + [Parameter] + public SwitchParameter SkipCertificateValidation { get; set; } + + ~AdminCmdlet() + { + Dispose(false); + } + + private RemoteCertificateValidationCallback originalValidateCallback; + + private static readonly RemoteCertificateValidationCallback unCheckCertificateValidation = (s, certificate, chain, sslPolicyErrors) => true; + + //TODO: take back the validation + private void ValidateParameters() + { + if (string.IsNullOrEmpty(Token)) + { + if (DefaultContext == null) + { + throw new ApplicationException(Resources.InvalidProfile); + } + } + else + { + // if token is specified, AdminUri is required as well. + if (AdminUri == null || SubscriptionId == null) + { + throw new ApplicationException(Resources.TokenAndAdminUriRequired); + } + } + } + + + /// + /// Initial StorageAdminManagementClient + /// + /// + protected override void BeginProcessing() + { + base.BeginProcessing(); + + originalValidateCallback = ServicePointManager.ServerCertificateValidationCallback; + + if (SkipCertificateValidation) + { + ServicePointManager.ServerCertificateValidationCallback = unCheckCertificateValidation; + } + + ValidateParameters(); + + Client = GetClient(); + } + + protected override AzureContext DefaultContext + { + get + { + if (DefaultProfile == null) + { + return null; + } + + return DefaultProfile.Context; + } + } + + /// + /// Dispose StorageAdminManagementClient + /// + /// + protected override void EndProcessing() + { + StorageAdminManagementClient client = Client; + if (client != null) + { + client.Dispose(); + } + Client = null; + if (SkipCertificateValidation) + { + if (originalValidateCallback != null) + { + ServicePointManager.ServerCertificateValidationCallback = originalValidateCallback; + } + } + + base.EndProcessing(); + } + + protected override void ProcessRecord() + { + Execute(); + base.ProcessRecord(); + } + + protected virtual void Execute() + { + } + + /// + /// Get token credentials + /// + /// + protected TokenCloudCredentials GetTokenCredentials() + { + return new TokenCloudCredentials(SubscriptionId, Token); + } + + /// + /// Dispose the resources + /// + /// Indicates whether the managed resources should be disposed or not + protected override void Dispose(bool disposing) + { + if (!disposed) + { + if (Client != null) + { + Client.Dispose(); + Client = null; + } + + disposed = true; + } + base.Dispose(disposing); + } + + protected StorageAdminManagementClient GetClient() + { + // get client from azure session if token is null or empty + if (string.IsNullOrEmpty(Token)) + { + return GetClientThruAzureSession(); + } + + return new StorageAdminManagementClient( + baseUri: AdminUri, + credentials: new TokenCloudCredentials(subscriptionId: SubscriptionId, token: Token)); + } + + private StorageAdminManagementClient GetClientThruAzureSession() + { + var context = DefaultContext; + + var armUri = context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager); + + var credentials = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context); + + if (string.IsNullOrEmpty(SubscriptionId)) + { + SubscriptionId = credentials.SubscriptionId; + } + + return AzureSession.ClientFactory.CreateCustomClient(credentials, armUri); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminException.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminException.cs new file mode 100644 index 000000000000..8c2a0f7610f4 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminException.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------------- +// +// 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; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Exception for admin operation errors + /// + public sealed class AdminException : Exception + { + /// + /// Constructor + /// + /// + public AdminException(string message) + : base(message) { } + + /// + /// Constructor + /// + /// + /// + public AdminException(string message, Exception innerException) + : base(message, innerException) { } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminMetricCmdLet.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminMetricCmdLet.cs new file mode 100644 index 000000000000..41d354d0e4c1 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminMetricCmdLet.cs @@ -0,0 +1,81 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + public abstract class AdminMetricCmdlet: AdminCmdlet + { + /// + /// Gets or sets the timegrain parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public TimeGrain TimeGrain { get; set; } + + /// + /// Gets or sets the starttime parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + public DateTime StartTime { get; set; } + + /// + /// Gets or sets the endtime parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + public DateTime EndTime { get; set; } + + /// + /// Gets or sets the metricnames parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string[] MetricNames { get; set; } + + /// + /// Gets or sets the detailedoutput parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + public SwitchParameter DetailedOutput { get; set; } + + + /// + /// Get Metrics result + /// + /// + /// + protected abstract MetricsResult GetMetricsResult(string filter); + + /// + /// + /// + protected override void Execute() + { + string filter = Tools.GenerateFilter(MetricNames, StartTime, EndTime, TimeGrain); + bool fullDetails = this.DetailedOutput.IsPresent; + + MetricsResult metrics = GetMetricsResult(filter); + var result = metrics.Metrics.Select(_ => fullDetails ? new PSMetric(_) : new PSMetricNoDetails(_)); + WriteObject(result, true); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminMetricDefinitionCmdlet.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminMetricDefinitionCmdlet.cs new file mode 100644 index 000000000000..f06e02baec1e --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/AdminMetricDefinitionCmdlet.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 System.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + public abstract class AdminMetricDefinitionCmdlet : AdminCmdlet + { + /// + /// Gets or sets the metricnames parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string[] MetricNames { get; set; } + + /// + /// Gets or sets the detailedoutput parameter of the cmdlet + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)] + public SwitchParameter DetailedOutput { get; set; } + + /// + /// Get Metrics definition result + /// + /// + /// + protected abstract MetricDefinitionsResult GetMetricDefinitionsResult(string filter); + + /// + /// + /// + protected override void Execute() + { + string filter = Tools.GenerateFilter(MetricNames); + bool fullDetails = this.DetailedOutput.IsPresent; + + MetricDefinitionsResult definitions = GetMetricDefinitionsResult(filter); + var result = definitions.Value.Select(_ => fullDetails ? new PSMetricDefinition(_) : new PSMetricDefinitionNoDetails(_)); + WriteObject(result); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/BaseCmdlet.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/BaseCmdlet.cs new file mode 100644 index 000000000000..8f97ba9aad29 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/BaseCmdlet.cs @@ -0,0 +1,117 @@ +// ---------------------------------------------------------------------------------- +// +// 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; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + public abstract class BaseCmdlet : PSCmdlet + { + /// + /// Gets or sets the progress record. + /// + protected ProgressRecord ProgressRecord { get; set; } + + // TODO: progress handler when necessary + //protected void ProgressHandler(object sender, ProgressEventArgs e) + //{ + //} + + /// + /// Gets the name of the cmdlet + /// + protected string CmdletName + { + get + { + return MyInvocation.MyCommand.Name; + } + } + + /// + /// Process record for this cmdlet. + /// + /// + /// We will catch all exceptions here so we can log them in our event provider. + /// + protected override void ProcessRecord() + { + Execute(); + } + + /// + /// Execute this cmdlet. + /// + /// + /// Descendant classes must override this methods instead of Cmdlet.ProcessRecord, so + /// we can have a unique place where log all errors. + /// + protected abstract void Execute(); + + /// + /// Send an error event to the current event source + /// + /// The operation + /// The message + /// The exception + protected abstract void TraceError(string operation, string message, Exception exception); + + /// + /// Send a warning event to the current event source + /// + /// The operation + /// The message + protected abstract void TraceWarning(string operation, string message); + + /// + /// Send an informational event to the current event source + /// + /// The operation + /// The message + protected abstract void TraceInformational(string operation, string message); + + /// + /// Send a verbose event to the current event source + /// + /// The operation. + /// The message. + protected abstract void TraceVerbose(string operation, string message); + + /// + /// Override the WriteError method to log the error on our event provider. + /// + /// The error to write + public new void WriteError(ErrorRecord errorRecord) + { + if (errorRecord == null) + throw new ArgumentNullException("errorRecord"); + base.WriteError(errorRecord); + TraceError(CmdletName, errorRecord.Exception.Message, errorRecord.Exception); + } + + /// + /// Override the WriteWarning method to log the warning on our event provider. + /// + /// The text to write + public new void WriteWarning(string text) + { + base.WriteWarning(text); + TraceWarning(CmdletName, text); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj new file mode 100644 index 000000000000..8f5a235bba32 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Commands.AzureStackStorage.csproj @@ -0,0 +1,237 @@ + + + + + Debug + AnyCPU + {D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791} + Library + Properties + Microsoft.AzureStack.Commands.StorageAdmin + Microsoft.AzureStack.Commands.StorageAdmin + v4.5 + 512 + ..\..\..\ + true + /assemblyCompareMode:StrongNameIgnoringVersion + + + true + full + false + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureStackStorage\ + DEBUG;TRACE + prompt + 4 + true + false + true + + + ..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AzureStackStorage\ + TRACE;SIGN + true + pdbonly + AnyCPU + bin\Release\Microsoft.AzureStack.Commands.StorageAdmin.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets + ;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules + true + true + MSSharedLibKey.snk + true + false + + + + False + ..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.6.1-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + True + + + False + ..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + False + ..\..\..\packages\Microsoft.AzureStack.Management.Storage.0.9.2-preview\lib\net45\Microsoft.AzureStack.Management.Storage.dll + + + False + ..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\..\..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll + + + False + ..\..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + True + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll + True + + + ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.0.11.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll + True + + + ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + + ..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll + True + + + + + + + + + False + ..\..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzureRM.AzureStackStorage.psd1 + PreserveNewest + + + + Designer + + + + + + + + Always + Designer + + + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {3819d8a7-c62c-4c47-8ddd-0332d9ce1252} + Commands.ResourceManager.Common + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Enums.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Enums.cs new file mode 100644 index 000000000000..2fc0dea2b3ab --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Enums.cs @@ -0,0 +1,77 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands.StorageAdmin +{ + public enum TimeGrain + { + Daily = 0, + Hourly, + Minutely + } + + /// + /// + /// + public enum RoleType + { + /// + /// + /// + TableServer, + + /// + /// + /// + BlobServer, + + /// + /// + /// + TableMaster, + + /// + /// + /// + AccountContainerserver, + + /// + /// + /// + TableFrontend, + + /// + /// + /// + BlobFrontend, + + /// + /// + /// + MetricsServer, + + /// + /// + /// + HealthMonitoringserver + } + + public enum StorageAccountSearchFilterParameter + { + TenantSubscriptionId, + PartialAccountName, + StorageAccountStatus, + VersionedAccountName + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Extensions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Extensions.cs new file mode 100644 index 000000000000..a24df9aa8ba6 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Extensions.cs @@ -0,0 +1,88 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Text; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal static class Extensions + { + public static string FormatInvariantCulture(this string format, params object[] arg0) + { + return string.Format(CultureInfo.InvariantCulture, format, arg0); + } + + /// + /// A string representation of the list of MetricAvailability objects including indentation + /// + /// The list of MetricAvailability objects + /// The number of tabs to insert in front of each member + /// A string representation of the list of MetricAvailability objects including indentation + public static string ToString(this IList metricAvailabilities, int indentationTabs) + { + StringBuilder output = new StringBuilder(); + foreach (var metricAvailability in metricAvailabilities) + { + output.AppendLine(); + output.AddSpacesInFront(indentationTabs).AppendLine("Retention : " + metricAvailability.Retention); + output.AddSpacesInFront(indentationTabs).Append("Values : " + metricAvailability.TimeGrain); + } + + return output.ToString(); + } + + /// + /// A string representation of the list of PSMetricValue objects including indentation + /// + /// The list of PSMetricValue objects + /// The number of tabs to insert in front of each member + /// A string representation of the list of PSMetricValue objects including indentation + public static string ToString(this IList metricValues, int indentationTabs) + { + StringBuilder output = new StringBuilder(); + foreach (var metricValue in metricValues) + { + output.AppendLine(); + output.AddSpacesInFront(indentationTabs).AppendLine("Average : " + metricValue.Average); + output.AddSpacesInFront(indentationTabs).AppendLine("Count : " + metricValue.Count); + output.AddSpacesInFront(indentationTabs).AppendLine("Maximum : " + metricValue.Maximum); + output.AddSpacesInFront(indentationTabs).AppendLine("Minimum : " + metricValue.Minimum); + output.AddSpacesInFront(indentationTabs).AppendLine("Properties : " + metricValue.Properties); + output.AddSpacesInFront(indentationTabs).AppendLine("Timestamp : " + metricValue.TimeStamp); + output.AddSpacesInFront(indentationTabs).Append("Total : " + metricValue.Total); + } + return output.ToString(); + } + + /// + /// Add spaces into the string builder + /// + /// The string builder + /// The number of tab chars to insert + /// The input string builder with the tabs appended + public static StringBuilder AddSpacesInFront(this StringBuilder output, int indentationTabs) + { + for (int i = 0; i < indentationTabs; i++) + { + output.Append('\t'); + } + + return output; + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/AddFarm.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/AddFarm.cs new file mode 100644 index 000000000000..0efb92b578d9 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/AddFarm.cs @@ -0,0 +1,73 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Add-Farm [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-SettingAccessString] {string} [-Region] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Add, Nouns.AdminFarm, SupportsShouldProcess = true)] + public sealed class AddAdminFarm : AdminCmdlet + { + const string ShouldProcessTargetFormat = "farm {0} "; + + /// + /// Farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// setting access string. ex: file:\\localhost\db1\settings + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNull] + public string SettingAccessString { get; set; } + + /// + /// Location of the farm + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string Location{ get; set; } + + protected override void Execute() + { + if (ShouldProcess(string.Format(CultureInfo.InvariantCulture, ShouldProcessTargetFormat, FarmName))){ + FarmCreateParameters request = new FarmCreateParameters + { + Location = Location, + + Properties = new FarmCreate + { + SettingAccessString = SettingAccessString + } + }; + + FarmGetResponse response = Client.Farms.Create(ResourceGroupName, FarmName, request); + + WriteObject(new FarmResponse(response.Farm)); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/AddFarm_new.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/AddFarm_new.cs new file mode 100644 index 000000000000..465016f78c4e --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/AddFarm_new.cs @@ -0,0 +1,87 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Add-Farm [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-SettingAccessString] {string} [-Region] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Add, Nouns.AdminFarm, SupportsShouldProcess = true)] + public sealed class AddAdminFarm : AdminCmdlet + { + const string ShouldProcessTargetFormat = "farm {0} "; + + /// + /// Farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// setting access string. ex: file:\\localhost\db1\settings + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNull] + public string SettingAccessString { get; set; } + + /// + /// Location of the farm + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string Location{ get; set; } + + protected override void Execute() + { + if (ShouldProcess(string.Format(CultureInfo.InvariantCulture, ShouldProcessTargetFormat, FarmName))){ + FarmCreateParameters request = new FarmCreateParameters + { + Location = Location, + + Properties = new FarmCreate + { + SettingAccessString = SettingAccessString + } + }; + + FarmGetResponse response = Client.Farms.Create(ResourceGroupName, FarmName, request); + + WriteObject(response); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetEvent.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetEvent.cs new file mode 100644 index 000000000000..9dd647198b0f --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetEvent.cs @@ -0,0 +1,151 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Parameter Set: EventWithFilter + /// Get-Event [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} -ResourceGroupName {string} + /// [-SkipCertificateValidation] -FarmName {string} -StartTime {DateTime} -EndTime {DateTime} [-NodeName {string}] + /// [-ResourceUri {string}] [-ProviderGuid {Guid}] -EventIds {int[]} [{CommonParameters}] + /// + /// Parameter Set: EventWithLocation + /// Get-Event [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} -EventQuery {EventQuery} + /// [{CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminFarmEvent, DefaultParameterSetName = EventWithFilterSet)] + public sealed class GetEvent : AdminCmdlet + { + const string EventWithFilterSet = "EventWithFilter"; + + const string EventWithLocationSet = "EventWithLocation"; + + Action func; + + /// + /// + /// + [Parameter(Mandatory = true, ParameterSetName = EventWithFilterSet)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = true, ParameterSetName = EventWithFilterSet)] + public DateTime StartTime + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = true, ParameterSetName = EventWithFilterSet)] + public DateTime EndTime + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, ParameterSetName = EventWithFilterSet)] + public String NodeName + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, ParameterSetName = EventWithFilterSet)] + public String ResourceUri + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, ParameterSetName = EventWithFilterSet)] + public Guid ProviderGuid + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, ParameterSetName = EventWithFilterSet)] + public int[] EventId + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = EventWithLocationSet)] + public EventQuery EventQuery + { + get; + set; + } + + protected override void BeginProcessing() + { + base.BeginProcessing(); + switch (ParameterSetName) + { + case EventWithFilterSet: + { + func = () => WriteObject( + Client.Farms.ExecuteEventQuery(ResourceGroupName, FarmName, StartTime, EndTime, NodeName, ResourceUri, ProviderGuid, EventId)); + } + break; + case EventWithLocationSet: + { + func = () => WriteObject( + Client.Farms.ExecuteEventQuery(EventQuery), + true); + } + break; + default: + throw new ArgumentException(Resources.BadParameterSet); + } + } + + protected override void Execute() + { + func(); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetEventQuery.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetEventQuery.cs new file mode 100644 index 000000000000..5d3ac6864e6b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetEventQuery.cs @@ -0,0 +1,142 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-EventQuery [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-StartTime] {DateTime} [-EndTime] {DateTime} [[-NodeName] {string}] + /// [[-ResourceUri] {string}] [[-ProviderGuid] {Guid}] [[-EventIds] {int[]}] [{CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminFarmEventQuery)] + public sealed class GetEventQuery : AdminCmdlet + { + /// + /// + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = true, Position = 5)] + public DateTime StartTime + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = true, Position = 6)] + public DateTime EndTime + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, Position = 7)] + public string NodeName + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, Position = 8)] + public string ResourceUri + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, Position = 9)] + public Guid? ProviderGuid + { + get; + set; + } + + /// + /// + /// + [Parameter(Mandatory = false, Position = 10)] + public int[] EventId + { + get; + set; + } + + protected override void Execute() + { + List filterList = new List(); + filterList.Add(string.Format(CultureInfo.InvariantCulture, "startTime eq '{0:O}'", StartTime.ToUniversalTime())); + filterList.Add(string.Format(CultureInfo.InvariantCulture, "endTime eq '{0:O}'", EndTime.ToUniversalTime())); + if (!string.IsNullOrEmpty(NodeName)) + { + filterList.Add(string.Format(CultureInfo.InvariantCulture, "computerName eq '{0}'", NodeName)); + } + if (!string.IsNullOrEmpty(ResourceUri)) + { + filterList.Add(string.Format(CultureInfo.InvariantCulture, "resourceUri eq '{0}'", ResourceUri)); + } + if (ProviderGuid != null) + { + filterList.Add(string.Format(CultureInfo.InvariantCulture, "providerId eq '{0}'", ProviderGuid)); + } + if (EventId != null) + { + List eventIdFilters = new List(); + foreach (var eventId in EventId) + { + eventIdFilters.Add(string.Format(CultureInfo.InvariantCulture, "eventId eq '{0}'", eventId)); + } + if (eventIdFilters.Any()) + { + string eventIdFilter = eventIdFilters.Aggregate((current, next) => string.Format(CultureInfo.InvariantCulture, "{0} or {1}", current, next)); + filterList.Add(string.Format(CultureInfo.InvariantCulture, "({0})", eventIdFilter)); + } + } + string filter = filterList.Aggregate((current, next) => string.Format(CultureInfo.InvariantCulture, "{0} and {1}", current, next)); + + EventQuery eventQuery = Client.Farms.GetEventQuery(ResourceGroupName, FarmName, filter); + WriteObject(eventQuery, true); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarm.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarm.cs new file mode 100644 index 000000000000..d36d4448dac5 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarm.cs @@ -0,0 +1,58 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-Farm [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [[-FarmName] {string}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminFarm)] + public sealed class GetAdminFarm : AdminCmdlet + { + /// + /// Farm identifier + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNullOrEmpty] + public string FarmName + { + get; + set; + } + + protected override void Execute() + { + if (string.IsNullOrEmpty(FarmName) == false) + { + FarmGetResponse response = Client.Farms.Get(ResourceGroupName, FarmName); + WriteObject(new FarmResponse(response.Farm)); + } + else + { + FarmListResponse response = Client.Farms.List(ResourceGroupName); + + WriteObject(response.Farms.Select(_=>new FarmResponse(_)), true); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarmMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarmMetricDefinitions.cs new file mode 100644 index 000000000000..e40211a0e751 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarmMetricDefinitions.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminFarmMetricDefinition)] + public sealed class GetFarmMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + return Client.Farms.GetMetricDefinitions(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarmMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarmMetrics.cs new file mode 100644 index 000000000000..aa8739be268d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/GetFarmMetrics.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminFarmMetric)] + public sealed class GetFarmMetric : AdminMetricCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + return Client.Farms.GetMetrics(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/InvokeLogCollect.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/InvokeLogCollect.cs new file mode 100644 index 000000000000..41512eda09a8 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/InvokeLogCollect.cs @@ -0,0 +1,144 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using System.Net; +using System.Runtime.InteropServices; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsData.Export, Nouns.Log, SupportsShouldProcess = true)] + public sealed class InvokeLogCollect : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string FarmName { get; set; } + + /// + /// StartTime + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public DateTime StartTime { get; set; } + + /// + /// + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public DateTime EndTime { get; set; } + + /// + /// Credential to run the log copy + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCredential Credential { get; set; } + + /// + /// Blob Prefix for the uploaded logs + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string LogPrefix { get; set; } + + /// + /// Azure blob name + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string AzureStorageContainer { get; set; } + + /// + /// Azure Storage account name + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string AzureStorageAccountName { get; set; } + + /// + /// Azure storage account key + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string AzureStorageAccountKey { get; set; } + + /// + /// Azure SAS Token + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string AzureSasToken { get; set; } + + /// + /// Target Share folder to save logs + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string TargetShareFolder { get; set; } + + protected override void Execute() + { + IntPtr valuePtr = IntPtr.Zero; + string password; + try + { + valuePtr = Marshal.SecureStringToGlobalAllocUnicode(Credential.Password); + password = Marshal.PtrToStringUni(valuePtr); + } + finally + { + Marshal.ZeroFreeGlobalAllocUnicode(valuePtr); + } + + LogCollectParameters parameters = new LogCollectParameters + { + AzureBlobContainer = AzureStorageContainer, + AzureSasToken = AzureSasToken, + AzureStorageAccountKey = AzureStorageAccountKey, + AzureStorageAccountName = AzureStorageAccountName, + EndTime = EndTime, + StartTime = StartTime, + LogPrefix = LogPrefix, + UserName = Credential.UserName, + PlainPassword = password, + TargetShareFolder = TargetShareFolder + }; + + var logCollectTask = Client.Farms.CollectLogAsync(ResourceGroupName, FarmName, parameters); + + WriteVerbose("Sending request to start a log Collect job, it will take some time..."); + + var response = logCollectTask.Result; + + if (response.StatusCode != HttpStatusCode.OK) + { + throw new AdminException(string.Format(CultureInfo.InvariantCulture, Resources.OperationFailedErrorMessage, response.StatusCode)); + } + + WriteObject(response); + } + } +} + diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/SetFarm.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/SetFarm.cs new file mode 100644 index 000000000000..35b12db7deb7 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Farm/SetFarm.cs @@ -0,0 +1,97 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Set-Farm [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [[-SettingPollingIntervalInSeconds] {int}] [-FarmName] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Set, Nouns.AdminFarm, SupportsShouldProcess = true)] + public sealed class SetAdminFarm : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// + /// + [Parameter] + [SettingField] + public int? SettingsPollingIntervalInSecond { get; set; } + + /// + /// + /// + [Parameter] + [SettingField] + public int? HostStyleHttpPort { get; set; } + + /// + /// + /// + [Parameter] + [SettingField] + public int? HostStyleHttpsPort { get; set; } + + /// + /// + /// + [Parameter] + [SettingField] + public string CorsAllowedOriginsList { get; set; } + + /// + [Parameter] + [SettingField] + public string DataCenterUriHostSuffixes { get; set; } + + protected override void Execute() + { + string confirmString; + FarmSettings settings = Tools.ToSettingsObject(this, out confirmString); + + if (ShouldProcess( + Resources.SetFarmDescription.FormatInvariantCulture(FarmName, confirmString), + Resources.SetFarmWarning.FormatInvariantCulture(FarmName, confirmString), + Resources.ShouldProcessCaption)) + { + + FarmUpdateParameters parameters = new FarmUpdateParameters + { + Farm = new FarmBase {Settings = settings} + }; + + FarmGetResponse response = Client.Farms.Update(ResourceGroupName, FarmName, parameters); + + WriteObject(new FarmResponse(response.Farm)); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Fault/GetFault.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Fault/GetFault.cs new file mode 100644 index 000000000000..5ce56681d2cf --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Fault/GetFault.cs @@ -0,0 +1,151 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// get faults + /// + /// SYNTAX + /// Parameter Set: GetFault + /// Get-Fault [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} -FaultId {string} [ {CommonParameters}] + /// + /// Parameter Set: GetCurrentFault + /// Get-Fault [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-ResourceUri {string}] [ {CommonParameters}] + /// + /// Parameter Set: GetHistoryFault + /// Get-Fault [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} -StartTime {DateTime} -EndTime {DateTime} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminFault, DefaultParameterSetName = GetCurrentFaultSet)] + public sealed class GetFault : AdminCmdlet + { + + const string GetCurrentFaultSet = "GetCurrentFault"; + const string GetHistoryFaultSet = "GetHistoryFault"; + const string GetFaultSet = "GetFault"; + Action func; + + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// Fault Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = GetFaultSet)] + [ValidateNotNull] + public string FaultId + { + get; + set; + } + + /// + /// Resource Uri + /// + [Alias("Id")] + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = GetCurrentFaultSet)] + [ValidateNotNull] + public string ResourceUri + { + get; + set; + } + + /// + /// Query Fault StartTime + /// + [Parameter(Mandatory = true, ParameterSetName = GetHistoryFaultSet)] + [ValidateNotNull] + public DateTime StartTime + { + get; + set; + } + + /// + /// Query Fault EndTime + /// + [Parameter(Mandatory = true, ParameterSetName = GetHistoryFaultSet)] + [ValidateNotNull] + public DateTime EndTime + { + get; + set; + } + + protected override void BeginProcessing() + { + base.BeginProcessing(); + + switch (ParameterSetName) + { + case GetFaultSet: + { + func = () => + { + FaultGetResponse fault = Client.Faults.Get(ResourceGroupName, FarmName, FaultId); + WriteObject(new FaultResponse(fault.Fault)); + }; + } + break; + case GetHistoryFaultSet: + { + func = () => + { + FaultListResponse faults = Client.Faults.ListHistoryFaults(ResourceGroupName, FarmName, + StartTime.ToString("O", CultureInfo.InvariantCulture), + EndTime.ToString("O", CultureInfo.InvariantCulture)); + WriteObject(faults.Select(_ => new FaultResponse(_)), true); + }; + } + break; + case GetCurrentFaultSet: + { + func = () => + { + FaultListResponse faults = Client.Faults.ListCurrentFaults(ResourceGroupName, FarmName, ResourceUri); + WriteObject(faults.Faults.Select(_=>new FaultResponse(_)), true); + }; + } + break; + default: + throw new ArgumentException("Bad GetFault parameter set"); + } + } + + protected override void Execute() + { + func(); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Fault/ResolveFault.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Fault/ResolveFault.cs new file mode 100644 index 000000000000..985f8ac3bdba --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Fault/ResolveFault.cs @@ -0,0 +1,76 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// dismiss faults + /// + /// SYNTAX + /// Resolve-Fault [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-FaultId] {string} [-Force] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsDiagnostic.Resolve, Nouns.AdminFault, SupportsShouldProcess = true)] + public sealed class ResolveFault : AdminCmdlet + { + const string ShouldProcessTargetFormat = "fault {0} "; + const string ShouldContinueQuery = "Continue with resolve fault?"; + const string ShouldContinueCaption = "Confirm"; + + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// Fault Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNull] + public string FaultId + { + get; + set; + } + + [Parameter] + public SwitchParameter Force + { + get; + set; + } + + protected override void Execute() + { + if (ShouldProcess(string.Format(CultureInfo.InvariantCulture, ShouldProcessTargetFormat, FaultId)) && + (Force || ShouldContinue(ShouldContinueQuery,ShouldContinueCaption))) + { + Client.Faults.Dismiss(ResourceGroupName, FarmName, FaultId); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/MSSharedLibKey.snk b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/MSSharedLibKey.snk differ diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Microsoft.AzureStack.Commands.StorageAdmin.dll-Help.xml b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Microsoft.AzureStack.Commands.StorageAdmin.dll-Help.xml new file mode 100644 index 000000000000..31b7aa1f5362 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Microsoft.AzureStack.Commands.StorageAdmin.dll-Help.xml @@ -0,0 +1,10970 @@ + + + + + Add-ACSFarm + + Register a new provisioned ACS farm. + + + + + Add + ACSFarm + + + + After fabric admin deploy a new ACS farm. Service Admin could use the cmdlet to registered that farm to SRP. + + + + Add-ACSFarm + + FarmName + + + + String + + + SettingAccessString + + + + String + + + Location + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + SettingAccessString + + + + String + + String + + + + + + Location + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +Add-ACSFarm -ResourceGroupName $resourceGroup -FarmName 'YourNameFarmName' -Location 'YourLocation' + + + + + + + + + + + + + + + + + + + + + + Disable-ACSNode + + Disable a particular node from service fabric cluster. + + + + + Disable + ACSNode + + + + Disable a particular node from service fabric cluster. After disable, service fabric instances will be moved to other nodes. + + + + Disable-ACSNode + + FarmName + + + + String + + + NodeName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + NodeName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.NodeResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +Disable-ACSNode -ResourceGroupName $resourceGroup -NodeName 'YourNodeName' + + + + + + + + + + + + + + + + + + + + + + Enable-ACSNode + + Enable a particular node in the service fabric cluster. + + + + + Enable + ACSNode + + + + Enable a particular node in the service fabric cluster. After enabing the node, service instances can be initantiated to this node. + + + + Enable-ACSNode + + FarmName + + + + String + + + NodeName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + NodeName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.NodeResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +Eable-ACSNode -ResourceGroupName $resourceGroup -NodeName 'YourNodeName' + + + + + + + + + + + + + + + + + + + + + + Get-ACSBlobService + + Retrieve the status and settings of blob service + + + + + Get + ACSBlobService + + + + Retrieve the status and settings of blob service + + + + Get-ACSBlobService + + FarmName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.BlobServiceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSBlobService -ResourceGroupName $resourceGroup -FarmName $farm.Name | fl + + + + + + + + + + + + + + + + + + + + + + + Get-ACSBlobServiceMetric + + Retrieve the metrics of blob service + + + + + Get + ACSBlobServiceMetric + + + + Retrieve the metrics of blob service + + + + Get-ACSBlobServiceMetric + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSBlobServiceMetricDefinition + + Retrieve the metric definitions of blob service + + + + + Get + ACSBlobServiceMetricDefinition + + + + Retrieve the metric definitions of blob service + + + + Get-ACSBlobServiceMetricDefinition + + FarmName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinition + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinitionNoDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSEventQuery + + Returns a query object, which could be used as the input parameter for Get-ACSEvent. + + + + + Get + ACSEventQuery + + + + This cmdlet returns a ACSEventQuery object. Then the ACSEventQuery object can be used to query events from Azure-consistent Storage system. + + + + Get-ACSEventQuery + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + Node + + + + String + + + ResourceUri + + + + String + + + ProviderGuid + + + + Nullable`1[Guid] + + + EventId + + + + Int32[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + Node + + + + String + + String + + + + + + ResourceUri + + + + String + + String + + + + + + ProviderGuid + + + + Nullable`1[Guid] + + Nullable`1[Guid] + + + + + + EventId + + + + Int32[] + + Int32[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +$endtime=get-date +$starttime=$endtime.addminutes(-10) + +Get-ACSEventQuery -FarmId $farm.Name -ResourceGroupName $resourceGroup -StartTime $starttime + -EndTime $endtime + + + + + + + + + + + + + + + + + + + + + + Get-ACSEvents + + List the events in the Azure Consistent Storage system. + + + + + Get + ACSEvents + + + + This cmdlet returns a list of event objects. You could specify query parameters: start time, end time, computer name, resource uri, provider guid, event id. You can also compose an event query with Get-ACSEventQuery cmdlet. + + + + Get-ACSEvents + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + Node + + + + String + + + ResourceUri + + + + String + + + ProviderGuid + + + + Guid + + + EventId + + + + Int32[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + Get-ACSEvents + + EventQuery + + + + EventQuery + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + Node + + + + String + + String + + + + + + ResourceUri + + + + String + + String + + + + + + ProviderGuid + + + + Guid + + Guid + + + + + + EventId + + + + Int32[] + + Int32[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + EventQuery + + + + EventQuery + + EventQuery + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSEvents -startTime $startTime -endtime $endtime -FarmName $farm -ResourceGroupName $resourceGroup + + + + + + + + + + + + + + + + + + + + + + Get-ACSFarm + + Retrieve the Azure-consistent Storage Farm and its properties and settings. + + + + + Get + ACSFarm + + + + Retrieve the Azure-consistent Storage Farm and its properties and settings. + + + + Get-ACSFarm + + FarmName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +Get-ACSFarm -ResourceGroupName $resourceGroup + + + + + + + + + + + + + + + + + + + + + + Get-ACSFarmMetric + + Retrieve the metrics of ACS farm + + + + + Get + ACSFarmMetric + + + + Retrieve the metrics of ACS farm + + + + Get-ACSFarmMetric + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSFarmMetricDefinition + + Retrieve the metric definitions of ACS farm + + + + + Get + ACSFarmMetricDefinition + + + + Retrieve the metric definitions of ACS farm + + + + Get-ACSFarmMetricDefinition + + FarmName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinition + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinitionNoDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSFault + + List faults in the Azure Consistent Storage system. + + + + + Get + ACSFault + + + + This cmdlet returns a list of faults in the Azure-consistent Storage system. It supports several parameter set: +The default parameter set is GetCurrentFaults, which returns a list of current active fault objects. If ResourceUri is specified, the cmdlet returns a list of current active fault objects on this resource. +GetHistoryFaults returns a list of active fault objects within specified time range. +GetFault returns one fault object with the specified fault ID. + + + + Get-ACSFault + + FarmName + + + + String + + + ResourceUri + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + Get-ACSFault + + FarmName + + + + String + + + FaultId + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + Get-ACSFault + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + ResourceUri + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + FaultId + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FaultResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSFault -ResourceGroupName $resourceGroup -FarmName $farm.Name + + + + + + + + + + + + + + + + + + + + + + + Get-ACSManagementService + + Retrieve running status and settings of management service. + + + + + Get + ACSManagementService + + + + Retrieve running status and settings of management service. + + + + Get-ACSManagementService + + FarmName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.ManagementServiceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSManagementService -ResourceGroupName $resourceGroup -FarmName $farm.Name | fl + + + + + + + + + + + + + + + + + + + + + + Get-ACSManagementServiceMetric + + Retrieve the metrics of management service + + + + + Get + ACSManagementServiceMetric + + + + Retrieve the metrics of management service + + + + Get-ACSManagementServiceMetric + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSManagementServiceMetricDefinition + + Retrieve the metric definitions of management service + + + + + Get + ACSManagementServiceMetricDefinition + + + + Retrieve the metric definitions of management service + + + + Get-ACSManagementServiceMetricDefinition + + FarmName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinition + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinitionNoDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSNode + + Get a list of nodes in Azure Consistent Storage. + + + + + Get + ACSNode + + + + Get a list of nodes in Azure Consistent Storage. A node could be of either Blob Server type and Service Fabric Node type. + + + + Get-ACSNode + + FarmName + + + + String + + + NodeName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + NodeName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.NodeResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.NodeResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSNode -ResourceGroupName $resourceGroup -FarmName $farm.Name + + + + + + + + + + + + + + + + + + + + + + Get-ACSNodeMetric + + Retrieve the metrics of a node + + + + + Get + ACSNodeMetric + + + + Retrieve the metrics of a node + + + + Get-ACSNodeMetric + + FarmName + + + + String + + + NodeName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + NodeName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.NodeResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSNodeMetricDefinition + + Retrieve the metric definitions of node + + + + + Get + ACSNodeMetricDefinition + + + + Retrieve the metric definitions of node + + + + Get-ACSNodeMetricDefinition + + FarmName + + + + String + + + NodeName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + NodeName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.NodeResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSRoleInstance + + Get a list of a specific type of role instances. + + + + + Get + ACSRoleInstance + + + + Get a list of a specific type of role instances, including TableServer | BlobServer | TableMaster | AccountContainerserver | TableFrontend | BlobFrontend | MetricsServer | HealthMonitoringserver. + + + + Get-ACSRoleInstance + + FarmName + + + + String + + + RoleType + + + + RoleType + + + InstanceId + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + RoleType + + + + RoleType + + RoleType + + + + + + InstanceId + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.BlobFrontendRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableFrontendInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.BlobServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.MonitoringServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.MetricsServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableMasterRoleInstanceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSRoleInstance -ResourceGroupName $resourceGroup -FarmId $farm.Name -RoleType BlobFrontend + + + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSRoleInstance -ResourceGroupName $resourceGroup -FarmId $farm.Name -RoleType BlobFrontend + + + + + + + + + + + + + + + + + + + + + + Get-ACSRoleInstanceMetric + + Retrieve the metrics of a role instance + + + + + Get + ACSRoleInstanceMetric + + + + Retrieve the metrics of a role instance + + + + Get-ACSRoleInstanceMetric + + FarmName + + + + String + + + RoleType + + + + RoleType + + + InstanceId + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + RoleType + + + + RoleType + + RoleType + + + + + + InstanceId + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSRoleInstanceMetricDefinition + + Retrieve the metric definitions of role instance + + + + + Get + ACSRoleInstanceMetricDefinition + + + + Retrieve the metric definitions of role instance + + + + Get-ACSRoleInstanceMetricDefinition + + FarmName + + + + String + + + RoleType + + + + RoleType + + + InstanceId + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + RoleType + + + + RoleType + + RoleType + + + + + + InstanceId + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinition + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinitionNoDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSShare + + Get list of SMB shares used in the Azure Consistent Storage system. + + + + + Get + ACSShare + + + + Get list of SMB shares used in the Azure Consistent Storage system. + + + + Get-ACSShare + + FarmName + + + + String + + + ShareName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + ShareName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.ShareResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSShare -ResourceGroupName $resourceGroup -FarmName $farm.Name -ShareName 'YourShareName' + + + + + + + + + + + + + + + + + + + + + + Get-ACSShareMetric + + Retrieve the metrics of a share + + + + + Get + ACSShareMetric + + + + Retrieve the metrics of a share + + + + Get-ACSShareMetric + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + ShareName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + ShareName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSShareMetricDefinition + + Retrieve the metric definitions of share + + + + + Get + ACSShareMetricDefinition + + + + Retrieve the metric definitions of share + + + + Get-ACSShareMetricDefinition + + FarmName + + + + String + + + ShareName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + ShareName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinition + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinitionNoDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSStorageAccount + + Retrieve a list of the tenant storage accounts based on the tenant subscription ID, account name (or part of the account name) , account status or based on a account ID. + + + + + Get + ACSStorageAccount + + + + Retrieve a list of the tenant storage accounts based on the tenant subscription ID, account name (or part of the account name) , account status or based on a account ID. + + + + Get-ACSStorageAccount + + FarmName + + + + String + + + TenantSubscriptionId + + + + String + + + PartialAccountName + + + + String + + + StorageAccountStatus + + + + Nullable`1[Int32] + + + Detail + + + + SwitchParameter + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + Get-ACSStorageAccount + + FarmName + + + + String + + + AccountId + + + + Int64 + + + Detail + + + + SwitchParameter + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + TenantSubscriptionId + + + + String + + String + + + + + + PartialAccountName + + + + String + + String + + + + + + StorageAccountStatus + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + Detail + + + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + AccountId + + + + Int64 + + Int64 + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.StorageAccountResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSStorageAccount -ResourceGroupName $resourceGroup -FarmName $farm.Name -PartialAccountName ‘YourStorageAccountName’ + + + + + + + + + + + + + + + + + + + + + + + Get-ACSTableService + + Get status and settings of table service. + + + + + Get + ACSTableService + + + + Get status and settings of table service. + + + + Get-ACSTableService + + FarmName + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableServiceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Get-ACSTableService -ResourceGroupName $resourceGroup -FarmName $farm.Name + + + + + + + + + + + + + + + + + + + + + + Get-ACSTableServiceMetric + + Retrieve the metrics of table service + + + + + Get + ACSTableServiceMetric + + + + Retrieve the metrics of table service + + + + Get-ACSTableServiceMetric + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + TimeGrain + + + + TimeGrain + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + TimeGrain + + + + TimeGrain + + TimeGrain + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricNoDetails + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.Metric + + + + + + + + + + + + + + + + + + + + + + + + + Get-ACSTableServiceMetricDefinition + + Retrieve the metric definitions of table service + + + + + Get + ACSTableServiceMetricDefinition + + + + Retrieve the metric definitions of table service + + + + Get-ACSTableServiceMetricDefinition + + FarmName + + + + String + + + MetricNames + + + + String[] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + MetricNames + + + + String[] + + String[] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinition + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.PSMetricDefinitionNoDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Export-ACSLog + + Invoke the log collector, which will collect logs, metrics, settings, health, and other system related information and package all these information into a package. + + + + + Export + ACSLog + + + + Invoke the log collector, which will collect logs, metrics, settings, health, and other system related informations and package all these information into a package. Later you can send the package to Microsoft for support. + + + + Export-ACSLog + + FarmName + + + + String + + + StartTime + + + + DateTime + + + EndTime + + + + DateTime + + + UserName + + + + String + + + Password + + + + String + + + LogPrefix + + + + String + + + AzureStorageContainer + + + + String + + + AzureStorageAccountName + + + + String + + + AzureStorageAccountKey + + + + String + + + AzureSasToken + + + + String + + + TargetShareFolder + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + StartTime + + + + DateTime + + DateTime + + + + + + EndTime + + + + DateTime + + DateTime + + + + + + UserName + + + + String + + String + + + + + + Password + + + + String + + String + + + + + + LogPrefix + + + + String + + String + + + + + + AzureStorageContainer + + + + String + + String + + + + + + AzureStorageAccountName + + + + String + + String + + + + + + AzureStorageAccountKey + + + + String + + String + + + + + + AzureSasToken + + + + String + + String + + + + + + TargetShareFolder + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resolve-ACSFault + + Resolve/Dismiss a fault in Azure Consistent Storage System. + + + + + Resolve + ACSFault + + + + This cmdlet change the state of a fault from Active to Resolved. + + + + Resolve-ACSFault + + FarmName + + + + String + + + FaultId + + + + String + + + Force + + + + SwitchParameter + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + FaultId + + + + String + + String + + + + + + Force + + + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Resolve-ACSFault -ResourceGroupName $resourceGroup -FarmName $farm.Name -FaultId <FaultId> + + + + + + + + + + + + + + + + + + + + + + Restart-ACSRoleInstance + + Restart a role instance in the Azure Consistent Storage system. + + + + + Restart + ACSRoleInstance + + + + Restart a role instance in the Azure Consistent Storage system. + + + + Restart-ACSRoleInstance + + FarmName + + + + String + + + RoleType + + + + RoleType + + + InstanceId + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + RoleType + + + + RoleType + + RoleType + + + + + + InstanceId + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Restart-ACSRoleInstance -ResourceGroupName $resourceGroup -FarmName $farm.Name -InstanceID 'YourInstanceID' + + + + + + + + + + + + + + + + + + + + + + Set-ACSBlobService + + Configure Settings of blob service + + + + + Set + ACSBlobService + + + + Configure Settings of blob service + + + + Set-ACSBlobService + + FarmName + + + + String + + + FrontEndCpuBasedKeepAliveThrottlingEnabled + + + + Nullable`1[Boolean] + + + FrontEndMemoryThrottlingEnabled + + + + Nullable`1[Boolean] + + + BlobSvcContainerGcInterval + + + + Nullable`1[Int32] + + + BlobSvcShallowGcInterval + + + + Nullable`1[Int32] + + + BlobSvcStreamMapMinContainerOccupancyPercent + + + + Nullable`1[Int32] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + FrontEndCpuBasedKeepAliveThrottlingEnabled + + + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + FrontEndMemoryThrottlingEnabled + + + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + BlobSvcContainerGcInterval + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + BlobSvcShallowGcInterval + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + BlobSvcStreamMapMinContainerOccupancyPercent + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse, + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.BlobServiceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Set-ACSBlobService -ResourceGroupName $resourceGroup -FarmName $farm.Name -FrontEndCpuBasedKeepAliveThrottlingEnabled $true + + + + + + + + + + + + + + + + + + + + + + Set-ACSFarm + + Change the setting of service configuration on ACS Farm + + + + + Set + ACSFarm + + + + Change the setting of service configuration on ACS Farm + + + + Set-ACSFarm + + FarmName + + + + String + + + SettingsPollingIntervalInSecond + + + + Nullable`1[Int32] + + + HostStyleHttpPort + + + + Nullable`1[Int32] + + + HostStyleHttpsPort + + + + Nullable`1[Int32] + + + CorsAllowedOriginsList + + + + String + + + DataCenterUriHostSuffixes + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + SettingsPollingIntervalInSecond + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + HostStyleHttpPort + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + HostStyleHttpsPort + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + CorsAllowedOriginsList + + + + String + + String + + + + + + DataCenterUriHostSuffixes + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Set-ACSFarm -ResourceGroupName $resourceGroup -FarmName $farm.Name -SettingPollingIntervalInSeconds 45 + + + + + + + + + + + + + + + + + + + + + + Set-ACSManagementService + + Configure Settings of management service + + + + + Set + ACSManagementService + + + + Configure Settings of management service + + + + Set-ACSManagementService + + FarmName + + + + String + + + WacContainerGcFullScanIntervalInSeconds + + + + Nullable`1[Int32] + + + WacAccountGcFullScanIntervalInSeconds + + + + Nullable`1[Int32] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + WacContainerGcFullScanIntervalInSeconds + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + WacAccountGcFullScanIntervalInSeconds + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.ManagementServiceResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.ManagementServiceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Set-ACSManagementService -ResourceGroupName $resourceGroup -FarmName $farm.Name WacAccountGcFullScanIntervalInSeconds 60000000 + + + + + + + + + + + + + + + + + + + + + + Set-ACSTableService + + Configure Settings of table service + + + + + Set + ACSTableService + + + + Configure Settings of table service + + + + Set-ACSTableService + + FarmName + + + + String + + + FrontEndCpuBasedKeepAliveThrottlingEnabled + + + + Nullable`1[Boolean] + + + FrontEndMemoryThrottlingEnabled + + + + Nullable`1[Boolean] + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + FrontEndCpuBasedKeepAliveThrottlingEnabled + + + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + FrontEndMemoryThrottlingEnabled + + + + Nullable`1[Boolean] + + Nullable`1[Boolean] + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableServiceResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableServiceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Set-ACSTableService -ResourceGroupName $resourceGroup -FarmName $farm.Name -FrontEndCpuBasedKeepAliveThrottlingEnabled $true + + + + + + + + + + + + + + + + + + + + + + Start-ACSBlobServerRoleInstance + + Start blob service instance on a specific physical node. + + + + + Start + ACSBlobServerRoleInstance + + + + Start blob service instance on a specific physical node. + + + + Start-ACSBlobServerRoleInstance + + FarmName + + + + String + + + InstanceId + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + InstanceId + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +start-ACSBlobServerRoleInstance -ResourceGroupName $resourceGroup -FarmName $farm.Name -InstanceID 'YourInstanceID' + + + + + + + + + + + + + + + + + + + + + + Stop-ACSBlobServerRoleInstance + + Stop blob service instance on a specific physical node. + + + + + Stop + ACSBlobServerRoleInstance + + + + Stop blob service instance on a specific physical node. + + + + Stop-ACSBlobServerRoleInstance + + FarmName + + + + String + + + InstanceId + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + InstanceId + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +stop-ACSBlobServerRoleInstance -ResourceGroupName $resourceGroup -FarmName $farm.Name -InstanceID 'YourInstanceID' + + + + + + + + + + + + + + + + + + + + + + Sync-ACSStorageAccount + + Synchronize the account status of the tenant storage accounts from backend to frontend cache. + + + + + Sync + ACSStorageAccount + + + + After undelete a storage account, service admin need to synchronize the account status change back to the frontend cache in order to make sure the frontend could serve the request for that undeleted storage account. + + + + Sync-ACSStorageAccount + + TenantAccountName + + + + String + + + TenantSubscriptionId + + + + String + + + Location + + + + String + + + TenantResourceGroup + + + + String + + + StorageAccountApiVersion + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + TenantAccountName + + + + String + + String + + + + + + TenantSubscriptionId + + + + String + + String + + + + + + Location + + + + String + + String + + + + + + TenantResourceGroup + + + + String + + String + + + + + + StorageAccountApiVersion + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.StorageAccountResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +Sync-ACSStorageAccount -AccountName first -TenantSubscriptionId <TenantSubscriptionId> -ResourceLocation 'local' -ResourceGroupName $resourceGroup + + + + + + + + + + + + + + + + + + + + + + Undo-ACSStorageAccountDeletion + + Undelete a tenant storage account. + + + + + Undo + ACSStorageAccountDeletion + + + + Service admin can use the cmdlet to recover a a storage account deleted by tenant admin. + + + + Undo-ACSStorageAccountDeletion + + FarmName + + + + String + + + AccountId + + + + Int64 + + + NewAccountName + + + + String + + + StorageAccountApiVersion + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + AccountId + + + + Int64 + + Int64 + + + + + + NewAccountName + + + + String + + String + + + + + + StorageAccountApiVersion + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.StorageAccountResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + $resourceGroup = 'System' + +$farm = Get-ACSFarm -ResourceGroupName $resourceGroup + +Undo-ACSStorageAccountDeletion -ResourceGroupName $resourceGroup -FarmName $farm.Name -AccountId <AccountId> + + + + + + + + + + + + + + + + + + + + + + Update-ACSRoleInstance + + Update the settings of a role instance from setting repository + + + + + Update + ACSRoleInstance + + + + Update the settings of a role instance from setting repository + + + + Update-ACSRoleInstance + + FarmName + + + + String + + + RoleType + + + + RoleType + + + InstanceId + + + + String + + + SubscriptionId + + + + String + + + Token + + + + String + + + AdminUri + + + + Uri + + + ResourceGroupName + + + + String + + + SkipCertificateValidation + + + + SwitchParameter + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + FarmName + + + + String + + String + + + + + + RoleType + + + + RoleType + + RoleType + + + + + + InstanceId + + + + String + + String + + + + + + SubscriptionId + + + + String + + String + + + + + + Token + + + + String + + String + + + + + + AdminUri + + + + Uri + + Uri + + + + + + ResourceGroupName + + + + String + + String + + + + + + SkipCertificateValidation + + + + SwitchParameter + + SwitchParameter + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.FarmResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse + + + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.AccountContainerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.BlobFrontendRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableFrontendInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.BlobServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.MonitoringServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.MetricsServerRoleInstanceResponse + + + + + + + + + + Microsoft.AzureStack.Commands.StorageAdmin.TableMasterRoleInstanceResponse + + + + + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/AccountContainerRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/AccountContainerRoleInstanceResponse.cs new file mode 100644 index 000000000000..6503f748ddf1 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/AccountContainerRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class AccountContainerRoleInstanceResponse: RoleInstanceResponseBase + { + public AccountContainerRoleInstanceResponse(AccountContainerRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.AccountContainerserver; + } + + public AccountContainerRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobFrontEndRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobFrontEndRoleInstanceResponse.cs new file mode 100644 index 000000000000..2c0cb5942589 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobFrontEndRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class BlobFrontEndRoleInstanceResponse : RoleInstanceResponseBase + { + public BlobFrontEndRoleInstanceResponse(BlobFrontEndRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.BlobFrontend; + } + + public BlobFrontEndRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobServerRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobServerRoleInstanceResponse.cs new file mode 100644 index 000000000000..9481834555f5 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobServerRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class BlobServerRoleInstanceResponse : RoleInstanceResponseBase + { + public BlobServerRoleInstanceResponse(BlobServerRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.BlobServer; + } + + public BlobServerRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobServiceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobServiceResponse.cs new file mode 100644 index 000000000000..6a3ce22d01a9 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/BlobServiceResponse.cs @@ -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. +// ---------------------------------------------------------------------------------- + +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class BlobServiceResponse : ServiceResponseBase + { + public BlobServiceResponse(BlobServiceResponseResource resource) : base(resource, "BlobService") + { + } + + public BlobServiceSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/FarmResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/FarmResponse.cs new file mode 100644 index 000000000000..ac95a56cc53d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/FarmResponse.cs @@ -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. +// ---------------------------------------------------------------------------------- + +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class FarmResponse: ResponseBase + { + public FarmResponse(FarmModel resource) : base(resource) + { + } + + public string SettingsStore { get; set; } + + public HealthStatus HealthStatus { get; set; } + + public FarmSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/FaultResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/FaultResponse.cs new file mode 100644 index 000000000000..0c5849fd5a56 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/FaultResponse.cs @@ -0,0 +1,42 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class FaultResponse:ResponseBase + { + public FaultResponse(FaultModel resource) : base(resource) + { + } + + public DateTime ActivatedTime { get; set; } + public AssociatedDataType AssociatedDataType { get; set; } + public EventQuery AssociatedEventQuery { get; set; } + public string AssociatedMetricsName { get; set; } + public string Description { get; set; } + public string FaultId { get; set; } + public string FaultRuleName { get; set; } + public string ResolutionText { get; set; } + public DateTime? ResolvedTime { get; set; } + public string ResourceUri { get; set; } + public Severity Severity { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ManagementServiceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ManagementServiceResponse.cs new file mode 100644 index 000000000000..efdc123bf904 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ManagementServiceResponse.cs @@ -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. +// ---------------------------------------------------------------------------------- + +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class ManagementServiceResponse : ServiceResponseBase + { + public ManagementServiceResponse(ManagementServiceResponseResource resource) : base(resource, "ManagementService") + { + } + + public ManagementServiceSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/MetricsServerRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/MetricsServerRoleInstanceResponse.cs new file mode 100644 index 000000000000..59367d1fb10b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/MetricsServerRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class MetricsServerRoleInstanceResponse : RoleInstanceResponseBase + { + public MetricsServerRoleInstanceResponse(MetricsServerRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.MetricsServer; + } + + public MetricsServerRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/MonitoringServerRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/MonitoringServerRoleInstanceResponse.cs new file mode 100644 index 000000000000..6badb606e8df --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/MonitoringServerRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class MonitoringServerRoleInstanceResponse : RoleInstanceResponseBase + { + public MonitoringServerRoleInstanceResponse(MonitoringServerRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.HealthMonitoringserver; + } + + public MonitoringServerRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/NodeResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/NodeResponse.cs new file mode 100644 index 000000000000..5d8f936cb979 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/NodeResponse.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 System; +using System.Collections.Generic; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class NodeResponse : ResponseBase + { + public NodeResponse(NodeModel resource) : base(resource) + { + } + + public string CodeVersion { get; set; } + + public string ConfigVersion { get; set; } + + public Uri FaultDomain { get; set; } + + public HealthStatus HealthState { get; set; } + + + public string IpAddressOrFqdn { get; set; } + + public bool IsSeedNode { get; set; } + + public string NodeId { get; set; } + + public string NodeName { get; set; } + + public NodeStatus NodeStatus { get; set; } + + public string NodeType { get; set; } + + public TimeSpan NodeUpTime { get; set; } + + public string UpgradeDomain { get; set; } + + public IEnumerable RunningInstanceUris { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSAvailabilityCollection.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSAvailabilityCollection.cs new file mode 100644 index 000000000000..b996e695487d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSAvailabilityCollection.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Wraps around a list of Dimension objects to display them with indentation + /// + internal class PSAvailabilityCollection + { + private IList metricAvailabilities; + + /// + /// Initializes a new instance of the PSAvailabilityCollection class + /// + /// The list of metric availabilities + public PSAvailabilityCollection(IList metricAvailabilities) + { + this.metricAvailabilities = metricAvailabilities; + } + + /// + /// A string representation of the list MetricAvailability objects including indentation + /// + /// A string representation of the list of MetricAvailability objects including indentation + public override string ToString() + { + return this.metricAvailabilities.ToString(indentationTabs: 1); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetric.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetric.cs new file mode 100644 index 000000000000..1c8fa3717543 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetric.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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Wrapps around the Metric and exposes a summary of the properties properties + /// + internal class PSMetric : PSMetricNoDetails + { + /// + /// Gets or sets the MetricValues collection of the metric + /// + public new PSMetricValuesCollection MetricValues { get; set; } + + /// + /// Initializes a new instance of the PSMetric class. + /// + /// The input Metric object + public PSMetric(Metric metric) : base(metric) + { + this.MetricValues = new PSMetricValuesCollection(metric.MetricValues); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricDefinition.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricDefinition.cs new file mode 100644 index 000000000000..6bde718617d5 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricDefinition.cs @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class PSMetricDefinition : PSMetricDefinitionNoDetails + { + /// + /// Gets or sets the MetricAvailabilties of the metric + /// + public new PSAvailabilityCollection MetricAvailabilities { get; set; } + + /// + /// Initializes an new instance of the PSMetricDefinition class + /// + /// The MetricDefinition + public PSMetricDefinition(MetricDefinition metricDefinition): base(metricDefinition) + { + this.MetricAvailabilities = new PSAvailabilityCollection(metricDefinition.MetricAvailabilities); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricDefinitionNoDetails.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricDefinitionNoDetails.cs new file mode 100644 index 000000000000..513ef158af2b --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricDefinitionNoDetails.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Wraps around MetricDefinition to provide summarized data about it + /// + internal class PSMetricDefinitionNoDetails : MetricDefinition + { + /// + /// Gets or sets the Name of the metric + /// + public new string Name { get; set; } + + /// + /// Initializes an new instance of the PSMetricDefinitionNoDetails class + /// + /// The MetricDefinition + public PSMetricDefinitionNoDetails(MetricDefinition metricDefinition) + { + // Keep the original value (localized string, Dictionary, List) in the base + base.Name = metricDefinition.Name; + + this.MetricAvailabilities = metricDefinition.MetricAvailabilities; + this.Name = metricDefinition.Name == null ? null : metricDefinition.Name.Value; + this.PrimaryAggregationType = metricDefinition.PrimaryAggregationType; + this.Unit = metricDefinition.Unit; + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricNoDetails.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricNoDetails.cs new file mode 100644 index 000000000000..6a995608e94a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricNoDetails.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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Wrapps around the Metric and exposes a summary of the properties properties + /// + internal class PSMetricNoDetails : Metric + { + /// + /// Gets or sets the Name of the metric + /// + public new string Name { get; set; } + + /// + /// Initializes a new instance of the PSMetric class. + /// + /// The input Metric object + public PSMetricNoDetails(Metric metric) + { + // Keep the original value (localized string, Dictionary, List) in the base + base.Name = metric.Name; + + this.EndTime = metric.EndTime; + this.Name = metric.Name == null ? null : metric.Name.Value; + this.MetricValues = metric.MetricValues; + this.StartTime = metric.StartTime; + this.TimeGrain = metric.TimeGrain; + this.MetricUnit = metric.MetricUnit; + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricValuesCollection.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricValuesCollection.cs new file mode 100644 index 000000000000..aa29d4aa0262 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/PSMetricValuesCollection.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Wraps around a list of PSMetricValue objects to display them with indentation + /// + internal class PSMetricValuesCollection + { + private IList metricValues; + + /// + /// Initializes a new instance of the PSMetricValuesCollection class + /// + /// The list of metric values + public PSMetricValuesCollection(IList metricValues) + { + this.metricValues = metricValues; + } + + /// + /// A string representation of the list Dimension objects including indentation + /// + /// A string representation of the list of Dimension objects including indentation + public override string ToString() + { + return this.metricValues.ToString(indentationTabs: 1); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ResponseBase.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ResponseBase.cs new file mode 100644 index 000000000000..45dbab258e80 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ResponseBase.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.Reflection; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class ResponseBase : ResourceBase + { + public ResponseBase(ResourceBase resource) : this(resource, "Properties") + { + + } + + public ResponseBase(ResourceBase resource, string propertyNameToExpand) + { + Id = resource.Id; + Location = resource.Location; + Tags = resource.Tags; + Type = resource.Type; + Name = resource.Name; + + // Id is in the following format: + // /subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/{providerName}/farms/{farmId}/nodes/{nodeId} + string[] ids = resource.Id.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + ResourceGroupName = ids[3]; + FarmName = ids[7]; + + Type inputType = resource.GetType(); + Type outPutType = this.GetType(); + + PropertyInfo propertiesPropertyInfo = inputType.GetProperty(propertyNameToExpand); + + if (propertiesPropertyInfo != null) + { + var propertiesValue = propertiesPropertyInfo.GetValue(resource); + PropertyInfo[] properties = propertiesValue.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); + foreach (var property in properties) + { + object propertyValue = property.GetValue(propertiesValue); + if (propertyValue != null) + { + PropertyInfo propertyInfoInResponse = outPutType.GetProperty(property.Name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + if (propertyInfoInResponse != null) + { + propertyInfoInResponse.SetValue(this, propertyValue); + } + } + } + } + } + + public string ResourceGroupName { get; set; } + public string FarmName { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/RoleInstanceResponseBase.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/RoleInstanceResponseBase.cs new file mode 100644 index 000000000000..48e81bbf1197 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/RoleInstanceResponseBase.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 System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class RoleInstanceResponseBase:ResponseBase + { + public RoleInstanceResponseBase(ResourceBase resource) : base(resource) + { + } + + public string InstanceId + { + get + { + return RoleIdentifier; + } + } + + protected string RoleIdentifier { get; set; } + public string Version { get; set; } + public RoleInstanceStatus Status { get; set; } + public HealthStatus HealthStatus { get; set; } + public string NodeUri { get; set; } + public IEnumerable HistoryInfos { get; set; } + + public RoleType RoleType { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ServiceResponseBase.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ServiceResponseBase.cs new file mode 100644 index 000000000000..faf9bfaa967d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ServiceResponseBase.cs @@ -0,0 +1,33 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class ServiceResponseBase : ResponseBase + { + public ServiceResponseBase(ResourceBase resource, string propertyNameToExpand) : base(resource, propertyNameToExpand) + { + } + + public HealthStatus HealthStatus { get; set; } + public string Version { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ShareResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ShareResponse.cs new file mode 100644 index 000000000000..64652e20efe4 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/ShareResponse.cs @@ -0,0 +1,37 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class ShareResponse:ResponseBase + { + public ShareResponse(ShareModel resource) : base(resource) + { + } + + public ulong? FreeCapacity { get; set; } + public HealthStatus HealthStatus { get; set; } + public string ShareName { get; set; } + public ulong? TotalCapacity { get; set; } + public string UncPath { get; set; } + public ulong? UsedCapacity { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/StorageAccountResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/StorageAccountResponse.cs new file mode 100644 index 000000000000..89a828bc9a85 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/StorageAccountResponse.cs @@ -0,0 +1,80 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class StorageAccountResponse : ResponseBase + { + public StorageAccountResponse(StorageAccountModel model, string farmName) + : base(model) + { + // Manually set those with different names or in root + this.AccountId = long.Parse(model.Name, CultureInfo.InvariantCulture); + this.AdminViewId = model.Id; + this.Location = model.Location; + this.WacAccountId = model.Properties.AccountId; + this.ResourceType = model.ResourceType; + this.Type = model.Type; + this.Tags = model.Tags; + this.FarmName = farmName; + } + + public string ResourceType { get; set; } + public long AccountId { get; set; } + public string AdminViewId { get; set; } + public string TenantViewId { get; set; } + public StorageAccountType AccountType { get; set; } + + public StorageAccountState State { get; set; } + + public IDictionary PrimaryEndpoints { get; set; } + + public string CreationTime { get; set; } + + public string AlternateName { get; set; } + + public RegionStatus StatusOfPrimary { get; set; } + + public Guid TenantSubscriptionId { get; set; } + + public string TenantAccountName { get; set; } + + public string TenantResourceGroupName { get; set; } + + public StorageAccountOperation CurrentOperation { get; set; } + + public string CustomDomain { get; set; } + public int AcquisitionOperationCount { get; set; } + public DateTime? DeletedTime { get; set; } + + public StorageAccountStatus AccountStatus { get; set; } + + public DateTime? RecoveredTime { get; set; } + + public DateTime? RecycledTime { get; set; } + + public WacAccountPermissions? Permissions { get; set; } + + public ulong? WacAccountId { get; set; } + public WacAccountStates? WacInternalState { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableFrontEndRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableFrontEndRoleInstanceResponse.cs new file mode 100644 index 000000000000..a51df47b2617 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableFrontEndRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class TableFrontEndRoleInstanceResponse : RoleInstanceResponseBase + { + public TableFrontEndRoleInstanceResponse(TableFrontEndRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.TableFrontend; + } + + public TableFrontEndRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableMasterRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableMasterRoleInstanceResponse.cs new file mode 100644 index 000000000000..f812b6deebff --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableMasterRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class TableMasterRoleInstanceResponse : RoleInstanceResponseBase + { + public TableMasterRoleInstanceResponse(TableMasterRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.TableMaster; + } + + public TableMasterRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableServerRoleInstanceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableServerRoleInstanceResponse.cs new file mode 100644 index 000000000000..bed88bbadf24 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableServerRoleInstanceResponse.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class TableServerRoleInstanceResponse : RoleInstanceResponseBase + { + public TableServerRoleInstanceResponse(TableServerRoleInstanceModel resource) : base(resource) + { + RoleType = RoleType.TableServer; + } + + public TableServerRoleInstanceEffectiveSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableServiceResponse.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableServiceResponse.cs new file mode 100644 index 000000000000..186316580e60 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Model/TableServiceResponse.cs @@ -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. +// ---------------------------------------------------------------------------------- + +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal class TableServiceResponse : ServiceResponseBase + { + public TableServiceResponse(TableServiceResponseResource resource) : base(resource, "TableService") + { + } + + public TableServiceSettings Settings { get; set; } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/DisableNode.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/DisableNode.cs new file mode 100644 index 000000000000..1cde4b28da59 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/DisableNode.cs @@ -0,0 +1,68 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +// +// +// Copyright (C) Microsoft. All rights reserved. +// +// + +using System; +using System.Globalization; +using System.Management.Automation; +using System.Net; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Disable-Node [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [[-NodeName] {string}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsLifecycle.Disable, Nouns.AdminNode, SupportsShouldProcess = true)] + public sealed class DisableAdminNode : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNullOrEmpty] + public string FarmName { get; set; } + + /// + /// Node name + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNullOrEmpty] + public string NodeName { get; set; } + + protected override void Execute() + { + if (ShouldProcess( + Resources.DisableNodeVerboseDescription.FormatInvariantCulture(NodeName, FarmName), + Resources.DisableNodeVerboseWarning.FormatInvariantCulture(NodeName, FarmName), + Resources.ShouldProcessCaption)) + { + var response = Client.Nodes.Disable(ResourceGroupName, FarmName, NodeName); + if (response.StatusCode != HttpStatusCode.OK) + { + throw new AdminException(string.Format(CultureInfo.InvariantCulture, Resources.OperationFailedErrorMessage, response.StatusCode)); + } + } + } + } +} + diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/EnableNode.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/EnableNode.cs new file mode 100644 index 000000000000..9955e771d210 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/EnableNode.cs @@ -0,0 +1,61 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using System.Net; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Enable-Node [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [[-NodeName] {string}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsLifecycle.Enable, Nouns.AdminNode, SupportsShouldProcess = true)] + public sealed class EnableAdminNode : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNullOrEmpty] + public string FarmName { get; set; } + + /// + /// Node name + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNullOrEmpty] + public string NodeName { get; set; } + + protected override void Execute() + { + if (ShouldProcess( + Resources.EnableNodeVerboseDescription.FormatInvariantCulture(NodeName, FarmName), + Resources.EnableNodeVerboseWarning.FormatInvariantCulture(NodeName, FarmName), + Resources.ShouldProcessCaption)) + { + var response = Client.Nodes.Enable(ResourceGroupName, FarmName, NodeName); + if (response.StatusCode != HttpStatusCode.OK) + { + throw new AdminException(string.Format(CultureInfo.InvariantCulture, Resources.OperationFailedErrorMessage, response.StatusCode)); + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNode.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNode.cs new file mode 100644 index 000000000000..d00cd742619e --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNode.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 System.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-Node [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [[-NodeName] {string}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminNode)] + public sealed class GetAdminNode : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// Node name + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 5)] + public string NodeName { get; set; } + + + protected override void Execute() + { + if (string.IsNullOrEmpty(NodeName)) + { + NodeListResponse nodes = Client.Nodes.List(ResourceGroupName, FarmName); + + WriteObject(nodes.Nodes.Select(_=>new NodeResponse(_)), true); + } + else + { + NodeGetResponse node = Client.Nodes.Get(ResourceGroupName, FarmName, NodeName); + WriteObject(new NodeResponse(node.Node)); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNodeMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNodeMetricDefinitions.cs new file mode 100644 index 000000000000..a939a6fee198 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNodeMetricDefinitions.cs @@ -0,0 +1,51 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminNodeMetricDefinition)] + public sealed class GetNodeMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// Node name + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public string NodeName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + return Client.Nodes.GetMetricDefinitions(ResourceGroupName, FarmName, NodeName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNodeMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNodeMetrics.cs new file mode 100644 index 000000000000..7a3dc6860e0a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Node/GetNodeMetrics.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminNodeMetric)] + public sealed class GetNodeMetrics : AdminMetricCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// Node name + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public string NodeName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + return Client.Nodes.GetMetrics(ResourceGroupName, FarmName, NodeName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Nouns.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Nouns.cs new file mode 100644 index 000000000000..49306c358290 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Nouns.cs @@ -0,0 +1,93 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Commands.StorageAdmin +{ + class Nouns + { + public const string Prefix = "ACS"; + + public const string Metric = "Metric"; + + public const string MetricDefinition = "MetricDefinition"; + + + // farm + public const string AdminFarm = Prefix + "Farm"; + + public const string AdminFarmMetric = AdminFarm + Metric; + + public const string AdminFarmMetricDefinition = AdminFarm + MetricDefinition; + + public const string AdminFarmEvent = Prefix + "Event"; + + public const string AdminFarmEventQuery = Prefix + "EventQuery"; + + // LogCollect + public const string Log = Prefix + "Log"; + + // node + public const string AdminNode = Prefix + "Node"; + + public const string AdminNodeMetric = AdminNode + Metric; + + public const string AdminNodeMetricDefinition = AdminNode + MetricDefinition; + + // blob server role instance + public const string AdminBlobServerRoleInstance = Prefix + "BlobServerRoleInstance"; + + // role instance + public const string AdminRoleInstance = Prefix + "RoleInstance"; + + // role instance + public const string AdminRoleInstanceSettingsPullNow = Prefix + "RoleInstancePullSettings"; + + public const string AdminRoleInstanceMetric = AdminRoleInstance + Metric; + + public const string AdminRoleInstanceMetricDefinition = AdminRoleInstance + MetricDefinition; + + // service + public const string AdminTableService = Prefix + "TableService"; + public const string AdminBlobService = Prefix + "BlobService"; + public const string AdminManagementService = Prefix + "ManagementService"; + + public const string AdminTableServiceMetric = AdminTableService + Metric; + public const string AdminTableServiceMetricDefinition = AdminTableService + MetricDefinition; + + public const string AdminBlobServiceMetric = AdminBlobService + Metric; + public const string AdminBlobServiceMetricDefinition = AdminBlobService + MetricDefinition; + + public const string AdminManagementServiceMetric = AdminManagementService + Metric; + public const string AdminManagementServiceMetricDefinition = AdminManagementService + MetricDefinition; + + // share + public const string AdminShare = Prefix + "Share"; + + public const string AdminShareMetric = AdminShare + Metric; + + public const string AdminShareMetricDefinition = AdminShare + MetricDefinition; + + // fault + public const string AdminFault = Prefix + "Fault"; + + // role instance + public const string AdminInstance = Prefix + "Instance"; + + // storage account + public const string AdminStorageAccount = Prefix + "StorageAccount"; + + // storage account deletion operation + public const string AdminStorageAccountDeletion = Prefix + "StorageAccountDeletion"; + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Properties/AssemblyInfo.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..f0d5722a28e3 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +// ---------------------------------------------------------------------------------- +// +// 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.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("Microsoft AzureStack Powershell ")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] + +[assembly: Guid("D4CA0CC1-CD0A-4CE2-A40D-2D8A082D8791")] + +[assembly: AssemblyVersion("0.9.2")] +[assembly: AssemblyFileVersion("0.9.2")] \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Resources.Designer.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Resources.Designer.cs new file mode 100644 index 000000000000..2a844b8de104 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Resources.Designer.cs @@ -0,0 +1,432 @@ +//------------------------------------------------------------------------------ +// +// 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.AzureStack.Commands.StorageAdmin { + 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 Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 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.AzureStack.Commands.StorageAdmin.Resources", typeof(Resources).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 Bad parameter set. + /// + internal static string BadParameterSet { + get { + return ResourceManager.GetString("BadParameterSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ACS Blob Service. + /// + internal static string BlobService { + get { + return ResourceManager.GetString("BlobService", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Disabling Node '{0}' in Storage cluster '{1}'.. + /// + internal static string DisableNodeVerboseDescription { + get { + return ResourceManager.GetString("DisableNodeVerboseDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to disable Node '{0}' in Storage cluster '{1}'?. + /// + internal static string DisableNodeVerboseWarning { + get { + return ResourceManager.GetString("DisableNodeVerboseWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enabling Node '{0}' in Storage cluster '{1}'.. + /// + internal static string EnableNodeVerboseDescription { + get { + return ResourceManager.GetString("EnableNodeVerboseDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to enable Node '{0}' in Storage cluster '{1}'?. + /// + internal static string EnableNodeVerboseWarning { + get { + return ResourceManager.GetString("EnableNodeVerboseWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to get undeleted storage account via Account Id or one of its properties is invalid: Tenant Subscription Id, Tenant View Id, Tenant Resource Group Name, Location.. + /// + internal static string FailedToGetAccount { + get { + return ResourceManager.GetString("FailedToGetAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to undelete storage account.. + /// + internal static string FailedToUndeleteAccount { + get { + return ResourceManager.GetString("FailedToUndeleteAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Azure profile is invalid, Make sure that you are in the Azure context with the Add-AzureEnvironment and Add-AzureAccount cmdlets.. + /// + internal static string InvalidProfile { + get { + return ResourceManager.GetString("InvalidProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This role type is not supported: '{0}'. + /// + internal static string InvalidRoleTypeErrorMessageFormat { + get { + return ResourceManager.GetString("InvalidRoleTypeErrorMessageFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ACS Management Service. + /// + internal static string ManagementService { + get { + return ResourceManager.GetString("ManagementService", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation is failed. Error code is: '{0}'. + /// + internal static string OperationFailedErrorMessage { + get { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If specified VersionedAccountName parameter, PartialAccountName, StorageAccountStatus or TenantSubscriptionId parameters must not be set.. + /// + internal static string OtherParameterMustNotSetWithVersionedAccountNameSet { + get { + return ResourceManager.GetString("OtherParameterMustNotSetWithVersionedAccountNameSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restarting role instance '{0}' with type '{1}'.. + /// + internal static string RestartRoleInstanceVerboseDescription { + get { + return ResourceManager.GetString("RestartRoleInstanceVerboseDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to restart role instance '{0}' with type '{1}'.. + /// + internal static string RestartRoleInstanceVerboseWarning { + get { + return ResourceManager.GetString("RestartRoleInstanceVerboseWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Retrieve properties of undeleted storage account to prepare for resource sync. + /// + internal static string RetrieveUndeletedStorageAccount { + get { + return ResourceManager.GetString("RetrieveUndeletedStorageAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Performing the operation set ACS Farm '{0}', {1}.. + /// + internal static string SetFarmDescription { + get { + return ResourceManager.GetString("SetFarmDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to perform the operation "set ACS Farm '{0}', {1}"?. + /// + internal static string SetFarmWarning { + get { + return ResourceManager.GetString("SetFarmWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Performing the operation set {0} {1}.. + /// + internal static string SetServiceDescription { + get { + return ResourceManager.GetString("SetServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' to '{1}'. + /// + internal static string SetServiceSettingParameter { + get { + return ResourceManager.GetString("SetServiceSettingParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to perform the operation "set {0}{1}"?. + /// + internal static string SetServiceWarning { + get { + return ResourceManager.GetString("SetServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + internal static string ShouldProcessCaption { + get { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Specified SMB share will be removed. + /// + internal static string ShouldProcessRemoveSmbShare { + get { + return ResourceManager.GetString("ShouldProcessRemoveSmbShare", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Blob server instance '{0}'.. + /// + internal static string StartBlobServerRoleInstanceVerboseDescription { + get { + return ResourceManager.GetString("StartBlobServerRoleInstanceVerboseDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to start Blob server role instance ‘{0}’.. + /// + internal static string StartBlobServerRoleInstanceVerboseWarning { + get { + return ResourceManager.GetString("StartBlobServerRoleInstanceVerboseWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping Blob server instance '{0}'.. + /// + internal static string StopBlobServerRoleInstanceVerboseDescription { + get { + return ResourceManager.GetString("StopBlobServerRoleInstanceVerboseDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to stop Blob server role instance ‘{0}’.. + /// + internal static string StopBlobServerRoleInstanceVerboseWarning { + get { + return ResourceManager.GetString("StopBlobServerRoleInstanceVerboseWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Account '{0}'. + /// + internal static string StorageAccount { + get { + return ResourceManager.GetString("StorageAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Account With VersionedAccountName '{0}'. + /// + internal static string StorageAccountAdminView { + get { + return ResourceManager.GetString("StorageAccountAdminView", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource Sync. + /// + internal static string SyncOperation { + get { + return ResourceManager.GetString("SyncOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ACS Table Service. + /// + internal static string TableService { + get { + return ResourceManager.GetString("TableService", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Both the parameters Token, AdminUri and SubscriptionId are required.. + /// + internal static string TokenAndAdminUriRequired { + get { + return ResourceManager.GetString("TokenAndAdminUriRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Triger resource sync now.. + /// + internal static string TriggerResourceSync { + get { + return ResourceManager.GetString("TriggerResourceSync", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Undelete. + /// + internal static string UndeleteOperation { + get { + return ResourceManager.GetString("UndeleteOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Performing the operation update the settings on ACS Role Instance '{0}' with type '{1}'.. + /// + internal static string UpdateRoleInstanceSettingDescription { + get { + return ResourceManager.GetString("UpdateRoleInstanceSettingDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to perform the operation "update the settings on ACS Role Instance '{0}' with type '{1}'"?. + /// + internal static string UpdateRoleInstanceSettingWarning { + get { + return ResourceManager.GetString("UpdateRoleInstanceSettingWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argument should be an absolute URI.. + /// + internal static string ValidateAbsoluteUriNotAbsolute { + get { + return ResourceManager.GetString("ValidateAbsoluteUriNotAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to System.Uri type is expected.. + /// + internal static string ValidateAbsoluteUriWrongType { + get { + return ResourceManager.GetString("ValidateAbsoluteUriWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argument should be a valid UNC.. + /// + internal static string ValidateUncNotValidUnc { + get { + return ResourceManager.GetString("ValidateUncNotValidUnc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to System.Uri type is expected.. + /// + internal static string ValidateUncWrongType { + get { + return ResourceManager.GetString("ValidateUncWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait a few minutes to let frontdoor finish sync job. After that storage account can be accessed by tenant user.. + /// + internal static string WaitAfterArmSync { + get { + return ResourceManager.GetString("WaitAfterArmSync", resourceCulture); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Resources.resx b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Resources.resx new file mode 100644 index 000000000000..525b804d7848 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Resources.resx @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ACS Blob Service + + + Disabling Node '{0}' in Storage cluster '{1}'. + + + Are you sure you want to disable Node '{0}' in Storage cluster '{1}'? + + + Enabling Node '{0}' in Storage cluster '{1}'. + + + Are you sure you want to enable Node '{0}' in Storage cluster '{1}'? + + + Failed to get undeleted storage account via Account Id or one of its properties is invalid: Tenant Subscription Id, Tenant View Id, Tenant Resource Group Name, Location. + + + Failed to undelete storage account. + + + This role type is not supported: '{0}' + + + ACS Management Service + + + Operation is failed. Error code is: '{0}' + {0} is the error code. + + + If specified VersionedAccountName parameter, PartialAccountName, StorageAccountStatus or TenantSubscriptionId parameters must not be set. + + + Restarting role instance '{0}' with type '{1}'. + + + Are you sure you want to restart role instance '{0}' with type '{1}'. + + + Performing the operation set {0} {1}. + + + '{0}' to '{1}' + whilte space in the beginning can't be discarded, it's treated as seperator. + + + Are you sure you want to perform the operation "set {0}{1}"? + + + Retrieve properties of undeleted storage account to prepare for resource sync + + + Confirm + + + Specified SMB share will be removed + + + Starting Blob server instance '{0}'. + + + Are you sure you want to start Blob server role instance ‘{0}’. + + + Stopping Blob server instance '{0}'. + + + Are you sure you want to stop Blob server role instance ‘{0}’. + + + ACS Table Service + + + Performing the operation update the settings on ACS Role Instance '{0}' with type '{1}'. + + + Are you sure you want to perform the operation "update the settings on ACS Role Instance '{0}' with type '{1}'"? + + + Storage Account '{0}' + + + Storage Account With VersionedAccountName '{0}' + + + Resource Sync + + + Triger resource sync now. + + + Undelete + + + Argument should be an absolute URI. + + + System.Uri type is expected. + + + Argument should be a valid UNC. + + + System.Uri type is expected. + + + Please wait a few minutes to let frontdoor finish sync job. After that storage account can be accessed by tenant user. + + + The Azure profile is invalid, Make sure that you are in the Azure context with the Add-AzureEnvironment and Add-AzureAccount cmdlets. + + + Both the parameters Token, AdminUri and SubscriptionId are required. + + + Performing the operation set ACS Farm '{0}', {1}. + {0} is the farm name, {1} is the updated settings key/value pair. + + + Are you sure you want to perform the operation "set ACS Farm '{0}', {1}"? + + + Bad parameter set + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstance.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstance.cs new file mode 100644 index 000000000000..d173432242d9 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstance.cs @@ -0,0 +1,135 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-RoleInstance [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-RoleType] {enum} [[-InstanceId] {string}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminRoleInstance)] + public sealed class GetAdminNodeRoleInstance : AdminCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// name of role + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public RoleType RoleType + { + get; + set; + } + + /// + /// instance identifier + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string InstanceId + { + get; + set; + } + + protected override void Execute() + { + object resultObject; + if (string.IsNullOrEmpty(InstanceId)) + { + switch (RoleType) + { + case RoleType.AccountContainerserver: + resultObject = Client.AccountContainerServerInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_=>new AccountContainerRoleInstanceResponse(_)); + break; + case RoleType.BlobFrontend: + resultObject = Client.BlobFrontendInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new BlobFrontEndRoleInstanceResponse(_)); + break; + case RoleType.TableFrontend: + resultObject = Client.TableFrontendInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new TableFrontEndRoleInstanceResponse(_)); + break; + case RoleType.BlobServer: + resultObject = Client.BlobServerInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new BlobServerRoleInstanceResponse(_)); + break; + case RoleType.TableServer: + resultObject = Client.TableServerInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new TableServerRoleInstanceResponse(_)); + break; + case RoleType.HealthMonitoringserver: + resultObject = Client.HealthMonitoringServerInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new MonitoringServerRoleInstanceResponse(_)); + break; + case RoleType.MetricsServer: + resultObject = Client.MetricsServerInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new MetricsServerRoleInstanceResponse(_)); + break; + case RoleType.TableMaster: + resultObject = Client.TableMasterInstances.List(ResourceGroupName, FarmName).RoleInstances.Select(_ => new TableMasterRoleInstanceResponse(_)); + break; + default: + throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, Resources.InvalidRoleTypeErrorMessageFormat, RoleType)); + } + } + else + { + switch (RoleType) + { + case RoleType.AccountContainerserver: + resultObject = new AccountContainerRoleInstanceResponse(Client.AccountContainerServerInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.BlobFrontend: + resultObject = new BlobFrontEndRoleInstanceResponse(Client.BlobFrontendInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.TableFrontend: + resultObject = new TableFrontEndRoleInstanceResponse(Client.TableFrontendInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.BlobServer: + resultObject = new BlobServerRoleInstanceResponse(Client.BlobServerInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.TableServer: + resultObject = new TableServerRoleInstanceResponse(Client.TableServerInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.HealthMonitoringserver: + resultObject = new MonitoringServerRoleInstanceResponse(Client.HealthMonitoringServerInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.MetricsServer: + resultObject = new MetricsServerRoleInstanceResponse(Client.MetricsServerInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + case RoleType.TableMaster: + resultObject = new TableMasterRoleInstanceResponse(Client.TableMasterInstances.Get(ResourceGroupName, FarmName, InstanceId).RoleInstance); + break; + default: + throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, Resources.InvalidRoleTypeErrorMessageFormat, RoleType)); + } + } + WriteObject(resultObject, true); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstanceMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstanceMetricDefinitions.cs new file mode 100644 index 000000000000..f786ae62e365 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstanceMetricDefinitions.cs @@ -0,0 +1,103 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminRoleInstanceMetricDefinition)] + public sealed class GetRoleInstanceMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// name of role + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public RoleType RoleType + { + get; + set; + } + + /// + /// instance identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string InstanceId + { + get; + set; + } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + MetricDefinitionsResult resultObject; + + switch (RoleType) + { + case RoleType.AccountContainerserver: + resultObject = Client.AccountContainerServerInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.BlobFrontend: + resultObject = Client.BlobFrontendInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.TableFrontend: + resultObject = Client.TableFrontendInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.BlobServer: + resultObject = Client.BlobServerInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.TableServer: + resultObject = Client.TableServerInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.HealthMonitoringserver: + resultObject = Client.HealthMonitoringServerInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.MetricsServer: + resultObject = Client.MetricsServerInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.TableMaster: + resultObject = Client.TableMasterInstances.GetMetricDefinitions(ResourceGroupName, FarmName, InstanceId, filter); + break; + default: + throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, Resources.InvalidRoleTypeErrorMessageFormat, RoleType)); + } + + return resultObject; + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstanceMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstanceMetrics.cs new file mode 100644 index 000000000000..d5b409a7a0f5 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/GetRoleInstanceMetrics.cs @@ -0,0 +1,103 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminRoleInstanceMetric)] + public sealed class GetRoleInstanceMetrics : AdminMetricCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// name of role + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public RoleType RoleType + { + get; + set; + } + + /// + /// instance identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string InstanceId + { + get; + set; + } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + MetricsResult resultObject; + switch (RoleType) + { + case RoleType.AccountContainerserver: + resultObject = Client.AccountContainerServerInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.BlobFrontend: + resultObject = Client.BlobFrontendInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.TableFrontend: + resultObject = Client.TableFrontendInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.BlobServer: + resultObject = Client.BlobServerInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.TableServer: + resultObject = Client.TableServerInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.HealthMonitoringserver: + resultObject = Client.HealthMonitoringServerInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.MetricsServer: + resultObject = Client.MetricsServerInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + case RoleType.TableMaster: + resultObject = Client.TableMasterInstances.GetMetrics(ResourceGroupName, FarmName, InstanceId, filter); + break; + default: + throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, Resources.InvalidRoleTypeErrorMessageFormat, RoleType)); + } + return resultObject; + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/RestartRoleInstance.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/RestartRoleInstance.cs new file mode 100644 index 000000000000..07ec665fd2c1 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/RestartRoleInstance.cs @@ -0,0 +1,111 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using System.Net; +using Microsoft.Azure; +using Microsoft.AzureStack.Commands.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Restart-RoleInstance [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-RoleType] {enum} [-InstanceId] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsLifecycle.Restart, Nouns.AdminRoleInstance, SupportsShouldProcess = true)] + public sealed class RestartRoleInstance : AdminCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNullOrEmpty] + public string FarmName + { + get; + set; + } + + /// + /// name of role + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public RoleType RoleType + { + get; + set; + } + + /// + /// instance identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNullOrEmpty] + public string InstanceId + { + get; + set; + } + + protected override void Execute() + { + if (ShouldProcess( + Resources.RestartRoleInstanceVerboseDescription.FormatInvariantCulture(InstanceId, RoleType), + Resources.RestartRoleInstanceVerboseWarning.FormatInvariantCulture(InstanceId, RoleType), + Resources.ShouldProcessCaption)) + { + AzureOperationResponse response; + switch (RoleType) + { + case RoleType.AccountContainerserver: + response = Client.AccountContainerServerInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.BlobFrontend: + response = Client.BlobFrontendInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.TableFrontend: + response = Client.TableFrontendInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.BlobServer: + response = Client.BlobServerInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.TableServer: + response = Client.TableServerInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.HealthMonitoringserver: + response = Client.HealthMonitoringServerInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.MetricsServer: + response = Client.MetricsServerInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + case RoleType.TableMaster: + response = Client.TableMasterInstances.Restart(ResourceGroupName, FarmName, InstanceId); + break; + default: + throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, Resources.InvalidRoleTypeErrorMessageFormat, RoleType)); + } + + if (response.StatusCode != HttpStatusCode.OK) + { + throw new AdminException(string.Format(CultureInfo.InvariantCulture, Resources.OperationFailedErrorMessage, response.StatusCode)); + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/RoleInstanceSettingsPullNow.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/RoleInstanceSettingsPullNow.cs new file mode 100644 index 000000000000..61e81d37c046 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/RoleInstanceSettingsPullNow.cs @@ -0,0 +1,105 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Globalization; +using System.Management.Automation; +using Microsoft.AzureStack.Commands.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Update-RoleInstance [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-RoleType] {enum} [[-InstanceId] {string}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsData.Update, Nouns.AdminRoleInstance, SupportsShouldProcess = true)] + public sealed class RoleInstanceSettingsPullNow : AdminCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// name of role + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public RoleType RoleType { get; set; } + + /// + /// instance identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string InstanceId { get; set; } + + + protected override void Execute() + { + if (ShouldProcess( + Resources.UpdateRoleInstanceSettingDescription.FormatInvariantCulture(InstanceId, RoleType), + Resources.UpdateRoleInstanceSettingWarning.FormatInvariantCulture(InstanceId, RoleType), + Resources.ShouldProcessCaption)) + { + object resultObject; + + switch (RoleType) + { + case RoleType.AccountContainerserver: + resultObject = Client.AccountContainerServerInstances.SettingsPullNow(ResourceGroupName, + FarmName, InstanceId); + break; + case RoleType.BlobFrontend: + resultObject = Client.BlobFrontendInstances.SettingsPullNow(ResourceGroupName, FarmName, + InstanceId); + break; + case RoleType.TableFrontend: + resultObject = Client.TableFrontendInstances.SettingsPullNow(ResourceGroupName, FarmName, + InstanceId); + break; + case RoleType.BlobServer: + resultObject = Client.BlobServerInstances.SettingsPullNow(ResourceGroupName, FarmName, + InstanceId); + break; + case RoleType.TableServer: + resultObject = Client.TableServerInstances.SettingsPullNow(ResourceGroupName, FarmName, + InstanceId); + break; + case RoleType.HealthMonitoringserver: + resultObject = Client.HealthMonitoringServerInstances.SettingsPullNow(ResourceGroupName, + FarmName, InstanceId); + break; + case RoleType.MetricsServer: + resultObject = Client.MetricsServerInstances.SettingsPullNow(ResourceGroupName, FarmName, + InstanceId); + break; + case RoleType.TableMaster: + resultObject = Client.TableMasterInstances.SettingsPullNow(ResourceGroupName, FarmName, + InstanceId); + break; + default: + throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, + Resources.InvalidRoleTypeErrorMessageFormat, RoleType)); + } + WriteObject(resultObject, true); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/StartBlobServerRoleInstance.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/StartBlobServerRoleInstance.cs new file mode 100644 index 000000000000..9c3991b97858 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/StartBlobServerRoleInstance.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.Globalization; +using System.Management.Automation; +using System.Net; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Start-BlobServerRoleInstance [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-InstanceId] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsLifecycle.Start, Nouns.AdminBlobServerRoleInstance, SupportsShouldProcess = true)] + public sealed class StartBlobServerRoleInstance : AdminCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNullOrEmpty] + public string FarmName + { + get; + set; + } + + /// + /// instance identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNullOrEmpty] + public string InstanceId + { + get; + set; + } + + protected override void Execute() + { + if (ShouldProcess( + Resources.StartBlobServerRoleInstanceVerboseDescription.FormatInvariantCulture(InstanceId), + Resources.StartBlobServerRoleInstanceVerboseWarning.FormatInvariantCulture(InstanceId), + Resources.ShouldProcessCaption)) + { + var response = Client.BlobServerInstances.Start(ResourceGroupName, FarmName, InstanceId); + + if (response.StatusCode != HttpStatusCode.OK) + { + throw new AdminException(string.Format(CultureInfo.InvariantCulture, Resources.OperationFailedErrorMessage, response.StatusCode)); + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/StopBlobServerRoleInstance.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/StopBlobServerRoleInstance.cs new file mode 100644 index 000000000000..4cea201af4fe --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/RoleInstance/StopBlobServerRoleInstance.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.Globalization; +using System.Management.Automation; +using System.Net; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Stop-BlobServerRoleInstance [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-InstanceId] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsLifecycle.Stop, Nouns.AdminBlobServerRoleInstance, SupportsShouldProcess = true)] + public sealed class StopBlobServerRoleInstance : AdminCmdlet + { + /// + /// farm identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNullOrEmpty] + public string FarmName + { + get; + set; + } + + /// + /// instance identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNullOrEmpty] + public string InstanceId + { + get; + set; + } + + protected override void Execute() + { + if (ShouldProcess( + Resources.StopBlobServerRoleInstanceVerboseDescription.FormatInvariantCulture(InstanceId), + Resources.StopBlobServerRoleInstanceVerboseWarning.FormatInvariantCulture(InstanceId), + Resources.ShouldProcessCaption)) + { + var response = Client.BlobServerInstances.Stop(ResourceGroupName, FarmName, InstanceId); + if (response.StatusCode != HttpStatusCode.OK) + { + throw new AdminException(string.Format(CultureInfo.InvariantCulture, + Resources.OperationFailedErrorMessage, response.StatusCode)); + } + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobService.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobService.cs new file mode 100644 index 000000000000..a9b2012e011d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobService.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-BlobService [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminBlobService)] + public sealed class GetBlobService : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + + protected override void Execute() + { + BlobServiceGetResponse result = Client.BlobService.Get(ResourceGroupName, FarmName); + WriteObject(new BlobServiceResponse(result.Resource)); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobServiceMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobServiceMetricDefinitions.cs new file mode 100644 index 000000000000..9ead00633ef7 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobServiceMetricDefinitions.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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminBlobServiceMetricDefinition)] + public sealed class GetBlobServiceMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + return Client.BlobService.GetMetricDefinitions(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobServiceMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobServiceMetrics.cs new file mode 100644 index 000000000000..d4aa9fd5dc5e --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetBlobServiceMetrics.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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminBlobServiceMetric)] + public sealed class GetBlobServiceMetrics : AdminMetricCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + return Client.BlobService.GetMetrics(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementService.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementService.cs new file mode 100644 index 000000000000..09bfa559c67d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementService.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-ManagementService [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminManagementService)] + public sealed class GetManagementService : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + + protected override void Execute() + { + ManagementServiceGetResponse result = Client.ManagementService.Get(ResourceGroupName, FarmName); + WriteObject(new ManagementServiceResponse(result.Resource)); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementServiceMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementServiceMetricDefinitions.cs new file mode 100644 index 000000000000..d7adb09560d4 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementServiceMetricDefinitions.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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminManagementServiceMetricDefinition)] + public sealed class GetManagementServiceMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + return Client.ManagementService.GetMetricDefinitions(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementServiceMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementServiceMetrics.cs new file mode 100644 index 000000000000..3cfb4c677b6c --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetManagementServiceMetrics.cs @@ -0,0 +1,43 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminManagementServiceMetric)] + public sealed class GetManagementServiceMetrics : AdminMetricCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + return Client.ManagementService.GetMetrics(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableService.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableService.cs new file mode 100644 index 000000000000..90a822b83378 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableService.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-TableService [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminTableService)] + public sealed class GetTableService : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + + protected override void Execute() + { + TableServiceGetResponse result = Client.TableService.Get(ResourceGroupName, FarmName); + WriteObject(new TableServiceResponse(result.Resource)); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableServiceMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableServiceMetricDefinitions.cs new file mode 100644 index 000000000000..853faae6cbdb --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableServiceMetricDefinitions.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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminTableServiceMetricDefinition)] + public sealed class GetTableServiceMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + return Client.TableService.GetMetricDefinitions(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableServiceMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableServiceMetrics.cs new file mode 100644 index 000000000000..72334fea4e5d --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/GetTableServiceMetrics.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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminTableServiceMetric)] + public sealed class GetTableServiceMetrics : AdminMetricCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + return Client.TableService.GetMetrics(ResourceGroupName, FarmName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetBlobService.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetBlobService.cs new file mode 100644 index 000000000000..83778a65cbd7 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetBlobService.cs @@ -0,0 +1,114 @@ +// ---------------------------------------------------------------------------------- +// +// 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; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Set, Nouns.AdminBlobService, SupportsShouldProcess = true)] + public sealed class SetBlobService : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + + /// + /// CpuBasedKeepAliveThrottlingEnabled + /// + [Parameter] + [SettingField] + public bool? FrontEndCpuBasedKeepAliveThrottlingEnabled + { + get; + set; + } + + + /// + /// MemoryThrottlingEnabled + /// + [Parameter] + [SettingField] + public bool? FrontEndMemoryThrottlingEnabled + { + get; + set; + } + + /// + /// ContainerGcInterval + /// + [Parameter] + [SettingField] + public int? BlobSvcContainerGcInterval + { + get; + set; + } + + /// + /// ShallowGcInterval + /// + [Parameter] + [SettingField] + public int? BlobSvcShallowGcInterval + { + get; + set; + } + + /// + /// StreamMapMinContainerOccupancyPercent + /// + [Parameter] + [SettingField] + public int? BlobSvcStreamMapMinContainerOccupancyPercent + { + get; + set; + } + + protected override void Execute() + { + string confirmString; + BlobServiceWritableSettings settings = Tools.ToSettingsObject(this, out confirmString); + + if (ShouldProcess( + Resources.SetServiceDescription.FormatInvariantCulture(Resources.BlobService, confirmString), + Resources.SetServiceWarning.FormatInvariantCulture(Resources.BlobService, confirmString), + Resources.ShouldProcessCaption)) + { + BlobServiceGetResponse result = Client.BlobService.Patch(ResourceGroupName, FarmName, new BlobServicePatchParameters + { + BlobService = new BlobServiceRequest + { + Settings = settings + } + }); + WriteObject(new BlobServiceResponse(result.Resource)); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetManagementService.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetManagementService.cs new file mode 100644 index 000000000000..2fa5d953035a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetManagementService.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.Collections; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Set, Nouns.AdminManagementService, SupportsShouldProcess = true)] + public sealed class SetManagementService : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// WacContainerGcFullScanIntervalInSeconds + /// + [Parameter] + [SettingField] + public int? WacContainerGcFullScanIntervalInSeconds { get; set; } + + /// + /// WacAccountGcFullScanIntervalInSeconds + /// + [Parameter] + [SettingField] + public int? WacAccountGcFullScanIntervalInSeconds { get; set; } + + protected override void Execute() + { + string confirmString; + ManagementServiceWritableSettings settings = Tools.ToSettingsObject(this, out confirmString); + if (ShouldProcess( + Resources.SetServiceDescription.FormatInvariantCulture(Resources.ManagementService, confirmString), + Resources.SetServiceWarning.FormatInvariantCulture(Resources.ManagementService, confirmString), + Resources.ShouldProcessCaption)) + { + ManagementServiceGetResponse result = Client.ManagementService.Patch(ResourceGroupName, FarmName, + new ManagementServicePatchParameters + { + ManagementService = new ManagementServiceRequest + { + Settings = settings + } + }); + WriteObject(new ManagementServiceResponse(result.Resource)); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetTableService.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetTableService.cs new file mode 100644 index 000000000000..d665d4893e15 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Service/SetTableService.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.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Set, Nouns.AdminTableService, SupportsShouldProcess = true)] + public sealed class SetTableService : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// CpuBasedKeepAliveThrottlingEnabled + /// + [Parameter] + [SettingField] + public bool? FrontEndCpuBasedKeepAliveThrottlingEnabled { get; set; } + + /// + /// MemoryThrottlingEnabled + /// + [Parameter] + [SettingField] + public bool? FrontEndMemoryThrottlingEnabled { get; set; } + + protected override void Execute() + { + string confirmString; + TableServiceWritableSettings settings = Tools.ToSettingsObject(this, out confirmString); + if (ShouldProcess( + Resources.SetServiceDescription.FormatInvariantCulture(Resources.TableService, confirmString), + Resources.SetServiceWarning.FormatInvariantCulture(Resources.TableService, confirmString), + Resources.ShouldProcessCaption)) + { + TableServiceGetResponse result = Client.TableService.Patch(ResourceGroupName, FarmName, + new TableServicePatchParameters + { + TableService = new TableServiceRequest + { + Settings = settings + } + }); + WriteObject(new TableServiceResponse(result.Resource)); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/SettingFieldAttribute.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/SettingFieldAttribute.cs new file mode 100644 index 000000000000..124db76eaad2 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/SettingFieldAttribute.cs @@ -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. +// ---------------------------------------------------------------------------------- + + +using System; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Setting Field Attribute + /// + [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] + public sealed class SettingFieldAttribute : Attribute + { + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShare.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShare.cs new file mode 100644 index 000000000000..ee31b1cce63f --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShare.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.Linq; +using System.Management.Automation; +using Microsoft.AzureStack.Management.StorageAdmin; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// get shares + /// + /// SYNTAX + /// Get-Share [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-ShareName] {string} [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminShare)] + public sealed class GetAdminShare : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string FarmName + { + get; + set; + } + + /// + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string ShareName + { + get; + set; + } + + protected override void Execute() + { + if (string.IsNullOrEmpty(ShareName)) + { + var shares = Client.Shares.List(ResourceGroupName, FarmName); + + WriteObject(shares.Shares.Select(_=>new ShareResponse(_)), true); + } + else + { + var share = Client.Shares.Get(ResourceGroupName, FarmName, ShareName); + + WriteObject(new ShareResponse(share.Share)); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShareMetricDefinitions.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShareMetricDefinitions.cs new file mode 100644 index 000000000000..63d2a6bbd33a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShareMetricDefinitions.cs @@ -0,0 +1,62 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-ShareMetricDefinition [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [-ShareName] {string} [[-MetricNames] {string[]}] [ {CommonParameters}] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminShareMetricDefinition)] + public sealed class GetShareMetricDefinitions : AdminMetricDefinitionCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string FarmName + { + get; + set; + } + + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true)] + [ValidateNotNull] + public string ShareName + { + get; + set; + } + + /// + /// + /// + /// + /// + protected override MetricDefinitionsResult GetMetricDefinitionsResult(string filter) + { + return Client.Shares.GetMetricDefinitions(ResourceGroupName, FarmName, ShareName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShareMetrics.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShareMetrics.cs new file mode 100644 index 000000000000..434a9f3b5505 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Share/GetShareMetrics.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminShareMetric)] + public sealed class GetShareMetric : AdminMetricCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// share name + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 8)] + public string ShareName { get; set; } + + /// + /// + /// + /// + /// + protected override MetricsResult GetMetricsResult(string filter) + { + return Client.Shares.GetMetrics(ResourceGroupName, FarmName, ShareName, filter); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/GetStorageAccountWithAdminInfo.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/GetStorageAccountWithAdminInfo.cs new file mode 100644 index 000000000000..e846e9f4342f --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/GetStorageAccountWithAdminInfo.cs @@ -0,0 +1,107 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Management.Automation; +using System.Globalization; +using Microsoft.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Get-StorageAccountsWithAdminInfo [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [[-TenantSubscriptionId] {string}] [[-StorageAccountName] {string}] + /// [[-StorageAccountStatus] {int}] [[-AccountId] {long}] [-Summary]] + /// + /// + [Cmdlet(VerbsCommon.Get, Nouns.AdminStorageAccount, DefaultParameterSetName = ListAccountsParamSet)] + public sealed class GetStorageAccountsWithAdminInfo : AdminCmdlet + { + const string ListAccountsParamSet = "ListMultipleAccounts"; + const string GetSingleAccountParamSet = "GetSingleAccount"; + + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// Tenant Subscription Id + /// + [Parameter(Mandatory = false, Position = 5, ParameterSetName = ListAccountsParamSet)] + public string TenantSubscriptionId { get; set; } + + /// + /// Storage Account Name + /// + [Parameter(Mandatory = false, Position = 6, ParameterSetName = ListAccountsParamSet)] + public string PartialAccountName { get; set; } + + /// + /// Storage Account Status + /// + [Parameter(Mandatory = false, Position = 7, ParameterSetName = ListAccountsParamSet)] + public int? StorageAccountStatus { get; set; } + + /// + /// Storage Account AccountId + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 8, ParameterSetName = GetSingleAccountParamSet)] + public long AccountId { get; set; } + + /// + /// Only need return summary information if not specified + /// + [Parameter(Mandatory = false, Position = 9)] + public SwitchParameter Detail { get; set; } + + protected override void Execute() + { + List> filters = new List>(); + + switch (ParameterSetName) + { + case GetSingleAccountParamSet: + filters.Add(new KeyValuePair(StorageAccountSearchFilterParameter.VersionedAccountName, AccountId.ToString(CultureInfo.InvariantCulture))); + break; + case ListAccountsParamSet: + if (TenantSubscriptionId != null) + filters.Add(new KeyValuePair(StorageAccountSearchFilterParameter.TenantSubscriptionId, TenantSubscriptionId)); + if (PartialAccountName != null) + filters.Add(new KeyValuePair(StorageAccountSearchFilterParameter.PartialAccountName, PartialAccountName)); + if (StorageAccountStatus.HasValue == true) + filters.Add(new KeyValuePair(StorageAccountSearchFilterParameter.StorageAccountStatus, StorageAccountStatus.Value.ToString(CultureInfo.InvariantCulture))); + break; + } + string filter = Tools.GenerateStorageAccountsSearchFilter(filters); + var response = Client.StorageAccounts.List(ResourceGroupName, FarmName, filter, !Detail.IsPresent); + if (response.StatusCode == System.Net.HttpStatusCode.OK) + { + List adminViewList = new List(); + foreach (StorageAccountModel model in response.StorageAccounts) + { + adminViewList.Add(new StorageAccountResponse(model, FarmName)); + } + WriteObject(adminViewList, true); + } + else + WriteObject(response, true); + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/SyncStorageAccount.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/SyncStorageAccount.cs new file mode 100644 index 000000000000..7802373ad199 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/SyncStorageAccount.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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; +using System.Globalization; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Sync-StorageAccount [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-AccountName] {string} [-ResourceLocation] {string} [-TenantSubscriptionId] {string} + /// + /// + [Cmdlet(VerbsData.Sync, Nouns.AdminStorageAccount, SupportsShouldProcess = true)] + public sealed class SyncStorageAccount : AdminCmdlet + { + /// + /// Storage Account Name + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string TenantAccountName { get; set; } + + /// + /// Tenant Subscription Id + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + [ValidateNotNull] + public string TenantSubscriptionId { get; set; } + + /// + /// Resource Location + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 6)] + [ValidateNotNull] + public string Location { get; set; } + + /// + /// Tenant Resource Group + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 7)] + [ValidateNotNull] + public string TenantResourceGroup { get; set; } + + /// + /// Specify storage account api version whic resource was created with + /// + [Parameter(Mandatory = false, Position = 8)] + public string StorageAccountApiVersion { get; set; } + + + internal static string DefaultStorageAccountApiVersion = "2015-06-15"; + internal static string SyncTargetOperation = "Create"; + + internal static string BuildSyncTargetId(string tenantSubscriptionId, string resourceGroupName, string accountName) + { + return "/subscriptions/" + tenantSubscriptionId + "/resourcegroups/" + resourceGroupName + "/providers/Microsoft.Storage/storageAccounts/" + accountName; + } + + protected override void Execute() + { + StorageAccountSyncRequest req = new StorageAccountSyncRequest(); + + if (StorageAccountApiVersion == null) + StorageAccountApiVersion = DefaultStorageAccountApiVersion; + req.ApiVersion = StorageAccountApiVersion; + req.TargetOperaton = SyncTargetOperation; + req.ResourceLocation = Location; + req.Id = BuildSyncTargetId(TenantSubscriptionId, TenantResourceGroup, TenantAccountName); + + WriteObject(req, true); + + if (ShouldProcess( + string.Format(CultureInfo.InvariantCulture, Resources.StorageAccount, req.Id), + string.Format(CultureInfo.InvariantCulture, Resources.SyncOperation))) + { + StorageAccountSyncResponse syncResponse = Client.StorageAccounts.Sync(TenantSubscriptionId, TenantResourceGroup, req); + WriteObject(syncResponse, true); + + WriteWarning(Resources.WaitAfterArmSync); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/UndeleteStorageAccount.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/UndeleteStorageAccount.cs new file mode 100644 index 000000000000..553f7d8262d0 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/StorageAccount/UndeleteStorageAccount.cs @@ -0,0 +1,103 @@ +// ---------------------------------------------------------------------------------- +// +// 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.AzureStack.Management.StorageAdmin; +using Microsoft.AzureStack.Management.StorageAdmin.Models; +using System.Globalization; +using System; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// SYNTAX + /// Undo-StorageAccountDeletion [-SubscriptionId] {string} [-Token] {string} [-AdminUri] {Uri} [-ResourceGroupName] {string} + /// [-SkipCertificateValidation] [-FarmName] {string} [[-AccountId] {long}] [[-NewAccountName] {string}] [-TenantSubscriptionId] {string} [-Sync] {bool} [-ResourceLocation] {string} + /// + /// + [Cmdlet(VerbsCommon.Undo, Nouns.AdminStorageAccountDeletion, SupportsShouldProcess = true)] + public sealed class UndeleteStorageAccount : AdminCmdlet + { + /// + /// Farm Identifier + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 4)] + [ValidateNotNull] + public string FarmName { get; set; } + + /// + /// Storage Account Name + /// + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 5)] + public long AccountId { get; set; } + + /// + /// Storage Account Name + /// + [Parameter(Mandatory = false, Position = 6)] + public string NewAccountName { get; set; } + + /// + /// Specify storage account api version whic resource was created with + /// + [Parameter(Mandatory = false, Position = 7)] + public string StorageAccountApiVersion { get; set; } + + protected override void Execute() + { + StorageAccountUndeleteParameters undeleteParam = new StorageAccountUndeleteParameters + { + NewAccountName = NewAccountName + }; + if (ShouldProcess( + string.Format(CultureInfo.InvariantCulture, Resources.StorageAccountAdminView, AccountId), + string.Format(CultureInfo.InvariantCulture, Resources.UndeleteOperation))) + { + var response = Client.StorageAccounts.Undelete(ResourceGroupName, FarmName, AccountId.ToString(CultureInfo.InvariantCulture), undeleteParam); + if (response.StatusCode != System.Net.HttpStatusCode.OK) + { + throw new ApplicationException(String.Format(CultureInfo.InvariantCulture, Resources.FailedToUndeleteAccount)); + } + + // get recovered account to set parameters for resource sync + WriteVerbose(Resources.RetrieveUndeletedStorageAccount); + StorageAccountListResponse accounts = Client.StorageAccounts.List(ResourceGroupName, FarmName, "{versionedaccountname eq '" + AccountId + "'}", true); + if (accounts.StatusCode != System.Net.HttpStatusCode.OK || + accounts.StorageAccounts.Count == 0 || + accounts.StorageAccounts[0].Properties == null || + accounts.StorageAccounts[0].Properties.TenantSubscriptionId.Equals(Guid.Empty) == true || + accounts.StorageAccounts[0].Properties.TenantViewId == null || + accounts.StorageAccounts[0].Properties.TenantResourceGroupName == null || + accounts.StorageAccounts[0].Location == null) + { + throw new ApplicationException(String.Format(CultureInfo.InvariantCulture, Resources.FailedToGetAccount)); + } + + // trigger resource sync + WriteVerbose(Resources.TriggerResourceSync); + StorageAccountSyncRequest req = new StorageAccountSyncRequest(); + if (StorageAccountApiVersion == null) + StorageAccountApiVersion = SyncStorageAccount.DefaultStorageAccountApiVersion; + req.ApiVersion = StorageAccountApiVersion; + req.TargetOperaton = SyncStorageAccount.SyncTargetOperation; + req.ResourceLocation = accounts.StorageAccounts[0].Location; + req.Id = accounts.StorageAccounts[0].Properties.TenantViewId; + + Client.StorageAccounts.Sync(accounts.StorageAccounts[0].Properties.TenantSubscriptionId.ToString(), accounts.StorageAccounts[0].Properties.TenantResourceGroupName, req); + + WriteWarning(Resources.WaitAfterArmSync); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Tools.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Tools.cs new file mode 100644 index 000000000000..38e91888c0f4 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Tools.cs @@ -0,0 +1,142 @@ +// ---------------------------------------------------------------------------------- +// +// 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; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Xml; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + internal static class Tools + { + private static readonly string filterParameterSeperator = " and "; + + private static readonly string filterParameterConditionEqual = " eq "; + + public static TSettings ToSettingsObject(TCmdlet cmd, out string confirmString) where TSettings: new() + { + List updatedSettingStrings = new List(); + TSettings ret = new TSettings(); + foreach (PropertyInfo propertyInfo in typeof (TCmdlet).GetProperties().Where(_=>_.GetCustomAttributes(typeof(SettingFieldAttribute)).Any())) + { + var settingValue = propertyInfo.GetValue(cmd); + if (settingValue != null) + { + PropertyInfo propertyInfoInSettings = typeof(TSettings).GetProperty(propertyInfo.Name, BindingFlags.Public | BindingFlags.Instance); + if (propertyInfoInSettings == null) + { + throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "Setting key '{0}' is not valid.", propertyInfo.Name)); + } + propertyInfoInSettings.SetValue(ret, settingValue); + updatedSettingStrings.Add(Resources.SetServiceSettingParameter.FormatInvariantCulture(propertyInfo.Name, settingValue)); + } + } + confirmString = string.Join("", updatedSettingStrings); + return ret; + } + + public static string GenerateFilter(string[] metricNames) + { + string filter = string.Empty; + + if (metricNames != null && metricNames.Any()) + { + List conditions = metricNames.Select(_ => ("name.value eq '" + _ + "'")).ToList(); + + if (conditions.Count > 1) + { + filter = conditions.Aggregate((a, b) => a + " or " + b); + } + else if (conditions.Count == 1) + { + filter = conditions[0]; + } + } + + return filter; + } + + public static string GenerateFilter(string[] metricNames, DateTime startTime, DateTime endTime, + TimeGrain timeGrain = TimeGrain.Daily) + { + List filters = new List(); + + if (metricNames != null && metricNames.Any()) + { + List conditions = metricNames.Select(_ => ("name.value eq '" + _ + "'")).ToList(); + + if (conditions.Count > 1) + { + string nameFilter = conditions.Aggregate((a, b) => a + " or " + b); + nameFilter = "(" + nameFilter + ")"; + filters.Add(nameFilter); + } + else if (conditions.Count == 1) + { + filters.Add(conditions[0]); + } + } + string startTimeFilter = string.Format(CultureInfo.InvariantCulture, "startTime eq '{0:O}'", startTime.ToUniversalTime()); + + filters.Add(startTimeFilter); + + string endTimeFilter = string.Format(CultureInfo.InvariantCulture, "endTime eq '{0:O}'", endTime.ToUniversalTime()); + + filters.Add(endTimeFilter); + + string timeGrainFilter; + + switch (timeGrain) + { + case TimeGrain.Hourly: + timeGrainFilter = XmlConvert.ToString(TimeSpan.FromHours(1)); + break; + case TimeGrain.Minutely: + timeGrainFilter = XmlConvert.ToString(TimeSpan.FromMinutes(1)); + break; + default: + timeGrainFilter = XmlConvert.ToString(TimeSpan.FromDays(1)); + break; + } + + timeGrainFilter = string.Format(CultureInfo.InvariantCulture, "timeGrain eq '{0}'", timeGrainFilter); + + filters.Add(timeGrainFilter); + + string filter = filters.Aggregate((a, b) => a + " and " + b); + + return filter; + } + + public static string GenerateStorageAccountsSearchFilter(List> filters) + { + string ret = string.Empty; + for (int i = 0; i < filters.Count; i++) + { + if (i != 0) + ret += filterParameterSeperator; + ret += filters[i].Key.ToString(); + ret += filterParameterConditionEqual; + ret += "'"; + ret += filters[i].Value; + ret += "'"; + } + return ret; + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Validation/ValidateAbsoluteUri.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Validation/ValidateAbsoluteUri.cs new file mode 100644 index 000000000000..4da10913e1ca --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Validation/ValidateAbsoluteUri.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// 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; + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + /// + /// Validation for URI parameters in cmdlets + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public sealed class ValidateAbsoluteUri : ValidateArgumentsAttribute + { + /// + /// Do the validation + /// + /// The args + /// The intrinsics + protected override void Validate(object arguments, EngineIntrinsics engineIntrinsics) + { + if (arguments == null) + { + return; + } + + var uri = arguments as Uri; + + if (uri == null) + { + throw new ValidationMetadataException(Resources.ValidateAbsoluteUriWrongType); + } + + if (!uri.IsAbsoluteUri) + { + throw new ValidationMetadataException(Resources.ValidateAbsoluteUriNotAbsolute); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Validation/ValidateUnc.cs b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Validation/ValidateUnc.cs new file mode 100644 index 000000000000..5cb5ed7fac6a --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/Validation/ValidateUnc.cs @@ -0,0 +1,43 @@ +// ---------------------------------------------------------------------------------- +// +// 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; + + +namespace Microsoft.AzureStack.Commands.StorageAdmin +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ValidateUnc : ValidateArgumentsAttribute + { + protected override void Validate(object arguments, EngineIntrinsics engineIntrinsics) + { + if (arguments == null) + { + return; + } + var uri = arguments as Uri; + + if (uri == null) + { + throw new ValidationMetadataException(Resources.ValidateUncWrongType); + } + + if (uri.IsUnc == false) + { + throw new ValidationMetadataException(Resources.ValidateUncWrongType); + } + } + } +} diff --git a/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/packages.config b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/packages.config new file mode 100644 index 000000000000..a2089ea273b6 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/Commands.AzureStackStorage/packages.config @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/AzureStackStorage/NuGet.Config b/src/ResourceManager/AzureStackStorage/NuGet.Config new file mode 100644 index 000000000000..2de911013532 --- /dev/null +++ b/src/ResourceManager/AzureStackStorage/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/AssemblyInfo.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/AssemblyInfo.cs index abfe416364fb..a28ca9b3d78b 100644 --- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/AssemblyInfo.cs @@ -24,5 +24,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("3819d8a7-c62c-4c47-8ddd-0332d9ce1252")] -[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] \ No newline at end of file diff --git a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Properties/AssemblyInfo.cs b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Properties/AssemblyInfo.cs index 24c15f222c0e..d11d2de303a7 100644 --- a/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Compute/AzureRM.Compute.psd1 b/src/ResourceManager/Compute/AzureRM.Compute.psd1 index 0fe343994075..9835aaa8ec1c 100644 --- a/src/ResourceManager/Compute/AzureRM.Compute.psd1 +++ b/src/ResourceManager/Compute/AzureRM.Compute.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Compute' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.2.1' +ModuleVersion = '1.2.2' # ID used to uniquely identify this module GUID = '0a83c907-1ffb-4d87-a492-c65ac7d7ed37' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Compute/Commands.Compute.Test/Properties/AssemblyInfo.cs index 29e0ba680d1b..4e3aadc992b0 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Compute/Commands.Compute.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("28fe3fc0-6fdf-4f01-8a82-d7b4a834ddd2")] -[assembly: AssemblyVersion("1.2.1")] -[assembly: AssemblyFileVersion("1.2.1")] +[assembly: AssemblyVersion("1.2.2")] +[assembly: AssemblyFileVersion("1.2.2")] diff --git a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj index 02499e82a56b..a7d9f0fcac83 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj +++ b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj @@ -373,7 +373,7 @@ PreserveNewest - Always + Never Always diff --git a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs index fdb7d91c817a..482110c79a7a 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs +++ b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs @@ -10,6 +10,7 @@ using Microsoft.WindowsAzure.Storage.Blob; using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Management.Automation; @@ -207,6 +208,17 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet [ValidateSetAttribute(new[] { "4.0", "latest", "5.0PP" })] public string WmfVersion { get; set; } + /// + /// The Extension Data Collection state + /// + [Parameter(ValueFromPipelineByPropertyName = true, + HelpMessage = "Enables or Disables Data Collection in the extension. It is enabled if it is not specified. " + + "The value is persisted in the extension between calls.") + ] + [ValidateSet("Enable", "Disable")] + [AllowNull] + public string DataCollection { get; set; } + //Private Variables private const string VersionRegexExpr = @"^(([0-9])\.)\d+$"; @@ -309,6 +321,11 @@ private void CreateConfiguration() publicSettings.SasToken = configurationUris.SasToken; publicSettings.ModulesUrl = configurationUris.ModulesUrl; + + Hashtable privacySetting = new Hashtable(); + privacySetting.Add("DataCollection", DataCollection); + publicSettings.Privacy = privacySetting; + publicSettings.ConfigurationFunction = string.Format( CultureInfo.InvariantCulture, "{0}\\{1}", diff --git a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml index 63570e9894ce..d76987a88f0b 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml +++ b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml @@ -11754,568 +11754,6 @@ PS C:\> Save-AzureRmVMImage -ResourceGroupName "ResourceGroup11" -V - - - Set-AzureRmVMChefExtension - - Adds the Chef extension to the virtual machine. - - - - - Set - AzureRmVMChefExtension - - - - The Set-AzureVMChefExtension cmdlet adds the Chef extension to the virtual machine. - - - - Set-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - - ValidationPem - - Specifies the Chef validator .pem file path - - String - - - ClientRb - - Specifies the full path of the Chef client.rb. - - String[] - - - AutoUpdateChefClient - - Specifies if the chef extension should be updated to the latest extension version. - - String - - - BootstrapOptions - - It overrides the configuration set in client_rb option. for e.g. node_name option i.e. if you set node_name as "foo" in the client_rb and in bootstrap_option you set chef_node_name as "bar" it will take "bar" as node name instead of "foo". - - String - - - ChefServerUrl - - Chef server URL - - String - - - DeleteChefConfig - - Indicates that this cmdlet deletes the Chef configuration on the virtual machine. - - String - - - OrganizationName - - Specifies the organization name of the Chef extension. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - RunList - - Specifies the Chef node run list. - - - - - ValidationClientName - - - - String - - - Windows - - Indicates that this cmdlet creates a Windows virtual machine. - - - - - Set-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - - ValidationPem - - Specifies the Chef validator .pem file path - - String - - - ClientRb - - Specifies the full path of the Chef client.rb. - - String[] - - - AutoUpdateChefClient - - Specifies if the chef extension should be updated to the latest extension version. - - String - - - BootstrapOptions - - It overrides the configuration set in client_rb option. for e.g. node_name option i.e. if you set node_name as "foo" in the client_rb and in bootstrap_option you set chef_node_name as "bar" it will take "bar" as node name instead of "foo". - - String - - - ChefServerUrl - - Chef server URL - - String - - - DeleteChefConfig - - Indicates that this cmdlet deletes the Chef configuration on the virtual machine. - - String - - - OrganizationName - - Specifies the organization name of the Chef extension. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - RunList - - Specifies the Chef node run list. - - - - - ValidationClientName - - - - String - - - Linux - - Indicates that this cmdlet creates a Linux virtual machine. - - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. - - String - - String - - - none - - - Name - - Specifies the name of the chef extension. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - String - - - none - - - AutoUpdateChefClient - - - SwitchParameter - - SwitchParameter - - - none - - - BootstrapOptions - - - String - - String - - - none - - - ChefServerUrl - - - String - - String - - - none - - - ClientRb - - Specifies the full path of the Chef client.rb. - - String - - String - - - none - - - DeleteChefConfig - - Indicates that this cmdlet deletes the Chef configuration on the virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - Linux - - Indicates that this cmdlet creates a Linux based virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - OrganizationName - - Specifies the organization name of the Chef extension. - - String - - String - - - none - - - RunList - - Specifies the Chef node run list. - - String - - String - - - none - - - ValidationClientName - - - - - String - - String - - - none - - - ValidationPem - - Specifies the Chef validator .pem file path - - String - - String - - - none - - - Windows - - Indicates that this cmdlet creates a Windows virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - Location - - Specifies the location of the VM. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Keywords: azure, azurerm, arm, resource, management, manager, compute, vm, iaas - - - - - -----Example 1: Add a Chef extension to a Windows virtual machine----- - - - - - PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -TypeHandlerVersion "1210.12" -RunList "Apache" -Windows; - - - This command adds a Chef extension to a Windows virtual machine. When the virtual machine comes up, it is bootstrapped with Chef and runs Apache on it. - - - - - - - - - - - - - - -----Example 2: Add a Chef extension to a Linux virtual machine----- - - - - - PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -TypeHandlerVersion "1210.12" -RunList "Apache" -Linux; - - - This command adds a Chef extension to a Linux virtual machine. When the virtual machine comes up, it is bootstrapped with Chef and runs Apache on it. - - - - - - - - - - - - - - Example 3: Add a Chef extension to a Windows virtual machine with bootstrap options - - - - - PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -TypeHandlerVersion "1210.12" -BootstrapOptions '{"chef_node_name":"your_node_name","chef_server_url":"https://api.opscode.com/organizations/some-org", "validation_client_name":"some-org-validator"}' -RunList "Apache" -Windows; - - - This command adds the Chef extension to a Windows virtual machine. When the virtual machine launches, it is bootstrapped with Chef and runs Apache on it. After bootstrapping, the virtual machine refers to the BootstrapOptions specified in JSON format. - - - - - - - - - - - Example 3: Add a Chef extension to a Windows virtual machine and install Apache and GIT - - - - - PS C:\>Set-AzureVMChefExtension -VM $VM -ValidationPem "C:\\myorg-validator.pem" -ChefServerUrl "http://ipaddress:port" -ValidationClientName "MyOrg-Validator" -RunList "apache, git" -Windows; - - - This command adds the Chef extension to a Windows virtual machine. When the virtual machine launches, it is bootstrapped with Chef and have Apache and GIT installed. If you do not provide the client.rb, you need to provide the Chef server URL and validation client name. - - - - - - - - - - - - - Get-AzureRmVMChefExtension - - - - Remove-AzureRmVMChefExtension - - - - - Set-AzureRmVMCustomScriptExtension @@ -14089,6 +13527,13 @@ Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName SwitchParameter + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + @@ -14287,6 +13732,18 @@ Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName latest + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + + string + + + + InformationAction @@ -17670,4 +17127,4 @@ PS C:\> $VirtualMachine07 = Set-AzureRmVMSourceImage -VM $VirtualMachine07 -I - \ No newline at end of file + diff --git a/src/ResourceManager/Compute/Commands.Compute/Properties/AssemblyInfo.cs b/src/ResourceManager/Compute/Commands.Compute/Properties/AssemblyInfo.cs index 4f40e4d78590..906eba0828e6 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Compute/Commands.Compute/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("91792853-487B-4DC2-BE6C-DD09A0A1BC10")] -[assembly: AssemblyVersion("1.2.1")] -[assembly: AssemblyFileVersion("1.2.1")] +[assembly: AssemblyVersion("1.2.2")] +[assembly: AssemblyFileVersion("1.2.2")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Compute.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1 b/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1 index e6e813977fb3..2c4715276098 100644 --- a/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1 +++ b/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.DataFactories' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'e3c0f6bc-fe96-41a0-88f4-5e490a91f05d' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Properties/AssemblyInfo.cs index a981424c182a..142d3339ac5b 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("8E86B542-B22F-44B6-8053-3F5118E04DEA")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Properties/AssemblyInfo.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Properties/AssemblyInfo.cs index e80c3ee639e6..3d622cf5051a 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("5d024af0-81c9-44f0-b3b0-7080f103fb4d")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.DataFactories.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/DataLakeAnalytics/AzureRM.DataLakeAnalytics.psd1 b/src/ResourceManager/DataLakeAnalytics/AzureRM.DataLakeAnalytics.psd1 index 25ee1646d9ce..d9566026297c 100644 --- a/src/ResourceManager/DataLakeAnalytics/AzureRM.DataLakeAnalytics.psd1 +++ b/src/ResourceManager/DataLakeAnalytics/AzureRM.DataLakeAnalytics.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.DataLakeAnalytics' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'eca73aa1-a68f-4ceb-9775-70759316a57b' @@ -21,7 +21,7 @@ Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = '� Microsoft Corporation. All rights reserved.' +Copyright = '© Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'Microsoft Azure PowerShell - Data Lake Analytics' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3' }) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4' }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/Properties/AssemblyInfo.cs index 2db4ce4880d6..34a508723774 100644 --- a/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ [assembly: Guid("C01CC766-EAA4-4CA3-A595-6C4681316532")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Properties/AssemblyInfo.cs b/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Properties/AssemblyInfo.cs index 467a6af4fddd..c490231530a5 100644 --- a/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/DataLakeStore/AzureRM.DataLakeStore.psd1 b/src/ResourceManager/DataLakeStore/AzureRM.DataLakeStore.psd1 index 4820786d4331..04440643e935 100644 --- a/src/ResourceManager/DataLakeStore/AzureRM.DataLakeStore.psd1 +++ b/src/ResourceManager/DataLakeStore/AzureRM.DataLakeStore.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.DataLakeStore' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '90dfd814-abce-4e1f-99b6-fe16760c079a' @@ -21,7 +21,7 @@ Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = '� Microsoft Corporation. All rights reserved.' +Copyright = '© Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'Microsoft Azure PowerShell - Data Lake Store' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3' }) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4' }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Properties/AssemblyInfo.cs index 45e0575fb01d..e96db409f76e 100644 --- a/src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ [assembly: Guid("C01CC766-EAA4-4CA3-A595-6C4681316532")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/AssemblyInfo.cs b/src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/AssemblyInfo.cs index afe8ce4f2ee7..f5b5989571f8 100644 --- a/src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Dns/AzureRM.Dns.psd1 b/src/ResourceManager/Dns/AzureRM.Dns.psd1 index 6ce80cfe5a3c..6d0411d23806 100644 --- a/src/ResourceManager/Dns/AzureRM.Dns.psd1 +++ b/src/ResourceManager/Dns/AzureRM.Dns.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Dns' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '5e5ed8bc-27bf-4380-9de1-4b22ba0920b2' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Dns/Commands.Dns.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Dns/Commands.Dns.Test/Properties/AssemblyInfo.cs index bb02cd42fd10..b3c7d1989158 100644 --- a/src/ResourceManager/Dns/Commands.Dns.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Dns/Commands.Dns.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4623A8BD-075F-4B7C-9971-FBEDBFBDE521")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Dns/Commands.Dns/Properties/AssemblyInfo.cs b/src/ResourceManager/Dns/Commands.Dns/Properties/AssemblyInfo.cs index 48a13c447a77..f0fbf60a4ba3 100644 --- a/src/ResourceManager/Dns/Commands.Dns/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Dns/Commands.Dns/Properties/AssemblyInfo.cs @@ -44,8 +44,8 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Resources.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1 b/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1 index dbc390bab577..2f4b68ce7a83 100644 --- a/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1 +++ b/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.HDInsight' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.4' +ModuleVersion = '1.0.5' # ID used to uniquely identify this module GUID = '3fd1475f-cb23-4ffb-bf08-33d94b7d1acb' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs index 8cd82e953e38..da6e6fb9c7e5 100644 --- a/src/ResourceManager/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs @@ -45,5 +45,5 @@ // 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.4")] -[assembly: AssemblyFileVersion("1.0.4")] +[assembly: AssemblyVersion("1.0.5")] +[assembly: AssemblyFileVersion("1.0.5")] diff --git a/src/ResourceManager/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj b/src/ResourceManager/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj index 3c7e74586e93..a819f7c80724 100644 --- a/src/ResourceManager/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj +++ b/src/ResourceManager/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj @@ -93,7 +93,7 @@ PreserveNewest - Always + Never @@ -156,10 +156,6 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\WindowsAzure.Storage.6.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll diff --git a/src/ResourceManager/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs b/src/ResourceManager/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs index 058430761037..e4f036b3e574 100644 --- a/src/ResourceManager/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs @@ -27,5 +27,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("57ad7b0e-1f56-4166-b1f9-ec6512139a54")] -[assembly: AssemblyVersion("1.0.4")] -[assembly: AssemblyFileVersion("1.0.4")] +[assembly: AssemblyVersion("1.0.5")] +[assembly: AssemblyFileVersion("1.0.5")] diff --git a/src/ResourceManager/HDInsight/Commands.HDInsight/packages.config b/src/ResourceManager/HDInsight/Commands.HDInsight/packages.config index 7635f15b8ad6..1b323da2b19f 100644 --- a/src/ResourceManager/HDInsight/Commands.HDInsight/packages.config +++ b/src/ResourceManager/HDInsight/Commands.HDInsight/packages.config @@ -19,7 +19,6 @@ - diff --git a/src/ResourceManager/Insights/AzureRM.Insights.psd1 b/src/ResourceManager/Insights/AzureRM.Insights.psd1 index 003ae685e3d1..8bdc9ee06519 100644 --- a/src/ResourceManager/Insights/AzureRM.Insights.psd1 +++ b/src/ResourceManager/Insights/AzureRM.Insights.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Insights' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '698c387c-bd6b-41c6-82ce-721f1ef39548' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Insights/Commands.Insights.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Insights/Commands.Insights.Test/Properties/AssemblyInfo.cs index 15e42004cb0d..18172f3dab84 100644 --- a/src/ResourceManager/Insights/Commands.Insights.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Insights/Commands.Insights.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("5802D147-3EE9-4352-A0B1-1C16B6DBCA7C")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj b/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj index d3a517d9718f..33a855c32677 100644 --- a/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj +++ b/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj @@ -91,9 +91,6 @@ ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.0.11.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll True - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\WindowsAzure.Storage.6.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll diff --git a/src/ResourceManager/Insights/Commands.Insights/Properties/AssemblyInfo.cs b/src/ResourceManager/Insights/Commands.Insights/Properties/AssemblyInfo.cs index 901f9e1da1a8..80d64d8ef25b 100644 --- a/src/ResourceManager/Insights/Commands.Insights/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Insights/Commands.Insights/Properties/AssemblyInfo.cs @@ -24,5 +24,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("ed102280-3577-49bf-93dd-11b6e3a44a57")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Insights/Commands.Insights/packages.config b/src/ResourceManager/Insights/Commands.Insights/packages.config index 9d9c8550e2bb..e25264df01b4 100644 --- a/src/ResourceManager/Insights/Commands.Insights/packages.config +++ b/src/ResourceManager/Insights/Commands.Insights/packages.config @@ -16,7 +16,6 @@ - diff --git a/src/ResourceManager/Intune/AzureRM.Intune.psd1 b/src/ResourceManager/Intune/AzureRM.Intune.psd1 index 0c0c3e7d9d67..4409946a6315 100644 --- a/src/ResourceManager/Intune/AzureRM.Intune.psd1 +++ b/src/ResourceManager/Intune/AzureRM.Intune.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'AzureRM.Intune' # # Generated by: vrmurthy @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '1.0.2' +ModuleVersion = '1.0.3' # ID used to uniquely identify this module GUID = '1be1e8c1-8b8a-41b3-82e9-88e7bc941fa0' @@ -48,7 +48,7 @@ CLRVersion='4.0' # ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() diff --git a/src/ResourceManager/Intune/Commands.Intune.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Intune/Commands.Intune.Test/Properties/AssemblyInfo.cs index aaa0bf43d21d..e784fac57392 100644 --- a/src/ResourceManager/Intune/Commands.Intune.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Intune/Commands.Intune.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // 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.2")] -[assembly: AssemblyFileVersion("1.0.2")] +[assembly: AssemblyVersion("1.0.3")] +[assembly: AssemblyFileVersion("1.0.3")] diff --git a/src/ResourceManager/Intune/Commands.Intune/Properties/AssemblyInfo.cs b/src/ResourceManager/Intune/Commands.Intune/Properties/AssemblyInfo.cs index 4eeec966ac5f..228e1227c5ac 100644 --- a/src/ResourceManager/Intune/Commands.Intune/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Intune/Commands.Intune/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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.2")] -[assembly: AssemblyFileVersion("1.0.2")] +[assembly: AssemblyVersion("1.0.3")] +[assembly: AssemblyFileVersion("1.0.3")] diff --git a/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1 b/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1 index ea6d5eed9c25..6d513a7f55fb 100644 --- a/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1 +++ b/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.KeyVault' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.1.2' +ModuleVersion = '1.1.3' # ID used to uniquely identify this module GUID = 'fa236c1f-6464-4d6a-a48d-db47c0e7923d' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Properties/AssemblyInfo.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Properties/AssemblyInfo.cs index cd76b0eaaa4d..30654e12a2b1 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Properties/AssemblyInfo.cs @@ -29,8 +29,8 @@ [assembly: CLSCompliant(false)] [assembly: Guid("2994548F-69B9-4DC2-8D19-52CC0C0C85BC")] -[assembly: AssemblyVersion("1.1.2")] -[assembly: AssemblyFileVersion("1.1.2")] +[assembly: AssemblyVersion("1.1.3")] +[assembly: AssemblyFileVersion("1.1.3")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.KeyVault.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Network/AzureRM.Network.psd1 b/src/ResourceManager/Network/AzureRM.Network.psd1 index 830e985aa86c..2de4d7e1d145 100644 --- a/src/ResourceManager/Network/AzureRM.Network.psd1 +++ b/src/ResourceManager/Network/AzureRM.Network.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Network' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'eb75c732-e274-4a20-b502-e9958e63484a' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Network/Commands.Network.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Network/Commands.Network.Test/Properties/AssemblyInfo.cs index f410bcf846a0..7f36868b4f31 100644 --- a/src/ResourceManager/Network/Commands.Network.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Network/Commands.Network.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("d1e9969e-7b83-4dfc-a7a2-523d4f7e6cc9")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Network/Commands.Network/Commands.Network.csproj b/src/ResourceManager/Network/Commands.Network/Commands.Network.csproj index 46a634ff0c8e..c4fe3e8d7089 100644 --- a/src/ResourceManager/Network/Commands.Network/Commands.Network.csproj +++ b/src/ResourceManager/Network/Commands.Network/Commands.Network.csproj @@ -480,7 +480,7 @@ PreserveNewest - Always + Never Always diff --git a/src/ResourceManager/Network/Commands.Network/Properties/AssemblyInfo.cs b/src/ResourceManager/Network/Commands.Network/Properties/AssemblyInfo.cs index 5b7c12ae30ea..f2feb97cf1ad 100644 --- a/src/ResourceManager/Network/Commands.Network/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Network/Commands.Network/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("be2ca022-590c-48ba-b465-9ab61d6e2ea0")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Network.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/NotificationHubs/AzureRM.NotificationHubs.psd1 b/src/ResourceManager/NotificationHubs/AzureRM.NotificationHubs.psd1 index 8d9e911bce48..ce89c4826e01 100644 --- a/src/ResourceManager/NotificationHubs/AzureRM.NotificationHubs.psd1 +++ b/src/ResourceManager/NotificationHubs/AzureRM.NotificationHubs.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.NotificationHubs' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'f875725d-8ce4-423f-a6af-ea880bc63f13' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3' }) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4' }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/Properties/AssemblyInfo.cs index 47f1d408e76f..cf3340d09fa8 100644 --- a/src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/NotificationHubs/Commands.NotificationHubs/Properties/AssemblyInfo.cs b/src/ResourceManager/NotificationHubs/Commands.NotificationHubs/Properties/AssemblyInfo.cs index a35f897fcf7e..28d9f719fa05 100644 --- a/src/ResourceManager/NotificationHubs/Commands.NotificationHubs/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/NotificationHubs/Commands.NotificationHubs/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("9e93b969-6685-4a67-b07d-cfd5ebd0091e")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.NotificationHubs.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1 b/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1 index 8452439bace5..1ba293119b6e 100644 --- a/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1 +++ b/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.OperationalInsights' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'e827799a-7abf-4538-a61f-94dc52a48bd4' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/Properties/AssemblyInfo.cs index f6d3b7ca5db5..fdad9c8f317f 100644 --- a/src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Commands.OperationalInsights.csproj b/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Commands.OperationalInsights.csproj index 290636feb0bb..26ba222b72e7 100644 --- a/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Commands.OperationalInsights.csproj +++ b/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Commands.OperationalInsights.csproj @@ -192,7 +192,9 @@ AzureRM.OperationalInsights.psd1 PreserveNewest - + + Never + PreserveNewest Designer diff --git a/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Properties/AssemblyInfo.cs b/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Properties/AssemblyInfo.cs index f7225bfafd7c..11f4222a83b3 100644 --- a/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("5be35a94-c20f-4659-aa29-9b9aebcfaf36")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.OperationalInsights.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Profile/AzureRM.Profile.psd1 b/src/ResourceManager/Profile/AzureRM.Profile.psd1 index bfe8182a976a..6498a636ef45 100644 --- a/src/ResourceManager/Profile/AzureRM.Profile.psd1 +++ b/src/ResourceManager/Profile/AzureRM.Profile.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Profile' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '342714fc-4009-4863-8afb-a9067e3db04b' diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj b/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj index b64114529c17..fad970c4c118 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj +++ b/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj @@ -69,7 +69,7 @@ False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.13-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5799.28345-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Profile/Commands.Profile.Test/Properties/AssemblyInfo.cs index ac1ea1d21421..38345b60ee46 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Profile/Commands.Profile.Test/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/packages.config b/src/ResourceManager/Profile/Commands.Profile.Test/packages.config index c17ed8d2d7e4..3aab10c17b8f 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/packages.config +++ b/src/ResourceManager/Profile/Commands.Profile.Test/packages.config @@ -5,7 +5,7 @@ - + diff --git a/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.csproj b/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.csproj index bd5ca97b6d3c..4b17e0a0f2fe 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.csproj +++ b/src/ResourceManager/Profile/Commands.Profile/Commands.Profile.csproj @@ -62,7 +62,7 @@ False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.13-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll diff --git a/src/ResourceManager/Profile/Commands.Profile/Properties/AssemblyInfo.cs b/src/ResourceManager/Profile/Commands.Profile/Properties/AssemblyInfo.cs index 683f96b65ca9..a60440de0510 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Profile/Commands.Profile/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Profile.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ResourceManager/Profile/Commands.Profile/packages.config b/src/ResourceManager/Profile/Commands.Profile/packages.config index df89a45abab5..f050b8000b55 100644 --- a/src/ResourceManager/Profile/Commands.Profile/packages.config +++ b/src/ResourceManager/Profile/Commands.Profile/packages.config @@ -4,7 +4,7 @@ - + diff --git a/src/ResourceManager/RecoveryServices/AzureRM.RecoveryServices.psd1 b/src/ResourceManager/RecoveryServices/AzureRM.RecoveryServices.psd1 index 7be466cb7b0a..aa622f26bc8f 100644 --- a/src/ResourceManager/RecoveryServices/AzureRM.RecoveryServices.psd1 +++ b/src/ResourceManager/RecoveryServices/AzureRM.RecoveryServices.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.RecoveryServices' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.4' +ModuleVersion = '1.0.5' # ID used to uniquely identify this module GUID = '4AA53B7E-FCFE-4E22-979C-9A4E6380DE58' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs index 0194f7ee69df..7a1292f06302 100644 --- a/src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs @@ -43,5 +43,5 @@ // 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.4")] -[assembly: AssemblyFileVersion("1.0.4")] +[assembly: AssemblyVersion("1.0.5")] +[assembly: AssemblyFileVersion("1.0.5")] diff --git a/src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs b/src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs index 92f179bd6d88..23329a3c9d3e 100644 --- a/src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs @@ -42,5 +42,5 @@ // 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.4")] -[assembly: AssemblyFileVersion("1.0.4")] +[assembly: AssemblyVersion("1.0.5")] +[assembly: AssemblyFileVersion("1.0.5")] diff --git a/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1 b/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1 index 32bf2cdea822..8db13dad3fc0 100644 --- a/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1 +++ b/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.RedisCache' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.1.1' +ModuleVersion = '1.1.2' # ID used to uniquely identify this module GUID = '820628d7-6938-488a-8760-43373a5ffce6' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Properties/AssemblyInfo.cs index 7925dec06634..8a5dc0f08d44 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("C01CC766-EAA4-4CA3-A595-6C4681316532")] -[assembly: AssemblyVersion("1.1.1")] -[assembly: AssemblyFileVersion("1.1.1")] +[assembly: AssemblyVersion("1.1.2")] +[assembly: AssemblyFileVersion("1.1.2")] diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj index fdeaf78fd909..03d35a51a510 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj @@ -111,10 +111,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - True - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/AssemblyInfo.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/AssemblyInfo.cs index a0aaa1473019..57d06250ee57 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("6D663ED9-C1A5-438F-B88A-D709562538C6")] -[assembly: AssemblyVersion("1.1.1")] -[assembly: AssemblyFileVersion("1.1.1")] +[assembly: AssemblyVersion("1.1.2")] +[assembly: AssemblyFileVersion("1.1.2")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.RedisCache.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config index 8cf97d759a4b..0d6be3f88d9e 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config @@ -18,7 +18,6 @@ - diff --git a/src/ResourceManager/Resources/AzureRM.Resources.psd1 b/src/ResourceManager/Resources/AzureRM.Resources.psd1 index 673f8cab94e0..5298573ea4e3 100644 --- a/src/ResourceManager/Resources/AzureRM.Resources.psd1 +++ b/src/ResourceManager/Resources/AzureRM.Resources.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Resources' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'ab3ca893-26fe-44b0-bd3c-8933df144d7b' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Properties/AssemblyInfo.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Properties/AssemblyInfo.cs index e457064cc4e7..e4b3c3b3c203 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("e8f34267-c461-4eae-b156-5f3528553d10")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Resources.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Resources/Commands.Resources.Test/Properties/AssemblyInfo.cs index 7b7a7de34523..3ec000b7a648 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Resources/Commands.Resources.Test/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ [assembly: Guid("28fe3fc0-6fdf-4f01-8a82-d7b4a834ddd2")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 index 2f6765349c16..7aa2810c6413 100644 --- a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 +++ b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Azure Resource Manager' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '0.10.1' +ModuleVersion = '1.2.0' # ID used to uniquely identify this module GUID = '81d522a4-6e5d-4105-8f58-376204c47458' @@ -114,7 +114,9 @@ NestedModules = @( '.\AzureRM.DataLakeAnalytics', '.\AzureRM.DataLakeStore', '.\AzureRM.Intune', - '.\AzureRM.RecoveryServices' + '.\AzureRM.RecoveryServices', + '.\AzureRM.AzureStackAdmin', + '.\AzureRM.AzureStackStorage' ) # Functions to export from this module diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index 36bc1a3c7b03..f4843189ce2b 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -74,7 +74,7 @@ False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.13-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.18.206251556\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll diff --git a/src/ResourceManager/Resources/Commands.Resources/Properties/AssemblyInfo.cs b/src/ResourceManager/Resources/Commands.Resources/Properties/AssemblyInfo.cs index 2ac131979d20..7c86d6d63e3a 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("e386b843-f3f0-4db3-8664-37d16b860dde")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Resources.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Resources/Commands.Resources/packages.config b/src/ResourceManager/Resources/Commands.Resources/packages.config index f4054068d033..07c00e2d7901 100644 --- a/src/ResourceManager/Resources/Commands.Resources/packages.config +++ b/src/ResourceManager/Resources/Commands.Resources/packages.config @@ -7,7 +7,7 @@ - + diff --git a/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1 b/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1 index 716b55fd87a7..645105b58d2f 100644 --- a/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1 +++ b/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.SiteRecovery' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.1.2' +ModuleVersion = '1.1.3' # ID used to uniquely identify this module GUID = 'd1de7560-48e1-48f3-bc8c-4eea3af2bbe1' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs index a71676676b84..94e034694b14 100644 --- a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs @@ -43,5 +43,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.2")] -[assembly: AssemblyFileVersion("1.1.2")] +[assembly: AssemblyVersion("1.1.3")] +[assembly: AssemblyFileVersion("1.1.3")] diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs index 072a2971dd67..5969b74db925 100644 --- a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs @@ -42,5 +42,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.2")] -[assembly: AssemblyFileVersion("1.1.2")] +[assembly: AssemblyVersion("1.1.3")] +[assembly: AssemblyFileVersion("1.1.3")] diff --git a/src/ResourceManager/Sql/AzureRM.Sql.psd1 b/src/ResourceManager/Sql/AzureRM.Sql.psd1 index 3706eb60894d..ee9731e2d7d9 100644 --- a/src/ResourceManager/Sql/AzureRM.Sql.psd1 +++ b/src/ResourceManager/Sql/AzureRM.Sql.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Sql' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '150d9544-6348-4373-806f-10cd0b4de4cb' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Sql/Commands.Sql.Test/Properties/AssemblyInfo.cs index 84e0b2304715..9b3cbf1a7db4 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Sql/Commands.Sql.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f6f46134-9c1b-4599-8dd0-789299c076ef")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj index ddefffe24722..57beb11eb95a 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj +++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj @@ -326,10 +326,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ResourceManager/Sql/Commands.Sql/Properties/AssemblyInfo.cs b/src/ResourceManager/Sql/Commands.Sql/Properties/AssemblyInfo.cs index 5883a17da268..6dba7812539d 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Properties/AssemblyInfo.cs @@ -44,8 +44,8 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Resources.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Sql/Commands.Sql/packages.config b/src/ResourceManager/Sql/Commands.Sql/packages.config index c390265fd34b..e8cb4e3a1926 100644 --- a/src/ResourceManager/Sql/Commands.Sql/packages.config +++ b/src/ResourceManager/Sql/Commands.Sql/packages.config @@ -18,7 +18,6 @@ - diff --git a/src/ResourceManager/Storage/AzureRM.Storage.psd1 b/src/ResourceManager/Storage/AzureRM.Storage.psd1 index 99c42a2b4b52..7ed38956a671 100644 --- a/src/ResourceManager/Storage/AzureRM.Storage.psd1 +++ b/src/ResourceManager/Storage/AzureRM.Storage.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Management.Storage' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'da67eaa7-4cb1-4bfa-a194-8bf3faae8ac5' @@ -46,8 +46,8 @@ ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @( - @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}, - @{ ModuleName = 'Azure.Storage'; ModuleVersion = '1.0.3'} + @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}, + @{ ModuleName = 'Azure.Storage'; ModuleVersion = '1.0.4'} ) # Assemblies that must be loaded prior to importing this module diff --git a/src/ResourceManager/Storage/Commands.Management.Storage.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Storage/Commands.Management.Storage.Test/Properties/AssemblyInfo.cs index e34f675601a4..7cf98a99b3e0 100644 --- a/src/ResourceManager/Storage/Commands.Management.Storage.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Storage/Commands.Management.Storage.Test/Properties/AssemblyInfo.cs @@ -47,5 +47,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Management.Storage.csproj b/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Management.Storage.csproj index 6beb2fe615ae..0377e5724117 100644 --- a/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Management.Storage.csproj +++ b/src/ResourceManager/Storage/Commands.Management.Storage/Commands.Management.Storage.csproj @@ -160,7 +160,7 @@ PreserveNewest - Always + Never Always diff --git a/src/ResourceManager/Storage/Commands.Management.Storage/Properties/AssemblyInfo.cs b/src/ResourceManager/Storage/Commands.Management.Storage/Properties/AssemblyInfo.cs index 85af45f3ef35..7651917fc546 100644 --- a/src/ResourceManager/Storage/Commands.Management.Storage/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Storage/Commands.Management.Storage/Properties/AssemblyInfo.cs @@ -46,5 +46,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1 b/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1 index 79657e116595..5b3c4cdccb12 100644 --- a/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1 +++ b/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.StreamAnalytics' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '59713673-194f-418a-b1f2-ac60db82edf9' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Properties/AssemblyInfo.cs index 2b05dc4c0bcb..2c87c95404a9 100644 --- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Properties/AssemblyInfo.cs b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Properties/AssemblyInfo.cs index 0e4a55a8c06b..01f2e58d4b5a 100644 --- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("9188beb8-68c3-404a-91e2-6f287f162a52")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.StreamAnalytics.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Tags/AzureRM.Tags.psd1 b/src/ResourceManager/Tags/AzureRM.Tags.psd1 index b876ead5b042..4fa2534943d7 100644 --- a/src/ResourceManager/Tags/AzureRM.Tags.psd1 +++ b/src/ResourceManager/Tags/AzureRM.Tags.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Tags' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '59713673-194f-418a-b1f2-ac60db82edf9' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Tags/Commands.Tags/Properties/AssemblyInfo.cs b/src/ResourceManager/Tags/Commands.Tags/Properties/AssemblyInfo.cs index b95dafeb57f5..dfd940e45a92 100644 --- a/src/ResourceManager/Tags/Commands.Tags/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Tags/Commands.Tags/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("e386b843-f3f0-4db3-8664-37d16b860dde")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Resources.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1 b/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1 index 09bb06531e36..479704fa0191 100644 --- a/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1 +++ b/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.TrafficManager' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = '59713673-194f-418a-b1f2-ac60db82edf9' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/TrafficManager/Commands.TrafficManager2.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/TrafficManager/Commands.TrafficManager2.Test/Properties/AssemblyInfo.cs index 774f1cde136f..f4cc8e779772 100644 --- a/src/ResourceManager/TrafficManager/Commands.TrafficManager2.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/TrafficManager/Commands.TrafficManager2.Test/Properties/AssemblyInfo.cs @@ -45,5 +45,5 @@ // // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Commands.TrafficManager.csproj b/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Commands.TrafficManager.csproj index 863e502292ef..61e14de3ef50 100644 --- a/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Commands.TrafficManager.csproj +++ b/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Commands.TrafficManager.csproj @@ -142,7 +142,9 @@ AzureRM.TrafficManager.psd1 PreserveNewest - + + Never + Designer diff --git a/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Properties/AssemblyInfo.cs b/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Properties/AssemblyInfo.cs index 52e8205ad214..38aff6159fd3 100644 --- a/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/TrafficManager/Commands.TrafficManager2/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("be2ca022-590c-48ba-b465-9ab61d6e2ea0")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.TrafficManager.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1 b/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1 index 55573497fc30..6de6870ed897 100644 --- a/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1 +++ b/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.UsageAggregates' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'e43e47c8-8bff-4013-b003-ded1741f403a' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/UsageAggregates/Commands.UsageAggregates.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/UsageAggregates/Commands.UsageAggregates.Test/Properties/AssemblyInfo.cs index 4200fde5f015..c4ab8a641630 100644 --- a/src/ResourceManager/UsageAggregates/Commands.UsageAggregates.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/UsageAggregates/Commands.UsageAggregates.Test/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("e1252a92-e377-4295-ab57-7e06fb319d5e")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Commands.UsageAggregates.csproj b/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Commands.UsageAggregates.csproj index 9635bbaec348..125b83993d95 100644 --- a/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Commands.UsageAggregates.csproj +++ b/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Commands.UsageAggregates.csproj @@ -103,7 +103,9 @@ AzureRM.UsageAggregates.psd1 PreserveNewest - + + Never + Always diff --git a/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Properties/AssemblyInfo.cs b/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Properties/AssemblyInfo.cs index 6fc7c6201c3d..fabc81ce0cde 100644 --- a/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/UsageAggregates/Commands.UsageAggregates/Properties/AssemblyInfo.cs @@ -31,8 +31,8 @@ [assembly: Guid("4fc77441-aa7b-4539-9e0c-e716797751a5")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.ResourceManager.Automation.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ResourceManager/Websites/AzureRM.Websites.psd1 b/src/ResourceManager/Websites/AzureRM.Websites.psd1 index 870c262820bd..53618d2fc00d 100644 --- a/src/ResourceManager/Websites/AzureRM.Websites.psd1 +++ b/src/ResourceManager/Websites/AzureRM.Websites.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'Microsoft.Azure.Commands.Websites' # # Generated by: Microsoft Corporation @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'cc69c625-e961-43f4-8b50-0061eba6e4b6' @@ -45,7 +45,7 @@ CLRVersion='4.0' ProcessorArchitecture = 'None' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.3'}) +RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '1.0.4'}) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = @() diff --git a/src/ResourceManager/Websites/Commands.Websites.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/Websites/Commands.Websites.Test/Properties/AssemblyInfo.cs index 1100bf8edd7c..9b6b215b2461 100644 --- a/src/ResourceManager/Websites/Commands.Websites.Test/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Websites/Commands.Websites.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ResourceManager/Websites/Commands.Websites/Properties/AssemblyInfo.cs b/src/ResourceManager/Websites/Commands.Websites/Properties/AssemblyInfo.cs index 02589080f96c..d435c6ed3886 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Properties/AssemblyInfo.cs +++ b/src/ResourceManager/Websites/Commands.Websites/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("76158def-441b-472a-9b1a-a75726a813f4")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Resources.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ServiceManagement/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs index 40d5ad9d7b7f..1176996557a5 100644 --- a/src/ServiceManagement/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Automation/Commands.Automation.Test/Properties/AssemblyInfo.cs @@ -42,6 +42,6 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] diff --git a/src/ServiceManagement/Automation/Commands.Automation/Properties/AssemblyInfo.cs b/src/ServiceManagement/Automation/Commands.Automation/Properties/AssemblyInfo.cs index dadd3b2b2006..278d2c5985e9 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.Azure.Commands.Automation.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ServiceManagement/Common/Commands.Common.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/Common/Commands.Common.Test/Properties/AssemblyInfo.cs index 169a20961986..354be543b44b 100644 --- a/src/ServiceManagement/Common/Commands.Common.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Common/Commands.Common.Test/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("080bc9b8-3c00-4d0e-bec2-38d2fd0d7061")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Common/Commands.ScenarioTest/Properties/AssemblyInfo.cs b/src/ServiceManagement/Common/Commands.ScenarioTest/Properties/AssemblyInfo.cs index dd8c9f6ee6b6..0aebc980b6f5 100644 --- a/src/ServiceManagement/Common/Commands.ScenarioTest/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Common/Commands.ScenarioTest/Properties/AssemblyInfo.cs @@ -41,5 +41,5 @@ // // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/Common/Commands.ServiceManagement.Common/Properties/AssemblyInfo.cs b/src/ServiceManagement/Common/Commands.ServiceManagement.Common/Properties/AssemblyInfo.cs index 8195e7431f54..42e15755f9c8 100644 --- a/src/ServiceManagement/Common/Commands.ServiceManagement.Common/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Common/Commands.ServiceManagement.Common/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("4f3ab2e4-cc7a-43ac-bb15-f481fcf94d58")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.CloudService, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Properties/AssemblyInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Properties/AssemblyInfo.cs index d948fb449c69..360dd07816c1 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Properties/AssemblyInfo.cs @@ -28,8 +28,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.ServiceManagement.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj index 2f31a70f0d23..fe327640d56b 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj @@ -295,7 +295,7 @@ Always - Always + Never Designer diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Properties/AssemblyInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Properties/AssemblyInfo.cs index 49a3527dcd3a..ec9fb836470e 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Properties/AssemblyInfo.cs @@ -28,8 +28,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.ServiceManagement.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Properties/AssemblyInfo.cs index dd9b60c2270c..9b023aef322d 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Properties/AssemblyInfo.cs @@ -32,8 +32,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.ScenarioTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj index 0922bd647a0d..72b071d3279a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj @@ -122,9 +122,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs index 93ccec9f7a7e..727700139e0f 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs @@ -92,6 +92,11 @@ public class Property /// public Property[] Properties { get; set; } + /// + /// Privacy parameters + /// + public Hashtable Privacy { get; set; } + /// /// Version of the protocol (DscExtensionPublicSettings and DscExtensionPrivateSettings mostly). /// diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs index c74d60370a3b..20821caae297 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs @@ -23,6 +23,7 @@ using Microsoft.WindowsAzure.Storage.Blob; using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Management.Automation; @@ -156,6 +157,17 @@ public class SetAzureVMDscExtension : VirtualMachineExtensionCmdletBase [ValidateSetAttribute(new[] { "4.0", "latest", "5.0PP" })] public string WmfVersion { get; set; } + /// + /// The Extension Data Collection state + /// + [Parameter(ValueFromPipelineByPropertyName = true, + HelpMessage = "Enables or Disables Data Collection in the extension. It is enabled if it is not specified. " + + "The value is persisted in the extension between calls.") + ] + [ValidateSet("Enable", "Disable")] + [AllowNull] + public string DataCollection { get; set; } + /// /// Credentials used to access Azure Storage /// @@ -389,6 +401,11 @@ private void CreateConfiguration() publicSettings.SasToken = configurationUris.SasToken; publicSettings.ModulesUrl = configurationUris.ModulesUrl; + + Hashtable privacySetting = new Hashtable(); + privacySetting.Add("DataCollection",DataCollection); + publicSettings.Privacy = privacySetting; + publicSettings.ConfigurationFunction = string.Format( CultureInfo.InvariantCulture, "{0}\\{1}", diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml index 932c942e61d4..508f5387bb85 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml @@ -36528,6 +36528,13 @@ PS C:\> Update-AzureVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Upda IPersistentVM + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + Confirm @@ -36695,6 +36702,18 @@ PS C:\> Update-AzureVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Upda none + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + + string + + + + Confirm diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Properties/AssemblyInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Properties/AssemblyInfo.cs index a8ffb0bd8ba8..2ee287a38bea 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Properties/AssemblyInfo.cs @@ -28,8 +28,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.ServiceManagement.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config index ea48be48e846..02e97c5e9c9a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config @@ -17,7 +17,6 @@ - diff --git a/src/ServiceManagement/Compute/Sync/Properties/AssemblyInfo.cs b/src/ServiceManagement/Compute/Sync/Properties/AssemblyInfo.cs index e5e44c603033..16da56455287 100644 --- a/src/ServiceManagement/Compute/Sync/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Compute/Sync/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] diff --git a/src/ServiceManagement/Compute/VhdManagement/Properties/AssemblyInfo.cs b/src/ServiceManagement/Compute/VhdManagement/Properties/AssemblyInfo.cs index 0955367dc0bc..3ecca36f9d0f 100644 --- a/src/ServiceManagement/Compute/VhdManagement/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Compute/VhdManagement/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/AssemblyInfo.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/AssemblyInfo.cs index c6170399eda8..5f668a7857bc 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Properties/AssemblyInfo.cs @@ -31,8 +31,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs index 18e80671469f..a3bacfd5f78e 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Properties/AssemblyInfo.cs @@ -43,6 +43,6 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/HDInsight.csproj b/src/ServiceManagement/HDInsight/Commands.HDInsight/HDInsight.csproj index 942603223df0..510ad56f0fda 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/HDInsight.csproj +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/HDInsight.csproj @@ -113,10 +113,6 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs index bd427968adc8..5bfcd6040e3e 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.HDInsight.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config b/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config index c4af6c9e6c54..02bbcf5f3c5c 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config @@ -17,7 +17,6 @@ - diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Properties/AssemblyInfo.cs index 2bfbffdf58ce..fd3d55c354ba 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("3E5D3114-DEBB-4DC2-BB9D-CF2A2707F74D")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj index b203c683174c..008c06034333 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj @@ -95,9 +95,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Properties/AssemblyInfo.cs b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Properties/AssemblyInfo.cs index 945da7795ce5..0725b16d55e3 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] #if SIGN diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config index 754c9d9e04a5..2cd3c72b84c0 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config @@ -15,7 +15,6 @@ - diff --git a/src/ServiceManagement/Network/Commands.Network.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/Network/Commands.Network.Test/Properties/AssemblyInfo.cs index a0c4571d2344..8625a1cfe827 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Network/Commands.Network.Test/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: Guid("3E5D3114-DEBB-4DC2-BB9D-CF2A2707F74D")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj b/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj index df9456f6f901..b4bbb1748bce 100644 --- a/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj +++ b/src/ServiceManagement/Network/Commands.Network/Commands.ServiceManagement.Network.csproj @@ -98,9 +98,6 @@ ..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.0.11.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll True - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/Network/Commands.Network/Properties/AssemblyInfo.cs b/src/ServiceManagement/Network/Commands.Network/Properties/AssemblyInfo.cs index bd245322dff5..a12c5f4ee341 100644 --- a/src/ServiceManagement/Network/Commands.Network/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Network/Commands.Network/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] #if SIGN diff --git a/src/ServiceManagement/Network/Commands.Network/packages.config b/src/ServiceManagement/Network/Commands.Network/packages.config index 63c0f16ec5f1..2b704b7115b6 100644 --- a/src/ServiceManagement/Network/Commands.Network/packages.config +++ b/src/ServiceManagement/Network/Commands.Network/packages.config @@ -17,7 +17,6 @@ - diff --git a/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs b/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs index 9701ec884fb6..e0db30a7512a 100644 --- a/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs +++ b/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs @@ -18,7 +18,6 @@ using System.ServiceModel.Description; using Microsoft.Azure.Common.Authentication; using Microsoft.Azure.Common.Authentication.Models; -using Microsoft.Web.Deployment; namespace Microsoft.WindowsAzure.Commands.Profile.Models { diff --git a/src/ServiceManagement/Profile/Commands.Profile/Properties/AssemblyInfo.cs b/src/ServiceManagement/Profile/Commands.Profile/Properties/AssemblyInfo.cs index 3511f38d683a..f8c36d737f02 100644 --- a/src/ServiceManagement/Profile/Commands.Profile/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Profile/Commands.Profile/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.CloudService.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs index e83f4fa12fed..0ec4432b6051 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs @@ -47,5 +47,5 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs index cd4607a607fe..cc1bf0f6a8e0 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] [assembly: CLSCompliant(false)] diff --git a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj index 76a4f07d9e0b..e15261da52e1 100644 --- a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj +++ b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj @@ -106,10 +106,6 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/packages.config b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/packages.config index aa9532b54abc..252fc6bbefd2 100644 --- a/src/ServiceManagement/RemoteApp/Commands.RemoteApp/packages.config +++ b/src/ServiceManagement/RemoteApp/Commands.RemoteApp/packages.config @@ -15,7 +15,6 @@ - diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/Properties/AssemblyInfo.cs b/src/ServiceManagement/Services/Commands.Test.Utilities/Properties/AssemblyInfo.cs index 3b9baa41dc55..40648d210f9a 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.HDInsight.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Services/Commands.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/Services/Commands.Test/Properties/AssemblyInfo.cs index 45a8f7fe6169..7f6803a3d83a 100644 --- a/src/ServiceManagement/Services/Commands.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Services/Commands.Test/Properties/AssemblyInfo.cs @@ -27,5 +27,5 @@ // // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1 b/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1 index a946dfbf27ed..734bd3fc1852 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1 +++ b/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1 @@ -9,7 +9,7 @@ @{ # Version number of this module. -ModuleVersion = '1.0.3' +ModuleVersion = '1.0.4' # ID used to uniquely identify this module GUID = 'D48CF693-4125-4D2D-8790-1514F44CE325' diff --git a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj index 7f6bd9043335..259e67d1ab9a 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj @@ -124,7 +124,7 @@ False - ..\..\..\lib\Microsoft.Web.Deployment.dll + ..\..\..\packages\Microsoft.Web.Deployment\lib\Net40\Microsoft.Web.Deployment.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -141,7 +141,7 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.MediaServices.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll - False + False ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.4\lib\net40\Microsoft.WindowsAzure.Management.Network.dll @@ -433,10 +433,6 @@ - - AutoMapper.Net4.dll - PreserveNewest - PreserveNewest @@ -541,7 +537,9 @@ PreserveNewest - + + Designer + PreserveNewest diff --git a/src/ServiceManagement/Services/Commands.Utilities/Properties/AssemblyInfo.cs b/src/ServiceManagement/Services/Commands.Utilities/Properties/AssemblyInfo.cs index 7c3c6eb7b474..289fcc7c2b14 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Properties/AssemblyInfo.cs @@ -29,8 +29,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Profile, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs b/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs index 6aefe4a032bd..1b57725a4ad6 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs @@ -644,7 +644,7 @@ public Utilities.SiteConfig GetWebsiteConfiguration(string name) /// /// The website name /// The website slot name - /// The website cobfiguration object + /// The website configuration object public Utilities.SiteConfig GetWebsiteConfiguration(string name, string slot) { Utilities.Site website = GetWebsite(name); @@ -995,7 +995,7 @@ public IList ListPublishingUserNames() /// Time grains for the metrics. /// Include details for the server instances in which the site is running. /// Represent the metrics for the hostnames that receive the traffic at the current slot. - /// If swap occured in the middle of the period mereics will be merged + /// If swap occurred in the middle of the period metrics will be merged /// The list of site metrics for the specified period. public IList GetHistoricalUsageMetrics(string siteName, string slot, IList metricNames, DateTime? starTime, DateTime? endTime, string timeGrain, bool instanceDetails, bool slotView) @@ -1164,7 +1164,7 @@ public string BuildWebProject(string projectFile, string configuration, string l project.SetProperty("Configuration", configuration); // Set this property use "managedRuntimeVersion=v4.0". - // Otherwise, WebDeploy will fail becasue Azure Web Site is expecting v4.0. + // Otherwise, WebDeploy will fail because Azure Web Site is expecting v4.0. project.SetProperty("VisualStudioVersion", "11.0"); // Build the project. @@ -1327,7 +1327,7 @@ private static void SetWebDeployToSkipAppData(bool skipAppData, DeploymentBaseOp /// Parse the Web.config files to get the connection string names. /// /// The default Web.config file. - /// The additional Web.config file for the specificed configuration, like Web.Release.Config file. + /// The additional Web.config file for the specified configuration, like Web.Release.Config file. /// An array of connection string names from the Web.config files. public string[] ParseConnectionStringNamesFromWebConfig(string defaultWebConfigFile, string overwriteWebConfigFile) { @@ -1713,7 +1713,7 @@ public Utilities.WebHostingPlan GetWebHostingPlan(string webSpaceName, string pl } /// - /// Get a list of historic metrics for the web hostin plan. + /// Get a list of historic metrics for the web hosting plan. /// /// web space name where plan belongs /// The web hosting plan name diff --git a/src/ServiceManagement/Services/Commands.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Utilities/packages.config index 717a55cd4b12..70b037b1d7d6 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Utilities/packages.config @@ -28,6 +28,7 @@ + diff --git a/src/ServiceManagement/Services/Commands/Commands.csproj b/src/ServiceManagement/Services/Commands/Commands.csproj index 3b3ae99ea255..e55786f494e8 100644 --- a/src/ServiceManagement/Services/Commands/Commands.csproj +++ b/src/ServiceManagement/Services/Commands/Commands.csproj @@ -117,9 +117,6 @@ False ..\..\..\lib\Microsoft.Web.Deployment.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/Services/Commands/Properties/AssemblyInfo.cs b/src/ServiceManagement/Services/Commands/Properties/AssemblyInfo.cs index 8ac0793e91af..40bc97b2c924 100644 --- a/src/ServiceManagement/Services/Commands/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Services/Commands/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.CloudService.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Services/Commands/packages.config b/src/ServiceManagement/Services/Commands/packages.config index 18f66e60b2aa..bcde5cd6b41c 100644 --- a/src/ServiceManagement/Services/Commands/packages.config +++ b/src/ServiceManagement/Services/Commands/packages.config @@ -15,7 +15,6 @@ - diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Properties/AssemblyInfo.cs index 9b524c154fc4..d28d19d5f619 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Properties/AssemblyInfo.cs @@ -40,5 +40,5 @@ // // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj b/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj index 959ac42e2453..033f873abc00 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj @@ -112,9 +112,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Properties/AssemblyInfo.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Properties/AssemblyInfo.cs index d75eac3ac43d..7a0a8c465e3b 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.SqlDatabase.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config b/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config index b7f60846f8b1..7cc892366a4e 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config @@ -16,7 +16,6 @@ - diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs index 32522a83fddd..27e8c002797c 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ [assembly: Guid("d1c35c6d-1778-4d39-92c8-0bf709cc5b23")] -[assembly: AssemblyVersion("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs index 3936464b9187..a10f9318b86c 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs @@ -44,8 +44,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.StorSimple.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Properties/AssemblyInfo.cs index df83398e6ace..80d06828dcb6 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Properties/AssemblyInfo.cs @@ -40,5 +40,5 @@ // // 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.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj index 4ca6b1e65c83..f9defd8bf7b8 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj @@ -99,9 +99,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Properties/AssemblyInfo.cs b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Properties/AssemblyInfo.cs index a461b1addf48..b0d65e6a13a9 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Properties/AssemblyInfo.cs +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Properties/AssemblyInfo.cs @@ -43,8 +43,8 @@ // 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("1.0.3")] -[assembly: AssemblyFileVersion("1.0.3")] +[assembly: AssemblyVersion("1.0.4")] +[assembly: AssemblyFileVersion("1.0.4")] #if SIGN [assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #else diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config index ca7203536955..4d2752df101a 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config @@ -15,7 +15,6 @@ - diff --git a/src/lib/Microsoft.Web.Deployment.dll b/src/lib/Microsoft.Web.Deployment.dll deleted file mode 100644 index 38053edf5b0f..000000000000 Binary files a/src/lib/Microsoft.Web.Deployment.dll and /dev/null differ diff --git a/src/lib/Microsoft.WindowsAzure.Storage.DataMovement.dll b/src/lib/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..ea3f259d8328 Binary files /dev/null and b/src/lib/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/tools/AzureRM/AzureRM.psd1 b/tools/AzureRM/AzureRM.psd1 index 82fc94e05183..124cd4eb802a 100644 --- a/tools/AzureRM/AzureRM.psd1 +++ b/tools/AzureRM/AzureRM.psd1 @@ -12,7 +12,7 @@ RootModule = '.\AzureRM.psm1' # Version number of this module. -ModuleVersion = '1.1.0' +ModuleVersion = '1.2.0' # ID used to uniquely identify this module GUID = 'B433E830-B479-4F7F-9C80-9CC6C28E1B51' diff --git a/tools/AzureRM/AzureRM.psm1 b/tools/AzureRM/AzureRM.psm1 index 50050041fc1a..fa72792b0b69 100644 --- a/tools/AzureRM/AzureRM.psm1 +++ b/tools/AzureRM/AzureRM.psm1 @@ -1,35 +1,35 @@ $AzureRMDependencies = @{ - "Azure.Storage" = "1.0.3"; - "AzureRM.Profile" = "1.0.3"; + "Azure.Storage" = "1.0.4"; + "AzureRM.Profile" = "1.0.4"; } $AzureRMModules = @{ - "AzureRM.ApiManagement" = "1.0.3"; - "AzureRM.Automation" = "1.0.3"; - "AzureRM.Backup" = "1.0.3"; - "AzureRM.Batch" = "1.0.3"; - "AzureRM.Compute" = "1.2.1"; - "AzureRM.DataFactories" = "1.0.3"; - "AzureRM.DataLakeAnalytics" = "1.0.3"; - "AzureRM.DataLakeStore" = "1.0.3"; - "AzureRM.Dns" = "1.0.3"; - "AzureRM.HDInsight" = "1.0.4"; - "AzureRM.Insights" = "1.0.3"; - "AzureRM.KeyVault" = "1.1.2"; - "AzureRM.Network" = "1.0.3"; - "AzureRM.NotificationHubs" = "1.0.3"; - "AzureRM.OperationalInsights" = "1.0.3"; - "AzureRM.RecoveryServices" = "1.0.4"; - "AzureRM.RedisCache" = "1.1.1"; - "AzureRM.Resources" = "1.0.3"; - "AzureRM.SiteRecovery" = "1.1.2"; - "AzureRM.Sql" = "1.0.3"; - "AzureRM.Storage" = "1.0.3"; - "AzureRM.StreamAnalytics" = "1.0.3"; - "AzureRM.Tags" = "1.0.3"; - "AzureRM.TrafficManager" = "1.0.3"; - "AzureRM.UsageAggregates" = "1.0.3"; - "AzureRM.Websites" = "1.0.3"; + "AzureRM.ApiManagement" = "1.0.4"; + "AzureRM.Automation" = "1.0.4"; + "AzureRM.Backup" = "1.0.4"; + "AzureRM.Batch" = "1.0.4"; + "AzureRM.Compute" = "1.2.2"; + "AzureRM.DataFactories" = "1.0.4"; + "AzureRM.DataLakeAnalytics" = "1.0.4"; + "AzureRM.DataLakeStore" = "1.0.4"; + "AzureRM.Dns" = "1.0.4"; + "AzureRM.HDInsight" = "1.0.5"; + "AzureRM.Insights" = "1.0.4"; + "AzureRM.KeyVault" = "1.1.3"; + "AzureRM.Network" = "1.0.4"; + "AzureRM.NotificationHubs" = "1.0.4"; + "AzureRM.OperationalInsights" = "1.0.4"; + "AzureRM.RecoveryServices" = "1.0.5"; + "AzureRM.RedisCache" = "1.1.2"; + "AzureRM.Resources" = "1.0.4"; + "AzureRM.SiteRecovery" = "1.1.3"; + "AzureRM.Sql" = "1.0.4"; + "AzureRM.Storage" = "1.0.4"; + "AzureRM.StreamAnalytics" = "1.0.4"; + "AzureRM.Tags" = "1.0.4"; + "AzureRM.TrafficManager" = "1.0.4"; + "AzureRM.UsageAggregates" = "1.0.4"; + "AzureRM.Websites" = "1.0.4"; } function Test-AdminRights([string]$Scope) @@ -179,7 +179,7 @@ function Import-AzureRM $AzureRMModules.Keys | ForEach { $moduleName = $_ $_MinVer = $MajorVersion - if(!MajorVersion ) { + if(!$MajorVersion) { $_MinVer = $AzureRMModules[$_] } $_MaxVer = "$($_MinVer.Split(".")[0]).9999.9999.9999" diff --git a/tools/StaticAnalysis/AppDomainHelpers.cs b/tools/StaticAnalysis/AppDomainHelpers.cs new file mode 100644 index 000000000000..cdf32c4cc754 --- /dev/null +++ b/tools/StaticAnalysis/AppDomainHelpers.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 System; + +namespace StaticAnalysis +{ + public static class AppDomainHelpers + { + /// + /// Create a new AppDomain and create a remote instance of AssemblyLoader we can use there + /// + /// directory containing assemblies + /// A new AppDomain, where assemblies can be loaded + /// A proxy to the AssemblyLoader running in the newly created app domain + public static T CreateProxy(string directoryPath, out AppDomain testDomain) where T:MarshalByRefObject + { + if (string.IsNullOrWhiteSpace(directoryPath)) + { + throw new ArgumentException("directoryPath"); + } + + var setup = new AppDomainSetup(); + setup.ApplicationBase = directoryPath; + setup.ApplicationName = "TestDomain"; + setup.ApplicationTrust = AppDomain.CurrentDomain.ApplicationTrust; + setup.DisallowApplicationBaseProbing = false; + setup.DisallowCodeDownload = false; + setup.DisallowBindingRedirects = false; + setup.DisallowPublisherPolicy = false; + testDomain = AppDomain.CreateDomain("TestDomain", null, setup); + return testDomain.CreateInstanceFromAndUnwrap(typeof(T).Assembly.Location, + typeof(T).FullName) as T; + } + } +} diff --git a/tools/StaticAnalysis/DependencyAnalyzer/AssemblyLoader.cs b/tools/StaticAnalysis/DependencyAnalyzer/AssemblyLoader.cs index 15cd6731a4c8..8b98a38c3f0f 100644 --- a/tools/StaticAnalysis/DependencyAnalyzer/AssemblyLoader.cs +++ b/tools/StaticAnalysis/DependencyAnalyzer/AssemblyLoader.cs @@ -71,31 +71,5 @@ public AssemblyMetadata GetReflectedAssemblyFromFile(string assemblyPath) return result; } - - /// - /// Create a new AppDomain and create a remote instance of AssemblyLoader we can use there - /// - /// directory containing assemblies - /// A new AppDomain, where assemblies can be loaded - /// A proxy to the AssemblyLoader running in the newly created app domain - public static AssemblyLoader Create(string directoryPath, out AppDomain testDomain) - { - if (string.IsNullOrWhiteSpace(directoryPath)) - { - throw new ArgumentException("directoryPath"); - } - - var setup = new AppDomainSetup(); - setup.ApplicationBase = directoryPath; - setup.ApplicationName = "TestDomain"; - setup.ApplicationTrust = AppDomain.CurrentDomain.ApplicationTrust; - setup.DisallowApplicationBaseProbing = false; - setup.DisallowCodeDownload = false; - setup.DisallowBindingRedirects = false; - setup.DisallowPublisherPolicy = false; - testDomain = AppDomain.CreateDomain("TestDomain", null, setup); - return testDomain.CreateInstanceFromAndUnwrap(typeof(AssemblyLoader).Assembly.Location, - typeof(AssemblyLoader).FullName) as AssemblyLoader; - } } } diff --git a/tools/StaticAnalysis/DependencyAnalyzer/DependencyAnalyzer.cs b/tools/StaticAnalysis/DependencyAnalyzer/DependencyAnalyzer.cs index 829b78e3e343..62f8ee2786ff 100644 --- a/tools/StaticAnalysis/DependencyAnalyzer/DependencyAnalyzer.cs +++ b/tools/StaticAnalysis/DependencyAnalyzer/DependencyAnalyzer.cs @@ -209,7 +209,7 @@ private void ProcessDirectory(string directoryPath) { var savedDirectory = Directory.GetCurrentDirectory(); Directory.SetCurrentDirectory(directoryPath); - _loader = AssemblyLoader.Create(directoryPath, out _testDomain); + _loader = AppDomainHelpers.CreateProxy(directoryPath, out _testDomain); foreach (var file in Directory.GetFiles(directoryPath).Where(file => file.EndsWith(".dll"))) { AssemblyRecord assembly = CreateAssemblyRecord(file); diff --git a/tools/StaticAnalysis/HelpAnalyzer/CmdletHelpMetadata.cs b/tools/StaticAnalysis/HelpAnalyzer/CmdletHelpMetadata.cs new file mode 100644 index 000000000000..6f2dc31d0f93 --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/CmdletHelpMetadata.cs @@ -0,0 +1,32 @@ +// ---------------------------------------------------------------------------------- +// +// 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; + +namespace StaticAnalysis.HelpAnalyzer +{ + [Serializable] + public class CmdletHelpMetadata + { + /// + /// The cmdlet name + /// + public string CmdletName { get; set; } + + /// + /// The class name implementing the cmdlet + /// + public string ClassName { get; set; } + } +} diff --git a/tools/StaticAnalysis/HelpAnalyzer/CmdletHelpParser.cs b/tools/StaticAnalysis/HelpAnalyzer/CmdletHelpParser.cs new file mode 100644 index 000000000000..c1d7d1e0476f --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/CmdletHelpParser.cs @@ -0,0 +1,85 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Xml.Linq; + +namespace StaticAnalysis.HelpAnalyzer +{ + /// + /// Parse the cmdlet help file + /// + public class CmdletHelpParser + { + public const string MamlSchemaUri = "http://schemas.microsoft.com/maml/2004/10"; + public const string MamlDevSchemaUri = "http://schemas.microsoft.com/maml/dev/2004/10"; + public const string CommandSchemaUri = "http://schemas.microsoft.com/maml/dev/command/2004/10"; + public static IList GetHelpTopics(string helpPath, ReportLogger logger) + { + IList cmdlets = new List(); + try + { + XDocument document = XDocument.Parse(File.ReadAllText(helpPath)); + var root = document.Root; + foreach (var command in root.GetChildElements("command")) + { + if (command.ContainsChildElement("details")) + { + var details = command.GetChildElement("details"); + if (details.ContainsChildElement("name")) + { + cmdlets.Add(details.GetChildElement("name").Value.Trim()); + } + else + { + logger.LogRecord(new HelpIssue + { + HelpFile = helpPath, + Severity = 0, + Description = string.Format("Missing command:name element for file {0}", helpPath), + Remediation = "Correct the xml format of the help file" + }); + + } + } + else + { + + logger.LogRecord(new HelpIssue + { + HelpFile = helpPath, + Severity = 0, + Description = string.Format("Missing command:details element for file {0}", helpPath), + Remediation = "Correct the xml format of the help file" + }); + } + } + } + catch (Exception e) + { + logger.LogRecord(new HelpIssue + { + HelpFile = helpPath, + Severity = 0, + Description = string.Format("Parsing error for help file {0}: {1}", helpPath, e.ToString()), + Remediation = "Correct the xml format of the help file" + }); + } + + return cmdlets; + } + } +} diff --git a/tools/StaticAnalysis/HelpAnalyzer/CmdletLoader.cs b/tools/StaticAnalysis/HelpAnalyzer/CmdletLoader.cs new file mode 100644 index 000000000000..4d79e1275739 --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/CmdletLoader.cs @@ -0,0 +1,57 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using StaticAnalysis.help; + +namespace StaticAnalysis.HelpAnalyzer +{ + public class CmdletLoader : MarshalByRefObject + { + /// + /// Get cmdlets from the given assembly + /// + /// + /// + public IList GetCmdlets(string assemblyPath) + { + IList result = new List(); + try + { + var assembly = Assembly.LoadFrom(assemblyPath); + foreach (var type in assembly.GetCmdletTypes()) + { + var cmdlet = type.GetAttribute(); + result.Add( + new CmdletHelpMetadata + { + ClassName = type.FullName, + CmdletName = string.Format("{0}-{1}", cmdlet.VerbName, cmdlet.NounName) + }); + } + } + catch + { + } + + return result; + } + } +} diff --git a/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs b/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs new file mode 100644 index 000000000000..dbbeabfb237f --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs @@ -0,0 +1,103 @@ +// ---------------------------------------------------------------------------------- +// +// 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; + +namespace StaticAnalysis.HelpAnalyzer +{ + /// + /// Static analyzer for PowerShell Help + /// + public class HelpAnalyzer : IStaticAnalyzer + { + public HelpAnalyzer() + { + Name = "Help Analyzer"; + } + public AnalysisLogger Logger { get; set; } + public string Name { get; private set; } + + private AppDomain _appDomain; + + /// + /// Given a set of directory paths containing PowerShell module folders, analyze the help + /// in the module folders and report any issues + /// + /// + public void Analyze(IEnumerable scopes) + { + var savedDirectory = Directory.GetCurrentDirectory(); + var processedHelpFiles = new List(); + var helpLogger = Logger.CreateLogger("HelpIssues.csv"); + foreach (var baseDirectory in scopes.Where(s => Directory.Exists(Path.GetFullPath(s)))) + { + foreach (var directory in Directory.EnumerateDirectories(Path.GetFullPath(baseDirectory))) + { + var helpFiles = Directory.EnumerateFiles(directory, "*.dll-Help.xml") + .Where(f => !processedHelpFiles.Contains(Path.GetFileName(f), + StringComparer.OrdinalIgnoreCase)).ToList(); + if (helpFiles.Any()) + { + Directory.SetCurrentDirectory(directory); + foreach (var helpFile in helpFiles) + { + var cmdletFile = helpFile.Substring(0, helpFile.Length - "-Help.xml".Length); + var helpFileName = Path.GetFileName(helpFile); + var cmdletFileName = Path.GetFileName(cmdletFile); + if (File.Exists(cmdletFile) ) + { + processedHelpFiles.Add(helpFileName); + helpLogger.Decorator.AddDecorator((h) => + { + h.HelpFile = helpFileName; + h.Assembly = cmdletFileName; + }, "Cmdlet"); + var proxy = AppDomainHelpers.CreateProxy(directory, out _appDomain); + var cmdlets = proxy.GetCmdlets(cmdletFile); + var helpRecords = CmdletHelpParser.GetHelpTopics(helpFile, helpLogger); + ValidateHelpRecords(cmdlets, helpRecords, helpLogger); + helpLogger.Decorator.Remove("Cmdlet"); + AppDomain.Unload(_appDomain); + } + } + + Directory.SetCurrentDirectory(savedDirectory); + } + } + } + } + + private void ValidateHelpRecords(IList cmdlets, IList helpRecords, + ReportLogger helpLogger) + { + foreach (var cmdlet in cmdlets) + { + if (!helpRecords.Contains(cmdlet.CmdletName, StringComparer.OrdinalIgnoreCase)) + { + helpLogger.LogRecord(new HelpIssue + { + Target = cmdlet.ClassName, + Severity = 1, + Description = string.Format("Help missing for cmdlet {0} implemented by class {1}", + cmdlet.CmdletName, cmdlet.ClassName), + Remediation = string.Format("Add Help record for cmdlet {0} to help file.", cmdlet.CmdletName) + }); + } + } + } + } +} diff --git a/tools/StaticAnalysis/HelpAnalyzer/HelpIssue.cs b/tools/StaticAnalysis/HelpAnalyzer/HelpIssue.cs new file mode 100644 index 000000000000..a35c80aafd31 --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/HelpIssue.cs @@ -0,0 +1,50 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; + + +namespace StaticAnalysis.HelpAnalyzer +{ + public class HelpIssue : IReportRecord + { + /// + /// The assembly containing the help issue + /// + public string Assembly { get; set; } + /// + /// The associated help file. + /// + public string HelpFile { get; set; } + /// + /// The target of the report (cmdlet name, etc..) + /// + public string Target { get; set; } + public string Description { get; set; } + public string Remediation { get; set; } + public int Severity { get; set; } + public string PrintHeaders() + { + return "\"Assembly\",\"HelpFile\",\"Target\",\"Severity\",\"Description\",\"Remediation\""; + } + + public string FormatRecord() + { + return string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\"", + Assembly, HelpFile, Target, Severity, Description, Remediation); + } + } +} diff --git a/tools/StaticAnalysis/HelpAnalyzer/ReflectionExtensions.cs b/tools/StaticAnalysis/HelpAnalyzer/ReflectionExtensions.cs new file mode 100644 index 000000000000..0156997106b7 --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/ReflectionExtensions.cs @@ -0,0 +1,64 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace StaticAnalysis.help + +{ + public static class ReflectionExtensions + { + public static T GetAttribute(this Type decoratedType) where T : Attribute + { + return decoratedType.GetTypeInfo().GetCustomAttribute(typeof(T), true) as T; + } + + public static T GetAttribute(this PropertyInfo decoratedProperty) where T : Attribute + { + return decoratedProperty.GetCustomAttribute(typeof(T), true) as T; + } + + public static IEnumerable GetAttributes(this Type decoratedType) where T : Attribute + { + return decoratedType.GetTypeInfo().GetCustomAttributes(typeof(T), false).Select(a => a as T); + } + + public static IEnumerable GetAttributes(this PropertyInfo decoratedProeprty) where T : Attribute + { + return decoratedProeprty.GetCustomAttributes(typeof(T), false).Select(a => a as T); + } + + public static bool HasAttribute(this Type decoratedType) where T : Attribute + { + return decoratedType.GetTypeInfo().CustomAttributes.Any(d => d.AttributeType == typeof (T)); + + } + + public static bool HasAttribute(this PropertyInfo decoratedProperty) where T : Attribute + { + return decoratedProperty.CustomAttributes.Any(d => d.AttributeType == typeof(T)); + + } + + public static IEnumerable GetCmdletTypes(this Assembly assembly) + { + return assembly.GetTypes().Where(t => t.HasAttribute()); + } + + } +} diff --git a/tools/StaticAnalysis/HelpAnalyzer/XmlExtensions.cs b/tools/StaticAnalysis/HelpAnalyzer/XmlExtensions.cs new file mode 100644 index 000000000000..f2d562a48c3f --- /dev/null +++ b/tools/StaticAnalysis/HelpAnalyzer/XmlExtensions.cs @@ -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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + +namespace StaticAnalysis +{ + public static class XmlExtensions + { + /// + /// Get all child elements with the given name + /// + /// The element to search + /// The child element name to search for + /// An enumeration of child elements with the given name, or null if none + /// are found. + public static IEnumerable GetChildElements(this XElement parent, string name) + { + return parent.Descendants().Where(e => String.Equals(e.Name.LocalName, name)); + } + + /// + /// Get all child elements with the given name that satisfy the given predicate + /// + /// The element to search + /// The child element name to search for + /// The additional condition to satisfy + /// An enumeration of child elements with the given name that satisfy the predicate, + /// or null if none are found. + public static IEnumerable GetChildElements(this XElement parent, string name, + Func predicate ) + { + return parent.Descendants().Where(e => String.Equals(e.Name.LocalName, name) + && predicate(e)); + } + + /// + /// Get the first child element with the given name + /// + /// The element to search + /// The child element name to search for + /// The child element with the given name, or null if none are found. + public static XElement GetChildElement(this XElement parent, string name) + { + return parent.Descendants().FirstOrDefault(e => String.Equals(e.Name.LocalName, name)); + } + + /// + /// Get the first child element with the given name that satisfies the given predicate + /// + /// The element to search + /// The child element name to search for + /// Additional conditions over the desired child element + /// + public static XElement GetChildElement(this XElement parent, string name, + Func predicate ) + { + return parent.Descendants().FirstOrDefault(e => String.Equals(e.Name.LocalName, name) + && predicate(e)); + } + + /// + /// Determines if the given element contains a child element of the given name + /// + /// The element to search + /// The child element name to search for + /// true if the given child element exists, otherwise false + public static bool ContainsChildElement(this XElement element, string name) + { + return element.Descendants().Any(e => string.Equals(e.Name.LocalName, name)); + } + + /// + /// Determines if the given element contains a child element of the given name that satisfies + /// the specified predicate + /// + /// The element to search + /// The child element name to search for + /// An additional condition on descendant elements + /// true if the given child element exists, otherwise false + public static bool ContainsChildElement(this XElement element, string name, + Func predicate) + { + return element.Descendants().Any(e => string.Equals(e.Name.LocalName, name) + && predicate(e)); + } + + /// + /// Determines if the given element contains a child element with any of the provided names + /// + /// The element to search + /// The child element names to search for + /// true if any of the given child elements exists, otherwise false + public static bool ContainsChildElement(this XElement element, IEnumerable names) + { + return names.Any(element.ContainsChildElement); + } + + /// + /// Determines if the given element contains a child element with any of the provided names that + /// satisfies the given predicate + /// + /// The element to search + /// The child element names to search for + /// An additional condition to check on descendant elements + /// True if any child element has the specified name and satisfies the specified + /// predicate. + public static bool ContainsChildElement(this XElement element, IEnumerable names, + Func predicate ) + { + return names.Any( n => element.ContainsChildElement(n, predicate)); + } + } +} diff --git a/tools/StaticAnalysis/Program.cs b/tools/StaticAnalysis/Program.cs index e4c94f164179..9f989039b0b1 100644 --- a/tools/StaticAnalysis/Program.cs +++ b/tools/StaticAnalysis/Program.cs @@ -16,13 +16,18 @@ using System.Collections.Generic; using System.IO; -namespace StaticAnalysis.DependencyAnalyzer +namespace StaticAnalysis { /// /// Runner for all static analysis tools. /// public class Program { + static readonly IList Analyzers = new List() + { + new HelpAnalyzer.HelpAnalyzer(), + new DependencyAnalyzer.DependencyAnalyzer() + }; public static void Main(string[] args) { if (args == null || args.Length < 1) @@ -58,11 +63,15 @@ public static void Main(string[] args) reportsDirectory); } - var analyzer = new DependencyAnalyzer { Logger = logger }; - logger.WriteMessage("Executing analyzer: {0}", analyzer.Name); - analyzer.Analyze(directories); + foreach (var analyzer in Analyzers) + { + analyzer.Logger = logger; + logger.WriteMessage("Executing analyzer: {0}", analyzer.Name); + analyzer.Analyze(directories); + logger.WriteMessage("Processing complete for analyzer: {0}", analyzer.Name); + } + logger.WriteReports(); - logger.WriteMessage("Processing complete for analyzer: {0}", analyzer.Name); } } } diff --git a/tools/StaticAnalysis/StaticAnalysis.csproj b/tools/StaticAnalysis/StaticAnalysis.csproj index cb94c8f63485..21a772b5b05c 100644 --- a/tools/StaticAnalysis/StaticAnalysis.csproj +++ b/tools/StaticAnalysis/StaticAnalysis.csproj @@ -34,6 +34,10 @@ + + packages\System.Management.Automation_PowerShell_3.0.6.3.9600.17400\lib\net40\System.Management.Automation.dll + True + @@ -42,6 +46,7 @@ + @@ -53,12 +58,22 @@ + + + + + + + + + +