Sha256: b8c15ce04541eff04de3b78eb2aa2172069b9e1f37a57399d2482687f5a36866

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

require 'restclient'

module VagrantPlugins
  module Openstack
    module RestUtils
      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, &block)
      end

      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, &block)
      end

      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, &block)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-openstack-provider-0.10.0 lib/vagrant-openstack-provider/client/rest_utils.rb
vagrant-openstack-provider-0.9.0 lib/vagrant-openstack-provider/client/rest_utils.rb
vagrant-openstack-provider-0.8.0 lib/vagrant-openstack-provider/client/rest_utils.rb
vagrant-openstack-provider-0.7.2 lib/vagrant-openstack-provider/client/rest_utils.rb
vagrant-openstack-provider-0.7.1 lib/vagrant-openstack-provider/client/rest_utils.rb
vagrant-openstack-provider-0.7.0 lib/vagrant-openstack-provider/client/rest_utils.rb
vagrant-openstack-provider-0.6.1 lib/vagrant-openstack-provider/client/rest_utils.rb