Skip to content

[IotHub] Updating breaking changes #10343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/IotHub/IotHub.Test/ScenarioTests/IotHubTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function Test-AzureRmIotHubLifecycle
Assert-True { $validSkus.Count -gt 1 }

# Get EventHub Consumer group for events
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName events
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName
Assert-True { $eventubConsumerGroup.Count -eq 1 }

# Get Keys
Expand All @@ -139,17 +139,17 @@ function Test-AzureRmIotHubLifecycle
Assert-True { $key.KeyName -eq "iothubowner" }

# Add consumer group
Add-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName events -EventHubConsumerGroupName cg1
Add-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubConsumerGroupName cg1

# Get consumer group
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName events
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName
Assert-True { $eventubConsumerGroup.Count -eq 2 }

# Delete consumer group
Remove-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName events -EventHubConsumerGroupName cg1
Remove-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubConsumerGroupName cg1

# Get consumer group
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName events
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName
Assert-True { $eventubConsumerGroup.Count -eq 1 }

# Add Key
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/IotHub/IotHub/Az.IotHub.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ CmdletsToExport = 'Add-AzIotHubKey', 'Get-AzIotHubEventHubConsumerGroup',

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = 'Get-AzIotHubEHCG', 'Add-AzIotHubEHCG', 'Remove-AzIotHubEHCG',
'Set-AzIotHubVC', 'Get-AzIotHubCVC', 'New-AzIotHubExportDevices',
'New-AzIotHubImportDevices', 'Add-AzIotHubMsgEnrich',
'Set-AzIotHubVC', 'Get-AzIotHubCVC', 'Add-AzIotHubMsgEnrich',
'Get-AzIotHubMsgEnrich', 'Remove-AzIotHubMsgEnrich',
'Set-AzIotHubMsgEnrich'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,8 @@ public class AddAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
[ValidateNotNullOrEmpty]
public string Name { get; set; }

public const string ChangeDesc = "Parameter is being deprecated without being replaced as IotHub comes with only one built-in endpoint(\"events\") which could handle system and device messages.";
[CmdletParameterBreakingChange("EventHubEndpointName", ChangeDescription = ChangeDesc)]
[Parameter(
Position = 2,
Mandatory = true,
HelpMessage = "Name of the Event Hub Endpoint. Possible values are 'events', 'operationsMonitoringEvents'")]
[ValidateNotNullOrEmpty]
[ValidateSetAttribute(EventsEndpointName, OperationsMonitoringEventsEndpointName)]
public string EventHubEndpointName { get; set; }

[Parameter(
Position = 3,
Position = 2,
Mandatory = true,
HelpMessage = "Name of the EventHub ConsumerGroup")]
[ValidateNotNullOrEmpty]
Expand All @@ -70,8 +60,5 @@ public override void ExecuteCmdlet()
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
}
}

private const string EventsEndpointName = "events";
private const string OperationsMonitoringEventsEndpointName = "operationsMonitoringEvents";
}
}
14 changes: 0 additions & 14 deletions src/IotHub/IotHub/IotHub/GetAzureRmEventHubConsumerGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,11 @@ public class GetAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
[ValidateNotNullOrEmpty]
public string Name { get; set; }

public const string ChangeDesc = "Parameter is being deprecated without being replaced as IotHub comes with only one built-in endpoint(\"events\") which could handle system and device messages.";
[CmdletParameterBreakingChange("EventHubEndpointName", ChangeDescription = ChangeDesc)]
[Parameter(
Position = 2,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the Event Hub Endpoint. Possible values are 'events', 'operationsMonitoringEvents'")]
[ValidateNotNullOrEmpty]
[ValidateSetAttribute(EventsEndpointName, OperationsMonitoringEventsEndpointName)]
public string EventHubEndpointName { get; set; }

public override void ExecuteCmdlet()
{
string eventsEndpointName = "events";
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, eventsEndpointName);
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
}

private const string EventsEndpointName = "events";
private const string OperationsMonitoringEventsEndpointName = "operationsMonitoringEvents";
}
}
2 changes: 0 additions & 2 deletions src/IotHub/IotHub/IotHub/NewAzureRmIotHubExportDevices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
using ResourceManager.Common.ArgumentCompleters;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

