Skip to content

Commit 2569c57

Browse files
committed
[Az.ServiceFabric] Removed ReimageByName, ReimageById, and ReimageByObj parameter sets from Set-AzServiceFabricManagedNodeType
1 parent 1b48e22 commit 2569c57

File tree

2 files changed

+1
-69
lines changed

2 files changed

+1
-69
lines changed

src/ServiceFabric/ServiceFabric/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Removed `ReimageByName`, `ReimageById`, and `ReimageByObj` parameter sets from `Set-AzServiceFabricManagedNodeType`.
2122
* Added parameters `-EnableAutoOsUpgrade` and `-AllowRdpAccess` to `New-AzServiceFabricManagedCluster` and `Set-AzServiceFabricManagedCluster`.
2223
* Added parameters `-ZoneBalance`, `-AllowOverProvisioning`, and `-Zone` to `New-AzServiceFabricManagedNodeType` and `Set-AzServiceFabricManagedNodeType`.
2324
* Added preannoucement for removing Reimage parameters from `Set-AzServiceFabricManagedNodeType`.

src/ServiceFabric/ServiceFabric/Commands/ManagedClusters/NodeTypes/SetAzServiceFabricManagedNodeType.cs

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ namespace Microsoft.Azure.Commands.ServiceFabric.Commands
2828
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzurePrefix + Constants.ServiceFabricPrefix + "ManagedNodeType", DefaultParameterSetName = ByObj, SupportsShouldProcess = true), OutputType(new Type[] { typeof(bool), typeof(PSManagedNodeType) })]
2929
public class SetAzServiceFabricManagedNodeType : ServiceFabricManagedCmdletBase
3030
{
31-
protected const string ReimageByName = "ReimageByName";
32-
protected const string ReimageById = "ReimageById";
33-
protected const string ReimageByObj = "ReimageByObj";
3431
protected const string WithParamsByName = "WithParamsByName";
3532
protected const string WithParamsById = "WithParamsById";
3633
protected const string ByObj = "ByObj";
@@ -41,75 +38,34 @@ public class SetAzServiceFabricManagedNodeType : ServiceFabricManagedCmdletBase
4138

4239
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = WithParamsByName,
4340
HelpMessage = "Specify the name of the resource group.")]
44-
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = ReimageByName,
45-
HelpMessage = "Specify the name of the resource group.")]
4641
[ResourceGroupCompleter]
4742
[ValidateNotNullOrEmpty()]
4843
public string ResourceGroupName { get; set; }
4944

5045
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = WithParamsByName,
5146
HelpMessage = "Specify the name of the cluster.")]
52-
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = ReimageByName,
53-
HelpMessage = "Specify the name of the cluster.")]
5447
[ResourceNameCompleter(Constants.ManagedClustersFullType, nameof(ResourceGroupName))]
5548
[ValidateNotNullOrEmpty()]
5649
public string ClusterName { get; set; }
5750

5851
[Parameter(Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = WithParamsByName,
5952
HelpMessage = "Specify the name of the node type.")]
60-
[Parameter(Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = ReimageByName,
61-
HelpMessage = "Specify the name of the node type.")]
6253
[ValidateNotNullOrEmpty()]
6354
[Alias("NodeTypeName")]
6455
public string Name { get; set; }
6556

6657
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = WithParamsById,
6758
HelpMessage = "Node type resource id")]
68-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = ReimageById,
69-
HelpMessage = "Node type resource id")]
7059
[ValidateNotNullOrEmpty]
7160
public string ResourceId { get; set; }
7261

7362
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = ByObj,
7463
HelpMessage = "Node type resource")]
75-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = ReimageByObj,
76-
HelpMessage = "Node type resource")]
7764
[ValidateNotNull]
7865
public PSManagedNodeType InputObject { get; set; }
7966

8067
#endregion
8168

