Esempio n. 1
0
        public Task<Parameter> Get(Action<ComponentTarget> target,
                                   CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.RequestCanceled(LogInfo);

            LogInfo(
                "Sent request to return all information pertaining to all parameters on all virtual hosts on current RabbitMQ server.");

            var targetImpl = new ComponentTargetImpl();
            target(targetImpl);

            string url = string.Format("api/parameters/{0}/{1}/{2}", targetImpl.Component,
                                       targetImpl.VirtualHost.SanitizeVirtualHostName(), targetImpl.Name);

            return base.Get(url, cancellationToken).As<Parameter>(cancellationToken);
        }
Esempio n. 2
0
        public Task<ServerResponse> Delete(Action<ComponentTarget> target,
                                           CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.RequestCanceled(LogInfo);

            var targetImpl = new ComponentTargetImpl();
            target(targetImpl);

            LogInfo(
                string.Format(
                    "Sent request to RabbitMQ server to delete parameter '{0}' of component '{1}' on virtual host '{2}'.",
                    targetImpl.Name, targetImpl.Component, targetImpl.VirtualHost));

            string url = string.Format("api/parameters/{0}/{1}/{2}", targetImpl.Component,
                                       targetImpl.VirtualHost.SanitizeVirtualHostName(), targetImpl.Name);

            return base.Delete(url, cancellationToken).Response<ServerResponse>(cancellationToken);
        }
Esempio n. 3
0
        public Task<IEnumerable<Parameter>> GetAll(Action<ComponentTarget> target,
                                                   CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.RequestCanceled(LogInfo);

            var targetImpl = new ComponentTargetImpl();
            target(targetImpl);

            LogInfo(
                string.Format(
                    "Sent request to return all information pertaining to all parameters for component '{0} on virtual host '{1}' on current RabbitMQ server.",
                    targetImpl.Component, targetImpl.VirtualHost));

            string url = string.Format("api/parameters/{0}/{1}", targetImpl.Component,
                                       targetImpl.VirtualHost.SanitizeVirtualHostName());

            return base.Get(url, cancellationToken).As<IEnumerable<Parameter>>(cancellationToken);
        }