[GenericBreakingChange("New-AzIotHubExportDevices alias will be removed in an upcoming breaking change release", "2.0.0")]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubExportDevice", SupportsShouldProcess = true)]
[Alias("New-AzIotHubExportDevices")]
[OutputType(typeof(PSIotHubJobResponse))]
public class NewAzureRmIotHubExportDevices : IotHubBaseCmdlet
{
Expand Down
2 changes: 0 additions & 2 deletions src/IotHub/IotHub/IotHub/NewAzureRmIotHubImportDevices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
using ResourceManager.Common.ArgumentCompleters;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;

[GenericBreakingChange("New-AzIotHubImportDevices alias will be removed in an upcoming breaking change release", "2.0.0")]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubImportDevice", SupportsShouldProcess = true)]
[Alias("New-AzIotHubImportDevices")]
[OutputType(typeof(PSIotHubJobResponse))]
public class NewAzureRmIotHubImportDevices : IotHubBaseCmdlet
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,8 @@ public class RemoveAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
[ValidateNotNullOrEmpty]
public string Name { get; set; }

public const string ChangeDesc = "Parameter is being deprecated without being replaced as IotHub comes with only one built-in endpoint(\"events\") which could handle system and device messages.";
[CmdletParameterBreakingChange("EventHubEndpointName", ChangeDescription = ChangeDesc)]
[Parameter(
Position = 2,
Mandatory = true,
HelpMessage = "EventHubEndpointName. Possible values events, operationsMonitoringEvents")]
[ValidateNotNullOrEmpty]
[ValidateSetAttribute(EventsEndpointName, OperationsMonitoringEventsEndpointName)]
public string EventHubEndpointName { get; set; }

[Parameter(
Position = 3,
Position = 2,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the EventHub ConsumerGroupName")]
Expand All @@ -71,8 +61,5 @@ public override void ExecuteCmdlet()
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
}
}

private const string EventsEndpointName = "events";
private const string OperationsMonitoringEventsEndpointName = "operationsMonitoringEvents";
}
}
10 changes: 0 additions & 10 deletions src/IotHub/IotHub/IotHub/SetAzureRmIotHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class SetAzureRmIotHub : IotHubBaseCmdlet
const string UpdateEventHubEndpointPropertiesParameterSet = "UpdateEventHubEndpointProperties";
const string UpdateFileUploadPropertiesParameterSet = "UpdateFileUploadProperties";
const string UpdateCloudToDevicePropertiesParameterSet = "UpdateCloudToDeviceProperties";
const string UpdateOperationsMonitoringPropertiesParameterSet = "UpdateOperationsMonitoringProperties";
const string UpdateRoutingPropertiesParameterSet = "UpdateRoutingProperties";
const string UpdateRoutePropertiesParameterSet = "UpdateRouteProperties";
const string UpdateFallbackRoutePropertyParameterSet = "UpdateFallbackRouteProperty";
Expand Down Expand Up @@ -122,15 +121,6 @@ public class SetAzureRmIotHub : IotHubBaseCmdlet
[ValidateNotNullOrEmpty]
public PSCloudToDeviceProperties CloudToDevice { get; set; }

public const string ChangeDesc = "Parameter is being deprecated without being replaced as IotHub is no longer using built-in endpoint(\"operationsMonitoringEvents\").";
[CmdletParameterBreakingChange("OperationsMonitoringProperties", ChangeDescription = ChangeDesc)]
[Parameter(
ParameterSetName = UpdateOperationsMonitoringPropertiesParameterSet,
Mandatory = true,
HelpMessage = "Set Operations Monitoring Properties")]
[ValidateNotNullOrEmpty]
public PSOperationsMonitoringProperties OperationsMonitoringProperties { get; set; }

[Parameter(
ParameterSetName = UpdateRoutingPropertiesParameterSet,
Mandatory = false,
Expand Down
5 changes: 0 additions & 5 deletions src/IotHub/IotHub/Models/PSIotHubInputProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ public class PSIotHubInputProperties
[JsonProperty(PropertyName = "comments")]
public string Comments { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "operationsMonitoringProperties")]
public PSOperationsMonitoringProperties OperationsMonitoringProperties { get; set; }

/// <summary>
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "routing")]
Expand Down
5 changes: 0 additions & 5 deletions src/IotHub/IotHub/Models/PSIotHubProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ public class PSIotHubProperties
[JsonProperty(PropertyName = "comments")]
public string Comments { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "operationsMonitoringProperties")]
public PSOperationsMonitoringProperties OperationsMonitoringProperties { get; set; }

/// <summary>
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "routing")]
Expand Down
23 changes: 3 additions & 20 deletions src/IotHub/IotHub/help/Add-AzIotHubEventHubConsumerGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Creates an eventhub consumer group.

