Remove /v1 from urls in pooler library

This commit is contained in:
Brian Cain 2015-09-14 14:50:35 -07:00
parent 4c1add6060
commit 2e32472ac2

View file

@ -6,7 +6,7 @@ class Pooler
def self.list(url, os_filter=nil) def self.list(url, os_filter=nil)
conn = Http.get_conn(url) conn = Http.get_conn(url)
response = conn.get '/v1/vm' response = conn.get '/vm'
response_body = JSON.parse(response.body) response_body = JSON.parse(response.body)
if os_filter if os_filter
@ -32,7 +32,7 @@ class Pooler
end end
response = conn.post do |req| response = conn.post do |req|
req.url '/v1/vm' req.url '/vm'
req.headers['Content-Type'] = 'application/json' req.headers['Content-Type'] = 'application/json'
req.body = os_body req.body = os_body
end end
@ -45,7 +45,7 @@ class Pooler
conn = Http.get_conn(url) conn = Http.get_conn(url)
# need to use token # need to use token
response = conn.put "/v1/#{hostname}" response = conn.put "/#{hostname}"
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
@ -57,7 +57,7 @@ class Pooler
hosts.each do |host| hosts.each do |host|
puts "Scheduling host #{host} for deletion" puts "Scheduling host #{host} for deletion"
response = conn.delete "/v1/#{host}" response = conn.delete "/#{host}"
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
end end
@ -66,7 +66,7 @@ class Pooler
def self.status(url) def self.status(url)
conn = Http.get_conn(url) conn = Http.get_conn(url)
response = conn.get '/v1/status' response = conn.get '/status'
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
end end
@ -74,7 +74,7 @@ class Pooler
def self.summary(url) def self.summary(url)
conn = Http.get_conn(url) conn = Http.get_conn(url)
response = conn.get '/v1/summary' response = conn.get '/summary'
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
end end
@ -82,7 +82,7 @@ class Pooler
def self.query(url, hostname) def self.query(url, hostname)
conn = Http.get_conn(url) conn = Http.get_conn(url)
response = conn.get "/v1/vm/#{hostname}" response = conn.get "/vm/#{hostname}"
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
@ -92,7 +92,7 @@ class Pooler
conn = Http.get_conn(url) conn = Http.get_conn(url)
# need to use token # need to use token
response = conn.post "/v1/#{hostname}/snapshot" response = conn.post "/#{hostname}/snapshot"
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
end end
@ -101,7 +101,7 @@ class Pooler
conn = Http.get_conn(url) conn = Http.get_conn(url)
# need to use token # need to use token
response = conn.post "/v1/#{hostname}/snapshot/#{snapshot}" response = conn.post "/#{hostname}/snapshot/#{snapshot}"
res_body = JSON.parse(response.body) res_body = JSON.parse(response.body)
puts res_body puts res_body
end end