Skip to content

Commit 6154bc1

Browse files
committed
resolved PR comments
1 parent 6abd09f commit 6154bc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+268
-269
lines changed

src/ResourceManager/IotHub/Commands.IotHub/Az.IotHub.psd1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ CmdletsToExport = 'Add-AzIotHubKey', 'Get-AzIotHubEventHubConsumerGroup',
8585
'Get-AzIotHubCertificate',
8686
'Get-AzIotHubCertificateVerificationCode',
8787
'Set-AzIotHubVerifiedCertificate',
88-
'Remove-AzIotHubCertificate'
88+
'Remove-AzIotHubCertificate', 'Get-AzIotHubRoutingEndpoint',
89+
'Add-AzIotHubRoutingEndpoint','Remove-AzIotHubRoutingEndpoint',
90+
'Get-AzIotHubRoute', 'Add-AzIotHubRoute','Remove-AzIotHubRoute',
91+
'Set-AzIotHubRoute','Test-AzIotHubRoute'
8992

9093
# Variables to export from this module
9194
# VariablesToExport = @()

src/ResourceManager/IotHub/Commands.IotHub/IotHub/RemoveAzureRmIotHubCertificate.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2020
using ResourceManager.Common.ArgumentCompleters;
2121
using Models;
2222

23-
[Cmdlet(VerbsCommon.Remove, "AzureRmIotHubCertificate", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
24-
[OutputType(typeof(bool))]
23+
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubCertificate", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
2524
public class RemoveAzureRmIotHubCertificate : IotHubBaseCmdlet
2625
{
2726
private const string ResourceIdParameterSet = "ResourceIdSet";

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/AddAzureRmIotHubRoute.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2424
using Microsoft.Azure.Management.IotHub.Models;
2525
using ResourceManager.Common.ArgumentCompleters;
2626

27-
[Cmdlet(VerbsCommon.Add, "AzureRmIotHubRoute", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
28-
[OutputType(typeof(PSRouteMetadata))]
27+
[Cmdlet("Add", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoute", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSRouteMetadata))]
2928
public class AddAzureRmIotHubRoute : IotHubBaseCmdlet
3029
{
3130
private const string ResourceIdParameterSet = "ResourceIdSet";

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/AddAzureRmIotHubRoutingEndpoint.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2323
using Microsoft.Azure.Management.IotHub.Models;
2424
using ResourceManager.Common.ArgumentCompleters;
2525

26-
[Cmdlet(VerbsCommon.Add, "AzureRmIotHubRoutingEndpoint", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
27-
[OutputType(typeof(PSRoutingEventHubEndpoint), typeof(PSRoutingServiceBusQueueEndpoint), typeof(PSRoutingServiceBusTopicEndpoint), typeof(PSRoutingStorageContainerEndpoint))]
26+
[Cmdlet("Add", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoutingEndpoint", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true), OutputType(
27+
typeof(PSRoutingEventHubEndpoint), typeof(PSRoutingServiceBusQueueEndpoint),
28+
typeof(PSRoutingServiceBusTopicEndpoint), typeof(PSRoutingStorageContainerEndpoint))]
2829
public class AddAzureRmIotHubRoutingEndpoint : IotHubBaseCmdlet, IDynamicParameters
2930
{
3031
private const string ResourceIdParameterSet = "ResourceIdSet";

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/GetAzureRmIotHubRoute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
namespace Microsoft.Azure.Commands.Management.IotHub
1616
{
1717
using System;
18-
using System.Collections.Generic;
1918
using System.Linq;
2019
using System.Management.Automation;
2120
using Microsoft.Azure.Commands.Management.IotHub.Common;
@@ -24,8 +23,8 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2423
using Microsoft.Azure.Management.IotHub.Models;
2524
using ResourceManager.Common.ArgumentCompleters;
2625

27-
[Cmdlet(VerbsCommon.Get, "AzureRmIotHubRoute", DefaultParameterSetName = ResourceParameterSet)]
28-
[OutputType(typeof(PSRouteMetadata), typeof(List<PSRouteProperties>))]
26+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoute", DefaultParameterSetName = ResourceParameterSet), OutputType(
27+
typeof(PSRouteMetadata), typeof(PSRouteProperties[]))]
2928
public class GetAzureRmIotHubRoute : IotHubBaseCmdlet
3029
{
3130
private const string ResourceIdParameterSet = "ResourceIdSet";

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/GetAzureRmIotHubRoutingEndpoint.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2323
using Microsoft.Azure.Management.IotHub;
2424
using Microsoft.Azure.Management.IotHub.Models;
2525
using ResourceManager.Common.ArgumentCompleters;
26-
27-
[Cmdlet(VerbsCommon.Get, "AzureRmIotHubRoutingEndpoint", DefaultParameterSetName = ResourceParameterSet)]
28-
[OutputType(typeof(PSRoutingEventHubEndpoint), typeof(List<PSRoutingEventHubProperties>),
29-
typeof(PSRoutingServiceBusQueueEndpoint), typeof(List<PSRoutingServiceBusQueueEndpointProperties>),
30-
typeof(PSRoutingServiceBusTopicEndpoint), typeof(List<PSRoutingServiceBusTopicEndpointProperties>),
31-
typeof(PSRoutingStorageContainerEndpoint), typeof(List<PSRoutingStorageContainerProperties>),
32-
typeof(List<PSRoutingCustomEndpoint>))]
26+
using WindowsAzure.Commands.Utilities.Common;
27+
28+
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoutingEndpoint", DefaultParameterSetName = ResourceParameterSet), OutputType(
29+
typeof(PSRoutingEventHubEndpoint), typeof(List<PSRoutingEventHubProperties>),
30+
typeof(PSRoutingServiceBusQueueEndpoint), typeof(PSRoutingServiceBusQueueEndpointProperties[]),
31+
typeof(PSRoutingServiceBusTopicEndpoint), typeof(PSRoutingServiceBusTopicEndpointProperties[]),
32+
typeof(PSRoutingStorageContainerEndpoint), typeof(PSRoutingStorageContainerProperties[]),
33+
typeof(PSRoutingCustomEndpoint[]))]
3334
public class GetAzureRmIotHubRoutingEndpoint : IotHubBaseCmdlet
3435
{
3536
private const string ResourceIdParameterSet = "ResourceIdSet";
@@ -54,7 +55,7 @@ public class GetAzureRmIotHubRoutingEndpoint : IotHubBaseCmdlet
5455
public string Name { get; set; }
5556

5657
[Parameter(Mandatory = false, HelpMessage = "Type of the Routing Endpoint")]
57-
public PSEndpointType? EndpointType { get; set; }
58+
public PSEndpointType EndpointType { get; set; }
5859

5960
[Parameter(Mandatory = false, HelpMessage = "Name of the Routing Endpoint")]
6061
public string EndpointName { get; set; }
@@ -77,7 +78,7 @@ public override void ExecuteCmdlet()
7778
iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.Name);
7879
}
7980

80-
if (!this.EndpointType.HasValue)
81+
if (!this.IsParameterBound(c => c.EndpointType))
8182
{
8283
List<PSRoutingCustomEndpoint> psRoutingCustomEndpointCollection = new List<PSRoutingCustomEndpoint>();
8384

@@ -141,7 +142,7 @@ public override void ExecuteCmdlet()
141142
}
142143
else
143144
{
144-
this.WriteEndpointObject(iotHubDescription, this.EndpointType.Value, this.EndpointName);
145+
this.WriteEndpointObject(iotHubDescription, this.EndpointType, this.EndpointName);
145146
}
146147
}
147148

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/RemoveAzureRmIotHubRoute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2323
using Microsoft.Azure.Management.IotHub.Models;
2424
using ResourceManager.Common.ArgumentCompleters;
2525

26-
[Cmdlet(VerbsCommon.Remove, "AzureRmIotHubRoute", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
27-
[OutputType(typeof(bool))]
26+
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoute", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
2827
public class RemoveAzureRmIotHubRoute : IotHubBaseCmdlet
2928
{
3029
private const string ResourceIdParameterSet = "ResourceIdSet";
@@ -51,7 +50,7 @@ public class RemoveAzureRmIotHubRoute : IotHubBaseCmdlet
5150
[Parameter(Mandatory = false, HelpMessage = "Name of the Route")]
5251
public string RouteName { get; set; }
5352

54-
[Parameter(Mandatory = false)]
53+
[Parameter(Mandatory = false, HelpMessage = "Allows to return the boolean object. By default, this cmdlet does not generate any output.")]
5554
public SwitchParameter PassThru { get; set; }
5655

5756
public override void ExecuteCmdlet()

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/RemoveAzureRmIotHubRoutingEndpoint.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2222
using Microsoft.Azure.Management.IotHub;
2323
using Microsoft.Azure.Management.IotHub.Models;
2424
using ResourceManager.Common.ArgumentCompleters;
25+
using WindowsAzure.Commands.Utilities.Common;
2526

26-
[Cmdlet(VerbsCommon.Remove, "AzureRmIotHubRoutingEndpoint", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
27-
[OutputType(typeof(bool))]
27+
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoutingEndpoint", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
2828
public class RemoveAzureRmIotHubRoutingEndpoint : IotHubBaseCmdlet
2929
{
3030
private const string ResourceIdParameterSet = "ResourceIdSet";
@@ -52,9 +52,9 @@ public class RemoveAzureRmIotHubRoutingEndpoint : IotHubBaseCmdlet
5252
public string EndpointName { get; set; }
5353

5454
[Parameter(Mandatory = false, HelpMessage = "Type of the Routing Endpoint")]
55-
public PSEndpointType? EndpointType { get; set; }
55+
public PSEndpointType EndpointType { get; set; }
5656

57-
[Parameter(Mandatory = false)]
57+
[Parameter(Mandatory = false, HelpMessage = "Allows to return the boolean object. By default, this cmdlet does not generate any output.")]
5858
public SwitchParameter PassThru { get; set; }
5959

6060
public override void ExecuteCmdlet()
@@ -81,9 +81,9 @@ public override void ExecuteCmdlet()
8181
{
8282
if (string.IsNullOrEmpty(this.EndpointName))
8383
{
84-
if (this.EndpointType.HasValue)
84+
if (this.IsParameterBound(c => c.EndpointType))
8585
{
86-
switch (this.EndpointType.Value)
86+
switch (this.EndpointType)
8787
{
8888
case PSEndpointType.EventHub:
8989
iotHubDescription.Properties.Routing.Endpoints.EventHubs = new List<RoutingEventHubProperties>();

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/SetAzureRmIotHubRoute.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2424
using Microsoft.Azure.Management.IotHub.Models;
2525
using ResourceManager.Common.ArgumentCompleters;
2626

27-
[Cmdlet(VerbsCommon.Set, "AzureRmIotHubRoute", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
28-
[OutputType(typeof(PSRouteMetadata))]
27+
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoute", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSRouteMetadata))]
2928
public class SetAzureRmIotHubRoute : IotHubBaseCmdlet
3029
{
3130
private const string ResourceIdParameterSet = "ResourceIdSet";

src/ResourceManager/IotHub/Commands.IotHub/IotHub/Routing/TestAzureRmIotHubRoute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace Microsoft.Azure.Commands.Management.IotHub
1616
{
1717
using System;
1818
using System.Collections;
19-
using System.Collections.Generic;
2019
using System.Linq;
2120
using System.Management.Automation;
2221
using Microsoft.Azure.Commands.Management.IotHub.Common;
@@ -25,8 +24,8 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2524
using Microsoft.Azure.Management.IotHub.Models;
2625
using ResourceManager.Common.ArgumentCompleters;
2726

28-
[Cmdlet(VerbsDiagnostic.Test, "AzureRmIotHubRoute", DefaultParameterSetName = ResourceParameterSet)]
29-
[OutputType(typeof(PSTestRouteResult), typeof(PSRouteCompilationError), typeof(List<PSRouteProperties>))]
27+
[Cmdlet("Test", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubRoute", DefaultParameterSetName = ResourceParameterSet), OutputType(
28+
typeof(PSTestRouteResult), typeof(PSRouteCompilationError), typeof(PSRouteProperties[]))]
3029
public class TestAzureRmIotHubRoute : IotHubBaseCmdlet
3130
{
3231
private const string ResourceIdParameterSet = "ResourceIdSet";

src/ResourceManager/IotHub/Commands.IotHub/help/Add-AzureRmIotHubCertificate.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Updates a CA certificate in an IoT hub by uploading a new CER file.
7979
Name of the Certificate
8080

8181
```yaml
82-
Type: String
82+
Type: System.String
8383
Parameter Sets: ResourceSet
8484
Aliases:
8585

@@ -94,7 +94,7 @@ Accept wildcard characters: False
9494
The credentials, account, tenant, and subscription used for communication with azure.
9595
9696
```yaml
97-
Type: IAzureContextContainer
97+
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
9898
Parameter Sets: (All)
9999
Aliases: AzureRmContext, AzureCredential
100100

@@ -109,7 +109,7 @@ Accept wildcard characters: False
109109
Etag of the Certificate
110110
111111
```yaml
112-
Type: String
112+
Type: System.String
113113
Parameter Sets: (All)
114114
Aliases:
115115

@@ -124,7 +124,7 @@ Accept wildcard characters: False
124124
Certificate Object
125125
126126
```yaml
127-
Type: PSCertificateDescription
127+
Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSCertificateDescription
128128
Parameter Sets: InputObjectSet
129129
Aliases:
130130

@@ -139,7 +139,7 @@ Accept wildcard characters: False
139139
Name of the Iot Hub
140140
141141
```yaml
142-
Type: String
142+
Type: System.String
143143
Parameter Sets: ResourceSet
144144
Aliases:
145145

@@ -154,7 +154,7 @@ Accept wildcard characters: False
154154
base-64 representation of X509 certificate .cer file or .pem file path.
155155
156156
```yaml
157-
Type: String
157+
Type: System.String
158158
Parameter Sets: (All)
159159
Aliases:
160160

@@ -169,7 +169,7 @@ Accept wildcard characters: False
169169
Name of the Resource Group
170170
171171
```yaml
172-
Type: String
172+
Type: System.String
173173
Parameter Sets: ResourceSet
174174
Aliases:
175175

@@ -184,7 +184,7 @@ Accept wildcard characters: False
184184
Certificate Resource Id
185185
186186
```yaml
187-
Type: String
187+
Type: System.String
188188
Parameter Sets: ResourceIdSet
189189
Aliases:
190190

@@ -199,7 +199,7 @@ Accept wildcard characters: False
199199
Prompts you for confirmation before running the cmdlet.
200200
201201
```yaml
202-
Type: SwitchParameter
202+
Type: System.Management.Automation.SwitchParameter
203203
Parameter Sets: (All)
204204
Aliases: cf
205205

@@ -215,7 +215,7 @@ Shows what would happen if the cmdlet runs.
215215
The cmdlet is not run.
216216
217217
```yaml
218-
Type: SwitchParameter
218+
Type: System.Management.Automation.SwitchParameter
219219
Parameter Sets: (All)
220220
Aliases: wi
221221

src/ResourceManager/IotHub/Commands.IotHub/help/Add-AzureRmIotHubEventHubConsumerGroup.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Adds a new consumergroup named "myconsumergroup" to the eventhub for operations
4343
The credentials, account, tenant, and subscription used for communication with azure
4444

4545
```yaml
46-
Type: IAzureContextContainer
46+
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
4747
Parameter Sets: (All)
4848
Aliases: AzureRmContext, AzureCredential
4949

@@ -58,7 +58,7 @@ Accept wildcard characters: False
5858
Name of the EventHub ConsumerGroup that you want to add.
5959
6060
```yaml
61-
Type: String
61+
Type: System.String
6262
Parameter Sets: (All)
6363
Aliases:
6464

@@ -74,7 +74,7 @@ Name of the EventHub Endpoint.
7474
Possible values events, operationsMonitoringEvents
7575
7676
```yaml
77-
Type: String
77+
Type: System.String
7878
Parameter Sets: (All)
7979
Aliases:
8080
Accepted values: events, operationsMonitoringEvents
@@ -90,7 +90,7 @@ Accept wildcard characters: False
9090
Name of the Iot Hub
9191
9292
```yaml
93-
Type: String
93+
Type: System.String
9494
Parameter Sets: (All)
9595
Aliases:
9696

@@ -105,7 +105,7 @@ Accept wildcard characters: False
105105
Name of the Resource Group.
106106
107107
```yaml
108-
Type: String
108+
Type: System.String
109109
Parameter Sets: (All)
110110
Aliases:
111111

@@ -120,7 +120,7 @@ Accept wildcard characters: False
120120
Prompts you for confirmation before running the cmdlet.
121121
122122
```yaml
123-
Type: SwitchParameter
123+
Type: System.Management.Automation.SwitchParameter
124124
Parameter Sets: (All)
125125
Aliases: cf
126126

@@ -136,7 +136,7 @@ Shows what would happen if the cmdlet runs.
136136
The cmdlet is not run.
137137
138138
```yaml
139-
Type: SwitchParameter
139+
Type: System.Management.Automation.SwitchParameter
140140
Parameter Sets: (All)
141141
Aliases: wi
142142

0 commit comments

Comments
 (0)