Skip to content

Commit c19b30e

Browse files
authored
[Az.ServiceFabric] Renamed Remove-AzServiceFabricManagedNodeType parameter sets to use "Remove" instead of "Delete" for consistency with cmdlet name. (#28518)
1 parent 95c90e6 commit c19b30e

File tree

3 files changed

+48
-47
lines changed

3 files changed

+48
-47
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+
* Renamed Remove-AzServiceFabricManagedNodeType parameter sets to use "Remove" instead of "Delete" for consistency with cmdlet name.
2122

2223
## Version 3.7.0
2324
* Updated SF to latest api preview version `2023-11-01-preview`

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,72 +20,72 @@
2020

2121
namespace Microsoft.Azure.Commands.ServiceFabric.Commands
2222
{
23-
[Cmdlet(VerbsCommon.Remove, ResourceManager.Common.AzureRMConstants.AzurePrefix + Constants.ServiceFabricPrefix + "ManagedNodeType", DefaultParameterSetName = DeleteNodeTypeByObj, SupportsShouldProcess = true), OutputType(typeof(bool))]
23+
[Cmdlet(VerbsCommon.Remove, ResourceManager.Common.AzureRMConstants.AzurePrefix + Constants.ServiceFabricPrefix + "ManagedNodeType", DefaultParameterSetName = RemoveNodeTypeByObj, SupportsShouldProcess = true), OutputType(typeof(bool))]
2424
public class RemoveAzServiceFabricManagedNodeType : ServiceFabricManagedCmdletBase
2525
{
26-
protected const string DeleteNodeTypeByName = "DeleteNodeTypeByName";
27-
protected const string DeleteNodeTypeByObj = "DeleteNodeTypeByObj";
28-
protected const string DeleteNodeTypeById = "DeleteNodeTypeById";
26+
protected const string RemoveNodeTypeByName = "RemoveNodeTypeByName";
27+
protected const string RemoveNodeTypeByObj = "RemoveNodeTypeByObj";
28+
protected const string RemoveNodeTypeById = "RemoveNodeTypeById";
2929

30-
protected const string DeleteNodeByName = "DeleteNodeByName";
31-
protected const string DeleteNodeByObj = "DeleteNodeByObj";
32-
protected const string DeleteNodeById = "DeleteNodeById";
30+
protected const string RemoveNodeByName = "RemoveNodeByName";
31+
protected const string RemoveNodeByObj = "RemoveNodeByObj";
32+
protected const string RemoveNodeById = "RemoveNodeById";
3333

3434
#region Params
3535

3636
#region Common params
3737

38-
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = DeleteNodeTypeByName,
38+
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveNodeTypeByName,
3939
HelpMessage = "Specify the name of the resource group.")]
40-
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = DeleteNodeByName,
40+
[Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveNodeByName,
4141
HelpMessage = "Specify the name of the resource group.")]
4242
[ResourceGroupCompleter]
4343
[ValidateNotNullOrEmpty()]
4444
public string ResourceGroupName { get; set; }
4545

46-
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = DeleteNodeTypeByName,
46+
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveNodeTypeByName,
4747
HelpMessage = "Specify the name of the cluster.")]
48-
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = DeleteNodeByName,
48+
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveNodeByName,
4949
HelpMessage = "Specify the name of the cluster.")]
5050
[ResourceNameCompleter(Constants.ManagedClustersFullType, nameof(ResourceGroupName))]
5151
[ValidateNotNullOrEmpty()]
5252
public string ClusterName { get; set; }
5353

54-
[Parameter(Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = DeleteNodeTypeByName,
54+
[Parameter(Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveNodeTypeByName,
5555
HelpMessage = "Specify the name of the node type.")]
56-
[Parameter(Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = DeleteNodeByName,
56+
[Parameter(Mandatory = true, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveNodeByName,
5757
HelpMessage = "Specify the name of the node type.")]
5858
[ValidateNotNullOrEmpty()]
5959
[Alias("NodeTypeName")]
6060
public string Name { get; set; }
6161

62-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = DeleteNodeTypeByObj,
62+
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = RemoveNodeTypeByObj,
6363
HelpMessage = "Node type resource")]
64-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = DeleteNodeByObj,
64+
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = RemoveNodeByObj,
6565
HelpMessage = "Node type resource")]
6666
[ValidateNotNull]
6767
public PSManagedNodeType InputObject { get; set; }
6868

69-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = DeleteNodeTypeById,
69+
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = RemoveNodeTypeById,
7070
HelpMessage = "Node type resource id")]
71-
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = DeleteNodeById,
71+
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = RemoveNodeById,
7272
HelpMessage = "Node type resource id")]
7373
[ValidateNotNullOrEmpty]
7474
public string ResourceId { get; set; }
7575

