Skip to content

Commit

Permalink
[EventHubs]: Migrating to Autorest Powershell (#19458)
Browse files Browse the repository at this point in the history
* Autorest cmdlets for eventhubs

* Testing

* Adding new testcases and a fixes

* Tests and fixes

* Tests and fixes

* Fixes and docs

* Fixes and docs

* Docs and tests

* deleting unnecessary files

* comment addressing

* fixes and docs

* Update Az.EventHub.psd1

* Update Get-AzEventHubClustersAvailableRegion.md

* Update Get-AzEventHubClustersAvailableRegion.md

* Update Get-AzEventHubPrivateLink.md

* Update Get-AzEventHubPrivateLink.md

* Removing aliases

* Removing aliasing and fixing documentation

* Removing aliases and DOC fixes Yunchi suggested to make

* Fixes

* Doc fixes

* Fixes

* fixes

* update the sleep logic

* Fix

* update the docs

* update docs

* GeoDR cmdlets: adding env parameters

* Schema group descriptions

* update doc

Co-authored-by: Yunchi Wang <[email protected]>
Co-authored-by: wyunchi-ms <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2022
1 parent 256b67c commit 054c0f3
Show file tree
Hide file tree
Showing 210 changed files with 39,298 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/EventHub/EventHub.Autorest/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
15 changes: 15 additions & 0 deletions src/EventHub/EventHub.Autorest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bin
obj
.vs
generated
internal
exports
tools
custom/*.psm1
test/*-TestResults.xml
/*.ps1
/*.ps1xml
/*.psm1
/*.snk
/*.csproj
/*.nuspec
24 changes: 24 additions & 0 deletions src/EventHub/EventHub.Autorest/Az.EventHub.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@{
GUID = 'c3f93fb7-6f6a-471a-9064-f4f38a883a47'
RootModule = './Az.EventHub.psm1'
ModuleVersion = '0.1.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: EventHub cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.EventHub.private.dll'
FormatsToProcess = './Az.EventHub.format.ps1xml'
FunctionsToExport = 'Approve-AzEventHubPrivateEndpointConnection', 'Deny-AzEventHubPrivateEndpointConnection', 'Get-AzEventHub', 'Get-AzEventHubApplicationGroup', 'Get-AzEventHubAuthorizationRule', 'Get-AzEventHubCluster', 'Get-AzEventHubClusterNamespace', 'Get-AzEventHubClustersAvailableRegion', 'Get-AzEventHubConsumerGroup', 'Get-AzEventHubGeoDRConfiguration', 'Get-AzEventHubKey', 'Get-AzEventHubNetworkRuleSet', 'Get-AzEventHubPrivateEndpointConnection', 'Get-AzEventHubPrivateLink', 'Get-AzEventHubSchemaGroup', 'New-AzEventHub', 'New-AzEventHubApplicationGroup', 'New-AzEventHubAuthorizationRule', 'New-AzEventHubCluster', 'New-AzEventHubConsumerGroup', 'New-AzEventHubGeoDRConfiguration', 'New-AzEventHubIPRuleConfig', 'New-AzEventHubKey', 'New-AzEventHubSchemaGroup', 'New-AzEventHubThrottlingPolicyConfig', 'New-AzEventHubVirtualNetworkRuleConfig', 'Remove-AzEventHub', 'Remove-AzEventHubApplicationGroup', 'Remove-AzEventHubAuthorizationRule', 'Remove-AzEventHubCluster', 'Remove-AzEventHubConsumerGroup', 'Remove-AzEventHubGeoDRConfiguration', 'Remove-AzEventHubPrivateEndpointConnection', 'Remove-AzEventHubSchemaGroup', 'Set-AzEventHub', 'Set-AzEventHubApplicationGroup', 'Set-AzEventHubAuthorizationRule', 'Set-AzEventHubCluster', 'Set-AzEventHubConsumerGroup', 'Set-AzEventHubGeoDRConfigurationBreakPair', 'Set-AzEventHubGeoDRConfigurationFailOver', 'Set-AzEventHubNetworkRuleSet', 'Test-AzEventHubName', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'EventHub'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}
317 changes: 317 additions & 0 deletions src/EventHub/EventHub.Autorest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
<!-- region Generated -->
# Az.EventHub
This directory contains the PowerShell module for the EventHub service.

---
## Status
[![Az.EventHub](https://img.shields.io/powershellgallery/v/Az.EventHub.svg?style=flat-square&label=Az.EventHub "Az.EventHub")](https://www.powershellgallery.com/packages/Az.EventHub/)

## Info
- Modifiable: yes
- Generated: all
- Committed: yes
- Packaged: yes

---
## Detail
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

## Module Requirements
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater

## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.

## Development
For information on how to develop for `Az.EventHub`, see [how-to.md](how-to.md).
<!-- endregion -->

### AutoRest Configuration
> see https://aka.ms/autorest
``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
branch: 6f0c7d58c0a923917c2b3467ee756f21dbd2f8e2
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/AvailableClusterRegions-preview.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/Clusters-preview.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/namespaces-preview.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/networkrulessets-preview.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/AuthorizationRules.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/CheckNameAvailability.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/consumergroups.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/disasterRecoveryConfigs.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/operations.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/SchemaRegistry.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/eventhubs.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-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

# For new RP, the version is 0.1.0
module-version: 0.1.0
# Normally, title is the service name
title: EventHub
subject-prefix: $(service-name)

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
resourcegroup-append: true
nested-object-to-string: true

directive:
- where:
variant: ^Create$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
remove: true
- where:
variant: ^CreateViaIdentity$
hide: true
- where:
variant: ^RegenerateExpanded$|^RegenerateViaIdentityExpanded$|^RegenerateViaIdentity$
remove: true
- where:
verb: Set
remove: true
- where:
verb: Update
remove: true
- where:
subject: AuthorizationRule|NamespaceAuthorizationRule
hide: true
- where:
subject: Key|NamespaceKey
hide: true
- where:
subject: AuthorizationRule|NamespaceAuthorizationRule
parameter-name: AuthorizationRuleName
set:
parameter-name: Name
- where:
subject: Key|NamespaceKey
parameter-name: AuthorizationRuleName
set:
parameter-name: Name

- where:
subject: NamespaceNetworkRuleSet
set:
subject: NetworkRuleSet

# Geo Disaster Recovery, cmdlet naming changes
- where:
subject: DisasterRecoveryConfig
parameter-name: Alias
set:
parameter-name: Name

- where:
verb: Invoke
subject: BreakDisasterRecoveryConfigPairing|FailDisasterRecoveryConfigOver
parameter-name: Alias
set:
parameter-name: Name

- where:
verb: Invoke
subject: BreakDisasterRecoveryConfigPairing
hide: true

- where:
verb: Invoke
subject: FailDisasterRecoveryConfigOver
hide: true

- where:
subject: DisasterRecoveryConfig
set:
subject: GeoDRConfiguration

# Remove namespace cmdlets
- where:
subject: Namespace
remove: true

# Hide New-AzEventHubPrivateEndpointConnection
- where:
verb: New
subject: PrivateEndpointConnection
hide: true

- where:
subject: PrivateLinkResource
set:
subject: PrivateLink

- where:
verb: Get
subject: PrivateLink
variant: GetViaIdentity
remove: true

- where:
model-name: PrivateEndpointConnection
property-name: PrivateLinkServiceConnectionStateStatus
set:
property-name: ConnectionState

- where:
model-name: PrivateEndpointConnection
property-name: PrivateLinkServiceConnectionStateDescription
set:
property-name: Description

# Remove NSP calls
- where:
subject: NetworkSecurityPerimeterConfiguration
remove: true

# Hide New-AzEventHubNetworkRuleSet
- where:
verb: New
subject: NetworkRuleSet
hide: true

# Rename parameters on New-AzEventHub and it's models
- where:
verb: New
subject: EventHub
parameter-name: CaptureDescriptionEnabled
set:
parameter-name: CaptureEnabled
- where:
model-name: EventHub
property-name: CaptureDescriptionEnabled
set:
property-name: CaptureEnabled

- where:
verb: New
subject: EventHub
parameter-name: CaptureDescriptionEncoding
set:
parameter-name: Encoding
- where:
model-name: EventHub
property-name: CaptureDescriptionEncoding
set:
property-name: Encoding

- where:
verb: New
subject: EventHub
parameter-name: CaptureDescriptionIntervalInSecond
set:
parameter-name: IntervalInSeconds
- where:
model-name: EventHub
property-name: CaptureDescriptionIntervalInSecond
set:
property-name: IntervalInSeconds

- where:
verb: New
subject: EventHub
parameter-name: CaptureDescriptionSkipEmptyArchive
set:
parameter-name: SkipEmptyArchive
- where:
model-name: EventHub
property-name: CaptureDescriptionSkipEmptyArchive
set:
property-name: SkipEmptyArchive

- where:
verb: New
subject: EventHub
parameter-name: CaptureDescriptionSizeLimitInByte
set:
parameter-name: SizeLimitInBytes
- where:
model-name: EventHub
property-name: CaptureDescriptionSizeLimitInByte
set:
property-name: SizeLimitInBytes

- where:
verb: New
subject: EventHub
parameter-name: DataLakeAccountName|DataLakeFolderPath|DataLakeSubscriptionId
hide: true

- where:
verb: New
subject: EventHub
parameter-name: MessageRetentionInDay
set:
parameter-name: MessageRetentionInDays
- where:
model-name: EventHub
property-name: MessageRetentionInDay
set:
property-name: MessageRetentionInDays

# Cluster
- where:
verb: New
subject: Cluster
parameter-name: SkuCapacity
set:
parameter-name: Capacity
- where:
model-name: Cluster
property-name: SkuCapacity
set:
property-name: Capacity
- where:
subject: ClusterAvailableClusterRegion
set:
subject: ClustersAvailableRegion
- where:
verb: New
subject: Cluster
parameter-name: Capacity
set:
default:
script: '1'

# Schema Group
- where:
verb: New|Remove|Get
subject: SchemaRegistry
parameter-name: SchemaGroupName
set:
parameter-name: Name

- where:
subject: SchemaRegistry
parameter-name: Name
set:
alias:
- SchemaGroupName

- where:
subject: SchemaRegistry
set:
subject: SchemaGroup

# Name Availability
- where:
verb: Test
subject: NamespaceNameAvailability
hide: true

- where:
verb: Test
subject: DisasterRecoveryConfigNameAvailability
hide: true

# Table formatting

- where:
model-name: (.*)
set:
suppress-format: true
Loading

0 comments on commit 054c0f3

Please sign in to comment.