Skip to content

Commit

Permalink
Migrate EventHub from generation to main (Azure#27037)
Browse files Browse the repository at this point in the history
* Move EventHub to main

* Update ChangeLog.md

* Update ChangeLog.md

---------

Co-authored-by: Yan Xu <[email protected]>
  • Loading branch information
azure-powershell-bot and YanaXu authored Jan 23, 2025
1 parent bd6445f commit 9704192
Show file tree
Hide file tree
Showing 200 changed files with 8,134 additions and 7,160 deletions.
29 changes: 27 additions & 2 deletions src/EventHub/EventHub.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For information on how to develop for `Az.EventHub`, see [how-to.md](how-to.md).
``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
commit: 49946abc47b5ea9402d7763ae61b183ca4741855
commit: bb87821da87100719c7dc8a3ef6b89781813ed0a
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
Expand All @@ -44,7 +44,7 @@ input-file:
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/disasterRecoveryConfigs.json
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/operations.json
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/SchemaRegistry.json
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/eventhubs.json
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2024-05-01-preview/eventhubs.json
- $(repo)/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2023-01-01-preview/ApplicationGroups.json
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-swagger
Expand Down Expand Up @@ -391,6 +391,30 @@ directive:
property-name: RetentionDescriptionTombstoneRetentionTimeInHour
set:
property-name: TombstoneRetentionTimeInHour

- where:
verb: New
subject: EventHub
parameter-name: MessageTimestampDescriptionTimestampType
set:
parameter-name: TimestampType
- where:
model-name: EventHub
property-name: MessageTimestampDescriptionTimestampType
set:
property-name: TimestampType

- where:
verb: New
subject: EventHub
parameter-name: RetentionDescriptionMinCompactionLagInMin
set:
parameter-name: MinCompactionLagInMin
- where:
model-name: EventHub
property-name: RetentionDescriptionMinCompactionLagInMin
set:
property-name: MinCompactionLagInMin

# Cluster
- where:
Expand Down Expand Up @@ -457,3 +481,4 @@ directive:
- model-cmdlet:
- model-name: KeyVaultProperties
cmdlet-name: New-AzEventHubKeyVaultPropertiesObject
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "namespaces/eventhubs",
"apiVersion": "2023-01-01-preview",
"apiVersion": "2024-05-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.eventhub"
},
Expand Down
17 changes: 14 additions & 3 deletions src/EventHub/EventHub.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

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

$isAzure = [System.Convert]::ToBoolean('true')

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

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

Write-Host -ForegroundColor Green '-------------Done-------------'
if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}