7676
#endregion
7777

78-
[Parameter(Mandatory = true, ParameterSetName = DeleteNodeByName, HelpMessage = "List of node names for the operation.")]
79-
[Parameter(Mandatory = true, ParameterSetName = DeleteNodeByObj, HelpMessage = "List of node names for the operation.")]
80-
[Parameter(Mandatory = true, ParameterSetName = DeleteNodeById, HelpMessage = "List of node names for the operation.")]
78+
[Parameter(Mandatory = true, ParameterSetName = RemoveNodeByName, HelpMessage = "List of node names for the operation.")]
79+
[Parameter(Mandatory = true, ParameterSetName = RemoveNodeByObj, HelpMessage = "List of node names for the operation.")]
80+
[Parameter(Mandatory = true, ParameterSetName = RemoveNodeById, HelpMessage = "List of node names for the operation.")]
8181
[ValidateNotNullOrEmpty()]
8282
public string[] NodeName { get; set; }
8383

84-
[Parameter(Mandatory = false, ParameterSetName = DeleteNodeByName,
84+
[Parameter(Mandatory = false, ParameterSetName = RemoveNodeByName,
8585
HelpMessage = "Using this flag will force the removal 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 nodes, or might bring the cluster down if there are not enough seed nodes after the opearion.")]
86-
[Parameter(Mandatory = false, ParameterSetName = DeleteNodeByObj,
86+
[Parameter(Mandatory = false, ParameterSetName = RemoveNodeByObj,
8787
HelpMessage = "Using this flag will force the removal 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 nodes, or might bring the cluster down if there are not enough seed nodes after the opearion.")]
88-
[Parameter(Mandatory = false, ParameterSetName = DeleteNodeById,
88+
[Parameter(Mandatory = false, ParameterSetName = RemoveNodeById,
8989
HelpMessage = "Using this flag will force the removal 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 nodes, or might bring the cluster down if there are not enough seed nodes after the opearion.")]
9090
public SwitchParameter ForceRemoveNode { get; set; }
9191

@@ -105,10 +105,10 @@ public override void ExecuteCmdlet()
105105
this.SetParams();
106106
switch (ParameterSetName)
107107
{
108-
case DeleteNodeByName:
109-
case DeleteNodeByObj:
110-
case DeleteNodeById:
111-
if (ShouldProcess(target: this.Name, action: string.Format("Delete node(s) {0}, from node type {1} on cluster {2}", string.Join(", ", this.NodeName), this.Name, this.ClusterName)))
108+
case RemoveNodeByName:
109+
case RemoveNodeByObj:
110+
case RemoveNodeById:
111+
if (ShouldProcess(target: this.Name, action: string.Format("Remove node(s) {0}, from node type {1} on cluster {2}", string.Join(", ", this.NodeName), this.Name, this.ClusterName)))
112112
{
113113

114114
var actionParams = new NodeTypeActionParameters(nodes: this.NodeName, force: this.ForceRemoveNode.IsPresent);
@@ -123,9 +123,9 @@ public override void ExecuteCmdlet()
123123

124124
break;
125125

126-
case DeleteNodeTypeByName:
127-
case DeleteNodeTypeByObj:
128-
case DeleteNodeTypeById:
126+
case RemoveNodeTypeByName:
127+
case RemoveNodeTypeByObj:
128+
case RemoveNodeTypeById:
129129
if (ShouldProcess(target: this.Name, action: string.Format("Remove node type: {0} on cluster {1}, resource group {2}", this.Name, this.ClusterName, this.ResourceGroupName)))
130130
{
131131
var beginRequestResponse = this.SfrpMcClient.NodeTypes.BeginDeleteWithHttpMessagesAsync(
@@ -155,17 +155,17 @@ private void SetParams()
155155
{
156156
switch (ParameterSetName)
157157
{
158-
case DeleteNodeByObj:
159-
case DeleteNodeTypeByObj:
158+
case RemoveNodeByObj:
159+
case RemoveNodeTypeByObj:
160160
if (string.IsNullOrEmpty(this.InputObject?.Id))
161161
{
162162
throw new ArgumentException("ResourceId is null.");
163163
}
164164

165165
SetParametersByResourceId(this.InputObject.Id);
166166
break;
167-
case DeleteNodeById:
168-
case DeleteNodeTypeById:
167+
case RemoveNodeById:
168+
case RemoveNodeTypeById:
169169
SetParametersByResourceId(this.ResourceId);
170170
break;
171171
}

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,39 @@ Remove the node type or specific nodes within the node type.
1212

1313
## SYNTAX
1414

15-
### DeleteNodeTypeByObj (Default)
15+
### RemoveNodeTypeByObj (Default)
1616
```
1717
Remove-AzServiceFabricManagedNodeType [-InputObject] <PSManagedNodeType> [-PassThru] [-AsJob]
1818
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
1919
```
2020

21-
### DeleteNodeTypeByName
21+
### RemoveNodeTypeByName
2222
```
2323
Remove-AzServiceFabricManagedNodeType [-ResourceGroupName] <String> [-ClusterName] <String> [-Name] <String>
2424
[-PassThru] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2525
```
2626

27-
### DeleteNodeByName
27+
### RemoveNodeByName
2828
```
2929
Remove-AzServiceFabricManagedNodeType [-ResourceGroupName] <String> [-ClusterName] <String> [-Name] <String>
3030
-NodeName <String[]> [-ForceRemoveNode] [-PassThru] [-AsJob] [-DefaultProfile <IAzureContextContainer>]
3131
[-WhatIf] [-Confirm] [<CommonParameters>]
3232
```
3333

34-
### DeleteNodeByObj
34+
### RemoveNodeByObj
3535
```
3636
Remove-AzServiceFabricManagedNodeType [-InputObject] <PSManagedNodeType> -NodeName <String[]>
3737
[-ForceRemoveNode] [-PassThru] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
3838
[<CommonParameters>]
3939
```
4040

41-
### DeleteNodeTypeById
41+
### RemoveNodeTypeById
4242
```
4343
Remove-AzServiceFabricManagedNodeType [-ResourceId] <String> [-PassThru] [-AsJob]
4444
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
4545
```
4646

47-
### DeleteNodeById
47+
### RemoveNodeById
4848
```
4949
Remove-AzServiceFabricManagedNodeType [-ResourceId] <String> -NodeName <String[]> [-ForceRemoveNode]
5050
[-PassThru] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
@@ -121,7 +121,7 @@ Specify the name of the cluster.
121121
122122
```yaml
123123
Type: System.String
124-
Parameter Sets: DeleteNodeTypeByName, DeleteNodeByName
124+
Parameter Sets: RemoveNodeTypeByName, RemoveNodeByName
125125
Aliases:
126126

127127
Required: True
@@ -152,7 +152,7 @@ Use with caution as this might cause data loss if stateful workloads are running
152152
153153
```yaml
154154
Type: System.Management.Automation.SwitchParameter
155-
Parameter Sets: DeleteNodeByName, DeleteNodeByObj, DeleteNodeById
155+
Parameter Sets: RemoveNodeByName, RemoveNodeByObj, RemoveNodeById
156156
Aliases:
157157

158158
Required: False
@@ -167,7 +167,7 @@ Node type resource
167167
168168
```yaml
169169
Type: Microsoft.Azure.Commands.ServiceFabric.Models.PSManagedNodeType
170-
Parameter Sets: DeleteNodeTypeByObj, DeleteNodeByObj
170+
Parameter Sets: RemoveNodeTypeByObj, RemoveNodeByObj
171171
Aliases:
172172

173173
Required: True
@@ -182,7 +182,7 @@ Specify the name of the node type.
182182
183183
```yaml
184184
Type: System.String
185-
Parameter Sets: DeleteNodeTypeByName, DeleteNodeByName
185+
Parameter Sets: RemoveNodeTypeByName, RemoveNodeByName
186186
Aliases: NodeTypeName
187187

188188
Required: True
@@ -197,7 +197,7 @@ List of node names for the operation.
197197
198198
```yaml
199199
Type: System.String[]
200-
Parameter Sets: DeleteNodeByName, DeleteNodeByObj, DeleteNodeById
200+
Parameter Sets: RemoveNodeByName, RemoveNodeByObj, RemoveNodeById
201201
Aliases:
202202

203203
Required: True
@@ -227,7 +227,7 @@ Specify the name of the resource group.
227227
228228
```yaml
229229
Type: System.String
230-
Parameter Sets: DeleteNodeTypeByName, DeleteNodeByName
230+
Parameter Sets: RemoveNodeTypeByName, RemoveNodeByName
231231
Aliases:
232232

233233
Required: True
@@ -242,7 +242,7 @@ Node type resource id
242242
243243
```yaml
244244
Type: System.String
245-
Parameter Sets: DeleteNodeTypeById, DeleteNodeById
245+
Parameter Sets: RemoveNodeTypeById, RemoveNodeById
246246
Aliases:
247247

248248
Required: True

0 commit comments

Comments
 (0)