Module: VagrantPlugins::Openstack::RestUtils

Defined in:
lib/vagrant-openstack-illuin-provider/client/rest_utils.rb

Class Method Summary collapse

Class Method Details

.delete(env, url, headers = {}, &block) ⇒ Object



20
21
22
23
24
25
# File 'lib/vagrant-openstack-illuin-provider/client/rest_utils.rb', line 20

def self.delete(env, url, headers = {}, &block)
  config = env[:machine].provider_config
  RestClient::Request.execute(method: :delete, url: url, headers: headers,
                              timeout: config.http.read_timeout, open_timeout: config.http.open_timeout,
                              ssl_ca_file: config.ssl_ca_file, verify_ssl: config.ssl_verify_peer, &block)
end

.get(env, url, headers = {}, &block) ⇒ Object



6
7
8
9
10
11
# File 'lib/vagrant-openstack-illuin-provider/client/rest_utils.rb', line 6

def self.get(env, url, headers = {}, &block)
  config = env[:machine].provider_config
  RestClient::Request.execute(method: :get, url: url, headers: headers,
                              timeout: config.http.read_timeout, open_timeout: config.http.open_timeout,
                              ssl_ca_file: config.ssl_ca_file, verify_ssl: config.ssl_verify_peer, &block)
end

.post(env, url, payload, headers = {}, &block) ⇒ Object



13
14
15
16
17
18
# File 'lib/vagrant-openstack-illuin-provider/client/rest_utils.rb', line 13

def self.post(env, url, payload, headers = {}, &block)
  config = env[:machine].provider_config
  RestClient::Request.execute(method: :post, url: url, payload: payload, headers: headers,
                              timeout: config.http.read_timeout, open_timeout: config.http.open_timeout,
                              ssl_ca_file: config.ssl_ca_file, verify_ssl: config.ssl_verify_peer, &block)
end