Get-AzEventGridTopic

Gets the details of an Event Grid topic, or gets a list of all Event Grid topics in the current Azure subscription.

Syntax

Get-AzEventGridTopic
   [[-ResourceGroupName] <String>]
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridTopic
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridTopic
   [-ResourceId] <String>
   [-ODataQuery <String>]
   [-Top <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzEventGridTopic
   [-NextLink <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzEventGridTopic cmdlet gets either the details of a specified Event Grid Topic, or a list of all Event Grid topics in the current Azure subscription. If the topic name is provided, the details of a single Event Grid Topic is returned. If the topic name is not provided, a list of topics is returned. The number of elements returned in this list is controlled by the Top parameter. If the Top value is not specified or $null, the list will contain all the topics items. Otherwise, Top will indicate the maximum number of elements to be returned in the list. If more topics are still available, the value in NextLink should be used in the next call to get the next page of topics. Finally, ODataQuery parameter is used to perform filtering for the search results. The filtering query follows OData syntax using the Name property only. The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.

Examples

Example 1

Get-AzEventGridTopic -ResourceGroup MyResourceGroupName -Name Topic1

Gets the details of Event Grid topic `Topic1` in resource group `MyResourceGroupName`.

Example 2

Get-AzEventGridTopic -ResourceId "/subscriptions/$subscriptionId/resourceGroups/MyResourceGroupName/providers/Microsoft.EventGrid/topics/Topic1"

Gets the details of Event Grid topic `Topic1` in resource group `MyResourceGroupName`.

Example 3

Get-AzEventGridTopic -ResourceGroup MyResourceGroupName

List all the Event Grid topics in resource group `MyResourceGroupName` without pagination.

Example 4

$odataFilter = "Name ne 'ABCD'"
$result = Get-AzEventGridTopic -ResourceGroup MyResourceGroupName -Top 10 -ODataQuery $odataFilter
Get-AzEventGridTopic $result.NextLink

List the first 10 Event Grid topics (if any) in resource group `MyResourceGroupName` that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of topics, user is expected to re-call Get-AzEventGridTopic and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Example 5

Get-AzEventGridTopic

List all the Event Grid topics in the subscription without pagination.

Example 6

$odataFilter = "Name ne 'ABCD'"
$result = Get-AzEventGridTopic -Top 10 -ODataQuery $odataFilter
Get-AzEventGridTopic $result.NextLink

List the first 10 Event Grid topics (if any) in the subscription that satisfies the $odataFilter query. If more results are available, the $result.NextLink will not be $null. In order to get next page(s) of topics, user is expected to re-call Get-AzEventGridTopic and uses result.NextLink obtained from the previous call. Caller should stop when result.NextLink becomes $null.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

EventGrid Topic Name.

Type:String
Aliases:TopicName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

The link for the next page of resources to be obtained. This value is obtained with the first Get-AzEventGrid cmdlet call when more resources are still available to be queried.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ODataQuery

The OData query used for filtering the list results. Filtering is currently allowed on the Name property only.The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name.

Type:String
Aliases:ResourceGroup
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceId

Resource Identifier representing the Event Grid Topic.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Top

The maximum number of resources to be obtained. Valid value is between 1 and 100. If top value is specified and more results are still available, the result will contain a link to the next page to be queried in NextLink. If the Top value is not specified, the full list of resources will be returned at once.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Outputs

PSTopic

PSTopicListInstance