Skip to content

Commit

Permalink
Event Grid Explorer - Adding Support for Event Grid V2 (#737)
Browse files Browse the repository at this point in the history
* Event Grid Explorer - Adding support for Event Grid V2 in Service Bus Explorer
Implemented Event Grid V2 library and components to view and manage Event Grid V2 entities
* Updated Event Grid Explorer README
* Made various fixes, including updating the connect form
* Updated EventGridExplorer README and removed Service Bus root node menu strip from Event Grid root node
* Adhare to the license in the repo
* Fall back to the default API version
* Change tenantId when logging in
* Improve UI event grid explorer (#752)
* Updated UI according to review.
* Set default and cancel buttons. Changed window looks.
* Changed the retry timout parsing
* Using Control plane sdk instead of generated files
* Adding Filter UI
* Allowing multiple filters
* Refining the explorer with proper error handling and the filters accepting values
* Resolving comments
* Removing custom exception and moving logic into filterfactory
* Build warnings resolved

---------

Co-authored-by: Sean Feldman <SeanFeldman@users.noreply.github.com>
Co-authored-by: Erik Mogensen <ErikMogensen@users.noreply.github.com>
Co-authored-by: Paolo Salvatori <paolos@microsoft.com>
Co-authored-by: harrieoriowo <168222311+harrieoriowo@users.noreply.github.com>
  • Loading branch information
5 people authored Jun 10, 2024
1 parent ae5505f commit 95c7742
Show file tree
Hide file tree
Showing 50 changed files with 14,973 additions and 1,178 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@ $RECYCLE.BIN/

# VS code settings
.vscode/settings.json

# Event Grid Explorer Library pkgrefgen
/src/EventGridExplorerLibrary/.pkgrefgen/
45 changes: 45 additions & 0 deletions EventGridExplorer_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Event Grid Explorer - Support for Event Grid V2 in Service Bus Explorer
**Author:** Amy Wang

The Event Grid Explorer provides a tool for viewing and managing Event Grid V2 entities, including namespaces, topics and subscriptions, as well as provide create/delete operations for topics and subscriptions, publish/receive operations for events, and acknowledge/release/reject operations for events.
Currently, the Event Grid Explorer features the functionality that is available for the preview version of Event Grid V2.
This additional support for Event Grid enables users to test event delivery with ease, contributing to the adoption of the new service.
Note: The EventGridExplorerLibrary uses models that are generated by Microsoft (R) AutoRest Code Generator

## Connect to Event Grid

Under the File tab, the user can connect to an Event Grid V2 namespace by providing the Resource Group, Namespace Name, Subscription ID, API Version, Retry Timeout and Cloud Tenant which selects the associated tenant ID.

![Connect to EGV2](./media/connect-event-grid.png)

![Connection Info](./media/connect-info-event-grid.png)

## Main View

When the connection is successful, a tree view of the Event Grid V2 namespace with its contained topics and subscriptions is displayed along with properties views.
Right-clicking the Topics and Subscriptions nodes enables the user to create topics/subscriptions and right-clicking the existing topics and subscriptions enables the user to publish/receive events and delete these entities.

![Main View](./media/main-view-event-grid.png)

## Publish

When right-clicking the Publish option on a topic, the user can create and publish an event by entering the event source, type and JSON payload.
Events are expected to use the CloudEvent format, as specified in the Azure SDK for .NET

![Publish Event to Topic](./media/publish-event-grid.png)

## Receive

When receiving events through a subscription, the user can receive the maximum number of events (100) or a top number of events.
When successful, the data view table is populated with the received events and the event data is displayed in a JSON format.

![Receive Event Popup](./media/receive-popup-event-grid.png)

![Receive Events in Subscription](./media/receive-results-event-grid.png)

## Event Settlement

The user can multi-select the received events in the table to acknowledge, release, or reject events.
When successful, the event status column is updated with the operation performed.

![Event Action](./media/event-action-event-grid.png)
Binary file added media/connect-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/connect-info-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/event-action-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/main-view-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/publish-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/receive-popup-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/receive-results-event-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EventGridExplorerLibrary\EventGridExplorerLibrary.csproj" />
<ProjectReference Include="..\EventHubs\EventHubs.csproj" />
<ProjectReference Include="..\Relay\Relay.csproj" />
<ProjectReference Include="..\ServiceBus\ServiceBus.csproj" />
Expand Down
1 change: 1 addition & 0 deletions src/Common/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static class Constants
{
public const string QueueEntities = "Queues";
public const string TopicEntities = "Topics";
public const string SubscriptionEntities = "Subscriptions";
public const string RelayEntities = "Relays";
public const string EventHubEntities = "Event Hubs";
public const string NotificationHubEntities = "Notification Hubs";
Expand Down
77 changes: 77 additions & 0 deletions src/Common/Helpers/EventGridSubscriptionWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#region Copyright
//=======================================================================================
// Microsoft Azure Customer Advisory Team
//
// This sample is supplemental to the technical guidance published on my personal
// blog at http://blogs.msdn.com/b/paolos/.
//
// Author: Paolo Salvatori
//=======================================================================================
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE
// FILES 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.
//=======================================================================================
#endregion

#region Using Directives

using Azure.ResourceManager.EventGrid;

#endregion

namespace ServiceBusExplorer.Helpers
{
/// <summary>
/// This class adds a Subscriptions collection to the TopicDescription class
/// </summary>
public class EventGridSubscriptionWrapper
{
#region Public Constructors
/// <summary>
/// Initializes a new instance of the SubscriptionWrapper class.
/// </summary>
public EventGridSubscriptionWrapper()
{
SubscriptionDescription = null;
TopicDescription = null;
Filter = null;
}

/// <summary>
/// Initializes a new instance of the SubscriptionWrapper class.
/// </summary>
/// <param name="subscription">A subscription.</param>
/// <param name="topic">The topic the subscription belongs to.</param>
public EventGridSubscriptionWrapper(NamespaceTopicEventSubscriptionResource subscription, NamespaceTopicResource topic)
{
SubscriptionDescription = subscription;
TopicDescription = topic;
}

/// <summary>
/// Initializes a new instance of the SubscriptionWrapper class.
/// </summary>
/// <param name="subscription">A subscription.</param>
/// <param name="topic">The topic the subscription belongs to.</param>
/// <param name="filter">The OData filter.</param>
public EventGridSubscriptionWrapper(NamespaceTopicEventSubscriptionResource subscription, NamespaceTopicResource topic, string filter)
{
SubscriptionDescription = subscription;
TopicDescription = topic;
Filter = filter;
}
#endregion

#region Public Properties
public NamespaceTopicEventSubscriptionResource SubscriptionDescription { get; set; }
public NamespaceTopicResource TopicDescription { get; set; }
public string Filter { get; set; }
#endregion
}
}
Loading

0 comments on commit 95c7742

Please sign in to comment.