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

Version Path
dpl-1.8.12 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1291.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1286.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1283.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1282.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1279.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1272.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1271.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1268.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1260.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1254.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1244.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1236.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1228.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1226.4 lib/dpl/provider/exoscale.rb
dpl-1.8.12.travis.1223.4 lib/dpl/provider/exoscale.rb
dpl-1.8.11 lib/dpl/provider/exoscale.rb
dpl-1.8.11.travis.1222.4 lib/dpl/provider/exoscale.rb
dpl-1.8.11.travis.1218.4 lib/dpl/provider/exoscale.rb
dpl-1.8.10.travis.1217.4 lib/dpl/provider/exoscale.rb