Skip to content

Commit 450ef98

Browse files
authored
[Az.ServiceFabric] Removed ReimageByName, ReimageById, and ReimageByObj parameter sets from Set-AzServiceFabricManagedNodeType (#28633)
1 parent 4f82022 commit 450ef98

File tree

6 files changed

+20
-173
lines changed

6 files changed

+20
-173
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

2223
## Version 3.8.0
2324
* Changed from `Basic` to `Standard` SKUs for loadbalancers and public IP addresses for `New-AzServiceFabricCluster` and `Add-AzServiceFabricNodeType` as `Basic` SKUs are being deprecated.

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
}

src/ServiceFabric/ServiceFabric/help/Az.ServiceFabric.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Deallocate specific nodes from the node type.
7272
Redeploy nodes from the node type.
7373

7474
### [Invoke-AzServiceFabricReimageManagedNodeType](Invoke-AzServiceFabricReimageManagedNodeType.md)
75-
Reimage nodes from the node type.
75+
Reimage nodes from the node type. On reimage operation the service fabric nodes will be disabled before reimaging the vms and enabled them back again once they come back. If this is done on primary node types it might take a while as it might not reimage all the nodes at the same time. Use -ForceReimage to force the operation even if service fabric is unable to disable the nodes but use with caution as this might cause data loss if stateful workloads are running on the node.
7676

7777
### [New-AzServiceFabricApplication](New-AzServiceFabricApplication.md)
7878
Create new service fabric application under the specified resource group and cluster.
@@ -174,7 +174,7 @@ Update a service fabric managed application type version. This allows you to upd
174174
Update a managed service from the cluster. Only supports ARM deployed services.
175175

176176
### [Set-AzServiceFabricManagedNodeType](Set-AzServiceFabricManagedNodeType.md)
177-
Sets node type resource properties or run reimage actions on specific nodes of the node type with -Reimage parameter.
177+
Sets node type resource properties.
178178

179179
### [Set-AzServiceFabricSetting](Set-AzServiceFabricSetting.md)
180180
Add or update one or multiple Service Fabric settings to the cluster.

src/ServiceFabric/ServiceFabric/help/Invoke-AzServiceFabricReimageManagedNodeType.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Invoke-AzServiceFabricReimageManagedNodeType
99

1010
## SYNOPSIS
11-
Reimage nodes from the node type.
11+
Reimage nodes from the node type. On reimage operation the service fabric nodes will be disabled before reimaging the vms and enabled them back again once they come back. If this is done on primary node types it might take a while as it might not reimage all the nodes at the same time. Use -ForceReimage to force the operation even if service fabric is unable to disable the nodes but use with caution as this might cause data loss if stateful workloads are running on the node.
1212

1313
## SYNTAX
1414

