diff --git a/Source/EasyNetQ.Management.Client.ApprovalTests/EasyNetQ.Management.Client.approved.txt b/Source/EasyNetQ.Management.Client.ApprovalTests/EasyNetQ.Management.Client.approved.txt index 6377437a..090bf3f5 100644 --- a/Source/EasyNetQ.Management.Client.ApprovalTests/EasyNetQ.Management.Client.approved.txt +++ b/Source/EasyNetQ.Management.Client.ApprovalTests/EasyNetQ.Management.Client.approved.txt @@ -3,78 +3,14 @@ namespace EasyNetQ.Management.Client public interface IManagementClient : System.IDisposable { System.Uri Endpoint { get; } - System.Threading.Tasks.Task CloseConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateExchangeAsync(string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateExchangeBindingAsync(string vhostName, string sourceExchangeName, string destinationExchangeName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateParameterAsync(string componentName, string vhostName, string parameterName, object parameterValue, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreatePermissionAsync(string vhostName, string userName, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreatePolicyAsync(string vhostName, string policyName, EasyNetQ.Management.Client.Model.PolicyInfo policyInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateQueueAsync(string vhostName, string queueName, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateQueueBindingAsync(string vhostName, string exchangeName, string queueName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateTopicPermissionAsync(string vhostName, string userName, EasyNetQ.Management.Client.Model.TopicPermissionInfo topicPermissionInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateUserAsync(string userName, EasyNetQ.Management.Client.Model.UserInfo userInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task CreateVhostAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteExchangeAsync(string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteExchangeBindingAsync(string vhostName, string sourceExchangeName, string destinationExchangeName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteParameterAsync(string componentName, string vhostName, string parameterName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeletePermissionAsync(string vhostName, string userName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeletePolicyAsync(string vhostName, string policyName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteQueueAsync(string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteQueueBindingAsync(string vhostName, string exchangeName, string queueName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteTopicPermissionAsync(string vhostName, string userName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteUserAsync(string userName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DeleteVhostAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task DisableTracingAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task EnableTracingAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetBindingsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetBindingsAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetBindingsForQueueAsync(string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetBindingsWithDestinationAsync(string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetBindingsWithSourceAsync(string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetChannelAsync(string channelName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetChannelsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetChannelsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetConnectionsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetConnectionsAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetConsumersAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetConsumersAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetDefinitionsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetExchangeAsync(string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetExchangeBindingsAsync(string vhostName, string sourceExchangeName, string destinationExchangeName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetExchangesAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetExchangesAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetExchangesByPageAsync(EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetExchangesByPageAsync(string vhostName, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetFederationsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetMessagesFromQueueAsync(string vhostName, string queueName, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetNodesAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetOverviewAsync(EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetParameterAsync(string vhostName, string componentName, string parameterName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetParametersAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetPermissionsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetPoliciesAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetQueueAsync(string vhostName, string queueName, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetQueueBindingsAsync(string vhostName, string exchangeName, string queueName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetQueuesAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetQueuesAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetQueuesByPageAsync(EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetQueuesByPageAsync(string vhostName, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetQueuesWithoutStatsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetShovelStatusesAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetShovelStatusesAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetTopicPermissionsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetUserAsync(string userName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetUsersAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task GetVhostAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task> GetVhostsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task HaveAnyClassicQueuesWithoutSynchronisedMirrorsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task HaveAnyClusterAlarmsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task HaveAnyLocalAlarmsAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task HaveAnyQuorumQueuesInCriticalStateAsync(System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task IsAliveAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task PublishAsync(string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task PurgeAsync(string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default); - System.Threading.Tasks.Task RebalanceQueuesAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task CheckAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task DeleteAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetAsync(EasyNetQ.Management.Client.RelativePath path, System.Collections.Generic.IEnumerable>? queryParameters, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PostAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PostAsync(EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PostAsync(EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PutAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PutAsync(EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default); } public static class IManagementClientExtensions { @@ -82,19 +18,23 @@ namespace EasyNetQ.Management.Client public static void ChangeUserPassword(this EasyNetQ.Management.Client.IManagementClient client, string userName, string newPassword, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task ChangeUserPasswordAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, string newPassword, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task ChangeUserPasswordAsync(this EasyNetQ.Management.Client.IManagementClient client, string userName, string newPassword, System.Threading.CancellationToken cancellationToken = default) { } + public static bool Check(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } public static void CloseConnection(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Connection connection, System.Threading.CancellationToken cancellationToken = default) { } public static void CloseConnection(this EasyNetQ.Management.Client.IManagementClient client, string connectionName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CloseConnectionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Connection connection, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CloseConnectionAsync(this EasyNetQ.Management.Client.IManagementClient client, string connectionName, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateExchange(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateExchangeBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName sourceExchange, EasyNetQ.Management.Client.Model.ExchangeName destinationExchange, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateExchangeBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string sourceExchangeName, string destinationExchangeName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateExchangeBinding(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateExchangeBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName sourceExchange, EasyNetQ.Management.Client.Model.ExchangeName destinationExchange, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateExchangeBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string sourceExchangeName, string destinationExchangeName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateExchangeBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateFederationUpstream(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string federationUpstreamName, EasyNetQ.Management.Client.Model.ParameterFederationValue federationUpstreamDescription, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateFederationUpstream(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string federationUpstreamName, EasyNetQ.Management.Client.Model.ParameterFederationValue federationUpstreamDescription, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateFederationUpstreamAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string federationUpstreamName, EasyNetQ.Management.Client.Model.ParameterFederationValue federationUpstreamDescription, System.Threading.CancellationToken cancellationToken = default) { } @@ -106,6 +46,7 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task CreateParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Parameter parameter, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Parameter parameter, object parameterValue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, string componentName, EasyNetQ.Management.Client.Model.Vhost vhost, string parameterName, object parameterValue, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, string componentName, string vhostName, string parameterName, object parameterValue, System.Threading.CancellationToken cancellationToken = default) { } public static void CreatePermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreatePermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreatePermission(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } @@ -113,16 +54,19 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task CreatePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreatePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreatePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreatePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string userName, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreatePolicy(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Policy policy, System.Threading.CancellationToken cancellationToken = default) { } public static void CreatePolicy(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string policyName, EasyNetQ.Management.Client.Model.PolicyInfo policyInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreatePolicy(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string policyName, EasyNetQ.Management.Client.Model.PolicyInfo policyInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreatePolicyAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Policy policy, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreatePolicyAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string policyName, EasyNetQ.Management.Client.Model.PolicyInfo policyInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreatePolicyAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string policyName, EasyNetQ.Management.Client.Model.PolicyInfo policyInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateQueue(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateQueueBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateQueueBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, string queueName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateQueueBinding(this EasyNetQ.Management.Client.IManagementClient client, string exchangeName, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } @@ -132,6 +76,7 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task CreateQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, string queueName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, string exchangeName, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, string queueName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, string queueName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateShovel(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string shovelName, EasyNetQ.Management.Client.Model.ParameterShovelValue shovelDescription, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateShovel(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string shovelName, EasyNetQ.Management.Client.Model.ParameterShovelValue shovelDescription, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateShovelAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string shovelName, EasyNetQ.Management.Client.Model.ParameterShovelValue shovelDescription, System.Threading.CancellationToken cancellationToken = default) { } @@ -143,12 +88,16 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task CreateTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.TopicPermissionInfo topicPermissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, EasyNetQ.Management.Client.Model.TopicPermissionInfo topicPermissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.TopicPermissionInfo topicPermissionInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string userName, EasyNetQ.Management.Client.Model.TopicPermissionInfo topicPermissionInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateUser(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.UserInfo userInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateUser(this EasyNetQ.Management.Client.IManagementClient client, string userName, EasyNetQ.Management.Client.Model.UserInfo userInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateUserAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, EasyNetQ.Management.Client.Model.UserInfo userInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateUserAsync(this EasyNetQ.Management.Client.IManagementClient client, string userName, EasyNetQ.Management.Client.Model.UserInfo userInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateVhost(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static void CreateVhost(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task CreateVhostAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task CreateVhostAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static void Delete(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Binding binding, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Binding binding, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, System.Threading.CancellationToken cancellationToken = default) { } @@ -156,16 +105,19 @@ namespace EasyNetQ.Management.Client public static void DeleteExchange(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteExchangeBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName sourceExchange, EasyNetQ.Management.Client.Model.ExchangeName destinationExchange, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteExchangeBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string sourceExchangeName, string destinationExchangeName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteExchangeBinding(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteExchangeBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName sourceExchange, EasyNetQ.Management.Client.Model.ExchangeName destinationExchange, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteExchangeBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string sourceExchangeName, string destinationExchangeName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteExchangeBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteParameter(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Parameter parameter, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteParameter(this EasyNetQ.Management.Client.IManagementClient client, string componentName, EasyNetQ.Management.Client.Model.Vhost vhost, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteParameter(this EasyNetQ.Management.Client.IManagementClient client, string componentName, string vhostName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Parameter parameter, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, string componentName, EasyNetQ.Management.Client.Model.Vhost vhost, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, string componentName, string vhostName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeletePermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Permission permission, System.Threading.CancellationToken cancellationToken = default) { } public static void DeletePermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } public static void DeletePermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, System.Threading.CancellationToken cancellationToken = default) { } @@ -175,14 +127,17 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task DeletePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeletePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeletePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeletePermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeletePolicy(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string policyName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeletePolicy(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string policyName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeletePolicyAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string policyName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeletePolicyAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string policyName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteQueue(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteQueueBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.QueueName queue, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteQueueBinding(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, string queueName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteQueueBinding(this EasyNetQ.Management.Client.IManagementClient client, string exchangeName, EasyNetQ.Management.Client.Model.QueueName queue, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } @@ -192,6 +147,7 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task DeleteQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, string queueName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, string exchangeName, EasyNetQ.Management.Client.Model.QueueName queue, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, string queueName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteQueueBindingAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, string queueName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteTopicPermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.TopicPermission topicPermission, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteTopicPermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteTopicPermission(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, System.Threading.CancellationToken cancellationToken = default) { } @@ -201,94 +157,130 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task DeleteTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteTopicPermissionAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteUser(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteUser(this EasyNetQ.Management.Client.IManagementClient client, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteUserAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteUserAsync(this EasyNetQ.Management.Client.IManagementClient client, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteVhost(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static void DeleteVhost(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DeleteVhostAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DeleteVhostAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static void DisableTracing(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static void DisableTracing(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task DisableTracingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task DisableTracingAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static void EnableTracing(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static void EnableTracing(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task EnableTracingAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task EnableTracingAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static TResult Get(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } + public static TResult Get(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Collections.Generic.IEnumerable>? queryParameters, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindings(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindings(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindings(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsForQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsForQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsForQueue(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsForQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsForQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetBindingsForQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsWithDestination(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsWithDestination(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsWithDestination(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsWithDestinationAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsWithDestinationAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetBindingsWithDestinationAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsWithSource(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsWithSource(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetBindingsWithSource(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsWithSourceAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetBindingsWithSourceAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Channel GetChannel(this EasyNetQ.Management.Client.IManagementClient client, string channelName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetBindingsWithSourceAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Channel GetChannel(this EasyNetQ.Management.Client.IManagementClient client, string channelName, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetChannelAsync(this EasyNetQ.Management.Client.IManagementClient client, string channelName, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetChannels(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetChannels(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Connection connection, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetChannels(this EasyNetQ.Management.Client.IManagementClient client, string connectionName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetChannelsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetChannelsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Connection connection, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetChannelsAsync(this EasyNetQ.Management.Client.IManagementClient client, string connectionName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetConnections(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetConnections(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetConnections(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetConnectionsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetConnectionsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetConnectionsAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetConsumers(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetConsumers(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetConsumers(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetConsumersAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetConsumersAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetConsumersAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Definitions GetDefinitions(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Exchange GetExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Exchange GetExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Exchange GetExchange(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task GetExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task GetExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetDefinitionsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Exchange GetExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Exchange GetExchange(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Exchange GetExchange(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetExchangeAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetExchangeBindings(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName sourceExchange, EasyNetQ.Management.Client.Model.ExchangeName destinationExchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetExchangeBindings(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string sourceExchangeName, string destinationExchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetExchangeBindings(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetExchangeBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName sourceExchange, EasyNetQ.Management.Client.Model.ExchangeName destinationExchange, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetExchangeBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string sourceExchangeName, string destinationExchangeName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetExchangeBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetExchanges(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetExchanges(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetExchanges(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetExchangesAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetExchangesAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.PageResult GetExchangesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.PageResult GetExchangesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.PageResult GetExchangesByPage(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task> GetExchangesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetExchangesAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.PageResult GetExchangesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.PageResult GetExchangesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.PageResult GetExchangesByPage(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetExchangesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetExchangesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetExchangesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetFederationUpstream(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string federationUpstreamName, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetFederationUpstream(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string federationUpstreamName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetFederationUpstreamAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string federationUpstreamName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetFederationUpstreamAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string federationUpstreamName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetFederations(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetFederationsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetMessagesFromQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetMessagesFromQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetMessagesFromQueue(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetMessagesFromQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetMessagesFromQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetMessagesFromQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetNodes(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Overview GetOverview(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetNodesAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Overview GetOverview(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetOverviewAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetParameter(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Parameter parameter, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetParameter(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string componentName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetParameter(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string componentName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Parameter parameter, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string componentName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetParameterAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string componentName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetParameters(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetParametersAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetPermissions(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetPermissionsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetPolicies(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Queue GetQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Queue GetQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.Queue GetQueue(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task GetQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task GetQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetPoliciesAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Queue GetQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Queue GetQueue(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.Queue GetQueue(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetQueueAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, EasyNetQ.Management.Client.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetQueueBindings(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetQueueBindings(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetQueueBindings(this EasyNetQ.Management.Client.IManagementClient client, string exchangeName, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } @@ -298,15 +290,19 @@ namespace EasyNetQ.Management.Client public static System.Threading.Tasks.Task> GetQueueBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetQueueBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, string exchangeName, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetQueueBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Collections.Generic.IReadOnlyList GetQueues(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Collections.Generic.IReadOnlyList GetQueues(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Collections.Generic.IReadOnlyList GetQueues(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task> GetQueuesAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.PageResult GetQueuesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.PageResult GetQueuesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static EasyNetQ.Management.Client.Model.PageResult GetQueuesByPage(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Threading.Tasks.Task> GetQueuesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public static System.Collections.Generic.IReadOnlyList GetQueuesWithoutStats(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueueBindingsAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Collections.Generic.IReadOnlyList GetQueues(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.StatsCriteria? statsCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Collections.Generic.IReadOnlyList GetQueues(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.StatsCriteria? statsCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Collections.Generic.IReadOnlyList GetQueues(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.StatsCriteria? statsCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueuesAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.StatsCriteria? statsCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueuesAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.StatsCriteria? statsCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueuesAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.StatsCriteria? statsCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.PageResult GetQueuesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.PageResult GetQueuesByPage(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static EasyNetQ.Management.Client.Model.PageResult GetQueuesByPage(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueuesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueuesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetQueuesByPageAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, EasyNetQ.Management.Client.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetShovel(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string shovelName, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Parameter GetShovel(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string shovelName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetShovelAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string shovelName, System.Threading.CancellationToken cancellationToken = default) { } @@ -314,34 +310,61 @@ namespace EasyNetQ.Management.Client public static System.Collections.Generic.IReadOnlyList GetShovelStatuses(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetShovelStatuses(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetShovelStatuses(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetShovelStatusesAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task> GetShovelStatusesAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetShovelStatusesAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetTopicPermissions(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetTopicPermissionsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.User GetUser(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.User GetUser(this EasyNetQ.Management.Client.IManagementClient client, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetUserAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.User user, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetUserAsync(this EasyNetQ.Management.Client.IManagementClient client, string userName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetUsers(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetUsersAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Vhost GetVhost(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.Vhost GetVhost(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task GetVhostAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task GetVhostAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IReadOnlyList GetVhosts(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task> GetVhostsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static bool HaveAnyClassicQueuesWithoutSynchronisedMirrors(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task HaveAnyClassicQueuesWithoutSynchronisedMirrorsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static bool HaveAnyClusterAlarms(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task HaveAnyClusterAlarmsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static bool HaveAnyLocalAlarms(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task HaveAnyLocalAlarmsAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static bool HaveAnyQuorumQueuesInCriticalState(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task HaveAnyQuorumQueuesInCriticalStateAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } public static bool IsAlive(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } public static bool IsAlive(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task IsAliveAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task IsAliveAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public static void Post(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } + public static void Post(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default) { } + public static TResult Post(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.PublishResult Publish(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.PublishResult Publish(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } public static EasyNetQ.Management.Client.Model.PublishResult Publish(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task PublishAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.ExchangeName exchange, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task PublishAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string exchangeName, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task PublishAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } public static void Purge(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static void Purge(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static void Purge(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task PurgeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.QueueName queue, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.Task PurgeAsync(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.Model.Vhost vhost, string queueName, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task PurgeAsync(this EasyNetQ.Management.Client.IManagementClient client, string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } + public static void Put(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } + public static void Put(this EasyNetQ.Management.Client.IManagementClient client, EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default) { } public static void RebalanceQueues(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.Task RebalanceQueuesAsync(this EasyNetQ.Management.Client.IManagementClient client, System.Threading.CancellationToken cancellationToken = default) { } + } + public class LengthsCriteria : System.IEquatable + { + public readonly System.Collections.Generic.IEnumerable> QueryParameters; + public LengthsCriteria(int LengthsAge, int LengthsIncr) { } + public int LengthsAge { get; init; } + public int LengthsIncr { get; init; } } public class ManagementClient : EasyNetQ.Management.Client.IManagementClient, System.IDisposable { @@ -350,79 +373,47 @@ namespace EasyNetQ.Management.Client [System.Obsolete("Please use another constructor")] public ManagementClient(string hostUrl, string username, string password, int portNumber = 15672, System.TimeSpan? timeout = default, System.Action? configureHttpRequestMessage = null, bool ssl = false, System.Action? configureHttpHandler = null) { } public System.Uri Endpoint { get; } - public System.Threading.Tasks.Task CloseConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateExchangeAsync(string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.ExchangeInfo exchangeInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateExchangeBindingAsync(string vhostName, string sourceExchangeName, string destinationExchangeName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateParameterAsync(string componentName, string vhostName, string parameterName, object parameterValue, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreatePermissionAsync(string vhostName, string userName, EasyNetQ.Management.Client.Model.PermissionInfo permissionInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreatePolicyAsync(string vhostName, string policyName, EasyNetQ.Management.Client.Model.PolicyInfo policyInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateQueueAsync(string vhostName, string queueName, EasyNetQ.Management.Client.Model.QueueInfo queueInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateQueueBindingAsync(string vhostName, string exchangeName, string queueName, EasyNetQ.Management.Client.Model.BindingInfo bindingInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateTopicPermissionAsync(string vhostName, string userName, EasyNetQ.Management.Client.Model.TopicPermissionInfo topicPermissionInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateUserAsync(string userName, EasyNetQ.Management.Client.Model.UserInfo userInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task CreateVhostAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteExchangeAsync(string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteExchangeBindingAsync(string vhostName, string sourceExchangeName, string destinationExchangeName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteParameterAsync(string componentName, string vhostName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeletePermissionAsync(string vhostName, string userName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeletePolicyAsync(string vhostName, string policyName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteQueueAsync(string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteQueueBindingAsync(string vhostName, string exchangeName, string queueName, string propertiesKey, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteTopicPermissionAsync(string vhostName, string userName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteUserAsync(string userName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DeleteVhostAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task DisableTracingAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task CheckAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task DeleteAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } public void Dispose() { } - public System.Threading.Tasks.Task EnableTracingAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetBindingsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetBindingsAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetBindingsForQueueAsync(string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetBindingsWithDestinationAsync(string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetBindingsWithSourceAsync(string vhostName, string exchangeName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetChannelAsync(string channelName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetChannelsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetChannelsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetConnectionsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetConnectionsAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetConsumersAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetConsumersAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetDefinitionsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetExchangeAsync(string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetExchangeBindingsAsync(string vhostName, string sourceExchangeName, string destinationExchangeName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetExchangesAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetExchangesAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetExchangesByPageAsync(EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetExchangesByPageAsync(string vhostName, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetFederationsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetMessagesFromQueueAsync(string vhostName, string queueName, EasyNetQ.Management.Client.Model.GetMessagesFromQueueInfo getMessagesFromQueueInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetNodesAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetOverviewAsync(EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetParameterAsync(string vhostName, string componentName, string parameterName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetParametersAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetPermissionsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetPoliciesAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetQueueAsync(string vhostName, string queueName, EasyNetQ.Management.Client.Model.LengthsCriteria? lengthsCriteria = null, EasyNetQ.Management.Client.Model.RatesCriteria? ratesCriteria = null, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetQueueBindingsAsync(string vhostName, string exchangeName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetQueuesAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetQueuesAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetQueuesByPageAsync(EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetQueuesByPageAsync(string vhostName, EasyNetQ.Management.Client.Model.PageCriteria pageCriteria, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetQueuesWithoutStatsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetShovelStatusesAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetShovelStatusesAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetTopicPermissionsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetUserAsync(string userName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetUsersAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task GetVhostAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task> GetVhostsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task HaveAnyClassicQueuesWithoutSynchronisedMirrorsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task HaveAnyClusterAlarmsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task HaveAnyLocalAlarmsAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task HaveAnyQuorumQueuesInCriticalStateAsync(System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task IsAliveAsync(string vhostName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task PublishAsync(string vhostName, string exchangeName, EasyNetQ.Management.Client.Model.PublishInfo publishInfo, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task PurgeAsync(string vhostName, string queueName, System.Threading.CancellationToken cancellationToken = default) { } - public System.Threading.Tasks.Task RebalanceQueuesAsync(System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task GetAsync(EasyNetQ.Management.Client.RelativePath path, System.Collections.Generic.IEnumerable>? queryParameters, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task PostAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task PostAsync(EasyNetQ.Management.Client.RelativePath path, TItem item, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task PostAsync(EasyNetQ.Management.Client.RelativePath path, TItem item, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task PutAsync(EasyNetQ.Management.Client.RelativePath path, System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task PutAsync(EasyNetQ.Management.Client.RelativePath path, TBody item, System.Threading.CancellationToken cancellationToken = default) { } + } + public class PageCriteria : System.IEquatable + { + public readonly System.Collections.Generic.IEnumerable> QueryParameters; + public PageCriteria(int Page, int PageSize, string? Name = null, bool UseRegex = false) { } + public string? Name { get; init; } + public int PageSize { get; init; } + public int Page { get; init; } + public bool UseRegex { get; init; } + } + public class RatesCriteria : System.IEquatable + { + public readonly System.Collections.Generic.IEnumerable> QueryParameters; + public RatesCriteria(int MsgRatesAge, int MsgRatesIncr) { } + public int MsgRatesAge { get; init; } + public int MsgRatesIncr { get; init; } + } + public readonly struct RelativePath + { + public RelativePath(string segment) { } + public string Build() { } + public static EasyNetQ.Management.Client.RelativePath operator /(EasyNetQ.Management.Client.RelativePath parent, char segment) { } + public static EasyNetQ.Management.Client.RelativePath operator /(EasyNetQ.Management.Client.RelativePath parent, string segment) { } + } + public class StatsCriteria : System.IEquatable + { + public readonly System.Collections.Generic.IEnumerable>? QueryParameters; + public static EasyNetQ.Management.Client.StatsCriteria Disable; + public static EasyNetQ.Management.Client.StatsCriteria QueueTotalsOnly; + public StatsCriteria(bool DisableStats, bool EnableQueueTotals) { } + public bool DisableStats { get; init; } + public bool EnableQueueTotals { get; init; } } [System.Serializable] public class UnexpectedHttpStatusCodeException : System.Exception @@ -846,13 +837,6 @@ namespace EasyNetQ.Management.Client.Model Manual = 0, Automatic = 1, } - public class LengthsCriteria : System.IEquatable - { - public LengthsCriteria(int LengthsAge, int LengthsIncr) { } - public int LengthsAge { get; init; } - public int LengthsIncr { get; init; } - public System.Collections.Generic.IReadOnlyDictionary ToQueryParameters() { } - } public class LengthsDetails : System.IEquatable { public LengthsDetails(double Rate, double AvgRate, double Avg, System.Collections.Generic.IReadOnlyList? Samples = null) { } @@ -1063,15 +1047,6 @@ namespace EasyNetQ.Management.Client.Model public EasyNetQ.Management.Client.Model.QueueTotals QueueTotals { get; init; } public string RabbitmqVersion { get; init; } } - public class PageCriteria : System.IEquatable - { - public PageCriteria(int Page, int PageSize, string? Name = null, bool UseRegex = false) { } - public string? Name { get; init; } - public int PageSize { get; init; } - public int Page { get; init; } - public bool UseRegex { get; init; } - public System.Collections.Generic.IReadOnlyDictionary ToQueryParameters() { } - } public class PageResult : System.IEquatable> { public PageResult(int FilteredCount, int ItemCount, System.Collections.Generic.IReadOnlyList Items, int Page, int PageCount, int PageSize, int TotalCount) { } @@ -1329,7 +1304,7 @@ namespace EasyNetQ.Management.Client.Model public PublishResult(bool Routed) { } public bool Routed { get; init; } } - public class Queue : EasyNetQ.Management.Client.Model.QueueWithoutStats, System.IEquatable + public class Queue : EasyNetQ.Management.Client.Model.QueueName, System.IEquatable { public Queue( string Name, @@ -1365,10 +1340,15 @@ namespace EasyNetQ.Management.Client.Model [System.Text.Json.Serialization.JsonExtensionData] public System.Collections.Generic.IDictionary? JsonExtensionData { get; set; } public long ActiveConsumers { get; init; } + [System.Text.Json.Serialization.JsonConverter(typeof(EasyNetQ.Management.Client.Serialization.StringObjectReadOnlyDictionaryConverter?))] + public System.Collections.Generic.IReadOnlyDictionary Arguments { get; init; } + public bool AutoDelete { get; init; } public EasyNetQ.Management.Client.Model.BackingQueueStatus? BackingQueueStatus { get; init; } public System.Collections.Generic.IReadOnlyList? ConsumerDetails { get; init; } public long Consumers { get; init; } + public bool Durable { get; init; } public string? ExclusiveConsumerTag { get; init; } + public bool Exclusive { get; init; } public long? HeadMessageTimestamp { get; init; } public string? IdleSince { get; init; } public long Memory { get; init; } @@ -1376,10 +1356,16 @@ namespace EasyNetQ.Management.Client.Model public EasyNetQ.Management.Client.Model.MessageStats? MessageStats { get; init; } public EasyNetQ.Management.Client.Model.LengthsDetails? MessagesDetails { get; init; } public EasyNetQ.Management.Client.Model.LengthsDetails? MessagesReadyDetails { get; init; } + public long MessagesReady { get; init; } public EasyNetQ.Management.Client.Model.LengthsDetails? MessagesUnacknowledgedDetails { get; init; } + public long MessagesUnacknowledged { get; init; } + public long Messages { get; init; } + public string? Node { get; init; } public string? Policy { get; init; } public System.Collections.Generic.IReadOnlyList? SlaveNodes { get; init; } + public string? State { get; init; } public System.Collections.Generic.IReadOnlyList? SynchronisedSlaveNodes { get; init; } + public EasyNetQ.Management.Client.Model.QueueType Type { get; init; } } public class QueueInfo : System.IEquatable { @@ -1423,28 +1409,6 @@ namespace EasyNetQ.Management.Client.Model V1 = 1, V2 = 2, } - public class QueueWithoutStats : EasyNetQ.Management.Client.Model.QueueName, System.IEquatable - { - public QueueWithoutStats(string Name, string Vhost, EasyNetQ.Management.Client.Model.QueueType Type, string? Node, string? State, System.Collections.Generic.IReadOnlyDictionary Arguments, bool Durable, bool Exclusive, bool AutoDelete, long MessagesReady, long MessagesUnacknowledged, long Messages) { } - [System.Text.Json.Serialization.JsonConverter(typeof(EasyNetQ.Management.Client.Serialization.StringObjectReadOnlyDictionaryConverter?))] - public System.Collections.Generic.IReadOnlyDictionary Arguments { get; init; } - public bool AutoDelete { get; init; } - public bool Durable { get; init; } - public bool Exclusive { get; init; } - public long MessagesReady { get; init; } - public long MessagesUnacknowledged { get; init; } - public long Messages { get; init; } - public string? Node { get; init; } - public string? State { get; init; } - public EasyNetQ.Management.Client.Model.QueueType Type { get; init; } - } - public class RatesCriteria : System.IEquatable - { - public RatesCriteria(int MsgRatesAge, int MsgRatesIncr) { } - public int MsgRatesAge { get; init; } - public int MsgRatesIncr { get; init; } - public System.Collections.Generic.IReadOnlyDictionary ToQueryParameters() { } - } public class ShovelStatus : System.IEquatable { public ShovelStatus( diff --git a/Source/EasyNetQ.Management.Client.ExtensionsGenerator/ReplacementExtensionsGenerator.cs b/Source/EasyNetQ.Management.Client.ExtensionsGenerator/ReplacementExtensionsGenerator.cs index b916cf95..38426081 100644 --- a/Source/EasyNetQ.Management.Client.ExtensionsGenerator/ReplacementExtensionsGenerator.cs +++ b/Source/EasyNetQ.Management.Client.ExtensionsGenerator/ReplacementExtensionsGenerator.cs @@ -76,13 +76,14 @@ private static MethodDeclarationSyntax GenerateReplacementExtensionMethod( SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.IdentifierName(thisParameter.Identifier.Text), - SyntaxFactory.IdentifierName(method.Name) + method.GetAccessName() ), SyntaxFactory.ArgumentList( SyntaxFactory.SeparatedList(argumentExpressions.Select(a => SyntaxFactory.Argument(a)))) ); return SyntaxFactory.MethodDeclaration(method.ReturnType.GetTypeSyntax(), methodName) + .WithTypeParameterList(method.GetTypeParameterListSyntax()) .AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)) .WithParameterList(SyntaxFactory.ParameterList(parameters)) .WithExpressionBody(SyntaxFactory.ArrowExpressionClause(expression)) diff --git a/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyncExtensionsGenerator.cs b/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyncExtensionsGenerator.cs index 9c33e60a..eff07e42 100644 --- a/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyncExtensionsGenerator.cs +++ b/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyncExtensionsGenerator.cs @@ -67,7 +67,7 @@ private static MethodDeclarationSyntax GenerateSyncExtensionMethod( SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.IdentifierName(thisParameter.Identifier.Text), - SyntaxFactory.IdentifierName(method.Name) + method.GetAccessName() ), SyntaxFactory.ArgumentList( SyntaxFactory.SeparatedList(argumentExpressions.Select(a => SyntaxFactory.Argument(a)))) @@ -90,6 +90,7 @@ private static MethodDeclarationSyntax GenerateSyncExtensionMethod( method.IsAwaitable(out var awaitableResultType); return SyntaxFactory.MethodDeclaration(awaitableResultType!.GetTypeSyntax(), methodName) + .WithTypeParameterList(method.GetTypeParameterListSyntax()) .AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)) .WithParameterList(SyntaxFactory.ParameterList(parameters)) .WithExpressionBody(SyntaxFactory.ArrowExpressionClause(expression)) diff --git a/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyntaxExtensions.cs b/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyntaxExtensions.cs index e18ce872..147bac1e 100644 --- a/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyntaxExtensions.cs +++ b/Source/EasyNetQ.Management.Client.ExtensionsGenerator/SyntaxExtensions.cs @@ -23,4 +23,22 @@ public static SeparatedSyntaxList GetParameterListSyntax(this I { return (SyntaxFactory.ParseMemberDeclaration(method.ToDisplayString(MethodDisplayFormat)) as MethodDeclarationSyntax)!.ParameterList.Parameters; } + + public static TypeParameterListSyntax? GetTypeParameterListSyntax(this IMethodSymbol method) + { + return (SyntaxFactory.ParseMemberDeclaration(method.ToDisplayString(MethodDisplayFormat)) as MethodDeclarationSyntax)!.TypeParameterList; + } + + public static SimpleNameSyntax GetAccessName(this IMethodSymbol method) + { + if (method.IsGenericMethod) + { + var arguments = method.GetTypeParameterListSyntax()!.Parameters.Select(typeParameter => SyntaxFactory.IdentifierName(typeParameter.Identifier)); + return SyntaxFactory.GenericName(method.Name).WithTypeArgumentList(SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(arguments))); + } + else + { + return SyntaxFactory.IdentifierName(method.Name); + } + } } diff --git a/Source/EasyNetQ.Management.Client.IntegrationTests/ManagementClientTests.cs b/Source/EasyNetQ.Management.Client.IntegrationTests/ManagementClientTests.cs index df44bb05..d65d6b3a 100644 --- a/Source/EasyNetQ.Management.Client.IntegrationTests/ManagementClientTests.cs +++ b/Source/EasyNetQ.Management.Client.IntegrationTests/ManagementClientTests.cs @@ -1215,11 +1215,39 @@ public async Task Should_get_queues() } [Fact] - public async Task Should_get_queues_without_stats() + public async Task Should_get_queues_with_stats_criteria() { - await CreateTestQueue(TestQueue); - var queues = await fixture.ManagementClient.GetQueuesWithoutStatsAsync(); - queues.Should().NotBeNullOrEmpty(); + var queue = await CreateTestQueue(TestQueue); + + var publishInfo = new PublishInfo( + TestQueue, + "Hello World", + PayloadEncoding.String, + new Dictionary + { + { "app_id", "management-test" } + } + ); + + await fixture.ManagementClient.PublishAsync("/", "amq.default", publishInfo); + Queue queueWithStats; + do + { + queueWithStats = (await fixture.ManagementClient.GetQueuesAsync()).Single(q => q.Name == TestQueue); + } while (queueWithStats.Messages == 0); + queueWithStats.Messages.Should().Be(1); + queueWithStats.MessagesDetails.Should().NotBeNull(); + queueWithStats.MessageStats.Should().NotBeNull(); + + var queueWithoutStats = (await fixture.ManagementClient.GetQueuesAsync(StatsCriteria.Disable)).Single(q => q.Name == TestQueue); + queueWithoutStats.Messages.Should().Be(0); + queueWithoutStats.MessagesDetails.Should().BeNull(); + queueWithoutStats.MessageStats.Should().BeNull(); + + var queueWithTotalsOnly = (await fixture.ManagementClient.GetQueuesAsync(StatsCriteria.QueueTotalsOnly)).Single(q => q.Name == TestQueue); + queueWithTotalsOnly.Messages.Should().Be(1); + queueWithTotalsOnly.MessagesDetails.Should().BeNull(); + queueWithTotalsOnly.MessageStats.Should().BeNull(); } diff --git a/Source/EasyNetQ.Management.Client/IManagementClient.cs b/Source/EasyNetQ.Management.Client/IManagementClient.cs index b2e30805..e50fdc05 100755 --- a/Source/EasyNetQ.Management.Client/IManagementClient.cs +++ b/Source/EasyNetQ.Management.Client/IManagementClient.cs @@ -9,270 +9,466 @@ public interface IManagementClient : IDisposable /// Uri Endpoint { get; } + Task GetAsync( + RelativePath path, + IEnumerable>? queryParameters, + CancellationToken cancellationToken = default); + + Task CheckAsync( + RelativePath path, + CancellationToken cancellationToken = default); + + Task PutAsync( + RelativePath path, + TBody item, + CancellationToken cancellationToken = default); + Task PutAsync( + RelativePath path, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + RelativePath path, + CancellationToken cancellationToken = default); + + Task PostAsync( + RelativePath path, + TBody item, + CancellationToken cancellationToken = default); + Task PostAsync( + RelativePath path, + TBody item, + CancellationToken cancellationToken = default); + Task PostAsync( + RelativePath path, + CancellationToken cancellationToken = default); +} + +public static partial class IManagementClientExtensions +{ + private static readonly RelativePath Api = new("api"); + private static readonly RelativePath Vhosts = Api / "vhosts"; + private static readonly RelativePath AlivenessTest = Api / "aliveness-test"; + private static readonly RelativePath Connections = Api / "connections"; + private static readonly RelativePath Consumers = Api / "consumers"; + private static readonly RelativePath Channels = Api / "channels"; + private static readonly RelativePath Users = Api / "users"; + private static readonly RelativePath Permissions = Api / "permissions"; + private static readonly RelativePath Parameters = Api / "parameters"; + private static readonly RelativePath Bindings = Api / "bindings"; + private static readonly RelativePath Queues = Api / "queues"; + private static readonly RelativePath Exchanges = Api / "exchanges"; + private static readonly RelativePath TopicPermissions = Api / "topic-permissions"; + private static readonly RelativePath Policies = Api / "policies"; + private static readonly RelativePath FederationLinks = Api / "federation-links"; + private static readonly RelativePath Overview = Api / "overview"; + private static readonly RelativePath Nodes = Api / "nodes"; + private static readonly RelativePath Definitions = Api / "definitions"; + private static readonly RelativePath Health = Api / "health"; + private static readonly RelativePath Rebalance = Api / "rebalance"; + private static readonly RelativePath ShovelStatuses = Api / "shovels"; + + private static IEnumerable>? ConcatNullableQueryParameters(params IEnumerable>?[] multipleQueryParameters) + { + return multipleQueryParameters.All(qp => qp == null) ? null : ConcatQueryParameters(multipleQueryParameters); + } + + private static IEnumerable> ConcatQueryParameters(params IEnumerable>?[] multipleQueryParameters) + { + foreach (var queryParameters in multipleQueryParameters) + { + if (queryParameters == null) + continue; + foreach (var queryParameter in queryParameters) + yield return queryParameter; + } + } + + public static Task GetAsync( + this IManagementClient client, + RelativePath path, + CancellationToken cancellationToken = default + ) + { + return client.GetAsync(path, null, cancellationToken); + } + /// /// Various random bits of information that describe the whole system. /// + /// /// Criteria for getting samples of queue length data /// Criteria for getting samples of rate data /// /// - Task GetOverviewAsync( + public static Task GetOverviewAsync( + this IManagementClient client, LengthsCriteria? lengthsCriteria = null, RatesCriteria? ratesCriteria = null, CancellationToken cancellationToken = default - ); + ) + { + var queryParameters = + ConcatNullableQueryParameters(lengthsCriteria?.QueryParameters, ratesCriteria?.QueryParameters); + return client.GetAsync(Overview, queryParameters, cancellationToken); + } /// /// A list of nodes in the RabbitMQ cluster. /// + /// /// /// - Task> GetNodesAsync(CancellationToken cancellationToken = default); + public static Task> GetNodesAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Nodes, cancellationToken); /// /// The server definitions - exchanges, queues, bindings, users, virtual hosts, permissions, topic permissions, policies and parameters. /// Everything apart from messages. /// + /// /// /// - Task GetDefinitionsAsync(CancellationToken cancellationToken = default); + public static Task GetDefinitionsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync(Definitions, cancellationToken); /// /// A list of all open connections. /// + /// /// /// - Task> GetConnectionsAsync(CancellationToken cancellationToken = default); + public static Task> GetConnectionsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Connections, cancellationToken); /// /// A list of all open connections on the specified VHost. /// + /// /// /// /// - Task> GetConnectionsAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task> GetConnectionsAsync( + this IManagementClient client, + string vhostName, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Vhosts / vhostName / "connections", cancellationToken); /// /// A list of all open channels. /// + /// /// /// - Task> GetChannelsAsync(CancellationToken cancellationToken = default); + public static Task> GetChannelsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Channels, cancellationToken); /// /// A list of all open channels for the given connection. /// + /// /// /// /// - Task> GetChannelsAsync( + public static Task> GetChannelsAsync( + this IManagementClient client, string connectionName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync>(Connections / connectionName / "channels", cancellationToken); /// /// Gets the channel. This returns more detail, including consumers than the GetChannels method. /// /// The channel. + /// /// Channel name. /// Criteria for getting samples of rate data /// - Task GetChannelAsync( + public static Task GetChannelAsync( + this IManagementClient client, string channelName, RatesCriteria? ratesCriteria = null, CancellationToken cancellationToken = default - ); + ) => client.GetAsync(Channels / channelName, ratesCriteria?.QueryParameters, cancellationToken); /// /// A list of all exchanges. /// + /// /// /// - Task> GetExchangesAsync(CancellationToken cancellationToken = default); + public static Task> GetExchangesAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Exchanges, cancellationToken); /// /// A list of exchanges for a page. /// + /// /// /// /// - Task> GetExchangesByPageAsync(PageCriteria pageCriteria, CancellationToken cancellationToken = default); + public static Task> GetExchangesByPageAsync( + this IManagementClient client, + PageCriteria pageCriteria, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Exchanges, pageCriteria.QueryParameters, cancellationToken); /// /// A list of all exchanges for a virtual host. /// + /// /// /// /// - Task> GetExchangesAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task> GetExchangesAsync( + this IManagementClient client, + string vhostName, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Exchanges / vhostName, cancellationToken); /// /// A list of exchanges for a page for a virtual host. /// + /// /// /// /// /// - Task> GetExchangesByPageAsync(string vhostName, PageCriteria pageCriteria, CancellationToken cancellationToken = default); + public static Task> GetExchangesByPageAsync( + this IManagementClient client, + string vhostName, + PageCriteria pageCriteria, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Exchanges / vhostName, pageCriteria.QueryParameters, cancellationToken); /// /// A list of all queues. /// + /// + /// /// /// - Task> GetQueuesAsync(CancellationToken cancellationToken = default); + public static Task> GetQueuesAsync( + this IManagementClient client, + StatsCriteria? statsCriteria = null, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Queues, statsCriteria?.QueryParameters, cancellationToken); /// /// A list of queues for a page. /// + /// /// /// /// - Task> GetQueuesByPageAsync(PageCriteria pageCriteria, CancellationToken cancellationToken = default); + public static Task> GetQueuesByPageAsync( + this IManagementClient client, + PageCriteria pageCriteria, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Queues, pageCriteria.QueryParameters, cancellationToken); /// /// A list of all queues for a virtual host. /// + /// /// + /// /// /// - Task> GetQueuesAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task> GetQueuesAsync( + this IManagementClient client, + string vhostName, + StatsCriteria? statsCriteria = null, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Queues / vhostName, statsCriteria?.QueryParameters, cancellationToken); /// /// A list of queues for a page for a virtual host. /// + /// /// /// /// /// - Task> GetQueuesByPageAsync(string vhostName, PageCriteria pageCriteria, CancellationToken cancellationToken = default); - - /// - /// A list of all queues. - /// - /// - /// - Task> GetQueuesWithoutStatsAsync(CancellationToken cancellationToken = default); + public static Task> GetQueuesByPageAsync( + this IManagementClient client, + string vhostName, + PageCriteria pageCriteria, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Queues / vhostName, pageCriteria.QueryParameters, cancellationToken); /// /// A list of all bindings. /// + /// /// /// - Task> GetBindingsAsync(CancellationToken cancellationToken = default); + public static Task> GetBindingsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Bindings, cancellationToken); /// /// A list of all bindings within the specified VHost. /// + /// /// /// /// - Task> GetBindingsAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task> GetBindingsAsync( + this IManagementClient client, + string vhostName, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Bindings / vhostName, cancellationToken); /// /// A list of all vhosts. /// + /// /// /// - Task> GetVhostsAsync(CancellationToken cancellationToken = default); + public static Task> GetVhostsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Vhosts, cancellationToken); /// /// A list of all users. /// + /// /// /// - Task> GetUsersAsync(CancellationToken cancellationToken = default); + public static Task> GetUsersAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Users, cancellationToken); /// /// A list of all permissions for all users. /// + /// /// /// - Task> GetPermissionsAsync(CancellationToken cancellationToken = default); + public static Task> GetPermissionsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Permissions, cancellationToken); /// /// A list of all topic permissions for all users. /// + /// /// /// - Task> GetTopicPermissionsAsync(CancellationToken cancellationToken = default); + public static Task> GetTopicPermissionsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(TopicPermissions, cancellationToken); /// /// A list of all consumers. /// + /// /// /// - Task> GetConsumersAsync(CancellationToken cancellationToken = default); + public static Task> GetConsumersAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Consumers, cancellationToken); /// /// A list of all consumers for the specified VHost. /// + /// /// /// /// - Task> GetConsumersAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task> GetConsumersAsync( + this IManagementClient client, + string vhostName, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Consumers / vhostName, cancellationToken); /// /// Closes the given connection /// + /// /// /// - Task CloseConnectionAsync( + public static Task CloseConnectionAsync( + this IManagementClient client, string connectionName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Connections / connectionName, cancellationToken); /// /// Creates the given exchange /// + /// /// /// /// /// - Task CreateExchangeAsync( + public static Task CreateExchangeAsync( + this IManagementClient client, string vhostName, string exchangeName, ExchangeInfo exchangeInfo, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Exchanges / vhostName / exchangeName, exchangeInfo, cancellationToken); /// /// Delete the given exchange /// + /// /// /// /// - Task DeleteExchangeAsync( + public static Task DeleteExchangeAsync( + this IManagementClient client, string vhostName, string exchangeName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Exchanges / vhostName / exchangeName, cancellationToken); /// /// A list of all bindings in which a given exchange is the source. /// + /// /// /// /// /// - Task> GetBindingsWithSourceAsync( + public static Task> GetBindingsWithSourceAsync( + this IManagementClient client, string vhostName, string exchangeName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync>(Exchanges / vhostName / exchangeName / "bindings" / "source", cancellationToken); /// /// A list of all bindings in which a given exchange is the destination. /// + /// /// /// /// /// - Task> GetBindingsWithDestinationAsync( + public static Task> GetBindingsWithDestinationAsync( + this IManagementClient client, string vhostName, string exchangeName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync>(Exchanges / vhostName / exchangeName / "bindings" / "destination", cancellationToken); /// /// Publish a message to a given exchange. @@ -280,67 +476,77 @@ Task> GetBindingsWithDestinationAsync( /// test messages, diagnostics etc - they do not implement reliable delivery and so should /// be treated as a sysadmin's tool rather than a general API for messaging. /// + /// /// The vhost /// The exchange /// The publication parameters /// /// A PublishResult, routed == true if the message was sent to at least one queue - Task PublishAsync( + public static Task PublishAsync( + this IManagementClient client, string vhostName, string exchangeName, PublishInfo publishInfo, CancellationToken cancellationToken = default - ); + ) => client.PostAsync(Exchanges / vhostName / exchangeName / "publish", publishInfo, cancellationToken); /// /// Create the given queue /// + /// /// /// /// /// - Task CreateQueueAsync( + public static Task CreateQueueAsync( + this IManagementClient client, string vhostName, string queueName, QueueInfo queueInfo, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Queues / vhostName / queueName, queueInfo, cancellationToken); /// /// Delete the given queue /// + /// /// /// /// - Task DeleteQueueAsync( + public static Task DeleteQueueAsync( + this IManagementClient client, string vhostName, string queueName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Queues / vhostName / queueName, cancellationToken); /// /// A list of all bindings on a given queue. /// + /// /// /// /// - Task> GetBindingsForQueueAsync( + public static Task> GetBindingsForQueueAsync( + this IManagementClient client, string vhostName, string queueName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync>(Queues / vhostName / queueName / "bindings", cancellationToken); /// /// Purge a queue of all messages /// + /// /// /// /// - Task PurgeAsync( + public static Task PurgeAsync( + this IManagementClient client, string vhostName, string queueName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Queues / vhostName / queueName / "contents", cancellationToken); /// /// Get messages from a queue. @@ -349,225 +555,262 @@ Task PurgeAsync( /// delivery and so should be treated as a sysadmin's tool rather than a /// general API for messaging. /// + /// /// /// The queue to retrieve from /// The criteria for the retrieve /// /// Messages - Task> GetMessagesFromQueueAsync( + public static Task> GetMessagesFromQueueAsync( + this IManagementClient client, string vhostName, string queueName, GetMessagesFromQueueInfo getMessagesFromQueueInfo, CancellationToken cancellationToken = default - ); + ) => client.PostAsync>(Queues / vhostName / queueName / "get", getMessagesFromQueueInfo, cancellationToken); /// /// Create a binding between an exchange and a queue /// + /// /// the vhost /// the exchange /// the queue /// properties of the binding /// /// The binding that was created - Task CreateQueueBindingAsync( + public static Task CreateQueueBindingAsync( + this IManagementClient client, string vhostName, string exchangeName, string queueName, BindingInfo bindingInfo, CancellationToken cancellationToken = default - ); + ) => client.PostAsync(Bindings / vhostName / "e" / exchangeName / "q" / queueName, bindingInfo, cancellationToken); /// /// Create a binding between an exchange and an exchange /// + /// /// the vhost /// the source exchange /// the destination exchange /// properties of the binding /// - Task CreateExchangeBindingAsync( + public static Task CreateExchangeBindingAsync( + this IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, BindingInfo bindingInfo, CancellationToken cancellationToken = default - ); + ) => client.PostAsync(Bindings / vhostName / "e" / sourceExchangeName / "e" / destinationExchangeName, bindingInfo, cancellationToken); /// /// A list of all bindings between an exchange and a queue. /// Remember, an exchange and a queue can be bound together many times! /// + /// /// /// /// /// /// - Task> GetQueueBindingsAsync( + public static Task> GetQueueBindingsAsync( + this IManagementClient client, string vhostName, string exchangeName, string queueName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync>(Bindings / vhostName / "e" / exchangeName / "q" / queueName, cancellationToken); /// /// A list of all bindings between an exchange and an exchange. /// Remember, an exchange and a exchange can be bound together many times! /// + /// /// /// /// /// /// - Task> GetExchangeBindingsAsync( + public static Task> GetExchangeBindingsAsync( + this IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync>(Bindings / vhostName / "e" / sourceExchangeName / "e" / destinationExchangeName, cancellationToken); /// /// Delete the given binding /// + /// /// /// /// /// /// - Task DeleteQueueBindingAsync( + public static Task DeleteQueueBindingAsync( + this IManagementClient client, string vhostName, string exchangeName, string queueName, string propertiesKey, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Bindings / vhostName / "e" / exchangeName / "q" / queueName / propertiesKey, cancellationToken); /// /// Delete the given binding /// + /// /// /// /// /// /// - Task DeleteExchangeBindingAsync( + public static Task DeleteExchangeBindingAsync( + this IManagementClient client, string vhostName, string sourceExchangeName, string destinationExchangeName, string propertiesKey, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Bindings / vhostName / "e" / sourceExchangeName / "e" / destinationExchangeName / propertiesKey, cancellationToken); /// /// Create a new virtual host /// + /// /// The name of the new virtual host /// - Task CreateVhostAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task CreateVhostAsync( + this IManagementClient client, + string vhostName, + CancellationToken cancellationToken = default + ) => client.PutAsync(Vhosts / vhostName, cancellationToken); /// /// Delete a virtual host /// + /// /// The virtual host to delete /// - Task DeleteVhostAsync( + public static Task DeleteVhostAsync( + this IManagementClient client, string vhostName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Vhosts / vhostName, cancellationToken); /// /// Enable tracing on given virtual host. /// + /// /// The virtual host on which to enable tracing /// - Task EnableTracingAsync( + public static Task EnableTracingAsync( + this IManagementClient client, string vhostName, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Vhosts / vhostName, new { Tracing = true }, cancellationToken); /// /// Disables tracing on given virtual host. /// + /// /// The virtual host on which to disable tracing /// - Task DisableTracingAsync( + public static Task DisableTracingAsync( + this IManagementClient client, string vhostName, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Vhosts / vhostName, new { Tracing = false }, cancellationToken); /// /// Create a new user /// + /// /// The user name to create /// The user info to create /// - Task CreateUserAsync( + public static Task CreateUserAsync( + this IManagementClient client, string userName, UserInfo userInfo, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Users / userName, userInfo, cancellationToken); /// /// Delete a user /// + /// /// The user to delete /// - Task DeleteUserAsync( + public static Task DeleteUserAsync( + this IManagementClient client, string userName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Users / userName, cancellationToken); /// /// Create a permission /// + /// /// /// /// /// - Task CreatePermissionAsync( + public static Task CreatePermissionAsync( + this IManagementClient client, string vhostName, string userName, PermissionInfo permissionInfo, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Permissions / vhostName / userName, permissionInfo, cancellationToken); /// /// Delete a permission /// + /// /// /// /// - Task DeletePermissionAsync( + public static Task DeletePermissionAsync( + this IManagementClient client, string vhostName, string userName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Permissions / vhostName / userName, cancellationToken); /// /// Create a topic permission /// + /// /// /// /// /// - Task CreateTopicPermissionAsync( + public static Task CreateTopicPermissionAsync( + this IManagementClient client, string vhostName, string userName, TopicPermissionInfo topicPermissionInfo, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(TopicPermissions / vhostName / userName, topicPermissionInfo, cancellationToken); /// /// Delete a topic permission /// + /// /// /// /// - Task DeleteTopicPermissionAsync( + public static Task DeleteTopicPermissionAsync( + this IManagementClient client, string vhostName, string userName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(TopicPermissions / vhostName / userName, cancellationToken); /// /// Declares a test queue, then publishes and consumes a message. Intended for use @@ -575,205 +818,272 @@ Task DeleteTopicPermissionAsync( /// Note: the test queue will not be deleted (to prevent queue churn if this /// is repeatedly pinged). /// + /// /// /// - Task IsAliveAsync( + public static Task IsAliveAsync( + this IManagementClient client, string vhostName, CancellationToken cancellationToken = default - ); + ) => client.CheckAsync(AlivenessTest / vhostName, cancellationToken); /// /// Get an individual exchange by name /// + /// /// The virtual host that contains the exchange /// The name of the exchange /// Criteria for getting samples of rate data /// /// The exchange - Task GetExchangeAsync( + public static Task GetExchangeAsync( + this IManagementClient client, string vhostName, string exchangeName, RatesCriteria? ratesCriteria = null, CancellationToken cancellationToken = default - ); + ) => client.GetAsync(Exchanges / vhostName / exchangeName, ratesCriteria?.QueryParameters, cancellationToken); /// /// Get an individual queue by name /// + /// /// The name of the queue /// The virtual host that contains the queue /// Criteria for getting samples of queue length data /// Criteria for getting samples of rate data /// /// The Queue - Task GetQueueAsync( + public static Task GetQueueAsync( + this IManagementClient client, string vhostName, string queueName, LengthsCriteria? lengthsCriteria = null, RatesCriteria? ratesCriteria = null, CancellationToken cancellationToken = default - ); + ) + { + var queryParameters = + ConcatNullableQueryParameters(lengthsCriteria?.QueryParameters, ratesCriteria?.QueryParameters); + return client.GetAsync(Queues / vhostName / queueName, queryParameters, cancellationToken); + } /// /// Get an individual vhost by name /// + /// /// The VHost /// - Task GetVhostAsync( + public static Task GetVhostAsync( + this IManagementClient client, string vhostName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync(Vhosts / vhostName, cancellationToken); /// /// Get a user by name /// + /// /// The name of the user /// /// The User - Task GetUserAsync( + public static Task GetUserAsync( + this IManagementClient client, string userName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync(Users / userName, cancellationToken); /// /// Get collection of Policies on the cluster /// + /// /// /// Policies - Task> GetPoliciesAsync(CancellationToken cancellationToken = default); + public static Task> GetPoliciesAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Policies, cancellationToken); /// /// Creates a policy on the cluster /// + /// /// /// /// /// - Task CreatePolicyAsync( + public static Task CreatePolicyAsync( + this IManagementClient client, string vhostName, string policyName, PolicyInfo policyInfo, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Policies / vhostName / policyName, policyInfo, cancellationToken); /// /// Delete a policy from the cluster /// + /// /// vhost on which the policy resides /// Policy name /// - Task DeletePolicyAsync( + public static Task DeletePolicyAsync( + this IManagementClient client, string vhostName, string policyName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Policies / vhostName / policyName, cancellationToken); /// /// Get specific parameters on the cluster /// + /// /// /// /// /// - public Task GetParameterAsync( + public static Task GetParameterAsync( + this IManagementClient client, string vhostName, string componentName, string parameterName, CancellationToken cancellationToken = default - ); + ) => client.GetAsync(Parameters / componentName / vhostName / parameterName, cancellationToken); /// /// Get all parameters on the cluster /// + /// /// - Task> GetParametersAsync(CancellationToken cancellationToken = default); + public static Task> GetParametersAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(Parameters, cancellationToken); /// /// Creates a parameter on the cluster /// + /// /// /// /// /// /// - Task CreateParameterAsync( + public static Task CreateParameterAsync( + this IManagementClient client, string componentName, string vhostName, string parameterName, object parameterValue, CancellationToken cancellationToken = default - ); + ) => client.PutAsync(Parameters / componentName / vhostName / parameterName, new { Value = parameterValue }, cancellationToken); /// /// Delete a parameter from the cluster /// + /// /// /// /// /// - Task DeleteParameterAsync( + public static Task DeleteParameterAsync( + this IManagementClient client, string componentName, string vhostName, string parameterName, CancellationToken cancellationToken = default - ); + ) => client.DeleteAsync(Parameters / componentName / vhostName / parameterName, cancellationToken); /// /// Get list of federations /// + /// /// /// - Task> GetFederationsAsync(CancellationToken cancellationToken = default); + public static Task> GetFederationsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(FederationLinks, cancellationToken); /// /// Returns true if there are any alarms in effect in the cluster /// + /// /// /// - Task HaveAnyClusterAlarmsAsync(CancellationToken cancellationToken = default); + public static async Task HaveAnyClusterAlarmsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => !await client.CheckAsync(Health / "checks" / "alarms", cancellationToken).ConfigureAwait(false); /// /// Returns true if there are any alarms in effect in on a target node /// + /// /// /// - Task HaveAnyLocalAlarmsAsync(CancellationToken cancellationToken = default); + public static async Task HaveAnyLocalAlarmsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => !await client.CheckAsync(Health / "checks" / "local-alarms", cancellationToken).ConfigureAwait(false); + /// /// Returns true if there are classic mirrored queues without synchronised mirrors online (queues that would potentially lose data if the target node is shut down). /// + /// /// /// - Task HaveAnyClassicQueuesWithoutSynchronisedMirrorsAsync(CancellationToken cancellationToken = default); + public static async Task HaveAnyClassicQueuesWithoutSynchronisedMirrorsAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => !await client.CheckAsync(Health / "checks" / "node-is-mirror-sync-critical", cancellationToken).ConfigureAwait(false); /// /// Returns true if there are quorum queues with minimum online quorum (queues that would lose their quorum and availability if the target node is shut down) /// + /// /// /// - Task HaveAnyQuorumQueuesInCriticalStateAsync(CancellationToken cancellationToken = default); + public static async Task HaveAnyQuorumQueuesInCriticalStateAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => !await client.CheckAsync(Health / "checks" / "node-is-quorum-critical", cancellationToken).ConfigureAwait(false); /// /// Rebalances all queues in all vhosts. This operation is asynchronous therefore please check the RabbitMQ log file for messages regarding the success or failure of the operation. /// + /// /// /// - Task RebalanceQueuesAsync(CancellationToken cancellationToken = default); + public static Task RebalanceQueuesAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.PostAsync(Rebalance / "queues", cancellationToken); /// /// A list of all shovel statuses. /// + /// /// /// - Task> GetShovelStatusesAsync(CancellationToken cancellationToken = default); + public static Task> GetShovelStatusesAsync( + this IManagementClient client, + CancellationToken cancellationToken = default + ) => client.GetAsync>(ShovelStatuses, cancellationToken); /// /// A list of all shovel statuses for a virtual host. /// + /// /// /// /// - Task> GetShovelStatusesAsync(string vhostName, CancellationToken cancellationToken = default); + public static Task> GetShovelStatusesAsync( + this IManagementClient client, + string vhostName, + CancellationToken cancellationToken = default + ) => client.GetAsync>(ShovelStatuses / vhostName, cancellationToken); // Current implementation in RabbitMQ has a lot of bugs // diff --git a/Source/EasyNetQ.Management.Client/Internals/QueryStringHelpers.cs b/Source/EasyNetQ.Management.Client/Internals/QueryStringHelpers.cs index aa3d4876..25bd23d3 100644 --- a/Source/EasyNetQ.Management.Client/Internals/QueryStringHelpers.cs +++ b/Source/EasyNetQ.Management.Client/Internals/QueryStringHelpers.cs @@ -4,21 +4,19 @@ namespace EasyNetQ.Management.Client.Internals; internal static class QueryStringHelpers { - public static string AddQueryString(string uri, IReadOnlyDictionary? queryString) + public static string AddQueryString(string uri, IEnumerable>? queryParameters) { - if (queryString == null || queryString.Count == 0) return uri; + if (queryParameters == null) return uri; - var queryIndex = uri.IndexOf('?'); - var hasQuery = queryIndex != -1; - var sb = new StringBuilder(); - sb.Append(uri); - foreach (var parameter in queryString) + var queryParameterSeparator = uri.Contains('?') ? '&' : '?'; + var sb = new StringBuilder(uri); + foreach (var parameter in queryParameters) { - sb.Append(hasQuery ? '&' : '?'); + sb.Append(queryParameterSeparator); sb.Append(Uri.EscapeDataString(parameter.Key)); sb.Append('='); sb.Append(Uri.EscapeDataString(parameter.Value)); - hasQuery = true; + queryParameterSeparator = '&'; } return sb.ToString(); } diff --git a/Source/EasyNetQ.Management.Client/LengthsCriteria.cs b/Source/EasyNetQ.Management.Client/LengthsCriteria.cs new file mode 100644 index 00000000..2f6e133a --- /dev/null +++ b/Source/EasyNetQ.Management.Client/LengthsCriteria.cs @@ -0,0 +1,11 @@ +namespace EasyNetQ.Management.Client; + +public record LengthsCriteria(int LengthsAge, int LengthsIncr) +{ + public readonly IEnumerable> QueryParameters = + new KeyValuePair[] + { + new KeyValuePair("lengths_age", LengthsAge.ToString()), + new KeyValuePair("lengths_incr", LengthsIncr.ToString()) + }; +} diff --git a/Source/EasyNetQ.Management.Client/ManagementClient.cs b/Source/EasyNetQ.Management.Client/ManagementClient.cs index 7372d5bb..96b4ba29 100644 --- a/Source/EasyNetQ.Management.Client/ManagementClient.cs +++ b/Source/EasyNetQ.Management.Client/ManagementClient.cs @@ -5,7 +5,6 @@ using System.Text.Json; using System.Text.Json.Serialization; using EasyNetQ.Management.Client.Internals; -using EasyNetQ.Management.Client.Model; using EasyNetQ.Management.Client.Serialization; #if NET6_0 @@ -24,33 +23,6 @@ public class ManagementClient : IManagementClient private static readonly MediaTypeWithQualityHeaderValue JsonMediaTypeHeaderValue = new("application/json"); private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(20); - private static readonly RelativePath Api = new("api"); - private static readonly RelativePath Vhosts = Api / "vhosts"; - private static readonly RelativePath AlivenessTest = Api / "aliveness-test"; - private static readonly RelativePath Connections = Api / "connections"; - private static readonly RelativePath Consumers = Api / "consumers"; - private static readonly RelativePath Channels = Api / "channels"; - private static readonly RelativePath Users = Api / "users"; - private static readonly RelativePath Permissions = Api / "permissions"; - private static readonly RelativePath Parameters = Api / "parameters"; - private static readonly RelativePath Bindings = Api / "bindings"; - private static readonly RelativePath Queues = Api / "queues"; - private static readonly RelativePath Exchanges = Api / "exchanges"; - private static readonly RelativePath TopicPermissions = Api / "topic-permissions"; - private static readonly RelativePath Policies = Api / "policies"; - private static readonly RelativePath FederationLinks = Api / "federation-links"; - private static readonly RelativePath Overview = Api / "overview"; - private static readonly RelativePath Nodes = Api / "nodes"; - private static readonly RelativePath Definitions = Api / "definitions"; - private static readonly RelativePath Health = Api / "health"; - private static readonly RelativePath Rebalance = Api / "rebalance"; - private static readonly RelativePath ShovelStatuses = Api / "shovels"; - - private static readonly Dictionary GetQueuesWithoutStatsQueryParameters = new Dictionary { - { "disable_stats", "true" }, - { "enable_queue_totals", "true" } - }; - internal static readonly JsonSerializerOptions SerializerOptions; private readonly HttpClient httpClient; @@ -190,597 +162,32 @@ public ManagementClient(HttpClient httpClient, string username, string password) public Uri Endpoint => httpClient.BaseAddress!; - public Task GetOverviewAsync( - LengthsCriteria? lengthsCriteria = null, - RatesCriteria? ratesCriteria = null, - CancellationToken cancellationToken = default - ) - { - var queryParameters = MergeQueryParameters( - lengthsCriteria?.ToQueryParameters(), ratesCriteria?.ToQueryParameters() - ); - return GetAsync(Overview, queryParameters, cancellationToken); - } - - public Task> GetNodesAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Nodes, cancellationToken); - } - - public Task GetDefinitionsAsync(CancellationToken cancellationToken = default) - { - return GetAsync(Definitions, cancellationToken); - } - - public Task> GetConnectionsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Connections, cancellationToken); - } - - public Task> GetConnectionsAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync>(Vhosts / vhostName / "connections", cancellationToken); - } - - public Task CloseConnectionAsync(string connectionName, CancellationToken cancellationToken = default) - { - return DeleteAsync(Connections / connectionName, cancellationToken); - } - - public Task> GetChannelsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Channels, cancellationToken); - } - - public Task> GetChannelsAsync(string connectionName, CancellationToken cancellationToken = default) - { - return GetAsync>(Connections / connectionName / "channels", cancellationToken); - } - - public Task GetChannelAsync( - string channelName, - RatesCriteria? ratesCriteria = null, - CancellationToken cancellationToken = default - ) - { - return GetAsync(Channels / channelName, ratesCriteria?.ToQueryParameters(), cancellationToken); - } - - public Task> GetExchangesAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Exchanges, cancellationToken); - } - - public Task> GetExchangesByPageAsync(PageCriteria pageCriteria, CancellationToken cancellationToken = default) - { - return GetAsync>(Exchanges, pageCriteria.ToQueryParameters(), cancellationToken); - } - - public Task> GetExchangesAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync>(Exchanges / vhostName, cancellationToken); - } - - public Task> GetExchangesByPageAsync( - string vhostName, - PageCriteria pageCriteria, - CancellationToken cancellationToken = default - ) - { - return GetAsync>(Exchanges / vhostName, pageCriteria.ToQueryParameters(), cancellationToken); - } - - public Task GetExchangeAsync( - string vhostName, - string exchangeName, - RatesCriteria? ratesCriteria = null, - CancellationToken cancellationToken = default - ) - { - return GetAsync( - Exchanges / vhostName / exchangeName, - ratesCriteria?.ToQueryParameters(), - cancellationToken - ); - } - - public Task GetQueueAsync( - string vhostName, - string queueName, - LengthsCriteria? lengthsCriteria = null, - RatesCriteria? ratesCriteria = null, - CancellationToken cancellationToken = default - ) - { - var queryParameters = MergeQueryParameters( - lengthsCriteria?.ToQueryParameters(), ratesCriteria?.ToQueryParameters() - ); - return GetAsync( - Queues / vhostName / queueName, - queryParameters, - cancellationToken - ); - } - - public Task CreateExchangeAsync( - string vhostName, - string exchangeName, - ExchangeInfo exchangeInfo, - CancellationToken cancellationToken = default - ) - { - return PutAsync( - Exchanges / vhostName / exchangeName, - exchangeInfo, - cancellationToken - ); - } - - public Task DeleteExchangeAsync(string vhostName, string exchangeName, CancellationToken cancellationToken = default) - { - return DeleteAsync( - Exchanges / vhostName / exchangeName, - cancellationToken - ); - } - - public Task> GetBindingsWithSourceAsync( - string vhostName, - string exchangeName, - CancellationToken cancellationToken = default - ) - { - return GetAsync>( - Exchanges / vhostName / exchangeName / "bindings" / "source", - cancellationToken - ); - } - - public Task> GetBindingsWithDestinationAsync( - string vhostName, - string exchangeName, - CancellationToken cancellationToken = default - ) - { - return GetAsync>( - Exchanges / vhostName / exchangeName / "bindings" / "destination", - cancellationToken - ); - } - - public Task PublishAsync( - string vhostName, - string exchangeName, - PublishInfo publishInfo, - CancellationToken cancellationToken = default - ) - { - return PostAsync( - Exchanges / vhostName / exchangeName / "publish", - publishInfo, - cancellationToken - ); - } - - - public Task> GetQueuesAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Queues, cancellationToken); - } - - public Task> GetQueuesByPageAsync(PageCriteria pageCriteria, CancellationToken cancellationToken = default) - { - return GetAsync>(Queues, pageCriteria.ToQueryParameters(), cancellationToken); - } - - public Task> GetQueuesAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync>(Queues / vhostName, cancellationToken); - } - - public Task> GetQueuesByPageAsync(string vhostName, PageCriteria pageCriteria, CancellationToken cancellationToken = default) - { - return GetAsync>(Queues / vhostName, pageCriteria.ToQueryParameters(), cancellationToken); - } - - public Task> GetQueuesWithoutStatsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Queues, GetQueuesWithoutStatsQueryParameters, cancellationToken); - } - - public Task CreateQueueAsync( - string vhostName, - string queueName, - QueueInfo queueInfo, - CancellationToken cancellationToken = default - ) - { - return PutAsync( - Queues / vhostName / queueName, - queueInfo, - cancellationToken - ); - } - - public Task DeleteQueueAsync(string vhostName, string queueName, CancellationToken cancellationToken = default) - { - return DeleteAsync( - Queues / vhostName / queueName, cancellationToken - ); - } - - public Task> GetBindingsForQueueAsync( - string vhostName, string queueName, CancellationToken cancellationToken = default - ) - { - return GetAsync>( - Queues / vhostName / queueName / "bindings", cancellationToken - ); - } - - public Task PurgeAsync(string vhostName, string queueName, CancellationToken cancellationToken = default) - { - return DeleteAsync( - Queues / vhostName / queueName / "contents", cancellationToken - ); - } - - public Task> GetMessagesFromQueueAsync( - string vhostName, - string queueName, - GetMessagesFromQueueInfo getMessagesFromQueueInfo, - CancellationToken cancellationToken = default - ) - { - return PostAsync>( - Queues / vhostName / queueName / "get", - getMessagesFromQueueInfo, - cancellationToken - ); - } - - public Task> GetBindingsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Bindings, cancellationToken); - } - - public Task> GetBindingsAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync>(Bindings / vhostName, cancellationToken); - } - - public Task CreateQueueBindingAsync( - string vhostName, - string exchangeName, - string queueName, - BindingInfo bindingInfo, - CancellationToken cancellationToken = default - ) - { - return PostAsync( - Bindings / vhostName / "e" / exchangeName / "q" / queueName, - bindingInfo, - cancellationToken - ); - } - - public Task CreateExchangeBindingAsync( - string vhostName, - string sourceExchangeName, - string destinationExchangeName, - BindingInfo bindingInfo, - CancellationToken cancellationToken = default - ) - { - return PostAsync( - Bindings / vhostName / "e" / sourceExchangeName / "e" / destinationExchangeName, - bindingInfo, - cancellationToken - ); - } - - public Task> GetQueueBindingsAsync( - string vhostName, - string exchangeName, - string queueName, - CancellationToken cancellationToken = default - ) - { - return GetAsync>( - Bindings / vhostName / "e" / exchangeName / "q" / queueName, - cancellationToken - ); - } - - public Task> GetExchangeBindingsAsync( - string vhostName, - string sourceExchangeName, - string destinationExchangeName, - CancellationToken cancellationToken = default - ) - { - return GetAsync>( - Bindings / vhostName / "e" / sourceExchangeName / "e" / destinationExchangeName, - cancellationToken - ); - } - - public Task DeleteQueueBindingAsync( - string vhostName, - string exchangeName, - string queueName, - string propertiesKey, - CancellationToken cancellationToken = default - ) - { - return DeleteAsync( - Bindings / vhostName / "e" / exchangeName / "q" / queueName / propertiesKey, - cancellationToken - ); - } - - public Task DeleteExchangeBindingAsync( - string vhostName, - string sourceExchangeName, - string destinationExchangeName, - string propertiesKey, - CancellationToken cancellationToken = default - ) - { - return DeleteAsync( - Bindings / vhostName / "e" / sourceExchangeName / "e" / destinationExchangeName / propertiesKey, - cancellationToken - ); - } - - public Task> GetVhostsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Vhosts, cancellationToken); - } - - public Task GetVhostAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync(Vhosts / vhostName, cancellationToken); - } - - public Task CreateVhostAsync(string vhostName, CancellationToken cancellationToken = default) - { - return PutAsync(Vhosts / vhostName, cancellationToken); - } - - public Task DeleteVhostAsync(string vhostName, CancellationToken cancellationToken = default) - { - return DeleteAsync(Vhosts / vhostName, cancellationToken); - } - - public Task EnableTracingAsync(string vhostName, CancellationToken cancellationToken = default) - { - return PutAsync(Vhosts / vhostName, new { Tracing = true }, cancellationToken); - } - - public Task DisableTracingAsync(string vhostName, CancellationToken cancellationToken = default) - { - return PutAsync(Vhosts / vhostName, new { Tracing = false }, cancellationToken); - } - - public Task> GetUsersAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Users, cancellationToken); - } - - public Task GetUserAsync(string userName, CancellationToken cancellationToken = default) - { - return GetAsync(Users / userName, cancellationToken); - } - - public Task> GetPoliciesAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Policies, cancellationToken); - } - - public Task CreatePolicyAsync( - string vhostName, - string policyName, - PolicyInfo policyInfo, - CancellationToken cancellationToken = default - ) - { - return PutAsync(Policies / vhostName / policyName, policyInfo, cancellationToken); - } - - public Task DeletePolicyAsync(string vhostName, string policyName, CancellationToken cancellationToken = default) - { - return DeleteAsync(Policies / vhostName / policyName, cancellationToken); - } - - public Task GetParameterAsync( - string vhostName, - string componentName, - string parameterName, - CancellationToken cancellationToken = default - ) - { - return GetAsync(Parameters / componentName / vhostName / parameterName, cancellationToken); - } - - public Task> GetParametersAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Parameters, cancellationToken); - } - - public Task CreateParameterAsync( - string componentName, - string vhostName, - string parameterName, - object parameterValue, - CancellationToken cancellationToken = default - ) - { - return PutAsync( - Parameters / componentName / vhostName / parameterName, - new { Value = parameterValue }, - cancellationToken - ); - } - - public Task DeleteParameterAsync( - string componentName, - string vhostName, - string parameterName, - CancellationToken cancellationToken = default - ) - { - return DeleteAsync(Parameters / componentName / vhostName / parameterName, cancellationToken); - } - - public Task CreateUserAsync(string userName, UserInfo userInfo, CancellationToken cancellationToken = default) - { - return PutAsync(Users / userName, userInfo, cancellationToken); - } - - public Task DeleteUserAsync(string userName, CancellationToken cancellationToken = default) - { - return DeleteAsync(Users / userName, cancellationToken); - } - - public Task> GetPermissionsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Permissions, cancellationToken); - } - - public Task CreatePermissionAsync(string vhostName, string userName, PermissionInfo permissionInfo, CancellationToken cancellationToken = default) - { - return PutAsync( - Permissions / vhostName / userName, - permissionInfo, - cancellationToken - ); - } - - public Task DeletePermissionAsync(string vhostName, string userName, CancellationToken cancellationToken = default) - { - return DeleteAsync(Permissions / vhostName / userName, cancellationToken); - } - - public Task> GetTopicPermissionsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(TopicPermissions, cancellationToken); - } - - public Task CreateTopicPermissionAsync( - string vhostName, - string userName, - TopicPermissionInfo topicPermissionInfo, - CancellationToken cancellationToken = default - ) - { - return PutAsync( - TopicPermissions / vhostName / userName, - topicPermissionInfo, - cancellationToken - ); - } - - public Task DeleteTopicPermissionAsync(string vhostName, string userName, CancellationToken cancellationToken = default) - { - return DeleteAsync(TopicPermissions / vhostName / userName, cancellationToken); - } - - public Task> GetFederationsAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(FederationLinks, cancellationToken); - } - - public Task IsAliveAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync(AlivenessTest / vhostName, c => c == HttpStatusCode.OK, c => c == HttpStatusCode.ServiceUnavailable, cancellationToken); - } - - public Task> GetConsumersAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(Consumers, cancellationToken); - } - - public Task> GetConsumersAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync>(Consumers / vhostName, cancellationToken); - } - - public Task HaveAnyClusterAlarmsAsync(CancellationToken cancellationToken = default) - { - return GetAsync( - Health / "checks" / "alarms", - c => c == HttpStatusCode.ServiceUnavailable, - c => c == HttpStatusCode.OK, - cancellationToken - ); - } - - public Task HaveAnyLocalAlarmsAsync(CancellationToken cancellationToken = default) - { - return GetAsync( - Health / "checks" / "local-alarms", - c => c == HttpStatusCode.ServiceUnavailable, - c => c == HttpStatusCode.OK, - cancellationToken - ); - } - - public Task HaveAnyClassicQueuesWithoutSynchronisedMirrorsAsync(CancellationToken cancellationToken = default) - { - return GetAsync( - Health / "checks" / "node-is-mirror-sync-critical", - c => c == HttpStatusCode.ServiceUnavailable, - c => c == HttpStatusCode.OK, - cancellationToken - ); - } - - public Task HaveAnyQuorumQueuesInCriticalStateAsync(CancellationToken cancellationToken = default) - { - return GetAsync( - Health / "checks" / "node-is-quorum-critical", - c => c == HttpStatusCode.ServiceUnavailable, - c => c == HttpStatusCode.OK, - cancellationToken - ); - } - - public Task RebalanceQueuesAsync(CancellationToken cancellationToken = default) - { - return PostAsync(Rebalance / "queues", cancellationToken); - } - public void Dispose() { if (disposeHttpClient) httpClient.Dispose(); } - private async Task GetAsync( + public async Task CheckAsync( RelativePath path, - Func trueCondition, - Func falseCondition, CancellationToken cancellationToken = default ) { using var request = CreateRequest(HttpMethod.Get, path); using var response = await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - if (trueCondition(response.StatusCode)) + if (response.StatusCode == HttpStatusCode.OK) return true; - if (falseCondition(response.StatusCode)) + if (response.StatusCode == HttpStatusCode.ServiceUnavailable) return false; throw new UnexpectedHttpStatusCodeException(response); } - private Task GetAsync(RelativePath path, CancellationToken cancellationToken = default) => GetAsync(path, null, cancellationToken); - - private async Task GetAsync( + public async Task GetAsync( RelativePath path, - IReadOnlyDictionary? queryParameters, + IEnumerable>? queryParameters, CancellationToken cancellationToken = default ) { @@ -791,7 +198,7 @@ private async Task GetAsync( try { - return (await response.Content.ReadFromJsonAsync(SerializerOptions, cancellationToken).ConfigureAwait(false))!; + return (await response.Content.ReadFromJsonAsync(SerializerOptions, cancellationToken).ConfigureAwait(false))!; } catch (Exception e) when (e is ArgumentNullException || e is JsonException) { @@ -800,7 +207,7 @@ private async Task GetAsync( } } - private async Task PostAsync( + public async Task PostAsync( RelativePath path, TItem item, CancellationToken cancellationToken = default @@ -823,7 +230,7 @@ private async Task PostAsync( } } - private async Task PostAsync( + public async Task PostAsync( RelativePath path, TItem item, CancellationToken cancellationToken = default @@ -836,7 +243,7 @@ private async Task PostAsync( response.EnsureExpectedStatusCode(statusCode => statusCode is HttpStatusCode.OK or HttpStatusCode.Created or HttpStatusCode.NoContent); } - private async Task PostAsync( + public async Task PostAsync( RelativePath path, CancellationToken cancellationToken = default ) @@ -847,7 +254,7 @@ private async Task PostAsync( response.EnsureExpectedStatusCode(statusCode => statusCode is HttpStatusCode.OK or HttpStatusCode.Created or HttpStatusCode.NoContent); } - private async Task DeleteAsync(RelativePath path, CancellationToken cancellationToken = default) + public async Task DeleteAsync(RelativePath path, CancellationToken cancellationToken = default) { using var request = CreateRequest(HttpMethod.Delete, path); using var response = await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); @@ -855,9 +262,9 @@ private async Task DeleteAsync(RelativePath path, CancellationToken cancellation response.EnsureExpectedStatusCode(statusCode => statusCode == HttpStatusCode.NoContent); } - private async Task PutAsync( + public async Task PutAsync( RelativePath path, - T item, + TBody item, CancellationToken cancellationToken = default ) { @@ -868,7 +275,7 @@ private async Task PutAsync( response.EnsureExpectedStatusCode(statusCode => statusCode is HttpStatusCode.Created or HttpStatusCode.NoContent); } - private async Task PutAsync(RelativePath path, CancellationToken cancellationToken = default) + public async Task PutAsync(RelativePath path, CancellationToken cancellationToken = default) { using var request = CreateRequest(HttpMethod.Put, path); using var response = await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); @@ -879,7 +286,7 @@ private async Task PutAsync(RelativePath path, CancellationToken cancellationTok private HttpRequestMessage CreateRequest( HttpMethod httpMethod, in RelativePath path, - IReadOnlyDictionary? queryParameters = null, + IEnumerable>? queryParameters = null, HttpContent? content = null ) { @@ -889,32 +296,4 @@ private HttpRequestMessage CreateRequest( configureHttpRequestMessage?.Invoke(request); return request; } - - private static IReadOnlyDictionary? MergeQueryParameters(params IReadOnlyDictionary?[]? multipleQueryParameters) - { - if (multipleQueryParameters == null || multipleQueryParameters.Length == 0) - return null; - - var mergedQueryParameters = new Dictionary(); - foreach (var queryParameters in multipleQueryParameters) - { - if (queryParameters == null) - continue; - - foreach (var kvp in queryParameters) - mergedQueryParameters[kvp.Key] = kvp.Value; - } - - return mergedQueryParameters; - } - - public Task> GetShovelStatusesAsync(CancellationToken cancellationToken = default) - { - return GetAsync>(ShovelStatuses, cancellationToken); - } - - public Task> GetShovelStatusesAsync(string vhostName, CancellationToken cancellationToken = default) - { - return GetAsync>(ShovelStatuses / vhostName, cancellationToken); - } } diff --git a/Source/EasyNetQ.Management.Client/Model/LengthsCriteria.cs b/Source/EasyNetQ.Management.Client/Model/LengthsCriteria.cs deleted file mode 100644 index 7e17a053..00000000 --- a/Source/EasyNetQ.Management.Client/Model/LengthsCriteria.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace EasyNetQ.Management.Client.Model; - -public record LengthsCriteria(int LengthsAge, int LengthsIncr) -{ - public IReadOnlyDictionary ToQueryParameters() - { - return new Dictionary - { - { "lengths_age", LengthsAge.ToString() }, - { "lengths_incr", LengthsIncr.ToString() } - }; - } -} diff --git a/Source/EasyNetQ.Management.Client/Model/PageCriteria.cs b/Source/EasyNetQ.Management.Client/Model/PageCriteria.cs deleted file mode 100644 index 4758bdcf..00000000 --- a/Source/EasyNetQ.Management.Client/Model/PageCriteria.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace EasyNetQ.Management.Client.Model; - -public record PageCriteria(int Page, int PageSize, string? Name = null, bool UseRegex = false) -{ - public IReadOnlyDictionary ToQueryParameters() - { - return new Dictionary - { - { "page", Page.ToString() }, - { "page_size", PageSize.ToString() }, - { "name", Name ?? "" }, - { "use_regex", UseRegex.ToString().ToLower() }, - { "pagination", "true" } - }; - } -} diff --git a/Source/EasyNetQ.Management.Client/Model/Queue.cs b/Source/EasyNetQ.Management.Client/Model/Queue.cs index b7f6d672..b65759f6 100755 --- a/Source/EasyNetQ.Management.Client/Model/Queue.cs +++ b/Source/EasyNetQ.Management.Client/Model/Queue.cs @@ -7,9 +7,11 @@ namespace EasyNetQ.Management.Client.Model; public record Queue( string Name, string Vhost, + QueueType Type, string? Node, string? State, + [property: JsonConverter(typeof(StringObjectReadOnlyDictionaryConverter))] IReadOnlyDictionary Arguments, bool Durable, bool Exclusive, @@ -17,7 +19,6 @@ public record Queue( long MessagesReady, long MessagesUnacknowledged, long Messages, - long Memory, string? IdleSince, string? Policy, @@ -34,7 +35,7 @@ public record Queue( LengthsDetails? MessagesReadyDetails, LengthsDetails? MessagesUnacknowledgedDetails, MessageStats? MessageStats -) : QueueWithoutStats(Name, Vhost, Type, Node, State, Arguments, Durable, Exclusive, AutoDelete, MessagesReady, MessagesUnacknowledged, Messages) +) : QueueName(Name, Vhost) { [JsonExtensionData()] public IDictionary? JsonExtensionData { get; set; } diff --git a/Source/EasyNetQ.Management.Client/Model/QueueWithoutStats.cs b/Source/EasyNetQ.Management.Client/Model/QueueWithoutStats.cs deleted file mode 100644 index 2c398975..00000000 --- a/Source/EasyNetQ.Management.Client/Model/QueueWithoutStats.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Text.Json.Serialization; -using EasyNetQ.Management.Client.Serialization; - -namespace EasyNetQ.Management.Client.Model; - -public record QueueWithoutStats( - string Name, - string Vhost, - - QueueType Type, - string? Node, - string? State, - [property: JsonConverter(typeof(StringObjectReadOnlyDictionaryConverter))] - IReadOnlyDictionary Arguments, - bool Durable, - bool Exclusive, - bool AutoDelete, - long MessagesReady, - long MessagesUnacknowledged, - long Messages -) : QueueName(Name, Vhost); diff --git a/Source/EasyNetQ.Management.Client/Model/RatesCriteria.cs b/Source/EasyNetQ.Management.Client/Model/RatesCriteria.cs deleted file mode 100644 index c61c23aa..00000000 --- a/Source/EasyNetQ.Management.Client/Model/RatesCriteria.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace EasyNetQ.Management.Client.Model; - -public record RatesCriteria(int MsgRatesAge, int MsgRatesIncr) -{ - public IReadOnlyDictionary ToQueryParameters() - { - return new Dictionary - { - { "msg_rates_age", MsgRatesAge.ToString() }, - { "msg_rates_incr", MsgRatesIncr.ToString() } - }; - } -} diff --git a/Source/EasyNetQ.Management.Client/PageCriteria.cs b/Source/EasyNetQ.Management.Client/PageCriteria.cs new file mode 100644 index 00000000..7fa78595 --- /dev/null +++ b/Source/EasyNetQ.Management.Client/PageCriteria.cs @@ -0,0 +1,14 @@ +namespace EasyNetQ.Management.Client; + +public record PageCriteria(int Page, int PageSize, string? Name = null, bool UseRegex = false) +{ + public readonly IEnumerable> QueryParameters = + new KeyValuePair[] + { + new KeyValuePair("page", Page.ToString()), + new KeyValuePair("page_size", PageSize.ToString()), + new KeyValuePair("name", Name ?? ""), + new KeyValuePair("use_regex", UseRegex.ToString().ToLower()), + new KeyValuePair("pagination", "true") + }; +} diff --git a/Source/EasyNetQ.Management.Client/RatesCriteria.cs b/Source/EasyNetQ.Management.Client/RatesCriteria.cs new file mode 100644 index 00000000..cca53d1e --- /dev/null +++ b/Source/EasyNetQ.Management.Client/RatesCriteria.cs @@ -0,0 +1,11 @@ +namespace EasyNetQ.Management.Client; + +public record RatesCriteria(int MsgRatesAge, int MsgRatesIncr) +{ + public readonly IEnumerable> QueryParameters = + new KeyValuePair[] + { + new KeyValuePair("msg_rates_age", MsgRatesAge.ToString()), + new KeyValuePair("msg_rates_incr", MsgRatesIncr.ToString()) + }; +} diff --git a/Source/EasyNetQ.Management.Client/Internals/RelativePath.cs b/Source/EasyNetQ.Management.Client/RelativePath.cs similarity index 67% rename from Source/EasyNetQ.Management.Client/Internals/RelativePath.cs rename to Source/EasyNetQ.Management.Client/RelativePath.cs index de701584..3f43b0b6 100644 --- a/Source/EasyNetQ.Management.Client/Internals/RelativePath.cs +++ b/Source/EasyNetQ.Management.Client/RelativePath.cs @@ -1,22 +1,22 @@ -namespace EasyNetQ.Management.Client.Internals; +namespace EasyNetQ.Management.Client; -internal readonly struct RelativePath +public readonly struct RelativePath { private readonly string[] segments; public RelativePath(string segment) => segments = new[] { segment }; - public string Build() => string.Join("/", (segments ?? Array.Empty()).Select(Uri.EscapeDataString)); + public string Build() => string.Join("/", segments.Select(Uri.EscapeDataString)); public static RelativePath operator /(RelativePath parent, string segment) => parent.Add(segment); - public static RelativePath operator /(RelativePath parent, char segment) => parent.Add(segment + ""); + public static RelativePath operator /(RelativePath parent, char segment) => parent.Add(segment.ToString()); private RelativePath(string[] segments) => this.segments = segments; private RelativePath Add(string segment) { - var old = segments ?? Array.Empty(); + var old = segments; var current = new string[old.Length + 1]; Array.Copy(old, 0, current, 0, old.Length); current[old.Length] = segment; diff --git a/Source/EasyNetQ.Management.Client/StatsCriteria.cs b/Source/EasyNetQ.Management.Client/StatsCriteria.cs new file mode 100644 index 00000000..41e60a4b --- /dev/null +++ b/Source/EasyNetQ.Management.Client/StatsCriteria.cs @@ -0,0 +1,21 @@ +namespace EasyNetQ.Management.Client; + +public record StatsCriteria(bool DisableStats, bool EnableQueueTotals) +{ + public readonly IEnumerable>? QueryParameters = + ((DisableStats, EnableQueueTotals)) switch + { + (true, false) => new KeyValuePair[] { + new KeyValuePair("disable_stats", "true") + }, + (true, true) => new KeyValuePair[] { + new KeyValuePair("disable_stats", "true"), + new KeyValuePair("enable_queue_totals", "true") + }, + (false, false) => null, + (false, true) => throw new NotSupportedException() + }; + + public static StatsCriteria Disable = new StatsCriteria(true, false); + public static StatsCriteria QueueTotalsOnly = new StatsCriteria(true, true); +}