Skip to content

Commit 1229c76

Browse files
author
Maddie Clayton
authored
Merge pull request #8500 from v-Ajnava/masterlocalEH
EventHub: added new boolean property SkipEmptyArchives to CaptureDescription
2 parents 9e94fcf + 0d2d2c4 commit 1229c76

File tree

9 files changed

+871
-373
lines changed

9 files changed

+871
-373
lines changed

src/EventHub/EventHub.Test/EventHub.Test.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>EventHubs</PsModuleName>
@@ -11,7 +11,6 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.3.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.4.0" />
1515
</ItemGroup>
16-
1716
</Project>

src/EventHub/EventHub.Test/ScenarioTests/EventHubsTests.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,21 @@ function EventHubsTests
7171
$createdEventHub.MessageRetentionInDays = 4
7272
$createdEventHub.CaptureDescription = New-Object -TypeName Microsoft.Azure.Commands.EventHub.Models.PSCaptureDescriptionAttributes
7373
$createdEventHub.CaptureDescription.Enabled = $true
74+
$createdEventHub.CaptureDescription.SkipEmptyArchives = $true
7475
$createdEventHub.CaptureDescription.IntervalInSeconds = 120
7576
$createdEventHub.CaptureDescription.Encoding = "Avro"
7677
$createdEventHub.CaptureDescription.SizeLimitInBytes = 10485763
7778
$createdEventHub.CaptureDescription.Destination.Name = "EventHubArchive.AzureBlockBlob"
7879
$createdEventHub.CaptureDescription.Destination.BlobContainer = "container01"
7980
$createdEventHub.CaptureDescription.Destination.ArchiveNameFormat = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"
80-
$createdEventHub.CaptureDescription.Destination.StorageAccountResourceId = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/v-ajnavtest/providers/Microsoft.Storage/storageAccounts/testingsdkeventhub"
81+
$createdEventHub.CaptureDescription.Destination.StorageAccountResourceId = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/v-ajnavtest/providers/Microsoft.Storage/storageAccounts/testingsdkeventhub11"
8182

8283
$result = Set-AzEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $createdEventHub.Name -InputObject $createdEventHub
8384

8485
# Assert
8586
Assert-AreEqual $result.MessageRetentionInDays $createdEventHub.MessageRetentionInDays
8687
Assert-AreEqual $result.CaptureDescription.Destination.BlobContainer "container01"
88+
Assert-True { $result.CaptureDescription.SkipEmptyArchives }
8789

8890
# Create New EventHub with InputObject
8991
$resultNew = New-AzEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $createdEventHub.Name -InputObject $result
@@ -99,10 +101,10 @@ function EventHubsTests
99101
{
100102
$delete1 = Remove-AzEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $createdEventHubList[$i].Name
101103
}
102-
Write-Debug " Delete namespaces"
104+
Write-Debug "Delete namespaces"
103105
Remove-AzEventHubNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName
104106

105-
Write-Debug " Delete resourcegroup"
107+
Write-Debug "Delete resourcegroup"
106108
#Remove-AzResourceGroup -Name $resourceGroupName -Force
107109
}
108110

src/EventHub/EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsCRUD.json

Lines changed: 852 additions & 364 deletions
Large diffs are not rendered by default.

src/EventHub/EventHub.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub", "EventHub\EventH
66
EndProject
77
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}"
88
EndProject
9-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHubs.Test", "EventHub.Test\EventHubs.Test.csproj", "{2DA1C063-AA27-4BBC-BE25-E3C7D008B6CF}"
9+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.Test", "EventHub.Test\EventHub.Test.csproj", "{2DA1C063-AA27-4BBC-BE25-E3C7D008B6CF}"
1010
EndProject
1111
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
1212
EndProject

src/EventHub/EventHub/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+
* Added new boolean property SkipEmptyArchives to Skip Empty Archives in CaptureDescription class of Eventhub
2122

2223
## Version 1.0.0
2324
* General availability of `Az.EventHub` module

src/EventHub/EventHub/EventHub.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.EventHub" Version="2.3.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.4.0" />
1515
</ItemGroup>
1616

1717
</Project>

src/EventHub/EventHub/Models/PSCaptureDescriptionAttributes.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public PSCaptureDescriptionAttributes(Microsoft.Azure.Management.EventHub.Models
5959
Destination = new PSDestinationAttributes(captureDescResource.Destination);
6060
else
6161
Destination = null;
62+
SkipEmptyArchives = captureDescResource.SkipEmptyArchives;
6263
}
6364

6465
/// <summary>
@@ -88,6 +89,12 @@ public PSCaptureDescriptionAttributes(Microsoft.Azure.Management.EventHub.Models
8889
/// </summary>
8990
public int? SizeLimitInBytes { get; set; }
9091

92+
/// <summary>
93+
/// Gets or sets a value that indicates whether to Skip Empty Archives is
94+
/// enabled.
95+
/// </summary>
96+
public bool? SkipEmptyArchives { get; set; }
97+
9198
/// <summary>
9299
/// Gets or sets properties of Destination where capture will be
93100
/// stored. (Storage Account, Blob Names)

src/EventHub/EventHub/Utilities/EventHubsClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public PSEventHubAttributes CreateOrUpdateEventHub(string resourceGroupName, str
261261
Parameter1.CaptureDescription = new CaptureDescription();
262262
Parameter1.CaptureDescription.Destination = new Destination();
263263
Parameter1.CaptureDescription.Enabled = parameter.CaptureDescription.Enabled;
264+
Parameter1.CaptureDescription.SkipEmptyArchives = parameter.CaptureDescription.SkipEmptyArchives;
264265
Parameter1.CaptureDescription.Encoding = (Management.EventHub.Models.EncodingCaptureDescription?)parameter.CaptureDescription.Encoding;
265266
Parameter1.CaptureDescription.IntervalInSeconds = parameter.CaptureDescription.IntervalInSeconds;
266267
Parameter1.CaptureDescription.SizeLimitInBytes = parameter.CaptureDescription.SizeLimitInBytes;

src/IotHub/IotHub.Test/IotHub.Test.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.EventHub" Version="2.3.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.4.0" />
1515
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.8.0-preview" />
1616
</ItemGroup>
1717

0 commit comments

Comments
 (0)