@@ -24,7 +24,6 @@ public static Overview GetOverview(
2424 . GetResult ( ) ;
2525 }
2626
27-
2827 /// <summary>
2928 /// A list of nodes in the RabbitMQ cluster.
3029 /// </summary>
@@ -74,6 +73,24 @@ public static IReadOnlyList<Connection> GetConnections(
7473 . GetResult ( ) ;
7574 }
7675
76+ /// <summary>
77+ /// A list of all open connections on the specified VHost.
78+ /// </summary>
79+ /// <param name="client"></param>
80+ /// <param name="vhostName"></param>
81+ /// <param name="cancellationToken"></param>
82+ /// <returns></returns>
83+ public static IReadOnlyList < Connection > GetConnections (
84+ this IManagementClient client ,
85+ string vhostName ,
86+ CancellationToken cancellationToken = default
87+ )
88+ {
89+ return client . GetConnectionsAsync ( vhostName , cancellationToken )
90+ . GetAwaiter ( )
91+ . GetResult ( ) ;
92+ }
93+
7794 /// <summary>
7895 /// A list of all open channels.
7996 /// </summary>
@@ -91,7 +108,25 @@ public static IReadOnlyList<Channel> GetChannels(
91108 }
92109
93110 /// <summary>
94- /// A list of all open channels.
111+ /// A list of all open channels for the given connection.
112+ /// </summary>
113+ /// <param name="client"></param>
114+ /// <param name="connectionName"></param>
115+ /// <param name="cancellationToken"></param>
116+ /// <returns></returns>
117+ public static IReadOnlyList < Channel > GetChannels (
118+ this IManagementClient client ,
119+ string connectionName ,
120+ CancellationToken cancellationToken = default
121+ )
122+ {
123+ return client . GetChannelsAsync ( connectionName , cancellationToken )
124+ . GetAwaiter ( )
125+ . GetResult ( ) ;
126+ }
127+
128+ /// <summary>
129+ /// A list of all open channels for the given connection.
95130 /// </summary>
96131 /// <param name="client"></param>
97132 /// <param name="connection"></param>
@@ -103,6 +138,24 @@ public static Task<IReadOnlyList<Channel>> GetChannelsAsync(
103138 CancellationToken cancellationToken = default
104139 ) => client . GetChannelsAsync ( connection . Name , cancellationToken ) ;
105140
141+ /// <summary>
142+ /// A list of all open channels for the given connection.
143+ /// </summary>
144+ /// <param name="client"></param>
145+ /// <param name="connection"></param>
146+ /// <param name="cancellationToken"></param>
147+ /// <returns></returns>
148+ public static IReadOnlyList < Channel > GetChannels (
149+ this IManagementClient client ,
150+ Connection connection ,
151+ CancellationToken cancellationToken = default
152+ )
153+ {
154+ return client . GetChannelsAsync ( connection , cancellationToken )
155+ . GetAwaiter ( )
156+ . GetResult ( ) ;
157+ }
158+
106159 /// <summary>
107160 /// Gets the channel. This returns more detail, including consumers than the GetChannels method.
108161 /// </summary>
@@ -139,6 +192,24 @@ public static IReadOnlyList<Exchange> GetExchanges(
139192 . GetResult ( ) ;
140193 }
141194
195+ /// <summary>
196+ /// A list of all exchanges for a virtual host.
197+ /// </summary>
198+ /// <param name="client"></param>
199+ /// <param name="vhostName"></param>
200+ /// <param name="cancellationToken"></param>
201+ /// <returns></returns>
202+ public static IReadOnlyList < Exchange > GetExchanges (
203+ this IManagementClient client ,
204+ string vhostName ,
205+ CancellationToken cancellationToken = default
206+ )
207+ {
208+ return client . GetExchangesAsync ( vhostName , cancellationToken )
209+ . GetAwaiter ( )
210+ . GetResult ( ) ;
211+ }
212+
142213 /// <summary>
143214 /// A list of all queues.
144215 /// </summary>
@@ -155,6 +226,24 @@ public static IReadOnlyList<Queue> GetQueues(
155226 . GetResult ( ) ;
156227 }
157228
229+ /// <summary>
230+ /// A list of all queues for a virtual host.
231+ /// </summary>
232+ /// <param name="client"></param>
233+ /// <param name="vhostName"></param>
234+ /// <param name="cancellationToken"></param>
235+ /// <returns></returns>
236+ public static IReadOnlyList < Queue > GetQueues (
237+ this IManagementClient client ,
238+ string vhostName ,
239+ CancellationToken cancellationToken = default
240+ )
241+ {
242+ return client . GetQueuesAsync ( vhostName , cancellationToken )
243+ . GetAwaiter ( )
244+ . GetResult ( ) ;
245+ }
246+
158247 /// <summary>
159248 /// A list of all queues for a virtual host.
160249 /// </summary>
@@ -239,6 +328,17 @@ public static PageResult<Queue> GetQueuesByPage(
239328 . GetResult ( ) ;
240329 }
241330
331+ /// <summary>
332+ /// A list of all queues without stats.
333+ /// </summary>
334+ /// <param name="client"></param>
335+ /// <param name="cancellationToken"></param>
336+ /// <returns></returns>
337+ public static IReadOnlyList < QueueWithoutStats > GetQueuesWithoutStats (
338+ this IManagementClient client ,
339+ CancellationToken cancellationToken = default
340+ ) => client . GetQueuesWithoutStatsAsync ( cancellationToken ) . GetAwaiter ( ) . GetResult ( ) ;
341+
242342 /// <summary>
243343 /// A list of all bindings.
244344 /// </summary>
@@ -1658,13 +1758,13 @@ public static Parameter GetShovel(
16581758 string vhostName ,
16591759 string shovelName ,
16601760 CancellationToken cancellationToken = default
1661- )
1662- {
1663- return client . GetParameterAsync ( vhostName , "shovel" , shovelName , cancellationToken )
1664- . GetAwaiter ( )
1665- . GetResult ( ) ;
1761+ )
1762+ {
1763+ return client . GetParameterAsync ( vhostName , "shovel" , shovelName , cancellationToken )
1764+ . GetAwaiter ( )
1765+ . GetResult ( ) ;
16661766 }
1667-
1767+
16681768 /// <summary>
16691769 /// Creates a federation upstream in a specific vhost
16701770 /// </summary>
@@ -1680,7 +1780,7 @@ public static Task CreateFederationUpstreamAsync(
16801780 ParameterFederationValue federationUpstreamDescription ,
16811781 CancellationToken cancellationToken = default
16821782 ) => client . CreateParameterAsync ( "federation-upstream" , vhostName , federationUpstreamName , federationUpstreamDescription , cancellationToken ) ;
1683-
1783+
16841784 /// <summary>
16851785 /// Creates a federation upstream in a specific vhost
16861786 /// </summary>
@@ -1695,11 +1795,11 @@ public static void CreateFederationUpstream(
16951795 string federationUpstreamName ,
16961796 ParameterFederationValue federationUpstreamDescription ,
16971797 CancellationToken cancellationToken = default
1698- )
1699- {
1798+ )
1799+ {
17001800 client . CreateParameterAsync ( "federation-upstream" , vhostName , federationUpstreamName , federationUpstreamDescription , cancellationToken )
17011801 . GetAwaiter ( )
1702- . GetResult ( ) ;
1802+ . GetResult ( ) ;
17031803 }
17041804
17051805 /// <summary>
@@ -1728,10 +1828,10 @@ public static Parameter GetFederationUpstream(
17281828 string vhostName ,
17291829 string federationUpstreamName ,
17301830 CancellationToken cancellationToken = default
1731- )
1732- {
1733- return client . GetParameterAsync ( vhostName , "federation-upstream" , federationUpstreamName , cancellationToken )
1734- . GetAwaiter ( )
1735- . GetResult ( ) ;
1831+ )
1832+ {
1833+ return client . GetParameterAsync ( vhostName , "federation-upstream" , federationUpstreamName , cancellationToken )
1834+ . GetAwaiter ( )
1835+ . GetResult ( ) ;
17361836 }
17371837}
0 commit comments