-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Az Eventgrid] Add new features for 2021-12-31 release #17608
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
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1adce5b
add new features
rohkuma-microsoft e48cdc3
fix build issue
rohkuma-microsoft 23d4228
Adding addtional code
rohkuma-microsoft 6556e1a
Adding extra code
rohkuma-microsoft 19a5651
adding constants
rohkuma-microsoft f2e801b
Fixing names of cmdlets
rohkuma-microsoft fd8ed9a
fix code bug and resolve a comment
rohkuma-microsoft 2f77a3b
fixing pr comments
rohkuma-microsoft 6b74895
Adding help files and fixing static analysis
rohkuma-microsoft f58d8e0
Adding session records
rohkuma-microsoft 8b10da8
Adding additional tests
rohkuma-microsoft fa97930
fixing system topic event subscription cmdlets
rohkuma-microsoft 050980d
Fix all the issues
rohkuma-microsoft eee0c4c
Update help files
rohkuma-microsoft 23018aa
Updating the help files
rohkuma-microsoft 160826a
Remove should process from get cmdlets
rohkuma-microsoft 3a2fe5c
Addressing pr comments
rohkuma-microsoft c1de5e2
fix help
rohkuma-microsoft 745ca46
Fix broken pipeline
rohkuma-microsoft bcaff1e
Add missing values in help file
rohkuma-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/EventGrid/EventGrid.Test/ScenarioTests/SystemTopicTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
| using Microsoft.Azure.Commands.EventGrid.Test.ScenarioTests; | ||
| using Microsoft.Azure.ServiceManagement.Common.Models; | ||
| using Microsoft.WindowsAzure.Commands.ScenarioTest; | ||
| using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; | ||
| using Xunit; | ||
| using Xunit.Abstractions; | ||
|
|
||
| namespace Microsoft.Azure.Commands.EventGrid.Test.ScenarioTests | ||
| { | ||
| public class SystemTopicTests : RMTestBase | ||
| { | ||
| public XunitTracingInterceptor _logger; | ||
|
|
||
| public SystemTopicTests(ITestOutputHelper output) | ||
| { | ||
| _logger = new XunitTracingInterceptor(output); | ||
| XunitTracingInterceptor.AddToContext(_logger); | ||
| } | ||
|
|
||
| [Fact] | ||
| [Trait(Category.AcceptanceType, Category.CheckIn)] | ||
| public void EventGrid_TopicsGetKey() | ||
| { | ||
| EventGridController.NewInstance.RunPsTest(_logger, "SystemTopicTests"); | ||
| } | ||
| } | ||
| } |
107 changes: 107 additions & 0 deletions
107
src/EventGrid/EventGrid.Test/ScenarioTests/SystemTopicTests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # ---------------------------------------------------------------------------------- | ||
| # | ||
| # Copyright Microsoft Corporation | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ---------------------------------------------------------------------------------- | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Tests EventGrid Topic Create, Get and List operations. | ||
| #> | ||
| function SystemTopicTests { | ||
| # Setup | ||
| $location = Get-LocationForEventGrid | ||
| $topicName = Get-TopicName | ||
| $topicName2 = Get-TopicName | ||
| $topicName3 = Get-TopicName | ||
| $topicName4 = Get-TopicName | ||
| $resourceGroupName = Get-ResourceGroupName | ||
| $secondResourceGroup = Get-ResourceGroupName | ||
| $subscriptionId = Get-SubscriptionId | ||
|
|
||
| New-ResourceGroup $resourceGroupName $location | ||
|
|
||
| New-ResourceGroup $secondResourceGroup $location | ||
|
|
||
| $sbNamespaceName = Get-ServiceBusNameSpaceName | ||
| $sbNamespaceName2 = Get-ServiceBusNameSpaceName | ||
| $sbNamespaceName3 = Get-ServiceBusNameSpaceName | ||
| $sbQueueName = Get-ServiceBusQueueName | ||
| $sbTopicName = Get-ServiceBusTopicName | ||
|
|
||
| $sbNamespaceInRg1 = New-ServiceBusNamespace $ResourceGroupName $sbNamespaceName $Location | ||
|
|
||
| $sbNamespace1InRg2 = New-ServiceBusNamespace $secondResourceGroup $sbNamespaceName2 $Location | ||
|
|
||
| $sbNamespace2InRg2 = New-ServiceBusNamespace $secondResourceGroup $sbNamespaceName3 $Location | ||
|
|
||
| try | ||
| { | ||
| Write-Debug "Creating a new EventGrid SystemTopic: $topicName in resource group $resourceGroupName" | ||
| Write-Debug "Topic: $topicName" | ||
| $result = New-AzEventGridSystemTopic -ResourceGroup $resourceGroupName -Name $topicName -Source $sbNamespaceInRg1.Id -TopicType 'Microsoft.ServiceBus.Namespaces' -Location $location | ||
| Assert-True {$result.ProvisioningState -eq "Succeeded"} | ||
|
|
||
| Write-Debug "Getting the created topic within the resource group" | ||
| $createdTopic = Get-AzEventGridSystemTopic -ResourceGroup $resourceGroupName -Name $topicName | ||
| Assert-True {$createdTopic.Count -eq 1} | ||
| Assert-True {$createdTopic.TopicName -eq $topicName} "System Topic created earlier is not found." | ||
|
|
||
| Write-Debug "Creating a second EventGrid SystemTopic: $topicName2 in resource group $secondResourceGroup" | ||
| $result = New-AzEventGridSystemTopic -ResourceGroup $secondResourceGroup -Name $topicName2 -Source $sbNamespace1InRg2.Id -TopicType 'Microsoft.ServiceBus.Namespaces' -Location $location -Tag @{ Dept = "IT"; Environment = "Test" } | ||
| Assert-True {$result.ProvisioningState -eq "Succeeded"} | ||
|
|
||
| Write-Debug "Creating a third EventGrid SystemTopic: $topicName3 in resource group $secondResourceGroup" | ||
| $result = New-AzEventGridSystemTopic -ResourceGroup $secondResourceGroup -Name $topicName3 -Source $sbNamespace2InRg2.Id -TopicType 'Microsoft.ServiceBus.Namespaces' -Location $location | ||
| Assert-True {$result.ProvisioningState -eq "Succeeded"} | ||
|
|
||
| Write-Debug "Listing all the system topics created in the resourceGroup $secondResourceGroup" | ||
| $allCreatedTopics = Get-AzEventGridSystemTopic -ResourceGroup $secondResourceGroup | ||
| Assert-True {$allCreatedTopics.PsSystemTopicsList.Count -ge 0 } "Topic created earlier is not found in the list" | ||
|
|
||
| Write-Debug "Listing the topics created in the resourceGroup $secondResourceGroup using Top option" | ||
| $allCreatedTopics = Get-AzEventGridSystemTopic -ResourceGroup $secondResourceGroup -Top 1 | ||
| Assert-True {$allCreatedTopics.NextLink -ne $null } "NextLink should not be null as more topics should be available under resource group.." | ||
|
|
||
| Write-Debug "Listing the next topics created in the resourceGroup $secondResourceGroup using NextLink" | ||
| $allCreatedTopics = Get-AzEventGridSystemTopic -NextLink $allCreatedTopics.NextLink | ||
|
|
||
| Write-Debug "Getting the first 1 topic created in the subscription using Top options" | ||
| $allCreatedTopics = Get-AzEventGridSystemTopic -Top 1 | ||
| Assert-True {$allCreatedTopics.PsSystemTopicsList.Count -ge 0} "SystemTopics created earlier are not found." | ||
| Assert-True {$allCreatedTopics.NextLink -ne $null } "NextLink should not be null as more SystemTopics should be available under the azure subscription." | ||
|
|
||
| Write-Debug "Getting all the SystemTopics created in the subscription" | ||
| $allCreatedTopics = Get-AzEventGridSystemTopic | ||
| Assert-True {$allCreatedTopics.PsSystemTopicsList.Count -ge 0} "Topics created earlier are not found." | ||
|
|
||
| Write-Debug "Deleting topic: $topicName" | ||
| Remove-AzEventGridSystemTopic -ResourceGroup $resourceGroupName -Name $topicName | ||
|
|
||
| Write-Debug "Deleting topic: $topicName" | ||
| Remove-AzEventGridSystemTopic -ResourceGroup $secondResourceGroup -Name $topicName2 | ||
|
|
||
| Write-Debug "Deleting topic: $topicName" | ||
| Remove-AzEventGridSystemTopic -ResourceGroup $secondResourceGroup -Name $topicName3 | ||
|
|
||
|
|
||
| } | ||
| finally | ||
| { | ||
| Remove-AzServiceBusNamespace -ResourceGroup $resourceGroupName -Name $sbNamespaceInRg1 | ||
| Remove-AzServiceBusNamespace -ResourceGroup $secondResourceGroup -Name $sbNamespace1InRg2 | ||
| Remove-AzServiceBusNamespace -ResourceGroup $secondResourceGroup -Name $sbNamespace2InRg2 | ||
|
|
||
| Remove-ResourceGroup $resourceGroupName | ||
| Remove-ResourceGroup $secondResourceGroup | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.