module Misty::HTTP::Direct

Allows to submit http request wwith provided path and override base_path if needed

Public Instance Methods

base_set(base_path) click to toggle source

Examples

auth = { ... }
cloud = Misty::Cloud.new(:auth => auth)

net = cloud.network.get('/v2.0/networks')
pp net.body

id = cloud.identity.get('/')
pp id.body

servers = cloud.compute.get('/servers')
pp servers.body

img = cloud.image.get('/v1')
pp img.body
# File lib/misty/http/direct.rb, line 22
def base_set(base_path)
  base = base_path ? base_path : @base_path
end
delete(path, base_path = nil) click to toggle source
# File lib/misty/http/direct.rb, line 26
def delete(path, base_path = nil)
  http_delete(base_set(base_path) + path, @headers.get)
end
get(path, base_path = nil) click to toggle source
# File lib/misty/http/direct.rb, line 30
def get(path, base_path = nil)
  http_get(base_set(base_path) + path, @headers.get)
end
post(path, data, base_path = nil) click to toggle source
# File lib/misty/http/direct.rb, line 34
def post(path, data, base_path = nil)
  http_post(base_set(base_path) + path, @headers.get, data)
end
put(path, data, base_path = nil) click to toggle source
# File lib/misty/http/direct.rb, line 38
def put(path, data, base_path = nil)
  http_put(base_set(base_path) + path, @headers.get, data)
end