Skip to content

Commit da36bc2

Browse files
committed
Bug fixes
1 parent 3e51378 commit da36bc2

10 files changed

+92
-11
lines changed

src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzResourceGroupDeploymentStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.DeploymentStacks
15+
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
1616
{
1717
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels;
1818
using System;

src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzResourceGroupDeploymentStackSnapshot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.DeploymentStacks
15+
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
1616
{
1717
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels;
1818
using System;
@@ -21,7 +21,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.Deploy
2121
using System.Text;
2222

2323
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "ResourceGroupDeploymentStackSnapshot",
24-
DefaultParameterSetName = GetAzResourceGroupDeploymentStackSnapshot.ListDeploymentStack), OutputType(typeof(PSDeploymentStack))]
24+
DefaultParameterSetName = GetAzResourceGroupDeploymentStackSnapshot.ListDeploymentStack), OutputType(typeof(PSDeploymentStackSnapshot))]
2525
public class GetAzResourceGroupDeploymentStackSnapshot : DeploymentStacksCmdletBase
2626
{
2727
#region Cmdlet Parameters and Parameter Set Definitions

src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzSubscriptionDeploymentStack.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
99
{
10-
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "SubscriptionDeploymentStack",
10+
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "DeploymentStack",
1111
DefaultParameterSetName = GetAzSubscriptionDeploymentStack.ListParameterSetname), OutputType(typeof(PSDeploymentStack))]
12+
[Alias("Get-AzSubscriptionDeploymentStack")]
1213
class GetAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
1314
{
1415
#region Cmdlet Parameters and Parameter Set Definitions

src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzSubscriptionDeploymentStackSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
99
{
1010
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "SubscriptionDeploymentStackSnapshot",
11-
DefaultParameterSetName = GetAzSubscriptionDeploymentStack.ListParameterSetname), OutputType(typeof(PSDeploymentStackSnapshot))]
11+
DefaultParameterSetName = GetAzSubscriptionDeploymentStackSnapshot.ListParameterSetname), OutputType(typeof(PSDeploymentStackSnapshot))]
1212
class GetAzSubscriptionDeploymentStackSnapshot : DeploymentStacksCmdletBase
1313
{
1414
#region Cmdlet Parameters and Parameter Set Definitions

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzSubscriptionDeploymentStack.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ public class NewAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
8080
HelpMessage = "Description for the stack")]
8181
public string Description { get; set; }
8282

83+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
84+
HelpMessage = "Location of the stack")]
85+
public string Location { get; set; }
86+
8387
#endregion
8488

8589
#region Cmdlet Overrides
@@ -99,6 +103,7 @@ public override void ExecuteCmdlet()
99103
throw new PSInvalidOperationException(
100104
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
101105
}
106+
TemplateUri = TemplateFile;
102107
break;
103108
case ParameterFileTemplateSpecParameterSetName:
104109
case ParameterFileTemplateUriParameterSetName:
@@ -112,6 +117,7 @@ public override void ExecuteCmdlet()
112117
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
113118
}
114119
parameters = this.GetParameterObject(ParameterFile);
120+
TemplateUri = TemplateFile;
115121
break;
116122
}
117123

@@ -122,11 +128,13 @@ public override void ExecuteCmdlet()
122128

123129
var deploymentStack = DeploymentStacksSdkClient.SubscriptionCreateOrUpdateDeploymentStack(
124130
Name,
131+
Location,
125132
TemplateUri,
126133
TemplateSpec,
127134
ParameterUri,
128135
parameters,
129-
Description
136+
Description,
137+
"Detach"
130138
);
131139
WriteObject(deploymentStack);
132140

src/Resources/ResourceManager/Implementation/DeploymentStacks/RemoveAzSubscriptionDeploymentStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
88
{
9-
[Cmdlet("Remove", Common.AzureRMConstants.AzureRMPrefix + "SubscriptionpDeploymentStack",
9+
[Cmdlet("Remove", Common.AzureRMConstants.AzureRMPrefix + "SubscriptionDeploymentStack",
1010
SupportsShouldProcess = true, DefaultParameterSetName = RemoveAzSubscriptionDeploymentStack.RemoveByResourceIdParameterSetName), OutputType(typeof(bool))]
1111
public class RemoveAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
1212
{

src/Resources/ResourceManager/Implementation/DeploymentStacks/SetAzSubscriptionDeploymentStack.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ public class SetAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
8080
HelpMessage = "Description for the stack")]
8181
public string Description { get; set; }
8282

83+
[Parameter(Mandatory = true, ValueFromPipeline = true,
84+
HelpMessage = "Update behavior for the stack. Value can be \"Detach\" or \"Purge\".")]
85+
public String UpdateBehavior { get; set; }
86+
87+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
88+
HelpMessage = "Location of the stack")]
89+
public string Location { get; set; }
90+
8391
#endregion
8492

