Skip to content

Commit 2cc7b44

Browse files
authored
Merge pull request #9844 from anusapan/manual-failover
Add new cmdlet and update existing emdlet
2 parents a36c72f + 7266916 commit 2cc7b44

File tree

30 files changed

+7918
-5280
lines changed

30 files changed

+7918
-5280
lines changed

src/DeviceProvisioningServices/DeviceProvisioningServices.Test/DeviceProvisioningServices.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.DeviceProvisioningServices" Version="0.10.0-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.9.0-preview" />
1616
</ItemGroup>
1717

1818
</Project>

src/DeviceProvisioningServices/DeviceProvisioningServices.Test/ScenarioTests/IotDpsLinkedHubTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public IotDpsLinkedHubTests(Xunit.Abstractions.ITestOutputHelper output)
3030
XunitTracingInterceptor.AddToContext(_logger);
3131
}
3232

33-
[Fact(Skip = "Test needs re-recorded")]
33+
[Fact]
3434
[Trait(Category.AcceptanceType, Category.CheckIn)]
3535
public void IotDpsLinkedHubLifeCycle()
3636
{

src/DeviceProvisioningServices/DeviceProvisioningServices.Test/SessionRecords/Commands.DeviceProvisioningServices.Test.IotDpsAccessPolicyTests/IotDpsAccessPolicyLifeCycle.json

Lines changed: 960 additions & 882 deletions
Large diffs are not rendered by default.

src/DeviceProvisioningServices/DeviceProvisioningServices.Test/SessionRecords/Commands.DeviceProvisioningServices.Test.IotDpsLinkedHubTests/IotDpsLinkedHubLifeCycle.json

Lines changed: 2491 additions & 1159 deletions
Large diffs are not rendered by default.

src/DeviceProvisioningServices/DeviceProvisioningServices.Test/SessionRecords/Commands.DeviceProvisioningServices.Test.IotDpsTests/IotDpsLifeCycle.json

Lines changed: 703 additions & 682 deletions
Large diffs are not rendered by default.

src/IotHub/IotHub.Test/IotHub.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.5.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.8.0-preview" />
15+
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.9.0-preview" />
1616
</ItemGroup>
1717

1818
</Project>

src/IotHub/IotHub.Test/ScenarioTests/IotHubTests.ps1

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ function Test-AzureRmIotHubLifecycle
119119
$eventubConsumerGroup = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName events
120120
Assert-True { $eventubConsumerGroup.Count -eq 1 }
121121

122-
# Get EventHub Consumer group for operationsmonitoring
123-
$eventubConsumerGroupOpMon = Get-AzIotHubEventHubConsumerGroup -ResourceGroupName $ResourceGroupName -Name $IotHubName -EventHubEndpointName operationsMonitoringEvents
124-
Assert-True { $eventubConsumerGroupOpMon.Count -eq 1 }
125-
126122
# Get Keys
127123
$keys = Get-AzIotHubKey -ResourceGroupName $ResourceGroupName -Name $IotHubName
128124
Assert-True { $keys.Count -eq 5 }
@@ -194,12 +190,6 @@ function Test-AzureRmIotHubLifecycle
194190
$iotHubUpdated = Set-AzIotHub -ResourceGroupName $ResourceGroupName -Name $IotHubName -CloudToDevice $cloudToDevice
195191
Assert-True { $iothubUpdated.Properties.CloudToDevice.MaxDeliveryCount -eq 25 }
196192

197-
# Operations Monitoring properties update
198-
$op= $iotHubUpdated.Properties.OperationsMonitoringProperties
199-
$op.OperationMonitoringEvents["Connections"] = "Information"
200-
$iotHubUpdated = Set-AzIotHub -ResourceGroupName $ResourceGroupName -Name $IotHubName -OperationsMonitoringProperties $op
201-
Assert-True { $iothubUpdated.Properties.OperationsMonitoringProperties.OperationMonitoringEvents["Connections"] -eq "Information" }
202-
203193
# Routing Properties Update
204194
$routingProperties = New-Object Microsoft.Azure.Commands.Management.IotHub.Models.PSRoutingProperties
205195
$routeProp = New-Object Microsoft.Azure.Commands.Management.IotHub.Models.PSRouteMetadata
@@ -267,6 +257,13 @@ function Test-AzureRmIotHubLifecycle
267257
Assert-True { $updatedIotHub.Tags.Count -eq 1 }
268258
Assert-True { $updatedIotHub.Tags.Item($Tag1Key) -eq $Tag1Value }
269259

260+
# Initiate Manual-Failover
261+
$beforeMFIotHub = Get-AzIotHub -ResourceGroupName $ResourceGroupName -Name $IotHubName
262+
Invoke-AzIotHubManualFailover -ResourceGroupName $ResourceGroupName -Name $IotHubName
263+
$afterMFIotHub = Get-AzIotHub -ResourceGroupName $ResourceGroupName -Name $IotHubName
264+
Assert-True { $beforeMFIotHub.Properties.Locations[0].Location -eq $afterMFIotHub.Properties.Locations[1].Location}
265+
Assert-True { $beforeMFIotHub.Properties.Locations[1].Location -eq $afterMFIotHub.Properties.Locations[0].Location}
266+
270267
# Remove IotHub
271268
Remove-AzIotHub -ResourceGroupName $ResourceGroupName -Name $IotHubName
272269
}

