Udostępnij za pośrednictwem


ManagementClient.GetRulesAsync Method

Definition

Retrieves the list of rules for a given subscription in a topic.

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))

Parameters

topicPath
String

The topic path.

subscriptionName
String

The subscription for which all the rules need to be retrieved.

count
Int32

The number of rules to fetch. Defaults to 100. Maximum value allowed is 100.

skip
Int32

The number of rules to skip. Defaults to 0. Cannot be negative.

cancellationToken
CancellationToken

Returns

IList<T> containing list of rules.

Exceptions

If the parameters are out of range.

The operation times out. The timeout period is initialized through the ServiceBusConnection class. You may need to increase the value of timeout to avoid this exception if the timeout value is relatively low.

No sufficient permission to perform this operation. You should check to ensure that your ManagementClient has the correct TokenProvider credentials to perform this operation.

The server is busy. You should wait before you retry the operation.

An internal error or an unexpected exception occured.

Remarks

You can simulate pages of list of entities by manipulating count and skip. skip(0)+count(100) gives first 100 entities. skip(100)+count(100) gives the next 100 entities. Note - Only following data types are deserialized in Filters and Action parameters - string,int,long,bool,double,DateTime. Other data types would return its string value.

Applies to