class FastlyNsq::Http::Nsqlookupd
Provides an interface to the functionality exposed by the nsqlookupd HTTP interface
Constants
- BASE_NSQLOOKUPD_URL
Attributes
Public Class Methods
List of channels for a given topic
@param topic [String] the topic for which to list channels
# File lib/fastly_nsq/http/nsqlookupd.rb, line 35 def self.channels(topic:, **args) new(request_uri: '/channels', **args).get(topic: topic) end
Deletes an existing channel of an existing topic
@param topic [String] an exsiting topic @param channel [String] the exsiting channel to delete
# File lib/fastly_nsq/http/nsqlookupd.rb, line 58 def self.delete_channel(topic:, channel:, **args) new(request_uri: '/delete_channel', **args).get(topic: topic, channel: channel) end
Deletes an existing topic
@param topic [String] the exsiting topic to delete
# File lib/fastly_nsq/http/nsqlookupd.rb, line 49 def self.delete_topic(topic:, **args) new(request_uri: '/delete_topic', **args).get(topic: topic) end
Returns nsqlookupd version information
# File lib/fastly_nsq/http/nsqlookupd.rb, line 81 def self.info(**args) new(request_uri: '/info', **args).get end
List of producers for a given topic
@param topic [String] the topic for which to list producers
# File lib/fastly_nsq/http/nsqlookupd.rb, line 21 def self.lookup(topic:, **args) new(request_uri: '/lookup', **args).get(topic: topic) end
Nsqlookupd
http wrapper. Provides a simple interface to all NSQlookupd http api's @see nsq.io/components/nsqlookupd.html
@attr [String] request_uri the request you would like to call ie: '/thing' @attr [String] base_uri the host, port, and protocol of your nsqd @attr [Object] adapter the http adapter you would like to useā¦
# File lib/fastly_nsq/http/nsqlookupd.rb, line 92 def initialize(request_uri:, base_uri: BASE_NSQLOOKUPD_URL, adapter: FastlyNsq::Http) @adapter = adapter @base_uri = base_uri uri = URI.join(@base_uri, request_uri) @client = @adapter.new(uri: uri) end
List all known nsqd nodes
# File lib/fastly_nsq/http/nsqlookupd.rb, line 41 def self.nodes(**args) new(request_uri: '/nodes', **args).get end
Monitoring endpoint, should return OK
# File lib/fastly_nsq/http/nsqlookupd.rb, line 75 def self.ping(**args) new(request_uri: '/ping', **args).get end
Tombstones a specific producer of an existing topic
@see nsq.io/components/nsqlookupd.html#deletion_tombstones
@param topic [String] the existing topic @param node [String] the producer (nsqd) to tombstone (identified by <broadcast_address>:<http_port>)
# File lib/fastly_nsq/http/nsqlookupd.rb, line 69 def self.tombstone_topic_producer(topic:, node:, **args) new(request_uri: '/tombstone_topic_producer', **args).get(topic: topic, node: node) end
List of all known topics
# File lib/fastly_nsq/http/nsqlookupd.rb, line 27 def self.topics(**args) new(request_uri: '/topics', **args).get end