8593
#region Cmdlet Overrides
@@ -99,6 +107,7 @@ public override void ExecuteCmdlet()
99107
throw new PSInvalidOperationException(
100108
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
101109
}
110+
TemplateUri = TemplateFile;
102111
break;
103112
case ParameterFileTemplateSpecParameterSetName:
104113
case ParameterFileTemplateUriParameterSetName:
@@ -112,6 +121,7 @@ public override void ExecuteCmdlet()
112121
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
113122
}
114123
parameters = this.GetParameterObject(ParameterFile);
124+
TemplateUri = TemplateFile;
115125
break;
116126
}
117127

@@ -123,11 +133,13 @@ public override void ExecuteCmdlet()
123133

124134
var deploymentStack = DeploymentStacksSdkClient.SubscriptionCreateOrUpdateDeploymentStack(
125135
Name,
136+
Location,
126137
TemplateUri,
127138
TemplateSpec,
128139
ParameterUri,
129140
parameters,
130-
Description
141+
Description,
142+
UpdateBehavior
131143
);
132144
WriteObject(deploymentStack);
133145

src/Resources/ResourceManager/SdkClient/DeploymentStacksSdkClient.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,20 @@ internal void DeleteSubscriptionDeploymentStack(string name)
391391

392392
public PSDeploymentStack SubscriptionCreateOrUpdateDeploymentStack(
393393
string deploymentStackName,
394+
string location,
394395
string templateUri,
395396
string templateSpec,
396397
string parameterUri,
397398
Hashtable parameters,
398-
string description
399+
string description,
400+
string updateBehavior
399401
)
400402
{
401403
var deploymentStackModel = new DeploymentStack
402404
{
403-
Description = description
405+
Description = description,
406+
Location = location,
407+
UpdateBehavior = updateBehavior
404408
};
405409

406410
DeploymentStacksTemplateLink templateLink = new DeploymentStacksTemplateLink();
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
using Xunit.Abstractions;
18+
19+
namespace Microsoft.Azure.Commands.Resources.Test.ScenarioTests
20+
{
21+
public class DeploymentStackTests : ResourceTestRunner
22+
{
23+
public DeploymentStackTests(ITestOutputHelper output) : base(output)
24+
{
25+
}
26+
27+
[Fact()]
28+
[Trait(Category.AcceptanceType, Category.CheckIn)]
29+
public void TestResourceGroupDeploymentStackGetWithResourceName()
30+
{
31+
TestRunner.RunTestScript("");
32+
}
33+
34+
[Fact()]
35+
[Trait(Category.AcceptanceType, Category.CheckIn)]
36+
public void TestResourceGroupDeploymentStackGetWithResourceId()
37+
{
38+
TestRunner.RunTestScript("");
39+
}
40+
41+
[Fact()]
42+
[Trait(Category.AcceptanceType, Category.CheckIn)]
43+
public void TestSubscriptionDeploymentStackGetWithResourceName()
44+
{
45+
TestRunner.RunTestScript("");
46+
}
47+
48+
[Fact()]
49+
[Trait(Category.AcceptanceType, Category.CheckIn)]
50+
public void TestSubscriptionDeploymentStackGetWithResourceId()
51+
{
52+
TestRunner.RunTestScript("");
53+
}
54+
55+
}
56+
}

src/Resources/Resources/Az.Resources.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ CmdletsToExport = 'Get-AzProviderOperation', 'Remove-AzRoleAssignment',
153153
'Get-AzTenantDeploymentWhatIfResult', 'Get-AzTemplateSpec',
154154
'New-AzTemplateSpec', 'Set-AzTemplateSpec', 'Export-AzTemplateSpec',
155155
'Remove-AzTemplateSpec', 'Get-AzResourceGroupDeploymentStack',
156-
'Get-AzResourceGroupDeploymentStackSnapshot', 'Get-AzSubscriptionDeploymentStack',
156+
'Get-AzResourceGroupDeploymentStackSnapshot', 'Get-AzDeploymentStack',
157157
'Get-AzSubscriptionDeploymentStackSnapshot', 'New-AzResourceGroupDeploymentStack',
158158
'New-AzSubscriptionDeploymentStack', 'Remove-AzResourceGroupDeploymentStack',
159159
'Remove-AzResourceGroupDeploymentStackSnapshot', 'Remove-AzSubscriptionDeploymentStack',

0 commit comments

Comments
 (0)