@@ -19,7 +19,7 @@ Invoke-AzServiceFabricReimageManagedNodeType [-ResourceGroupName] <String> [-Clu
1919
```
2020

2121
## DESCRIPTION
22-
Reimage nodes from the node type. The nodes will be disabled, reimaged, then renabled.
22+
Reimage nodes from the node type. The nodes will be disabled, reimaged, then renabled. On reimage operation the service fabric nodes will be disabled before reimaging the vms and enabled them back again once they come back. If this is done on primary node types it might take a while as it might not reimage all the nodes at the same time. Use -ForceReimage to force the operation even if service fabric is unable to disable the nodes but use with caution as this might cause data loss if stateful workloads are running on the node.
2323

2424
## EXAMPLES
2525

src/ServiceFabric/ServiceFabric/help/Set-AzServiceFabricManagedNodeType.md

Lines changed: 8 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Set-AzServiceFabricManagedNodeType
99

1010
## SYNOPSIS
11-
Sets node type resource properties or run reimage actions on specific nodes of the node type with -Reimage parameter.
11+
Sets node type resource properties.
1212

1313
## SYNTAX
1414

@@ -26,39 +26,18 @@ Set-AzServiceFabricManagedNodeType [-ResourceGroupName] <String> [-ClusterName]
2626
[-EphemeralStartPort <Int32>] [-EphemeralEndPort <Int32>] [-Capacity <Hashtable>]
2727
[-PlacementProperty <Hashtable>] [-VmSize <String>] [-ZoneBalance <Boolean>]
2828
[-EnableOverProvisioning <Boolean>] [-Zone <System.Collections.Generic.List`1[System.String]>] [-AsJob]
29-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
30-
```
31-
32-
### ReimageByName
33-
```
34-
Set-AzServiceFabricManagedNodeType [-ResourceGroupName] <String> [-ClusterName] <String> [-Name] <String>
35-
-NodeName <String[]> [-Reimage] [-ForceReimage] [-PassThru] [-AsJob]
3629
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
3730
[<CommonParameters>]
3831
```
3932

4033
### WithParamsById
4134
```
4235
Set-AzServiceFabricManagedNodeType [-ResourceId] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>]
43-
[-WhatIf] [-Confirm] [<CommonParameters>]
44-
```
45-
46-
### ReimageById
47-
```
48-
Set-AzServiceFabricManagedNodeType [-ResourceId] <String> -NodeName <String[]> [-Reimage] [-ForceReimage]
49-
[-PassThru] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
50-
[-Confirm] [<CommonParameters>]
51-
```
52-
53-
### ReimageByObj
54-
```
55-
Set-AzServiceFabricManagedNodeType [-InputObject] <PSManagedNodeType> -NodeName <String[]> [-Reimage]
56-
[-ForceReimage] [-PassThru] [-AsJob] [-DefaultProfile <IAzureContextContainer>]
5736
[-WhatIf] [-Confirm] [<CommonParameters>]
5837
```
5938

6039
## DESCRIPTION
61-
Sets node type resource properties or run reimage actions on specific nodes of the node type with -Reimage parameter. On reimage operation the service fabric nodes will be disabled before reimaging the vms and enabled them back again once they come back. If this is done on primary node types it might take a while as it might not reimage all the nodes at the same time. Use -ForceReimage to force the operation even if service fabric is unable to disable the nodes but use with caution as this might cause data loss if stateful workloads are running on the node.
40+
Sets node type resource properties.
6241

6342
## EXAMPLES
6443

@@ -87,16 +66,6 @@ Update placement properties of the node type. This will overwrite older placemen
8766
$rgName = "testRG"
8867
$clusterName = "testCluster"
8968
$NodeTypeName = "nt1"
90-
Set-AzServiceFabricManagedNodeType -ResourceGroupName $rgName -ClusterName $clusterName -Name $NodeTypeName -Reimage -NodeName nt1_0, nt1_3
91-
```
92-
93-
Reimage node 0 and 3 on the node type.
94-
95-
### Example 4
96-
```powershell
97-
$rgName = "testRG"
98-
$clusterName = "testCluster"
99-
$NodeTypeName = "nt1"
10069
$nodeType = Get-AzServiceFabricManagedNodeType -ResourceGroupName $rgName -ClusterName $clusterName -Name $NodeTypeName
10170
10271
$nodeType.VmInstanceCount = 6
@@ -105,7 +74,7 @@ $nodeType | Set-AzServiceFabricManagedNodeType
10574

10675
Update the instance count of the node type, with piping.
10776

108-
### Example 5
77+
### Example 4
10978
```powershell
11079
$rgName = "testRG"
11180
$clusterName = "testCluster"
@@ -182,7 +151,7 @@ Specify the name of the cluster.
182151
183152
```yaml
184153
Type: System.String
185-
Parameter Sets: WithParamsByName, ReimageByName
154+
Parameter Sets: WithParamsByName
186155
Aliases:
187156

188157
Required: True
@@ -252,28 +221,12 @@ Accept pipeline input: False
252221
Accept wildcard characters: False
253222
```
254223
255-
### -ForceReimage
256-
Using this flag will force the removal even if service fabric is unable to disable the nodes.
257-
Use with caution as this might cause data loss if stateful workloads are running on the node.
258-
259-
```yaml
260-
Type: System.Management.Automation.SwitchParameter
261-
Parameter Sets: ReimageByName, ReimageById, ReimageByObj
262-
Aliases:
263-
264-
Required: False
265-
Position: Named
266-
Default value: None
267-
Accept pipeline input: False
268-
Accept wildcard characters: False
269-
```
270-
271224
### -InputObject
272225
Node type resource
273226
274227
```yaml
275228
Type: Microsoft.Azure.Commands.ServiceFabric.Models.PSManagedNodeType
276-
Parameter Sets: ByObj, ReimageByObj
229+
Parameter Sets: ByObj
277230
Aliases:
278231

279232
Required: True
@@ -303,7 +256,7 @@ Specify the name of the node type.
303256
304257
```yaml
305258
Type: System.String
306-
Parameter Sets: WithParamsByName, ReimageByName
259+
Parameter Sets: WithParamsByName
307260
Aliases: NodeTypeName
308261

309262
Required: True
@@ -313,36 +266,6 @@ Accept pipeline input: True (ByPropertyName)
313266
Accept wildcard characters: False
314267
```
315268
316-
### -NodeName
317-
List of node names for the operation.
318-
319-
```yaml
320-
Type: System.String[]
321-
Parameter Sets: ReimageByName, ReimageById, ReimageByObj
322-
Aliases:
323-
324-
Required: True
325-
Position: Named
326-
Default value: None
327-
Accept pipeline input: False
328-
Accept wildcard characters: False
329-
```
330-
331-
### -PassThru
332-
{{ Fill PassThru Description }}
333-
334-
```yaml
335-
Type: System.Management.Automation.SwitchParameter
336-
Parameter Sets: ReimageByName, ReimageById, ReimageByObj
337-
Aliases:
338-
339-
Required: False
340-
Position: Named
341-
Default value: None
342-
Accept pipeline input: False
343-
Accept wildcard characters: False
344-
```
345-
346269
### -PlacementProperty
347270
Placement tags applied to nodes in the node type as key/value pairs, which can be used to indicate where certain services (workload) should run. Updating this will override the current values.
348271
@@ -358,27 +281,12 @@ Accept pipeline input: False
358281
Accept wildcard characters: False
359282
```
360283
361-
### -Reimage
362-
Specify to reimage nodes on the node type.
363-
364-
```yaml
365-
Type: System.Management.Automation.SwitchParameter
366-
Parameter Sets: ReimageByName, ReimageById, ReimageByObj
367-
Aliases:
368-
369-
Required: True
370-
Position: Named
371-
Default value: None
372-
Accept pipeline input: False
373-
Accept wildcard characters: False
374-
```
375-
376284
### -ResourceGroupName
377285
Specify the name of the resource group.
378286
379287
```yaml
380288
Type: System.String
381-
Parameter Sets: WithParamsByName, ReimageByName
289+
Parameter Sets: WithParamsByName
382290
Aliases:
383291

384292
Required: True
@@ -393,7 +301,7 @@ Node type resource id
393301
394302
```yaml
395303
Type: System.String
396-
Parameter Sets: WithParamsById, ReimageById
304+
Parameter Sets: WithParamsById
397305
Aliases:
398306

399307
Required: True

0 commit comments

Comments
 (0)