Skip to content

Commit

Permalink
Change the parameter set names to verb+ByName|ResourceId|InputObject …
Browse files Browse the repository at this point in the history
…style
  • Loading branch information
Zhenyu Zhou committed Jun 7, 2021
1 parent 9e6221d commit 1de6bd6
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@

namespace Microsoft.Azure.Commands.HDInsight
{
[Cmdlet("Disable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightAzureMonitor", DefaultParameterSetName = SetByNameParameterSet, SupportsShouldProcess = true)]
[Cmdlet("Disable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightAzureMonitor", DefaultParameterSetName = DisableByNameParameterSet, SupportsShouldProcess = true)]
[OutputType(typeof(bool))]
public class DisableAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
{
#region Input Parameter Definitions

private const string SetByNameParameterSet = "ByNameParameterSet";
private const string SetByResourceIdParameterSet = "SetByResourceIdParameterSet";
private const string SetByInputObjectParameterSet = "SetByInputObjectParameterSet";
private const string DisableByNameParameterSet = "DisableByNameParameterSet";
private const string DisableByResourceIdParameterSet = "DisableByResourceIdParameterSet";
private const string DisableByInputObjectParameterSet = "DisableByInputObjectParameterSet";

[Parameter(
Position = 0,
Mandatory = false,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = DisableByNameParameterSet,
HelpMessage = "Gets or sets the name of the resource group.")]
[ResourceGroupCompleter]
public string ResourceGroupName { get; set; }

[Parameter(
Position = 1,
Mandatory = true,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = DisableByNameParameterSet,
HelpMessage = "Gets or sets the name of the cluster.")]
[ResourceNameCompleter("Microsoft.HDInsight/clusters", nameof(ResourceGroupName))]
[ValidateNotNullOrEmpty]
Expand All @@ -52,7 +52,7 @@ public class DisableAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
Position = 0,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = SetByResourceIdParameterSet,
ParameterSetName = DisableByResourceIdParameterSet,
HelpMessage = "Gets or sets the resource id.")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
Expand All @@ -61,7 +61,7 @@ public class DisableAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
Position = 0,
Mandatory = true,
ValueFromPipeline = true,
ParameterSetName = SetByInputObjectParameterSet,
ParameterSetName = DisableByInputObjectParameterSet,
HelpMessage = "Gets or sets the input object.")]
[ValidateNotNull]
public AzureHDInsightCluster InputObject { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@

namespace Microsoft.Azure.Commands.HDInsight
{
[Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightAzureMonitor", DefaultParameterSetName = SetByNameParameterSet, SupportsShouldProcess = true)]
[Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightAzureMonitor", DefaultParameterSetName = EnableByNameParameterSet, SupportsShouldProcess = true)]
[OutputType(typeof(bool))]
public class EnableAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
{
#region Input Parameter Definitions

private const string SetByNameParameterSet = "ByNameParameterSet";
private const string SetByResourceIdParameterSet = "SetByResourceIdParameterSet";
private const string SetByInputObjectParameterSet = "SetByInputObjectParameterSet";
private const string EnableByNameParameterSet = "EnableByNameParameterSet";
private const string EnableByResourceIdParameterSet = "EnableByResourceIdParameterSet";
private const string EnableByInputObjectParameterSet = "EnableByInputObjectParameterSet";

[Parameter(
Position = 0,
Mandatory = false,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = EnableByNameParameterSet,
HelpMessage = "Gets or sets the name of the resource group.")]
[ResourceGroupCompleter]
public string ResourceGroupName { get; set; }

[Parameter(
Position = 1,
Mandatory = true,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = EnableByNameParameterSet,
HelpMessage = "Gets or sets the name of the cluster.")]
[ResourceNameCompleter("Microsoft.HDInsight/clusters", nameof(ResourceGroupName))]
[ValidateNotNullOrEmpty]
Expand All @@ -54,7 +54,7 @@ public class EnableAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
Position = 0,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = SetByResourceIdParameterSet,
ParameterSetName = EnableByResourceIdParameterSet,
HelpMessage = "Gets or sets the resource id.")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
Expand All @@ -63,42 +63,42 @@ public class EnableAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
Position = 0,
Mandatory = true,
ValueFromPipeline = true,
ParameterSetName = SetByInputObjectParameterSet,
ParameterSetName = EnableByInputObjectParameterSet,
HelpMessage = "Gets or sets the input object.")]
[ValidateNotNull]
public AzureHDInsightCluster InputObject { get; set; }

[Parameter(
Position = 2,
Mandatory = true,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = EnableByNameParameterSet,
HelpMessage = "Gets or sets the ID of the Log Analytics workspace.")]
[Parameter(
Position = 1,
Mandatory = true,
ParameterSetName = SetByResourceIdParameterSet,
ParameterSetName = EnableByResourceIdParameterSet,
HelpMessage = "Gets or sets the ID of the Log Analytics workspace.")]
[Parameter(
Position = 1,
Mandatory = true,
ParameterSetName = SetByInputObjectParameterSet,
ParameterSetName = EnableByInputObjectParameterSet,
HelpMessage = "Gets or sets the ID of the Log Analytics workspace.")]
public string WorkspaceId { get; set; }

[Parameter(
Position = 3,
Mandatory = true,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = EnableByNameParameterSet,
HelpMessage = "Gets to sets the primary key of the Log Analytics workspace.")]
[Parameter(
Position = 2,
Mandatory = true,
ParameterSetName = SetByResourceIdParameterSet,
ParameterSetName = EnableByResourceIdParameterSet,
HelpMessage = "Gets to sets the primary key of the Log Analytics workspace.")]
[Parameter(
Position = 2,
Mandatory = true,
ParameterSetName = SetByInputObjectParameterSet,
ParameterSetName = EnableByInputObjectParameterSet,
HelpMessage = "Gets to sets the primary key of the Log Analytics workspace.")]
public string PrimaryKey { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@

namespace Microsoft.Azure.Commands.HDInsight
{
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightAzureMonitor", DefaultParameterSetName = SetByNameParameterSet)]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightAzureMonitor", DefaultParameterSetName = GetByNameParameterSet)]
[OutputType(typeof(AzureHDInsightAzureMonitor))]
public class GetAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
{
#region Input Parameter Definitions
private const string SetByNameParameterSet = "ByNameParameterSet";
private const string SetByResourceIdParameterSet = "SetByResourceIdParameterSet";
private const string SetByInputObjectParameterSet = "SetByInputObjectParameterSet";
private const string GetByNameParameterSet = "GetByNameParameterSet";
private const string GetByResourceIdParameterSet = "GetByResourceIdParameterSet";
private const string GetByInputObjectParameterSet = "GetByInputObjectParameterSet";

[Parameter(
Position = 0,
Mandatory = false,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = GetByNameParameterSet,
HelpMessage = "Gets or sets the name of the resource group.")]
[ResourceGroupCompleter]
public string ResourceGroupName { get; set; }

[Parameter(
Position = 1,
Mandatory = true,
ParameterSetName = SetByNameParameterSet,
ParameterSetName = GetByNameParameterSet,
HelpMessage = "Gets or sets the name of the cluster.")]
[ResourceNameCompleter("Microsoft.HDInsight/clusters", nameof(ResourceGroupName))]
[ValidateNotNullOrEmpty]
Expand All @@ -52,7 +52,7 @@ public class GetAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
Position = 0,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = SetByResourceIdParameterSet,
ParameterSetName = GetByResourceIdParameterSet,
HelpMessage = "Gets or sets the resource id.")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
Expand All @@ -61,7 +61,7 @@ public class GetAzureHDInsightAzureMonitorCommand : HDInsightCmdletBase
Position = 0,
Mandatory = true,
ValueFromPipeline = true,
ParameterSetName = SetByInputObjectParameterSet,
ParameterSetName = GetByInputObjectParameterSet,
HelpMessage = "Gets or sets the input object.")]
[ValidateNotNull]
public AzureHDInsightCluster InputObject { get; set; }
Expand Down
14 changes: 7 additions & 7 deletions src/HDInsight/HDInsight/help/Disable-AzHDInsightAzureMonitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ Disables Azure Monitor in a specified HDInsight cluster.

