Sha256: aa2be24a3e2a855f8483759ca1eb7749f4f51402850cea7120d8d9fef7657f7c

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

require 'restclient'

module VagrantPlugins
  module ConoHa
    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

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-conoha-0.1.7 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.6 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.5 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.4 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.3 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.2 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.1 lib/vagrant-conoha/client/rest_utils.rb
vagrant-conoha-0.1.0 lib/vagrant-conoha/client/rest_utils.rb