src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubRoutingTests/TestAzureIotHubRoutingLifeCycle.json

Lines changed: 857 additions & 1037 deletions
Large diffs are not rendered by default.

src/IotHub/IotHub.Test/SessionRecords/Microsoft.Azure.Commands.IotHub.Test.ScenarioTests.IotHubTests/TestAzureIotHubLifeCycle.json

Lines changed: 2488 additions & 1453 deletions
Large diffs are not rendered by default.

src/IotHub/IotHub/Az.IotHub.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ CmdletsToExport = 'Add-AzIotHubKey', 'Get-AzIotHubEventHubConsumerGroup',
8888
'Get-AzIotHubRoutingEndpoint', 'Add-AzIotHubRoutingEndpoint',
8989
'Remove-AzIotHubRoutingEndpoint', 'Get-AzIotHubRoute',
9090
'Add-AzIotHubRoute', 'Remove-AzIotHubRoute', 'Set-AzIotHubRoute',
91-
'Test-AzIotHubRoute', 'New-AzIotHubKey'
91+
'Test-AzIotHubRoute', 'New-AzIotHubKey', 'Invoke-AzIotHubManualFailover'
9292

9393
# Variables to export from this module
9494
# VariablesToExport = @()

src/IotHub/IotHub/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+
* Add support to invoke failover for an IotHub to the geo-paired disaster recovery region.
2122

2223
## Version 1.2.1
2324
* Fixed miscellaneous typos across module

src/IotHub/IotHub/Common/IotHubUtils.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ public static CloudToDeviceProperties ToCloudToDeviceProperties(PSCloudToDeviceP
118118
return ConvertObject<PSCloudToDeviceProperties, CloudToDeviceProperties>(psCloudToDeviceProperties);
119119
}
120120

