diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj index 536e9500d0ff..7afeb0988eff 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj +++ b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj @@ -186,7 +186,6 @@ - @@ -474,7 +473,7 @@ Always - + Always diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/GetAzureResourceGroupLogCommandTests.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/GetAzureResourceGroupLogCommandTests.cs deleted file mode 100644 index 9428c416b372..000000000000 --- a/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/GetAzureResourceGroupLogCommandTests.cs +++ /dev/null @@ -1,104 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// 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 Microsoft.Azure.Commands.Resources.Models; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Moq; -using Xunit; - -namespace Microsoft.Azure.Commands.Resources.Test -{ - public class GetAzureResourceGroupLogCommandTests - { - private GetAzureResourceGroupLogCommand cmdlet; - - private Mock resourcesClientMock; - - private Mock commandRuntimeMock; - - public GetAzureResourceGroupLogCommandTests() - { - resourcesClientMock = new Mock(); - commandRuntimeMock = new Mock(); - cmdlet = new GetAzureResourceGroupLogCommand() - { - CommandRuntime = commandRuntimeMock.Object, - ResourcesClient = resourcesClientMock.Object - }; - } - - // TODO: http://vstfrd:8080/Azure/RD/_workitems#_a=edit&id=3247094 - //[Fact] - //[Trait(Category.AcceptanceType, Category.CheckIn)] - //public void GetAzureResourceGroupLogOutputsProperties() - //{ - // List result = new List(); - // result.Add(new PSDeploymentEventData - // { - // EventId = "ac7d2ab5-698a-4c33-9c19-0a93d3d7f527", - // EventName = "Start request", - // EventSource = "Microsoft Resources", - // Channels = "Operation", - // Level = "Informational", - // Timestamp = DateTime.Now, - // OperationId = "c0f2e85f-efb0-47d0-bf90-f983ec8be91d", - // OperationName = "Microsoft.Resources/subscriptions/resourcegroups/deployments/write", - // Status = "Succeeded", - // SubStatus = "Created", - // ResourceGroupName = "foo", - // ResourceProvider = "Microsoft Resources", - // ResourceUri = - // "/subscriptions/ffce8037-a374-48bf-901d-dac4e3ea8c09/resourcegroups/foo/deployments/testdeploy", - // HttpRequest = new PSDeploymentEventDataHttpRequest - // { - // Url = "http://path/subscriptions/ffce8037-a374-48bf-901d-dac4e3ea8c09/resourcegroups/foo/deployments/testdeploy", - // Method = "PUT", - // ClientId = "1234", - // ClientIpAddress = "123.123.123.123" - // }, - // Authorization = new PSDeploymentEventDataAuthorization - // { - // Action = "PUT", - // Condition = "", - // Role = "Sender", - // Scope = "None" - // }, - // Claims = new Dictionary - // { - // {"aud", "https://management.core.windows.net/"}, - // {"iss", "https://sts.windows.net/123456/"}, - // {"iat", "h123445"} - // }, - // Properties = new Dictionary() - // }); - - // GetPSResourceGroupLogParameters expected = new GetPSResourceGroupLogParameters(); - - // resourcesClientMock.Setup(f => f.GetResourceGroupLogs(It.IsAny())) - // .Returns(result) - // .Callback((GetPSResourceGroupLogParameters r) => expected = r); - - // cmdlet.Name = "foo"; - - // cmdlet.ExecuteCmdlet(); - - // Assert.Equal(1, result.Count()); - // Assert.Equal("foo", expected.Name); - //} - } -} diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index 08d91354ed46..a0144ef468ef 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -203,7 +203,6 @@ - diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs index 9e62bfdf2ce6..3719b435d38c 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs @@ -47,11 +47,10 @@ public override void ExecuteCmdlet() new List() { ProvisioningState } }; - if(!string.IsNullOrEmpty(Name)) + if(!string.IsNullOrEmpty(ProvisioningState)) { - WriteWarning("The parameter 'Name' in Get-AzureResourceGroupDeployment cmdlet is being renamed to DeploymentName and will be updated in a future release."); + WriteWarning("The ProvisioningState parameter is being deprecated and will be removed in a future release."); } - WriteObject(ResourcesClient.FilterResourceGroupDeployments(options), true); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs index 916570c27eba..76a1555eb444 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs @@ -61,9 +61,9 @@ public override void ExecuteCmdlet() StorageAccountName = StorageAccountName }; - if(!string.IsNullOrEmpty(TemplateVersion) || !string.IsNullOrEmpty(StorageAccountName)) + if (!string.IsNullOrEmpty(TemplateVersion) || !string.IsNullOrEmpty(StorageAccountName) || !string.IsNullOrEmpty(GalleryTemplateIdentity)) { - WriteWarning("The TemplateVersion and StorageAccountName parameters in New-AzureResourceGroupDeployment cmdlet is being deprecated and will be removed in a future release."); + WriteWarning("The GalleryTemplateIdentity, TemplateVersion and StorageAccountName parameters in New-AzureResourceGroupDeployment cmdlet is being deprecated and will be removed in a future release."); } if(this.Mode == DeploymentMode.Complete) diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs index 8a90dfa99070..718995251566 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs @@ -50,6 +50,7 @@ public override void ExecuteCmdlet() if (PassThru) { + WriteWarning("The PassThru switch parameter is being deprecated and will be removed in a future release."); WriteObject(true); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs index 7ddcb77495fe..2e73d77ec4a6 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs @@ -50,6 +50,7 @@ public override void ExecuteCmdlet() if (PassThru) { + WriteWarning("The output object of this cmdlet will be modified in a future release."); WriteObject(true); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs index 69834262df57..08a86bfbd99d 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureLocationCommand.cs @@ -29,6 +29,7 @@ public class GetAzureLocationCommand : ResourcesBaseCmdlet, IModuleAssemblyIniti { public override void ExecuteCmdlet() { + WriteWarning("The output object of this cmdlet will be modified in a future release."); WriteObject(ResourcesClient.GetLocations(), true); } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs index 12ece2649c21..c3725bd00a90 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs @@ -38,6 +38,15 @@ public class GetAzureResourceGroupCommand : ResourcesBaseCmdlet public override void ExecuteCmdlet() { + if(this.Tag != null) + { + WriteWarning("The Tag parameter is being deprecated and will be removed in a future release."); + } + if(this.Detailed.IsPresent) + { + WriteWarning("The Detailed switch parameter is being deprecated and will be removed in a future release."); + } + WriteWarning("The output object of this cmdlet will be modified in a future release."); var detailed = Detailed.IsPresent || !string.IsNullOrEmpty(Name); WriteObject(ResourcesClient.FilterResourceGroups(Name, Tag, detailed), true); } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupLogCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupLogCommand.cs deleted file mode 100644 index d8572700da5c..000000000000 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupLogCommand.cs +++ /dev/null @@ -1,59 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// 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.Management.Automation; -using Microsoft.Azure.Commands.Resources.Models; - -namespace Microsoft.Azure.Commands.Resources -{ - /// - /// Get the list of events for a deployment. - /// - // TODO: http://vstfrd:8080/Azure/RD/_workitems#_a=edit&id=3247094 - //[Cmdlet(VerbsCommon.Get, "AzureResourceGroupLog", DefaultParameterSetName = LastDeploymentSetName), OutputType(typeof(List))] - public class GetAzureResourceGroupLogCommand : ResourcesBaseCmdlet - { - internal const string AllSetName = "All"; - internal const string LastDeploymentSetName = "Last deployment"; - internal const string DeploymentNameSetName = "Deployment by name"; - - [Alias("ResourceGroupName")] - [Parameter(Position = 0, ParameterSetName = AllSetName, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the resource group you want to see the logs.")] - [Parameter(Position = 0, ParameterSetName = LastDeploymentSetName, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the resource group you want to see the logs.")] - [Parameter(Position = 0, ParameterSetName = DeploymentNameSetName, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the resource group you want to see the logs.")] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter(ParameterSetName = DeploymentNameSetName, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the deployment whose logs you want to see.")] - [ValidateNotNullOrEmpty] - public string DeploymentName { get; set; } - - [Parameter(ParameterSetName = AllSetName, HelpMessage = "Optional. If given, return logs of all the operations including CRUD and deployment.")] - public SwitchParameter All { get; set; } - - public override void ExecuteCmdlet() - { - GetPSResourceGroupLogParameters parameters = new GetPSResourceGroupLogParameters - { - Name = Name, - DeploymentName = DeploymentName, - All = All.IsPresent - }; - - // TODO: http://vstfrd:8080/Azure/RD/_workitems#_a=edit&id=3247094 - //WriteObject(ResourcesClient.GetResourceGroupLogs(parameters), true); - } - } -} \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs index f1c2f1c2d8d8..c87d87fdaabf 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs @@ -67,6 +67,7 @@ public override void ExecuteCmdlet() { WriteWarning("The deployment parameters in New-AzureResourceGroup cmdlet is being deprecated and will be removed in a future release. Please use New-AzureResourceGroupDeployment to submit deployments."); } + WriteWarning("The output object of this cmdlet will be modified in a future release."); WriteObject(ResourcesClient.CreatePSResourceGroup(parameters)); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/RemoveAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/RemoveAzureResourceGroupCommand.cs index 3466c35e8ee1..4ca85c73e5af 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/RemoveAzureResourceGroupCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/RemoveAzureResourceGroupCommand.cs @@ -46,6 +46,7 @@ public override void ExecuteCmdlet() if (PassThru) { + WriteWarning("The PassThru switch parameter is being deprecated and will be removed in a future release."); WriteObject(true); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/SetAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/SetAzureResourceGroupCommand.cs index f0229511ca01..7b9b06753775 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/SetAzureResourceGroupCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/SetAzureResourceGroupCommand.cs @@ -40,7 +40,7 @@ public override void ExecuteCmdlet() ResourceGroupName = Name, Tag = Tag }; - + WriteWarning("The output object of this cmdlet will be modified in a future release."); WriteObject(ResourcesClient.UpdatePSResourceGroup(parameters)); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/Templates/GetAzureResourceGroupGalleryTemplateCommand.cs b/src/ResourceManager/Resources/Commands.Resources/Templates/GetAzureResourceGroupGalleryTemplateCommand.cs index 54fdb43e08f3..ce355a4d61ec 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Templates/GetAzureResourceGroupGalleryTemplateCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Templates/GetAzureResourceGroupGalleryTemplateCommand.cs @@ -49,6 +49,7 @@ public class GetAzureResourceGroupGalleryTemplateCommand : ResourcesBaseCmdlet public override void ExecuteCmdlet() { + WriteWarning("This cmdlet is being deprecated and will be removed in a future release."); FilterGalleryTemplatesOptions options = new FilterGalleryTemplatesOptions() { Category = Category, diff --git a/src/ResourceManager/Resources/Commands.Resources/Templates/SaveAzureResourceGroupGalleryTemplateCommand.cs b/src/ResourceManager/Resources/Commands.Resources/Templates/SaveAzureResourceGroupGalleryTemplateCommand.cs index b16092d8d93f..1e5d49804fd9 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Templates/SaveAzureResourceGroupGalleryTemplateCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Templates/SaveAzureResourceGroupGalleryTemplateCommand.cs @@ -37,6 +37,7 @@ public class SaveAzureResourceGroupGalleryTemplateCommand : ResourcesBaseCmdlet public override void ExecuteCmdlet() { + WriteWarning("This cmdlet is being deprecated and will be removed in a future release."); string path = GalleryTemplatesClient.DownloadGalleryTemplateFile( Identity, string.IsNullOrEmpty(Path) ? System.IO.Path.Combine(CurrentPath(), Identity) : this.TryResolvePath(Path), diff --git a/src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs b/src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs index 7b9b658e11d1..ec3a01c99250 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs @@ -41,6 +41,10 @@ public TestAzureResourceGroupTemplateCommand() public override void ExecuteCmdlet() { this.WriteWarning("The Test-AzureResourceGroupTemplate cmdlet is being renamed to Test-AzureResourceGroupDeployment in a future release."); + if (!string.IsNullOrEmpty(TemplateVersion) || !string.IsNullOrEmpty(StorageAccountName) || !string.IsNullOrEmpty(GalleryTemplateIdentity)) + { + WriteWarning("The GalleryTemplateIdentity, TemplateVersion and StorageAccountName parameters are being deprecated and will be removed in a future release."); + } ValidatePSResourceGroupDeploymentParameters parameters = new ValidatePSResourceGroupDeploymentParameters() { ResourceGroupName = ResourceGroupName,