Sha256: b46e4282e9b4581101531fa0b864e8fe38af7f31ecb638e28f3db85852c8a8d5
Contents?: true
Size: 689 Bytes
Versions: 160
Compression:
Stored size: 689 Bytes
Contents
require 'json' require 'net/http' require 'net/https' module DPL class Provider class ExoScale < CloudControl def initialize(context, options) super @http = Net::HTTP.new('api.app.exo.io', 443) @http.use_ssl = true @tokenHttp = Net::HTTP.new('portal.exoscale.ch', 443) @tokenHttp.use_ssl = true end private def get_token request = Net::HTTP::Post.new '/api/apps/token' request.basic_auth options[:email], options[:password] response = @tokenHttp.request(request) error('authorization failed') if response.code != '200' return JSON.parse response.body end end end end
Version data entries
160 entries across 160 versions & 1 rubygems