Skip to content

EventHub: added new boolean property SkipEmptyArchives to CaptureDescription #8500

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 3 commits into from
Feb 11, 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
5 changes: 2 additions & 3 deletions src/EventHub/EventHub.Test/EventHub.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PsModuleName>EventHubs</PsModuleName>
Expand All @@ -11,7 +11,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.3.0" />
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.4.0" />
</ItemGroup>

</Project>
8 changes: 5 additions & 3 deletions src/EventHub/EventHub.Test/ScenarioTests/EventHubsTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,21 @@ function EventHubsTests
$createdEventHub.MessageRetentionInDays = 4
$createdEventHub.CaptureDescription = New-Object -TypeName Microsoft.Azure.Commands.EventHub.Models.PSCaptureDescriptionAttributes
$createdEventHub.CaptureDescription.Enabled = $true
$createdEventHub.CaptureDescription.SkipEmptyArchives = $true
$createdEventHub.CaptureDescription.IntervalInSeconds = 120
$createdEventHub.CaptureDescription.Encoding = "Avro"
$createdEventHub.CaptureDescription.SizeLimitInBytes = 10485763
$createdEventHub.CaptureDescription.Destination.Name = "EventHubArchive.AzureBlockBlob"
$createdEventHub.CaptureDescription.Destination.BlobContainer = "container01"
$createdEventHub.CaptureDescription.Destination.ArchiveNameFormat = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"
$createdEventHub.CaptureDescription.Destination.StorageAccountResourceId = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/v-ajnavtest/providers/Microsoft.Storage/storageAccounts/testingsdkeventhub"
$createdEventHub.CaptureDescription.Destination.StorageAccountResourceId = "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/v-ajnavtest/providers/Microsoft.Storage/storageAccounts/testingsdkeventhub11"

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

# Assert
Assert-AreEqual $result.MessageRetentionInDays $createdEventHub.MessageRetentionInDays
Assert-AreEqual $result.CaptureDescription.Destination.BlobContainer "container01"
Assert-True { $result.CaptureDescription.SkipEmptyArchives }

# Create New EventHub with InputObject
$resultNew = New-AzEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $createdEventHub.Name -InputObject $result
Expand All @@ -99,10 +101,10 @@ function EventHubsTests
{
$delete1 = Remove-AzEventHub -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $createdEventHubList[$i].Name
}
Write-Debug " Delete namespaces"
Write-Debug "Delete namespaces"
Remove-AzEventHubNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName

Write-Debug " Delete resourcegroup"
Write-Debug "Delete resourcegroup"
#Remove-AzResourceGroup -Name $resourceGroupName -Force
}

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/EventHub/EventHub.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub", "EventHub\EventH
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHubs.Test", "EventHub.Test\EventHubs.Test.csproj", "{2DA1C063-AA27-4BBC-BE25-E3C7D008B6CF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.Test", "EventHub.Test\EventHub.Test.csproj", "{2DA1C063-AA27-4BBC-BE25-E3C7D008B6CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
EndProject
Expand Down
1 change: 1 addition & 0 deletions src/EventHub/EventHub/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added new boolean property SkipEmptyArchives to Skip Empty Archives in CaptureDescription class of Eventhub

## Version 1.0.0
* General availability of `Az.EventHub` module
2 changes: 1 addition & 1 deletion src/EventHub/EventHub/EventHub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.3.0" />
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.4.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public PSCaptureDescriptionAttributes(Microsoft.Azure.Management.EventHub.Models
Destination = new PSDestinationAttributes(captureDescResource.Destination);
else
Destination = null;
SkipEmptyArchives = captureDescResource.SkipEmptyArchives;
}

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

/// <summary>
/// Gets or sets a value that indicates whether to Skip Empty Archives is
/// enabled.
/// </summary>
public bool? SkipEmptyArchives { get; set; }

/// <summary>
/// Gets or sets properties of Destination where capture will be
/// stored. (Storage Account, Blob Names)
Expand Down
1 change: 1 addition & 0 deletions src/EventHub/EventHub/Utilities/EventHubsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public PSEventHubAttributes CreateOrUpdateEventHub(string resourceGroupName, str
Parameter1.CaptureDescription = new CaptureDescription();
Parameter1.CaptureDescription.Destination = new Destination();
Parameter1.CaptureDescription.Enabled = parameter.CaptureDescription.Enabled;
Parameter1.CaptureDescription.SkipEmptyArchives = parameter.CaptureDescription.SkipEmptyArchives;
Parameter1.CaptureDescription.Encoding = (Management.EventHub.Models.EncodingCaptureDescription?)parameter.CaptureDescription.Encoding;
Parameter1.CaptureDescription.IntervalInSeconds = parameter.CaptureDescription.IntervalInSeconds;
Parameter1.CaptureDescription.SizeLimitInBytes = parameter.CaptureDescription.SizeLimitInBytes;
Expand Down
2 changes: 1 addition & 1 deletion src/IotHub/IotHub.Test/IotHub.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.3.0" />
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.4.0" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="2.8.0-preview" />
</ItemGroup>

Expand Down