82-
#region reimage params
83-
public const String ChangeDesc = "Parameter is being deprecated without being replaced, use Invoke-AzServiceFabricReimageManagedNodeType cmdlet instead.";
84-
[CmdletParameterBreakingChangeWithVersion("NodeName", "15.0.0", "5.0.0", ChangeDescription = ChangeDesc)]
85-
[Parameter(Mandatory = true, ParameterSetName = ReimageByName, HelpMessage = "List of node names for the operation.")]
86-
[Parameter(Mandatory = true, ParameterSetName = ReimageById, HelpMessage = "List of node names for the operation.")]
87-
[Parameter(Mandatory = true, ParameterSetName = ReimageByObj, HelpMessage = "List of node names for the operation.")]
88-
[ValidateNotNullOrEmpty()]
89-
public string[] NodeName { get; set; }
90-
91-
[CmdletParameterBreakingChangeWithVersion("Reimage", "15.0.0", "5.0.0", ChangeDescription = ChangeDesc)]
92-
[Parameter(Mandatory = true, ParameterSetName = ReimageByName, HelpMessage = "List of node names for the operation.")]
93-
[Parameter(Mandatory = true, ParameterSetName = ReimageById, HelpMessage = "List of node names for the operation.")]
94-
[Parameter(Mandatory = true, ParameterSetName = ReimageByObj, HelpMessage = "List of node names for the operation.")]
95-
public SwitchParameter Reimage { get; set; }
96-
97-
[CmdletParameterBreakingChangeWithVersion("ForceReimage", "15.0.0", "5.0.0", ChangeDescription = ChangeDesc)]
98-
[Parameter(Mandatory = false, ParameterSetName = ReimageByName,
99-
HelpMessage = "Using this flag will force the reimage even if service fabric is unable to disable the nodes. Use with caution as this might cause data loss if stateful workloads are running on the node.")]
100-
[Parameter(Mandatory = false, ParameterSetName = ReimageById,
101-
HelpMessage = "Using this flag will force the reimage even if service fabric is unable to disable the nodes. Use with caution as this might cause data loss if stateful workloads are running on the node.")]
102-
[Parameter(Mandatory = false, ParameterSetName = ReimageByObj,
103-
HelpMessage = "Using this flag will force the reimage even if service fabric is unable to disable the nodes. Use with caution as this might cause data loss if stateful workloads are running on the node.")]
104-
public SwitchParameter ForceReimage { get; set; }
105-
106-
[CmdletParameterBreakingChangeWithVersion("PassThru", "15.0.0", "5.0.0", ChangeDescription = ChangeDesc)]
107-
[Parameter(Mandatory = false, ParameterSetName = ReimageByName)]
108-
[Parameter(Mandatory = false, ParameterSetName = ReimageById)]
109-
[Parameter(Mandatory = false, ParameterSetName = ReimageByObj)]
110-
public SwitchParameter PassThru { get; set; }
111-
#endregion
112-
11369
#region set params
11470

11571
[Parameter(Mandatory = false, ParameterSetName = WithParamsByName, HelpMessage = "The number of nodes in the node type.")]
@@ -150,7 +106,6 @@ public class SetAzServiceFabricManagedNodeType : ServiceFabricManagedCmdletBase
150106

151107
#endregion
152108

153-
154109
#endregion
155110

156111
public override void ExecuteCmdlet()
@@ -161,28 +116,6 @@ public override void ExecuteCmdlet()
161116
NodeType updatedNodeTypeParams = null;
162117
switch (ParameterSetName)
163118
{
164-
case ReimageByName:
165-
case ReimageById:
166-
case ReimageByObj:
167-
if (ShouldProcess(target: this.Name, action: string.Format("Reimage node(s) {0}, from node type {1} on cluster {2}", string.Join(", ", this.NodeName), this.Name, this.ClusterName)))
168-
{
169-
170-
var actionParams = new NodeTypeActionParameters(nodes: this.NodeName, force: this.ForceReimage.IsPresent);
171-
var beginRequestResponse = this.SfrpMcClient.NodeTypes.BeginReimageWithHttpMessagesAsync(
172-
this.ResourceGroupName,
173-
this.ClusterName,
174-
this.Name,
175-
actionParams).GetAwaiter().GetResult();
176-
177-
this.PollLongRunningOperation(beginRequestResponse);
178-
}
179-
180-
if (this.PassThru)
181-
{
182-
WriteObject(true);
183-
}
184-
185-
return;
186119
case WithParamsByName:
187120
case WithParamsById:
188121
updatedNodeTypeParams = this.GetUpdatedNodeTypeParams();
@@ -275,7 +208,6 @@ private void SetParams()
275208
switch (ParameterSetName)
276209
{
277210
case ByObj:
278-
case ReimageByObj:
279211
if (string.IsNullOrEmpty(this.InputObject?.Id))
280212
{
281213
throw new ArgumentException("ResourceId is null.");
@@ -284,7 +216,6 @@ private void SetParams()
284216
SetParametersByResourceId(this.InputObject.Id);
285217
break;
286218
case WithParamsById:
287-
case ReimageById:
288219
SetParametersByResourceId(this.ResourceId);
289220
break;
290221
}

0 commit comments

Comments
 (0)