121-
public static OperationsMonitoringProperties ToOperationsMonitoringProperties(PSOperationsMonitoringProperties psOperationsMonitoringProperties)
122-
{
123-
return ConvertObject<PSOperationsMonitoringProperties, OperationsMonitoringProperties>(psOperationsMonitoringProperties);
124-
}
125-
126121
public static IotHubSkuInfo ToIotHubSku(PSIotHubSkuInfo psIotHubSkuInfo)
127122
{
128123
return ConvertObject<PSIotHubSkuInfo, IotHubSkuInfo>(psIotHubSkuInfo);

src/IotHub/IotHub/IotHub.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.8.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.9.0-preview" />
1515
</ItemGroup>
1616

1717
</Project>

src/IotHub/IotHub/IotHub/AddAzureRmIotHubEventHubConsumerGroup.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ namespace Microsoft.Azure.Commands.Management.IotHub
1616
{
1717
using System.Collections.Generic;
1818
using System.Management.Automation;
19-
using Microsoft.Azure.Management.IotHub;
20-
using ResourceManager.Common.ArgumentCompleters;
2119
using Azure.Management.IotHub.Models;
2220
using Common;
21+
using Microsoft.Azure.Management.IotHub;
22+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
23+
using ResourceManager.Common.ArgumentCompleters;
2324

2425
[Cmdlet("Add", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubEventHubConsumerGroup", SupportsShouldProcess = true), OutputType(typeof(string))]
2526
[Alias("Add-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubEHCG")]
@@ -42,6 +43,8 @@ public class AddAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
4243
[ValidateNotNullOrEmpty]
4344
public string Name { get; set; }
4445

46+
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.";
47+
[CmdletParameterBreakingChange("EventHubEndpointName", ChangeDescription = ChangeDesc)]
4548
[Parameter(
4649
Position = 2,
4750
Mandatory = true,
@@ -51,18 +54,19 @@ public class AddAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
5154
public string EventHubEndpointName { get; set; }
5255

5356
[Parameter(
54-
Position = 3,
55-
Mandatory = true,
56-
HelpMessage = "Name of the EventHub ConsumerGroup")]
57+
Position = 3,
58+
Mandatory = true,
59+
HelpMessage = "Name of the EventHub ConsumerGroup")]
5760
[ValidateNotNullOrEmpty]
5861
public string EventHubConsumerGroupName { get; set; }
5962

6063
public override void ExecuteCmdlet()
6164
{
65+
string eventsEndpointName = "events";
6266
if (ShouldProcess(EventHubConsumerGroupName, Properties.Resources.AddEventHubConsumerGroup))
6367
{
64-
this.IotHubClient.IotHubResource.CreateEventHubConsumerGroup(this.ResourceGroupName, this.Name, this.EventHubEndpointName, this.EventHubConsumerGroupName);
65-
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, this.EventHubEndpointName);
68+
this.IotHubClient.IotHubResource.CreateEventHubConsumerGroup(this.ResourceGroupName, this.Name, eventsEndpointName, this.EventHubConsumerGroupName);
69+
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, eventsEndpointName);
6670
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
6771
}
6872
}

src/IotHub/IotHub/IotHub/GetAzureRmEventHubConsumerGroup.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2020
using Microsoft.Azure.Commands.Management.IotHub.Models;
2121
using Microsoft.Azure.Management.IotHub;
2222
using Microsoft.Azure.Management.IotHub.Models;
23+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2324
using ResourceManager.Common.ArgumentCompleters;
2425

2526
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubEventHubConsumerGroup"), OutputType(typeof(PSEventHubConsumerGroupInfo))]
@@ -43,6 +44,8 @@ public class GetAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
4344
[ValidateNotNullOrEmpty]
4445
public string Name { get; set; }
4546

47+
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.";
48+
[CmdletParameterBreakingChange("EventHubEndpointName", ChangeDescription = ChangeDesc)]
4649
[Parameter(
4750
Position = 2,
4851
Mandatory = true,
@@ -54,7 +57,8 @@ public class GetAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
5457

5558
public override void ExecuteCmdlet()
5659
{
57-
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, this.EventHubEndpointName);
60+
string eventsEndpointName = "events";
61+
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, eventsEndpointName);
5862
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
5963
}
6064

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
namespace Microsoft.Azure.Commands.Management.IotHub
16+
{
17+
using System;
18+
using System.Linq;
19+
using System.Management.Automation;
20+
using Microsoft.Azure.Commands.Management.IotHub.Common;
21+
using Microsoft.Azure.Commands.Management.IotHub.Models;
22+
using Microsoft.Azure.Management.IotHub;
23+
using Microsoft.Azure.Management.IotHub.Models;
24+
using ResourceManager.Common.ArgumentCompleters;
25+
26+
[Cmdlet(VerbsLifecycle.Invoke, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubManualFailover", DefaultParameterSetName = ResourceParameterSet, SupportsShouldProcess = true)]
27+
[OutputType(typeof(bool))]
28+
public class InvokeAzureRmIotHubManualFailover : IotHubBaseCmdlet
29+
{
30+
private const string ResourceIdParameterSet = "ResourceIdSet";
31+
private const string ResourceParameterSet = "ResourceSet";
32+
private const string InputObjectParameterSet = "InputObjectSet";
33+
34+
[Parameter(
35+
Position = 0,
36+
Mandatory = true,
37+
ParameterSetName = InputObjectParameterSet,
38+
ValueFromPipeline = true,
39+
HelpMessage = "Iot Hub Object")]
40+
[ValidateNotNullOrEmpty]
41+
public PSIotHub InputObject { get; set; }
42+
43+
[Parameter(
44+
Position = 0,
45+
Mandatory = true,
46+
ParameterSetName = ResourceParameterSet,
47+
HelpMessage = "Name of the Resource Group")]
48+
[ValidateNotNullOrEmpty]
49+
[ResourceGroupCompleter]
50+
public string ResourceGroupName { get; set; }
51+
52+
[Parameter(
53+
Position = 0,
54+
Mandatory = true,
55+
ParameterSetName = ResourceIdParameterSet,
56+
ValueFromPipelineByPropertyName = true,
57+
HelpMessage = "Iot Hub Resource Id")]
58+
[ValidateNotNullOrEmpty]
59+
public string ResourceId { get; set; }
60+
61+
[Parameter(
62+
Position = 1,
63+
Mandatory = true,
64+
ParameterSetName = ResourceParameterSet,
65+
HelpMessage = "Name of the Iot Hub")]
66+
[ValidateNotNullOrEmpty]
67+
public string Name { get; set; }
68+
69+
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
70+
public SwitchParameter AsJob { get; set; }
71+
72+
[Parameter(Mandatory = false, HelpMessage = "Allows to return the boolean object. By default, this cmdlet does not generate any output.")]
73+
public SwitchParameter PassThru { get; set; }
74+
75+
public override void ExecuteCmdlet()
76+
{
77+
if (ParameterSetName.Equals(InputObjectParameterSet))
78+
{
79+
this.ResourceGroupName = this.InputObject.Resourcegroup;
80+
this.Name = this.InputObject.Name;
81+
}
82+
83+
if (ParameterSetName.Equals(ResourceIdParameterSet))
84+
{
85+
this.ResourceGroupName = IotHubUtils.GetResourceGroupName(this.ResourceId);
86+
this.Name = IotHubUtils.GetIotHubName(this.ResourceId);
87+
}
88+
89+
if (ShouldProcess(this.Name, Properties.Resources.ManualFailoverIotHub))
90+
{
91+
IotHubDescription iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.Name);
92+
PSIotHub psIotHub = IotHubUtils.ToPSIotHub(iotHubDescription);
93+
string failoverRegion = psIotHub.Properties.Locations.FirstOrDefault(loc => loc.Role.Equals("secondary", StringComparison.OrdinalIgnoreCase)).Location;
94+
FailoverInput failoverInput = new FailoverInput(failoverRegion);
95+
this.IotHubClient.IotHub.ManualFailover(this.Name, failoverInput, this.ResourceGroupName);
96+
97+
if (this.PassThru.IsPresent)
98+
{
99+
WriteObject(true);
100+
}
101+
}
102+
}
103+
}
104+
}

src/IotHub/IotHub/IotHub/RemoveAzureRmIotHubEventHubConsumerGroup.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ namespace Microsoft.Azure.Commands.Management.IotHub
1717
using System.Collections.Generic;
1818
using System.Management.Automation;
1919
using Microsoft.Azure.Commands.Management.IotHub.Common;
20-
using Microsoft.Azure.Commands.Management.IotHub.Models;
2120
using Microsoft.Azure.Management.IotHub;
2221
using Microsoft.Azure.Management.IotHub.Models;
22+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2323
using ResourceManager.Common.ArgumentCompleters;
2424

2525
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHubEventHubConsumerGroup", SupportsShouldProcess = true), OutputType(typeof(string))]
@@ -43,6 +43,8 @@ public class RemoveAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
4343
[ValidateNotNullOrEmpty]
4444
public string Name { get; set; }
4545

46+
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.";
47+
[CmdletParameterBreakingChange("EventHubEndpointName", ChangeDescription = ChangeDesc)]
4648
[Parameter(
4749
Position = 2,
4850
Mandatory = true,
@@ -52,19 +54,20 @@ public class RemoveAzureRmIotHubEventHubConsumerGroup : IotHubBaseCmdlet
5254
public string EventHubEndpointName { get; set; }
5355

5456
[Parameter(
55-
Position = 3,
56-
Mandatory = true,
57-
ValueFromPipelineByPropertyName = true,
57+
Position = 3,
58+
Mandatory = true,
59+
ValueFromPipelineByPropertyName = true,
5860
HelpMessage = "Name of the EventHub ConsumerGroupName")]
5961
[ValidateNotNullOrEmpty]
6062
public string EventHubConsumerGroupName { get; set; }
6163

6264
public override void ExecuteCmdlet()
6365
{
66+
string eventsEndpointName = "events";
6467
if (ShouldProcess(EventHubConsumerGroupName, Properties.Resources.RemoveEventHubConsumerGroup))
6568
{
66-
this.IotHubClient.IotHubResource.DeleteEventHubConsumerGroup(this.ResourceGroupName, this.Name, this.EventHubEndpointName, this.EventHubConsumerGroupName);
67-
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, this.EventHubEndpointName);
69+
this.IotHubClient.IotHubResource.DeleteEventHubConsumerGroup(this.ResourceGroupName, this.Name, eventsEndpointName, this.EventHubConsumerGroupName);
70+
IEnumerable<EventHubConsumerGroupInfo> iotHubEHConsumerGroups = this.IotHubClient.IotHubResource.ListEventHubConsumerGroups(this.ResourceGroupName, this.Name, eventsEndpointName);
6871
this.WriteObject(IotHubUtils.ToPSEventHubConsumerGroupInfo(iotHubEHConsumerGroups), true);
6972
}
7073
}

src/IotHub/IotHub/IotHub/SetAzureRmIotHub.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace Microsoft.Azure.Commands.Management.IotHub
2121
using Microsoft.Azure.Commands.Management.IotHub.Models;
2222
using Microsoft.Azure.Management.IotHub;
2323
using Microsoft.Azure.Management.IotHub.Models;
24+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2425
using ResourceManager.Common.ArgumentCompleters;
2526

2627
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IotHub", DefaultParameterSetName = "UpdateSku", SupportsShouldProcess = true)]
@@ -121,6 +122,8 @@ public class SetAzureRmIotHub : IotHubBaseCmdlet
121122
[ValidateNotNullOrEmpty]
122123
public PSCloudToDeviceProperties CloudToDevice { get; set; }
123124

125+
public const string ChangeDesc = "Parameter is being deprecated without being replaced as IotHub is no longer using built-in endpoint(\"operationsMonitoringEvents\").";
126+
[CmdletParameterBreakingChange("OperationsMonitoringProperties", ChangeDescription = ChangeDesc)]
124127
[Parameter(
125128
ParameterSetName = UpdateOperationsMonitoringPropertiesParameterSet,
126129
Mandatory = true,
@@ -170,7 +173,6 @@ public override void ExecuteCmdlet()
170173
case UpdateEventHubEndpointPropertiesParameterSet:
171174

172175
iotHubDescription.Properties.EventHubEndpoints["events"].RetentionTimeInDays = this.EventHubRetentionTimeInDays;
173-
iotHubDescription.Properties.EventHubEndpoints["operationsMonitoringEvents"].RetentionTimeInDays = this.EventHubRetentionTimeInDays;
174176
break;
175177
case UpdateFileUploadPropertiesParameterSet:
176178

@@ -209,14 +211,6 @@ public override void ExecuteCmdlet()
209211
iotHubDescription.Properties.CloudToDevice = IotHubUtils.ToCloudToDeviceProperties(this.CloudToDevice);
210212
}
211213

212-
break;
213-
case UpdateOperationsMonitoringPropertiesParameterSet:
214-
215-
if (this.OperationsMonitoringProperties != null)
216-
{
217-
iotHubDescription.Properties.OperationsMonitoringProperties = IotHubUtils.ToOperationsMonitoringProperties(this.OperationsMonitoringProperties);
218-
}
219-
220214
break;
221215
case UpdateRoutingPropertiesParameterSet:
222216

src/IotHub/IotHub/Models/PSIotHubInputProperties.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public class PSIotHubInputProperties
6363
[JsonProperty(PropertyName = "comments")]
6464
public string Comments { get; set; }
6565

66-
/// <summary>
67-
/// </summary>
66+
/// <summary>
67+
/// </summary>
6868
[JsonProperty(PropertyName = "operationsMonitoringProperties")]
6969
public PSOperationsMonitoringProperties OperationsMonitoringProperties { get; set; }
7070

0 commit comments

Comments
 (0)