Skip to content

Commit daa74d1

Browse files
authored
Merge pull request #4 from rpcpool/all-namespaces
scrape all namespaces, filter out irrelevant data
2 parents ac391df + 0a84b6c commit daa74d1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/nomad/client.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,15 @@ def get_allocation_info(alloc_id)
135135

136136
# Function to make GET requests with headers
137137
def get_request(path)
138+
# Collect query parameters in a dictionary (hash)
139+
params = {
140+
# by default we're only getting default namespace, use * to get all namespaces
141+
'namespace' => '*',
142+
# we don't need any of this and it's big part of the responses
143+
'task_states' => 'false'
144+
}
138145
uri = URI("#{@nomad_addr}#{path}")
146+
uri.query = URI.encode_www_form(params)
139147
request = Net::HTTP::Get.new(uri)
140148
request['X-Nomad-Token'] = @nomad_token
141149

0 commit comments

Comments
 (0)