Skip to content

Commit 50c2db9

Browse files
azure-powershell-botBethanyZhouNickcandy
authored
Migrate EventHub from generation to release-2022-12-06 (#20315)
* Move EventHub to release-2022-12-06 * Update ChangeLog.md * Update SignatureIssues.csv * Update ChangeLog.md Co-authored-by: Beisi Zhou <[email protected]> Co-authored-by: NanxiangLiu <[email protected]>
1 parent 8322c91 commit 50c2db9

File tree

299 files changed

+23251
-14508
lines changed

Some content is hidden

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

299 files changed

+23251
-14508
lines changed

src/EventHub/EventHub.Autorest/README.md

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ directive:
131131
subject: GeoDRConfiguration
132132

133133
# Remove namespace cmdlets
134-
- where:
135-
subject: Namespace
136-
remove: true
134+
# - where:
135+
# subject: Namespace
136+
# remove: true
137137

138138
# Hide New-AzEventHubPrivateEndpointConnection
139139
- where:
@@ -146,6 +146,95 @@ directive:
146146
set:
147147
subject: PrivateLink
148148

149+
# Renaming New-AzEventHubNamespace
150+
- where:
151+
verb: New
152+
subject: Namespace
153+
parameter-name: EncryptionRequireInfrastructureEncryption
154+
set:
155+
parameter-name: RequireInfrastructureEncryption
156+
- where:
157+
model-name: EhNamespace
158+
property-name: EncryptionRequireInfrastructureEncryption
159+
set:
160+
property-name: RequireInfrastructureEncryption
161+
162+
- where:
163+
verb: New
164+
subject: Namespace
165+
parameter-name: EncryptionKeyVaultProperty
166+
set:
167+
parameter-name: KeyVaultProperty
168+
- where:
169+
model-name: EhNamespace
170+
property-name: EncryptionKeyVaultProperty
171+
set:
172+
property-name: KeyVaultProperty
173+
174+
- where:
175+
verb: New
176+
subject: Namespace
177+
parameter-name: IsAutoInflateEnabled
178+
set:
179+
parameter-name: EnableAutoInflate
180+
- where:
181+
model-name: EhNamespace
182+
property-name: IsAutoInflateEnabled
183+
set:
184+
property-name: EnableAutoInflate
185+
186+
- where:
187+
verb: New
188+
subject: Namespace
189+
parameter-name: EncryptionKeySource
190+
set:
191+
parameter-name: KeySource
192+
- where:
193+
model-name: EhNamespace
194+
property-name: EncryptionKeySource
195+
set:
196+
property-name: KeySource
197+
198+
- where:
199+
verb: New
200+
subject: Namespace
201+
parameter-name: IdentityUserAssignedIdentity
202+
set:
203+
parameter-name: UserAssignedIdentity
204+
- where:
205+
model-name: EhNamespace
206+
property-name: IdentityUserAssignedIdentity
207+
set:
208+
property-name: UserAssignedIdentity
209+
210+
- where:
211+
model-name: EhNamespace
212+
property-name: IdentityPrincipalId
213+
set:
214+
property-name: PrincipalId
215+
216+
- where:
217+
model-name: EhNamespace
218+
property-name: IdentityTenantId
219+
set:
220+
property-name: TenantId
221+
222+
- where:
223+
subject: Namespace
224+
set:
225+
subject: NamespaceV2
226+
227+
- where:
228+
verb: New
229+
subject: NamespaceV2
230+
hide: true
231+
232+
- where:
233+
model-name: KeyVaultProperties
234+
property-name: IdentityUserAssignedIdentity
235+
set:
236+
property-name: UserAssignedIdentity
237+
149238
- where:
150239
verb: Get
151240
subject: PrivateLink
@@ -315,3 +404,6 @@ directive:
315404
model-name: (.*)
316405
set:
317406
suppress-format: true
407+
408+
- model-cmdlet:
409+
- KeyVaultProperties

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ $examplesFolder = Join-Path $PSScriptRoot 'examples'
122122
$null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

124124
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
125-
$modelCmdlets = @()
125+
$modelCmdlets = @('KeyVaultProperties')
126126
if ($modelCmdlets.Count -gt 0) {
127127
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
128128
CreateModelCmdlet($modelCmdlets)

src/EventHub/EventHub.Autorest/create-model-cmdlets.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Create an in-memory object for ${ObjectType}.
158158
.Outputs
159159
${ObjectTypeWithNamespace}
160160
.Link
161-
https://docs.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
161+
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162162
#>
163163
function New-Az${ModulePrefix}${ObjectType}Object {
164164
[OutputType('${ObjectTypeWithNamespace}')]
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.Synopsis
17+
Creates an EventHub Namespace
18+
.Description
19+
Creates an EventHub Namespace
20+
#>
21+
22+
function New-AzEventHubNamespaceV2{
23+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IEhNamespace])]
24+
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
25+
param(
26+
27+
[Parameter(Mandatory, HelpMessage = "The name of EventHub namespace.")]
28+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Path')]
29+
[System.String]
30+
# The name of EventHub namespace
31+
${Name},
32+
33+
[Parameter(Mandatory, HelpMessage = "The name of the resource group. The name is case insensitive.")]
34+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Path')]
35+
[System.String]
36+
# The name of the resource group.
37+
# The name is case insensitive.
38+
${ResourceGroupName},
39+
40+
[Parameter(HelpMessage = "The ID of the target subscription.")]
41+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Path')]
42+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
43+
[System.String]
44+
# The ID of the target subscription.
45+
${SubscriptionId},
46+
47+
[Parameter(HelpMessage = "Alternate name specified when alias and namespace names are same")]
48+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
49+
[System.String]
50+
${AlternateName},
51+
52+
[Parameter(HelpMessage = "Cluster ARM ID of the Namespace.")]
53+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
54+
[System.String]
55+
${ClusterArmId},
56+
57+
[Parameter(HelpMessage = "This property disables SAS authentication for the Event Hubs namespace.")]
58+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
59+
[System.Management.Automation.SwitchParameter]
60+
${DisableLocalAuth},
61+
62+
[Parameter(HelpMessage = "Enable Infrastructure Encryption (Double Encryption)")]
63+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
64+
[System.Management.Automation.SwitchParameter]
65+
${RequireInfrastructureEncryption},
66+
67+
[Parameter(Mandatory, HelpMessage = "Cluster ARM ID of the Namespace.")]
68+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
69+
[System.String]
70+
${Location},
71+
72+
[Parameter(HelpMessage = "Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones.")]
73+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
74+
[System.Management.Automation.SwitchParameter]
75+
${ZoneRedundant},
76+
77+
[Parameter(HelpMessage = "Properties to configure Encryption")]
78+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
79+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IKeyVaultProperties[]]
80+
${KeyVaultProperty},
81+
82+
[Parameter(HelpMessage = "Type of managed service identity.")]
83+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
84+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Support.ManagedServiceIdentityType]
85+
${IdentityType},
86+
87+
[Parameter(HelpMessage = "Properties for User Assigned Identities")]
88+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
89+
[System.String[]]
90+
# IdentityId
91+
${UserAssignedIdentityId},
92+
93+
[Parameter(HelpMessage = "Value that indicates whether AutoInflate is enabled for eventhub namespace.")]
94+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
95+
[System.Management.Automation.SwitchParameter]
96+
${EnableAutoInflate},
97+
98+
[Parameter(HelpMessage = "Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true)")]
99+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
100+
[System.Int64]
101+
${MaximumThroughputUnit},
102+
103+
[Parameter(HelpMessage = "The minimum TLS version for the cluster to support, e.g. '1.2'")]
104+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
105+
[System.String]
106+
${MinimumTlsVersion},
107+
108+
[Parameter(HelpMessage = "The minimum TLS version for the cluster to support, e.g. '1.2'")]
109+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
110+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Support.SkuName]
111+
${SkuName},
112+
113+
[Parameter(HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled.")]
114+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
115+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Support.PublicNetworkAccess]
116+
${PublicNetworkAccess},
117+
118+
[Parameter(HelpMessage = "The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units.")]
119+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
120+
[System.Int64]
121+
${SkuCapacity},
122+
123+
[Parameter(HelpMessage = "Tag of EventHub Namespace.")]
124+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
125+
[System.Collections.Hashtable]
126+
${Tag},
127+
128+
[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
129+
[Alias('AzureRMContext', 'AzureCredential')]
130+
[ValidateNotNull()]
131+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Azure')]
132+
[System.Management.Automation.PSObject]
133+
${DefaultProfile},
134+
135+
[Parameter(HelpMessage = "Run the command as a job")]
136+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
137+
[System.Management.Automation.SwitchParameter]
138+
# Run the command as a job
139+
${AsJob},
140+
141+
[Parameter(DontShow)]
142+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
143+
[System.Management.Automation.SwitchParameter]
144+
# Wait for .NET debugger to attach
145+
${Break},
146+
147+
[Parameter(DontShow)]
148+
[ValidateNotNull()]
149+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
150+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.SendAsyncStep[]]
151+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
152+
${HttpPipelineAppend},
153+
154+
[Parameter(DontShow)]
155+
[ValidateNotNull()]
156+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
157+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.SendAsyncStep[]]
158+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
159+
${HttpPipelinePrepend},
160+
161+
[Parameter(DontShow)]
162+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
163+
[System.Management.Automation.SwitchParameter]
164+
# Run the command asynchronously
165+
${NoWait},
166+
167+
[Parameter(DontShow)]
168+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
169+
[System.Uri]
170+
# The URI for the proxy server to use
171+
${Proxy},
172+
173+
[Parameter(DontShow)]
174+
[ValidateNotNull()]
175+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
176+
[System.Management.Automation.PSCredential]
177+
# Credentials for a proxy server to use for the remote call
178+
${ProxyCredential},
179+
180+
[Parameter(DontShow)]
181+
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')]
182+
[System.Management.Automation.SwitchParameter]
183+
# Use the default credentials for the proxy
184+
${ProxyUseDefaultCredentials}
185+
)
186+
process{
187+
try{
188+
$null = $PSBoundParameters.Remove('WhatIf')
189+
$null = $PSBoundParameters.Remove('Confirm')
190+
if($PSBoundParameters.ContainsKey('SkuName')){
191+
$PSBoundParameters.Add('SkuTier', $SkuName)
192+
}
193+
194+
if($PSBoundParameters.ContainsKey('KeyVaultProperty')){
195+
$PSBoundParameters.Add('KeySource', 'Microsoft.KeyVault')
196+
}
197+
198+
if($PSBoundParameters.ContainsKey('UserAssignedIdentityId')){
199+
$identityHashTable = @{}
200+
201+
foreach ($resourceID in $UserAssignedIdentityId){
202+
$identityHashTable.Add($resourceID, [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.UserAssignedIdentity]::new())
203+
}
204+
205+
$PSBoundParameters.Add("UserAssignedIdentity", $identityHashTable)
206+
$null = $PSBoundParameters.Remove("UserAssignedIdentityId")
207+
}
208+
if ($PSCmdlet.ShouldProcess("EventHub Namespace $($Name)", "Create or update")) {
209+
Az.EventHub.private\New-AzEventHubNamespaceV2_CreateExpanded @PSBoundParameters
210+
}
211+
}
212+
catch{
213+
throw
214+
}
215+
}
216+
}

0 commit comments

Comments
 (0)