Skip to content

Commit 9704192

Browse files
Migrate EventHub from generation to main (#27037)
* Move EventHub to main * Update ChangeLog.md * Update ChangeLog.md --------- Co-authored-by: Yan Xu <[email protected]>
1 parent bd6445f commit 9704192

File tree

200 files changed

+8134
-7160
lines changed

Some content is hidden

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

200 files changed

+8134
-7160
lines changed

src/EventHub/EventHub.Autorest/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For information on how to develop for `Az.EventHub`, see [how-to.md](how-to.md).
2828
2929
``` yaml
3030
# Please specify the commit id that includes your features to make sure generated codes stable.
31-
commit: 49946abc47b5ea9402d7763ae61b183ca4741855
31+
commit: bb87821da87100719c7dc8a3ef6b89781813ed0a
3232
require:
3333
# readme.azure.noprofile.md is the common configuration file
3434
- $(this-folder)/../../readme.azure.noprofile.md
@@ -44,7 +44,7 @@ input-file:
4444
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/disasterRecoveryConfigs.json
4545
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/operations.json
4646
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/SchemaRegistry.json
47-
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/eventhubs.json
47+
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2024-05-01-preview/eventhubs.json
4848
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/ApplicationGroups.json
4949
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
5050
# - (this-folder)/relative-path-to-your-swagger
@@ -391,6 +391,30 @@ directive:
391391
property-name: RetentionDescriptionTombstoneRetentionTimeInHour
392392
set:
393393
property-name: TombstoneRetentionTimeInHour
394+
395+
- where:
396+
verb: New
397+
subject: EventHub
398+
parameter-name: MessageTimestampDescriptionTimestampType
399+
set:
400+
parameter-name: TimestampType
401+
- where:
402+
model-name: EventHub
403+
property-name: MessageTimestampDescriptionTimestampType
404+
set:
405+
property-name: TimestampType
406+
407+
- where:
408+
verb: New
409+
subject: EventHub
410+
parameter-name: RetentionDescriptionMinCompactionLagInMin
411+
set:
412+
parameter-name: MinCompactionLagInMin
413+
- where:
414+
model-name: EventHub
415+
property-name: RetentionDescriptionMinCompactionLagInMin
416+
set:
417+
property-name: MinCompactionLagInMin
394418

395419
# Cluster
396420
- where:
@@ -457,3 +481,4 @@ directive:
457481
- model-cmdlet:
458482
- model-name: KeyVaultProperties
459483
cmdlet-name: New-AzEventHubKeyVaultPropertiesObject
484+
```

src/EventHub/EventHub.Autorest/UX/Microsoft.EventHub/namespaces-eventhubs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "namespaces/eventhubs",
3-
"apiVersion": "2023-01-01-preview",
3+
"apiVersion": "2024-05-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.eventhub"
66
},

src/EventHub/EventHub.Autorest/build-module.ps1

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
15+
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
@@ -75,6 +75,8 @@ if(-not $NotIsolated -and -not $Debugger) {
7575
$binFolder = Join-Path $PSScriptRoot 'bin'
7676
$objFolder = Join-Path $PSScriptRoot 'obj'
7777

78+
$isAzure = [System.Convert]::ToBoolean('true')
79+
7880
if(-not $Debugger) {
7981
Write-Host -ForegroundColor Green 'Cleaning build folders...'
8082
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -151,7 +153,7 @@ if($NoDocs) {
151153
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
152154
}
153155
$null = New-Item -ItemType Directory -Force -Path $docsFolder
154-
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
156+
$addComplexInterfaceInfo = !$isAzure
155157
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
156158
}
157159

@@ -177,4 +179,13 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
177179
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
178180
}
179181

