你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzEventGridDomain
获取事件网格域的详细信息,或获取当前 Azure 订阅中所有事件网格域的列表。
语法
Get-AzEventGridDomain
[[-ResourceGroupName] <String>]
[-ODataQuery <String>]
[-Top <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzEventGridDomain
[-ResourceGroupName] <String>
[-Name] <String>
[-ODataQuery <String>]
[-Top <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzEventGridDomain
[-ResourceId] <String>
[-ODataQuery <String>]
[-Top <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzEventGridDomain
[-NextLink <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzEventGridDomain cmdlet 获取指定事件网格域的详细信息,或当前 Azure 订阅中所有事件网格域的列表。 如果提供域名,则返回单个事件网格域的详细信息。 如果未提供域名,则返回域列表。 此列表中返回的元素数由 Top 参数控制。 如果未指定 Top 值或$null,列表将同时包含返回的所有域项。 否则,Top 将指示列表中要返回的最大元素数。 如果仍有更多域可用,则应在下一次调用中使用 NextLink 中的值来获取下一页域。 最后,ODataQuery 参数用于对搜索结果执行筛选。 筛选查询仅使用 Name 属性遵循 OData 语法。 支持的操作包括:CONTAINS、eq(等于)、ne(不等于)、AND、OR 和 NOT。
示例
示例 1
获取资源组“MyResourceGroupName”中事件网格域“Domain1”的详细信息。
Get-AzEventGridDomain -ResourceGroup MyResourceGroupName -Name Domain1
ResourceGroupName : MyResourceGroupName
DomainName : Domain1
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname/providers/Microsoft.EventGrid/domains/domain1
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain1.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags : {[Tag1, Value1], [Tag2, Value2]}
示例 2
使用 ResourceId 选项获取资源组“MyResourceGroupName”中的事件网格域“Domain1”的详细信息。
Get-AzEventGridDomain -ResourceId "/subscriptions/$subscriptionId/resourceGroups/MyResourceGroupName/providers/Microsoft.EventGrid/domains/Domain1"
ResourceGroupName : MyResourceGroupName
DomainName : Domain1
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname/providers/Microsoft.EventGrid/domains/domain1
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain1.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags : {[Tag1, Value1], [Tag2, Value2]}
示例 3
列出资源组“MyResourceGroupName”中没有分页的所有事件网格域(所有域都在一次拍摄中返回)
$result=Get-AzEventGridDomain -ResourceGroup MyResourceGroupName
Write-Output $result.PsDomainsList
ResourceGroupName : MyResourceGroupName
DomainName : Domain1
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname/providers/Microsoft.EventGrid/domains/domain1
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain1.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags : {[Tag1, Value1], [Tag2, Value2]}
ResourceGroupName : MyResourceGroupName
DomainName : Domain2
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname/providers/Microsoft.EventGrid/domains/domain2
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain2.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags :
ResourceGroupName : MyResourceGroupName
DomainName : Domain3
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname/providers/Microsoft.EventGrid/domains/domain3
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain3.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags : {[Tag3, Value3], [Tag4, Value4]}
ResourceGroupName : MyResourceGroupName
DomainName : Domain4
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname/providers/Microsoft.EventGrid/domains/domain4
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain4.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags :
示例 4
列出资源组“MyResourceGroupName”中满足$odataFilter查询 10 个域的事件网格域(如果有)。 如果有更多结果可用,$result。NextLink 不会$null。 为了获取域的下一页,用户应重新调用 Get-AzEventGridDomain 并使用结果。从上一次调用获取的 NextLink。 调用方应在结果时停止。NextLink 变为$null。
$total = 0
$odataFilter = "Name ne 'ABCD'"
$result = Get-AzEventGridDomain -ResourceGroup MyResourceGroupName -Top 10 -ODataQuery $odataFilter
$total += $result.Count
while ($null -ne $result.NextLink)
{
$result = Get-AzEventGridDomain -NextLink $result.NextLink
$total += $result.Count
}
Write-Output "Total number of domains is $Total"
示例 5
列出 Azure 订阅中没有分页的所有事件网格域(所有域在一次拍摄中返回)
$result=Get-AzEventGridDomain
Write-Output $result.PsDomainsList
ResourceGroupName : MyResourceGroupName
DomainName : Domain1
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname1/providers/Microsoft.EventGrid/domains/domain1
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain1.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags : {[Tag1, Value1], [Tag2, Value2]}
ResourceGroupName : MyResourceGroupName
DomainName : Domain2
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname1/providers/Microsoft.EventGrid/domains/domain2
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain2.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags :
ResourceGroupName : MyResourceGroupName
DomainName : Domain3
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname2/providers/Microsoft.EventGrid/domains/domain3
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain3.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags : {[Tag3, Value3], [Tag4, Value4]}
ResourceGroupName : MyResourceGroupName
DomainName : Domain4
Id : /subscriptions/<Azure Subscription Id>/resourceGroups/myresourcegroupname3/providers/Microsoft.EventGrid/domains/domain4
Type : Microsoft.EventGrid/domains
Location : westus2
Endpoint : https://domain4.westus2-1.eventgrid.azure.net/api/events
ProvisioningState : Succeeded
Tags :
示例 6
列出 Azure 订阅中满足$odataFilter查询 20 个域的事件网格域(如果有)。 如果有更多结果可用,$result。NextLink 不会$null。 为了获取域的下一页,用户应重新调用 Get-AzEventGridDomain 并使用结果。从上一次调用获取的 NextLink。 调用方应在结果时停止。NextLink 变为$null。
$total = 0
$odataFilter = "Contains(Name, 'ABCD')"
$result = Get-AzEventGridDomain -Top 20 -ODataQuery $odataFilter
$total += $result.Count
while ($null -ne $result.NextLink)
{
$result = Get-AzEventGridDomain -NextLink $result.NextLink
$total += $result.Count
}
Write-Output "Total number of domains is $Total"
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
EventGrid 域名。
Type: | String |
Aliases: | DomainName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-NextLink
要获取的下一页资源的链接。 当仍有更多资源可供查询时,使用第一个 Get-AzEventGrid cmdlet 调用获取此值。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ODataQuery
用于筛选列表结果的 OData 查询。 目前仅允许对 Name 属性进行筛选。支持的操作包括:CONTAINS、eq(等于)、ne(不等于)、AND、OR 和 NOT。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
资源组的名称。
Type: | String |
Aliases: | ResourceGroup |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceId
表示事件网格域的资源标识符。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Top
要获取的最大资源数。 有效值为 1 到 100。 如果指定了顶部值,并且仍有更多结果可用,则结果将包含指向要在 NextLink 中查询的下一页的链接。 如果未指定 Top 值,则会同时返回资源的完整列表。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
输入
输出
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