Write-Host -ForegroundColor Green '-------------Done-------------'
33 changes: 33 additions & 0 deletions src/EventHub/EventHub.Autorest/custom/Set-AzEventHub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ function Set-AzEventHub{
# Enumerates the possible values for the status of the Event Hub.
${Status},

[Parameter(HelpMessage = "Gets and Sets Metadata of User.")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.String]
${UserMetadata},

[Parameter(HelpMessage = "The minimum time a message will remain ineligible for compaction in the log.")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.Int64]
${MinCompactionLagInMin},

[Parameter(HelpMessage = "Denotes the type of timestamp the message will hold.")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.String]
${TimestampType},

[Parameter(HelpMessage = "Name for capture destination")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.String]
Expand Down Expand Up @@ -221,6 +236,9 @@ function Set-AzEventHub{
$hasBlobContainer = $PSBoundParameters.Remove('BlobContainer')
$hasAsJob = $PSBoundParameters.Remove('AsJob')
$hasPartitionCount = $PSBoundParameters.Remove('PartitionCount')
$hasUserMetadata = $PSBoundParameters.Remove('UserMetadata')
$hasMinCompactionLagInMin = $PSBoundParameters.Remove('MinCompactionLagInMin')
$hasTimestampType = $PSBoundParameters.Remove('TimestampType')
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

Expand Down Expand Up @@ -293,6 +311,21 @@ function Set-AzEventHub{
$eventHub.UserAssignedIdentityId = $UserAssignedIdentityId
}

if($hasUserMetadata) {
$eventHub.UserMetadata = $UserMetadata
$hasProperty = $true
}

if($hasMinCompactionLagInMin) {
$eventHub.MinCompactionLagInMin = $MinCompactionLagInMin
$hasProperty = $true
}

if($hasTimestampType) {
$eventHub.TimestampType = $TimestampType
$hasProperty = $true
}

if ($hasStorageAccountResourceId) {
$eventHub.StorageAccountResourceId = $StorageAccountResourceId
$hasProperty = $true
Expand Down
46 changes: 38 additions & 8 deletions src/EventHub/EventHub.Autorest/exports/New-AzEventHub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a new Event Hub as a nested resource within a Namespace.
create a new Event Hub as a nested resource within a Namespace.
.Description
Create a new Event Hub as a nested resource within a Namespace.
create a new Event Hub as a nested resource within a Namespace.
.Example
New-AzEventHub -Name myEventHub -ResourceGroupName myResourceGroup -NamespaceName myNamespace -RetentionTimeInHour 168 -PartitionCount 5 -CleanupPolicy Delete
.Example
Expand Down Expand Up @@ -65,14 +65,17 @@ PARAMETER <IEventhub>: Single item in List or Get Event Hub operation
[IdentityType <String>]: Type of Azure Active Directory Managed Identity.
[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
[MessageRetentionInDay <Int64?>]: Number of days to retain the events for this Event Hub, value should be 1 to 7 days
[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.
[PartitionCount <Int64?>]: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
[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
[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.
[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
[SkipEmptyArchive <Boolean?>]: A value that indicates whether to Skip Empty Archives
[Status <String>]: Enumerates the possible values for the status of the Event Hub.
[StorageAccountResourceId <String>]: Resource id of the storage account to be used to create the blobs
[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
[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.
[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
[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.
[UserMetadata <String>]: Gets and Sets Metadata of User.
.Link
https://learn.microsoft.com/powershell/module/az.eventhub/new-azeventhub
#>
Expand Down Expand Up @@ -140,7 +143,7 @@ param(

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.PSArgumentCompleterAttribute("Delete", "Compact")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.PSArgumentCompleterAttribute("Delete", "Compact", "DeleteOrCompact")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.String]
# Enumerates the possible values for cleanup policy
Expand Down Expand Up @@ -177,6 +180,14 @@ param(
# 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
${IntervalInSeconds},

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.Int64]
# The minimum time a message will remain ineligible for compaction in the log.
# This value is used when cleanupPolicy is Compact or DeleteOrCompact.
${MinCompactionLagInMin},

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
Expand All @@ -189,8 +200,8 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.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
# 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.
${RetentionTimeInHour},

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

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.PSArgumentCompleterAttribute("LogAppend", "Create")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.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.
${TimestampType},

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.Int32]
# Number of hours to retain the tombstone markers of a compacted Event Hub.
# This value is only used when cleanupPolicy is Compact.
# 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
${TombstoneRetentionTimeInHour},

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

[Parameter(ParameterSetName='CreateExpanded')]
[Parameter(ParameterSetName='CreateViaIdentityNamespaceExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.String]
# Gets and Sets Metadata of User.
${UserMetadata},

[Parameter(ParameterSetName='CreateViaIdentityNamespace', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.IEventhub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create an ApplicationGroup for a Namespace.
create an ApplicationGroup for a Namespace.
.Description
Create an ApplicationGroup for a Namespace.
create an ApplicationGroup for a Namespace.
.Example
$t1 = New-AzEventHubThrottlingPolicyConfig -Name t1 -MetricId IncomingMessages -RateLimitThreshold 10000
$t2 = New-AzEventHubThrottlingPolicyConfig -Name t2 -MetricId OutgoingBytes -RateLimitThreshold 20000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create an instance of an Event Hubs Cluster.
create an instance of an Event Hubs Cluster.
.Description
Create an instance of an Event Hubs Cluster.
create an instance of an Event Hubs Cluster.
.Example
New-AzEventHubCluster -ResourceGroupName myResourceGroup -Name myEventHubsCluster -Location "eastasia" -SupportsScaling -Capacity 2
.Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create an Event Hubs consumer group as a nested resource within a Namespace.
create an Event Hubs consumer group as a nested resource within a Namespace.
.Description
Create an Event Hubs consumer group as a nested resource within a Namespace.
create an Event Hubs consumer group as a nested resource within a Namespace.
.Example
New-AzEventHubConsumerGroup -Name myConsumerGroup -NamespaceName myNamespace -ResourceGroupName myResourceGroup -EventHubName myEventHub -UserMetadata "Test ConsumerGroup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a new Alias(Disaster Recovery configuration)
create a new Alias(Disaster Recovery configuration)
.Description
Create a new Alias(Disaster Recovery configuration)
create a new Alias(Disaster Recovery configuration)
.Example
New-AzEventHubGeoDRConfiguration -Name myAlias -ResourceGroupName myResourceGroup -NamespaceName myPrimaryNamespace -PartnerNamespace /subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.EventHub/namespaces/mySecondaryNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create an EventHub schema group.
create an EventHub schema group.
.Description
Create an EventHub schema group.
create an EventHub schema group.
.Example
$schemaGroup = New-AzEventHubSchemaGroup -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name mySchemaGroup -SchemaCompatibility Backward -SchemaType Avro
Expand Down
Loading

0 comments on commit 9704192

Please sign in to comment.