## SYNTAX

### ByNameParameterSet (Default)
### DisableByNameParameterSet (Default)
```
Disable-AzHDInsightAzureMonitor [[-ResourceGroupName] <String>] [-ClusterName] <String>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### SetByResourceIdParameterSet
### DisableByResourceIdParameterSet
```
Disable-AzHDInsightAzureMonitor [-ResourceId] <String> [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### SetByInputObjectParameterSet
### DisableByInputObjectParameterSet
```
Disable-AzHDInsightAzureMonitor [-InputObject] <AzureHDInsightCluster>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
Expand Down Expand Up @@ -62,7 +62,7 @@ Gets or sets the name of the cluster.

```yaml
Type: System.String
Parameter Sets: ByNameParameterSet
Parameter Sets: DisableByNameParameterSet
Aliases:

Required: True
Expand Down Expand Up @@ -92,7 +92,7 @@ Gets or sets the input object.
```yaml
Type: Microsoft.Azure.Commands.HDInsight.Models.AzureHDInsightCluster
Parameter Sets: SetByInputObjectParameterSet
Parameter Sets: DisableByInputObjectParameterSet
Aliases:

Required: True
Expand All @@ -107,7 +107,7 @@ Gets or sets the name of the resource group.
```yaml
Type: System.String
Parameter Sets: ByNameParameterSet
Parameter Sets: DisableByNameParameterSet
Aliases:

Required: False
Expand All @@ -122,7 +122,7 @@ Gets or sets the resource id.
```yaml
Type: System.String
Parameter Sets: SetByResourceIdParameterSet
Parameter Sets: DisableByResourceIdParameterSet
Aliases:

Required: True
Expand Down
14 changes: 7 additions & 7 deletions src/HDInsight/HDInsight/help/Enable-AzHDInsightAzureMonitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ Enables Azure Monitor in a specified HDInsight cluster.

## SYNTAX

### ByNameParameterSet (Default)
### EnableByNameParameterSet (Default)
```
Enable-AzHDInsightAzureMonitor [[-ResourceGroupName] <String>] [-ClusterName] <String> [-WorkspaceId] <String>
[-PrimaryKey] <String> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### SetByResourceIdParameterSet
### EnableByResourceIdParameterSet
```
Enable-AzHDInsightAzureMonitor [-ResourceId] <String> [-WorkspaceId] <String> [-PrimaryKey] <String>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### SetByInputObjectParameterSet
### EnableByInputObjectParameterSet
```
Enable-AzHDInsightAzureMonitor [-InputObject] <AzureHDInsightCluster> [-WorkspaceId] <String>
[-PrimaryKey] <String> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
Expand Down Expand Up @@ -66,7 +66,7 @@ Gets or sets the name of the cluster.

```yaml
Type: System.String
Parameter Sets: ByNameParameterSet
Parameter Sets: EnableByNameParameterSet
Aliases:

Required: True
Expand Down Expand Up @@ -96,7 +96,7 @@ Gets or sets the input object.
```yaml
Type: Microsoft.Azure.Commands.HDInsight.Models.AzureHDInsightCluster
Parameter Sets: SetByInputObjectParameterSet
Parameter Sets: EnableByInputObjectParameterSet
Aliases:

Required: True
Expand Down Expand Up @@ -126,7 +126,7 @@ Gets or sets the name of the resource group.
```yaml
Type: System.String
Parameter Sets: ByNameParameterSet
Parameter Sets: EnableByNameParameterSet
Aliases:

Required: False
Expand All @@ -141,7 +141,7 @@ Gets or sets the resource id.
```yaml
Type: System.String
Parameter Sets: SetByResourceIdParameterSet
Parameter Sets: EnableByResourceIdParameterSet
Aliases:

Required: True
Expand Down
14 changes: 7 additions & 7 deletions src/HDInsight/HDInsight/help/Get-AzHDInsightAzureMonitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ Gets the azure monitor status of a specified HDInsight cluster.

## SYNTAX

### ByNameParameterSet (Default)
### GetByNameParameterSet (Default)
```
Get-AzHDInsightAzureMonitor [[-ResourceGroupName] <String>] [-ClusterName] <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### SetByResourceIdParameterSet
### GetByResourceIdParameterSet
```
Get-AzHDInsightAzureMonitor [-ResourceId] <String> [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
```

### SetByInputObjectParameterSet
### GetByInputObjectParameterSet
```
Get-AzHDInsightAzureMonitor [-InputObject] <AzureHDInsightCluster> [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Expand Down Expand Up @@ -62,7 +62,7 @@ Gets or sets the name of the cluster.

```yaml
Type: System.String
Parameter Sets: ByNameParameterSet
Parameter Sets: GetByNameParameterSet
Aliases:

Required: True
Expand Down Expand Up @@ -92,7 +92,7 @@ Gets or sets the input object.
```yaml
Type: Microsoft.Azure.Commands.HDInsight.Models.AzureHDInsightCluster
Parameter Sets: SetByInputObjectParameterSet
Parameter Sets: GetByInputObjectParameterSet
Aliases:

Required: True
Expand All @@ -107,7 +107,7 @@ Gets or sets the name of the resource group.
```yaml
Type: System.String
Parameter Sets: ByNameParameterSet
Parameter Sets: GetByNameParameterSet
Aliases:

Required: False
Expand All @@ -122,7 +122,7 @@ Gets or sets the resource id.
```yaml
Type: System.String
Parameter Sets: SetByResourceIdParameterSet
Parameter Sets: GetByResourceIdParameterSet
Aliases:

Required: True
Expand Down

0 comments on commit 1de6bd6

Please sign in to comment.