你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ManagementClient.GetRulesAsync 方法

定义

检索主题中给定订阅的规则列表。

public virtual System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.RuleDescription>> GetRulesAsync (string topicPath, string subscriptionName, int count = 100, int skip = 0, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRulesAsync : string * string * int * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.RuleDescription>>
override this.GetRulesAsync : string * string * int * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.RuleDescription>>
Public Overridable Function GetRulesAsync (topicPath As String, subscriptionName As String, Optional count As Integer = 100, Optional skip As Integer = 0, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IList(Of RuleDescription))

参数

topicPath
String

主题路径。

subscriptionName
String

需要检索其所有规则的订阅。

count
Int32

要提取的规则数。 默认为 100。 允许的最大值为 100。

skip
Int32

要跳过的规则数量。 默认值为 0。 不能为负值。

cancellationToken
CancellationToken

返回

IList<T> 包含规则列表。

例外

如果参数在范围外。

操作超时。超时期限通过 ServiceBusConnection 类进行初始化。 如果超时值相对较低,则可能需要增加超时值以避免此异常。

没有足够的权限来执行此操作。 应检查,以确保拥有ManagementClient执行此操作的正确TokenProvider凭据。

服务器繁忙。 在重试操作之前,应等待。

发生内部错误或意外异常。

注解

可以通过操作 countskip来模拟实体列表的页面。 skip (0) +count (100) 提供前 100 个实体。 skip (100) +count (100) 提供接下来的 100 个实体。 注意 - 筛选器和操作参数中仅反序列化以下数据类型 - string、int、long、bool、double、DateTime。 其他数据类型将返回其字符串值。

适用于