180-
Write-Host -ForegroundColor Green '-------------Done-------------'
182+
if (-not $DisableAfterBuildTasks){
183+
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
184+
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
185+
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
186+
Write-Host -ForegroundColor Green 'Running after build tasks...'
187+
. $afterBuildTasksPath @afterBuildTasksArgs
188+
}
189+
}
190+
191+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/EventHub/EventHub.Autorest/custom/Set-AzEventHub.ps1

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,21 @@ function Set-AzEventHub{
105105
# Enumerates the possible values for the status of the Event Hub.
106106
${Status},
107107

108+
[Parameter(HelpMessage = "Gets and Sets Metadata of User.")]
109+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
110+
[System.String]
111+
${UserMetadata},
112+
113+
[Parameter(HelpMessage = "The minimum time a message will remain ineligible for compaction in the log.")]
114+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
115+
[System.Int64]
116+
${MinCompactionLagInMin},
117+
118+
[Parameter(HelpMessage = "Denotes the type of timestamp the message will hold.")]
119+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
120+
[System.String]
121+
${TimestampType},
122+
108123
[Parameter(HelpMessage = "Name for capture destination")]
109124
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
110125
[System.String]
@@ -221,6 +236,9 @@ function Set-AzEventHub{
221236
$hasBlobContainer = $PSBoundParameters.Remove('BlobContainer')
222237
$hasAsJob = $PSBoundParameters.Remove('AsJob')
223238
$hasPartitionCount = $PSBoundParameters.Remove('PartitionCount')
239+
$hasUserMetadata = $PSBoundParameters.Remove('UserMetadata')
240+
$hasMinCompactionLagInMin = $PSBoundParameters.Remove('MinCompactionLagInMin')
241+
$hasTimestampType = $PSBoundParameters.Remove('TimestampType')
224242
$null = $PSBoundParameters.Remove('WhatIf')
225243
$null = $PSBoundParameters.Remove('Confirm')
226244

@@ -293,6 +311,21 @@ function Set-AzEventHub{
293311
$eventHub.UserAssignedIdentityId = $UserAssignedIdentityId
294312
}
295313

314+
if($hasUserMetadata) {
315+
$eventHub.UserMetadata = $UserMetadata
316+
$hasProperty = $true
317+
}
318+
319+
if($hasMinCompactionLagInMin) {
320+
$eventHub.MinCompactionLagInMin = $MinCompactionLagInMin
321+
$hasProperty = $true
322+
}
323+
324+
if($hasTimestampType) {
325+
$eventHub.TimestampType = $TimestampType
326+
$hasProperty = $true
327+
}
328+
296329
if ($hasStorageAccountResourceId) {
297330
$eventHub.StorageAccountResourceId = $StorageAccountResourceId
298331
$hasProperty = $true

src/EventHub/EventHub.Autorest/exports/New-AzEventHub.ps1

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create a new Event Hub as a nested resource within a Namespace.
19+
create a new Event Hub as a nested resource within a Namespace.
2020
.Description
21-
Create a new Event Hub as a nested resource within a Namespace.
21+
create a new Event Hub as a nested resource within a Namespace.
2222
.Example
2323
New-AzEventHub -Name myEventHub -ResourceGroupName myResourceGroup -NamespaceName myNamespace -RetentionTimeInHour 168 -PartitionCount 5 -CleanupPolicy Delete
2424
.Example
@@ -65,14 +65,17 @@ PARAMETER <IEventhub>: Single item in List or Get Event Hub operation
6565
[IdentityType <String>]: Type of Azure Active Directory Managed Identity.
6666
[IntervalInSeconds <Int32?>]: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds
6767
[MessageRetentionInDay <Int64?>]: Number of days to retain the events for this Event Hub, value should be 1 to 7 days
68+
[MinCompactionLagInMin <Int64?>]: The minimum time a message will remain ineligible for compaction in the log. This value is used when cleanupPolicy is Compact or DeleteOrCompact.
6869
[PartitionCount <Int64?>]: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
69-
[RetentionTimeInHour <Int64?>]: Number of hours to retain the events for this Event Hub. This value is only used when cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue
70+
[RetentionTimeInHour <Int64?>]: Number of hours to retain the events for this Event Hub. This should be positive value upto namespace SKU max. -1 is a special case where retention time is infinite, but the size of an entity is restricted and its size depends on namespace SKU type.
7071
[SizeLimitInBytes <Int32?>]: The size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes
7172
[SkipEmptyArchive <Boolean?>]: A value that indicates whether to Skip Empty Archives
7273
[Status <String>]: Enumerates the possible values for the status of the Event Hub.
7374
[StorageAccountResourceId <String>]: Resource id of the storage account to be used to create the blobs
74-
[TombstoneRetentionTimeInHour <Int32?>]: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key described by the tombstone marker within the compacted Event Hub
75+
[TimestampType <String>]: Denotes the type of timestamp the message will hold.Two types of timestamp types - "AppendTime" and "CreateTime". AppendTime refers the time in which message got appended inside broker log. CreateTime refers to the time in which the message was generated on source side and producers can set this timestamp while sending the message. Default value is AppendTime. If you are using AMQP protocol, CreateTime equals AppendTime and its behavior remains the same.
76+
[TombstoneRetentionTimeInHour <Int32?>]: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is used when cleanupPolicy is Compact or DeleteOrCompact. Consumer must complete reading the tombstone marker within this specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key described by the tombstone marker within the compacted Event Hub
7577
[UserAssignedIdentityId <String>]: ARM ID of Managed User Identity. This property is required is the type is UserAssignedIdentity. If type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be used.
78+
[UserMetadata <String>]: Gets and Sets Metadata of User.
7679
.Link
7780
https://learn.microsoft.com/powershell/module/az.eventhub/new-azeventhub
7881
#>
@@ -140,7 +143,7 @@ param(
140143

141144
[Parameter(ParameterSetName='CreateExpanded')]
142145
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
143-
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.PSArgumentCompleterAttribute("Delete", "Compact")]
146+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.PSArgumentCompleterAttribute("Delete", "Compact", "DeleteOrCompact")]
144147
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
145148
[System.String]
146149
# Enumerates the possible values for cleanup policy
@@ -177,6 +180,14 @@ param(
177180
# The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds
178181
${IntervalInSeconds},
179182

183+
[Parameter(ParameterSetName='CreateExpanded')]
184+
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
185+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
186+
[System.Int64]
187+
# The minimum time a message will remain ineligible for compaction in the log.
188+
# This value is used when cleanupPolicy is Compact or DeleteOrCompact.
189+
${MinCompactionLagInMin},
190+
180191
[Parameter(ParameterSetName='CreateExpanded')]
181192
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
182193
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
@@ -189,8 +200,8 @@ param(
189200
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
190201
[System.Int64]
191202
# Number of hours to retain the events for this Event Hub.
192-
# This value is only used when cleanupPolicy is Delete.
193-
# If cleanupPolicy is Compact the returned value of this property is Long.MaxValue
203+
# This should be positive value upto namespace SKU max.
204+
# -1 is a special case where retention time is infinite, but the size of an entity is restricted and its size depends on namespace SKU type.
194205
${RetentionTimeInHour},
195206

196207
[Parameter(ParameterSetName='CreateExpanded')]
@@ -222,12 +233,24 @@ param(
222233
# Resource id of the storage account to be used to create the blobs
223234
${StorageAccountResourceId},
224235

236+
[Parameter(ParameterSetName='CreateExpanded')]
237+
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
238+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.PSArgumentCompleterAttribute("LogAppend", "Create")]
239+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
240+
[System.String]
241+
# Denotes the type of timestamp the message will hold.Two types of timestamp types - "AppendTime" and "CreateTime".
242+
# AppendTime refers the time in which message got appended inside broker log.
243+
# CreateTime refers to the time in which the message was generated on source side and producers can set this timestamp while sending the message.
244+
# Default value is AppendTime.
245+
# If you are using AMQP protocol, CreateTime equals AppendTime and its behavior remains the same.
246+
${TimestampType},
247+
225248
[Parameter(ParameterSetName='CreateExpanded')]
226249
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
227250
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
228251
[System.Int32]
229252
# Number of hours to retain the tombstone markers of a compacted Event Hub.
230-
# This value is only used when cleanupPolicy is Compact.
253+
# This value is used when cleanupPolicy is Compact or DeleteOrCompact.
231254
# Consumer must complete reading the tombstone marker within this specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key described by the tombstone marker within the compacted Event Hub
232255
${TombstoneRetentionTimeInHour},
233256

@@ -240,6 +263,13 @@ param(
240263
# If type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be used.
241264
${UserAssignedIdentityId},
242265

266+
[Parameter(ParameterSetName='CreateExpanded')]
267+
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
268+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
269+
[System.String]
270+
# Gets and Sets Metadata of User.
271+
${UserMetadata},
272+
243273
[Parameter(ParameterSetName='CreateViaIdentityNamespace', Mandatory, ValueFromPipeline)]
244274
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
245275
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.IEventhub]

src/EventHub/EventHub.Autorest/exports/New-AzEventHubApplicationGroup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create an ApplicationGroup for a Namespace.
19+
create an ApplicationGroup for a Namespace.
2020
.Description
21-
Create an ApplicationGroup for a Namespace.
21+
create an ApplicationGroup for a Namespace.
2222
.Example
2323
$t1 = New-AzEventHubThrottlingPolicyConfig -Name t1 -MetricId IncomingMessages -RateLimitThreshold 10000
2424
$t2 = New-AzEventHubThrottlingPolicyConfig -Name t2 -MetricId OutgoingBytes -RateLimitThreshold 20000

src/EventHub/EventHub.Autorest/exports/New-AzEventHubCluster.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create an instance of an Event Hubs Cluster.
19+
create an instance of an Event Hubs Cluster.
2020
.Description
21-
Create an instance of an Event Hubs Cluster.
21+
create an instance of an Event Hubs Cluster.
2222
.Example
2323
New-AzEventHubCluster -ResourceGroupName myResourceGroup -Name myEventHubsCluster -Location "eastasia" -SupportsScaling -Capacity 2
2424
.Example

src/EventHub/EventHub.Autorest/exports/New-AzEventHubConsumerGroup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create an Event Hubs consumer group as a nested resource within a Namespace.
19+
create an Event Hubs consumer group as a nested resource within a Namespace.
2020
.Description
21-
Create an Event Hubs consumer group as a nested resource within a Namespace.
21+
create an Event Hubs consumer group as a nested resource within a Namespace.
2222
.Example
2323
New-AzEventHubConsumerGroup -Name myConsumerGroup -NamespaceName myNamespace -ResourceGroupName myResourceGroup -EventHubName myEventHub -UserMetadata "Test ConsumerGroup"
2424

src/EventHub/EventHub.Autorest/exports/New-AzEventHubGeoDRConfiguration.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create a new Alias(Disaster Recovery configuration)
19+
create a new Alias(Disaster Recovery configuration)
2020
.Description
21-
Create a new Alias(Disaster Recovery configuration)
21+
create a new Alias(Disaster Recovery configuration)
2222
.Example
2323
New-AzEventHubGeoDRConfiguration -Name myAlias -ResourceGroupName myResourceGroup -NamespaceName myPrimaryNamespace -PartnerNamespace /subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/namespaces/mySecondaryNamespace
2424

src/EventHub/EventHub.Autorest/exports/New-AzEventHubSchemaGroup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<#
1818
.Synopsis
19-
Create an EventHub schema group.
19+
create an EventHub schema group.
2020
.Description
21-
Create an EventHub schema group.
21+
create an EventHub schema group.
2222
.Example
2323
$schemaGroup = New-AzEventHubSchemaGroup -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name mySchemaGroup -SchemaCompatibility Backward -SchemaType Avro
2424

0 commit comments

Comments
 (0)