```
Add-AzIotHubEventHubConsumerGroup [-ResourceGroupName] <String> [-Name] <String>
[-EventHubEndpointName] <String> [-EventHubConsumerGroupName] <String>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-EventHubConsumerGroupName] <String> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -25,7 +25,7 @@ Creates a consumer group in the Eventhub associated with the specified IotHub.

### Example 1: Add a consumer group to the telemetry eventhub
```
PS C:\> Add-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubEndpointName "events" -EventHubConsumerGroupName "myconsumergroup"
PS C:\> Add-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName "myconsumergroup"
```

Adds a new consumergroup named "myconsumergroup" to the eventhub for telemetry events in the iothub named "myiothub"
Expand Down Expand Up @@ -55,23 +55,6 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EventHubEndpointName
Name of the EventHub Endpoint.
Possible values events, operationsMonitoringEvents

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: events, operationsMonitoringEvents

Required: True
Position: 2
Default value: None
Expand Down
21 changes: 2 additions & 19 deletions src/IotHub/IotHub/help/Get-AzIotHubEventHubConsumerGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gets all the eventhub consumergroups.

```
Get-AzIotHubEventHubConsumerGroup [-ResourceGroupName] <String> [-Name] <String>
[-EventHubEndpointName] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -24,7 +24,7 @@ Gets all the eventhub consumergroups for the different EventHubs used by IotHub.

### Example 1 Gets all the eventhub consumergroups for the telemetry eventhub
```
PS C:\> Get-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubEndpointName "events"
PS C:\> Get-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub"
```

Gets all the eventhub consumergroups for the telemetry eventhub for the iothub named myiothub
Expand All @@ -46,23 +46,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -EventHubEndpointName
Name of the Event Hub endpoint.
Possible values events, operationsMonitoringEvents

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: events, operationsMonitoringEvents

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Name
Name of the IotHub

Expand Down
25 changes: 4 additions & 21 deletions src/IotHub/IotHub/help/Remove-AzIotHubEventHubConsumerGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Deletes an eventhub consumergroup.

```
Remove-AzIotHubEventHubConsumerGroup [-ResourceGroupName] <String> [-Name] <String>
[-EventHubEndpointName] <String> [-EventHubConsumerGroupName] <String>
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-EventHubConsumerGroupName] <String> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -25,7 +25,7 @@ Deletes an eventhub consumergroup.

### Example 1 Remove eventhub consumergroup from the telemetry eventhub
```
PS C:\> Remove-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubEndpointName "events" -EventHubConsumerGroupName myconsumergroup
PS C:\> Remove-AzIotHubEventHubConsumerGroup -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubConsumerGroupName myconsumergroup
```

Removes the consumergroup named myconsumergroup from the IotHub named "myiothub"
Expand Down Expand Up @@ -55,27 +55,10 @@ Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -EventHubEndpointName
EventHub Endpoint Name.
Possible values events, operationsMonitoringEvents

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: events, operationsMonitoringEvents

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

Expand Down
24 changes: 1 addition & 23 deletions src/IotHub/IotHub/help/Set-AzIotHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ Set-AzIotHub -ResourceGroupName <String> -Name <String> -CloudToDevice <PSCloudT
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### UpdateOperationsMonitoringProperties
```
Set-AzIotHub -ResourceGroupName <String> -Name <String>
-OperationsMonitoringProperties <PSOperationsMonitoringProperties> [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### UpdateRoutingProperties
```
Set-AzIotHub -ResourceGroupName <String> -Name <String> [-RoutingProperties <PSRoutingProperties>]
Expand Down Expand Up @@ -81,7 +74,7 @@ Update the sku to S1 and units to 5 for the IotHub named "myiothub"
PS C:\> Set-AzIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubRetentionTimeInDays 4
```

Update the retention time in days to 4 for both the telemetry and operationsmonitoringevents events for the IotHub named "myiothub"
Update the retention time of telemetry in days to 4 for the IotHub named "myiothub"

## PARAMETERS

Expand Down Expand Up @@ -250,21 +243,6 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -OperationsMonitoringProperties
The properties related to operations monitoring.

```yaml
Type: Microsoft.Azure.Commands.Management.IotHub.Models.PSOperationsMonitoringProperties
Parameter Sets: UpdateOperationsMonitoringProperties
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ResourceGroupName
Resource Group Name

Expand Down
Loading