Skip to content

Migrate ServiceBus from generation to main #27086

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 2 commits into from
Feb 7, 2025
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
1 change: 1 addition & 0 deletions src/ServiceBus/ServiceBus.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,3 +525,4 @@ directive:
- model-cmdlet:
- model-name: KeyVaultProperties
cmdlet-name: New-AzServiceBusKeyVaultPropertiesObject
```
17 changes: 14 additions & 3 deletions src/ServiceBus/ServiceBus.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-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ function Set-AzServiceBusNamespace{
$hasTag = $PSBoundParameters.Remove('Tag')
$hasDefaultProfile = $PSBoundParameters.Remove('DefaultProfile')
$hasAsJob = $PSBoundParameters.Remove('AsJob')
$hasNoWait = $PSBoundParameters.Remove('NoWait')
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')
$serviceBusNamespace = Get-AzServiceBusNamespace @PSBoundParameters
Expand Down Expand Up @@ -227,6 +228,10 @@ function Set-AzServiceBusNamespace{
$PSBoundParameters.Add('AsJob', $true)
}

if ($hasNoWait) {
$PSBoundParameters.Add('NoWait', $true)
}

if ($PSCmdlet.ShouldProcess("ServiceBusNamespace $($serviceBusNamespace.Name)", "Create or update")) {
Az.ServiceBus.private\New-AzServiceBusNamespace_CreateViaIdentity -InputObject $serviceBusNamespace -Parameter $serviceBusNamespace @PSBoundParameters
}
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-AzServiceBusGeoDRConfiguration -Name myAlias -ResourceGroupName myResourceGroup -NamespaceName myPrimaryNamespace -PartnerNamespace "/subscriptions/0000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/mySecondaryNamespace"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

<#
.Synopsis
Create a Service Bus queue.
create a Service Bus queue.
This operation is idempotent.
.Description
Create a Service Bus queue.
create a Service Bus queue.
This operation is idempotent.
.Example
New-AzServiceBusQueue -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name myQueue -AutoDeleteOnIdle (New-TimeSpan -Days 1 -Minutes 3 -Seconds 4) -DefaultMessageTimeToLive (New-TimeSpan -Days 5) -EnablePartitioning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a new rule and updates an existing rule
create a new rule and create an existing rule
.Description
Create a new rule and updates an existing rule
create a new rule and create an existing rule
.Example
New-AzServiceBusRule -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -SubscriptionName mySubscription -Name myCorrelationRule -FilterType CorrelationFilter -ContentType contenttype -CorrelationFilterProperty @{a='b';c='d'} -SessionId sessionid -CorrelationId correlationid -MessageId messageid -Label label -ReplyTo replyto -ReplyToSessionId replytosessionid
.Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a topic subscription.
create a topic subscription.
.Description
Create a topic subscription.
create a topic subscription.
.Example
New-AzServiceBusSubscription -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -Name mySubscription -DefaultMessageTimeToLive (New-TimeSpan -Days 6) -EnableBatchedOperations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create a topic in the specified namespace.
create a topic in the specified namespace.
.Description
Create a topic in the specified namespace.
create a topic in the specified namespace.
.Example
New-AzServiceBusTopic -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name myTopic -DefaultMessageTimeToLive (New-TimeSpan -Days 18) -EnableBatchedOperations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2588,9 +2588,9 @@ end {

<#
.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-AzServiceBusGeoDRConfiguration -Name myAlias -ResourceGroupName myResourceGroup -NamespaceName myPrimaryNamespace -PartnerNamespace "/subscriptions/0000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/mySecondaryNamespace"

Expand Down Expand Up @@ -2828,10 +2828,10 @@ end {

<#
.Synopsis
Create a Service Bus queue.
create a Service Bus queue.
This operation is idempotent.
.Description
Create a Service Bus queue.
create a Service Bus queue.
This operation is idempotent.
.Example
New-AzServiceBusQueue -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name myQueue -AutoDeleteOnIdle (New-TimeSpan -Days 1 -Minutes 3 -Seconds 4) -DefaultMessageTimeToLive (New-TimeSpan -Days 5) -EnablePartitioning
Expand Down Expand Up @@ -3189,9 +3189,9 @@ end {

<#
.Synopsis
Create a new rule and updates an existing rule
create a new rule and create an existing rule
.Description
Create a new rule and updates an existing rule
create a new rule and create an existing rule
.Example
New-AzServiceBusRule -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -SubscriptionName mySubscription -Name myCorrelationRule -FilterType CorrelationFilter -ContentType contenttype -CorrelationFilterProperty @{a='b';c='d'} -SessionId sessionid -CorrelationId correlationid -MessageId messageid -Label label -ReplyTo replyto -ReplyToSessionId replytosessionid
.Example
Expand Down Expand Up @@ -3635,9 +3635,9 @@ end {

<#
.Synopsis
Create a topic subscription.
create a topic subscription.
.Description
Create a topic subscription.
create a topic subscription.
.Example
New-AzServiceBusSubscription -ResourceGroupName myResourceGroup -NamespaceName myNamespace -TopicName myTopic -Name mySubscription -DefaultMessageTimeToLive (New-TimeSpan -Days 6) -EnableBatchedOperations

Expand Down Expand Up @@ -4037,9 +4037,9 @@ end {

<#
.Synopsis
Create a topic in the specified namespace.
create a topic in the specified namespace.
.Description
Create a topic in the specified namespace.
create a topic in the specified namespace.
.Example
New-AzServiceBusTopic -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name myTopic -DefaultMessageTimeToLive (New-TimeSpan -Days 18) -EnableBatchedOperations

Expand Down Expand Up @@ -6303,9 +6303,9 @@ end {

<#
.Synopsis
Create Migration configuration and starts migration of entities from Standard to Premium namespace
create Migration configuration and starts migration of entities from Standard to Premium namespace
.Description
Create Migration configuration and starts migration of entities from Standard to Premium namespace
create Migration configuration and starts migration of entities from Standard to Premium namespace
.Example
Start-AzServiceBusMigration -ResourceGroupName myResourceGroup -NamespaceName myNamespace -PostMigrationName myStandardNamespace2 -TargetNamespace /subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/myPremiumNamespace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<#
.Synopsis
Create Migration configuration and starts migration of entities from Standard to Premium namespace
create Migration configuration and starts migration of entities from Standard to Premium namespace
.Description
Create Migration configuration and starts migration of entities from Standard to Premium namespace
create Migration configuration and starts migration of entities from Standard to Premium namespace
.Example
Start-AzServiceBusMigration -ResourceGroupName myResourceGroup -NamespaceName myNamespace -PostMigrationName myStandardNamespace2 -TargetNamespace /subscriptions/subscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.ServiceBus/namespaces/myPremiumNamespace

Expand Down
9 changes: 9 additions & 0 deletions src/ServiceBus/ServiceBus.Autorest/generate-portal-ux.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,16 @@ function New-MetadataForParameterSet()
$cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name
$description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description
[object[]]$example = New-ExampleForParameterSet $ParameterSetInfo
if ($Null -eq $example)
{
$example = @()
}

[string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo
if ($Null -eq $signature)
{
$signature = @()
}

return @{
Path = $httpPath
Expand Down
Loading