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.10 lib/dpl/provider/exoscale.rb
dpl-1.8.10.travis.1215.4 lib/dpl/provider/exoscale.rb
dpl-1.8.9.travis.1214.4 lib/dpl/provider/exoscale.rb
dpl-1.8.9 lib/dpl/provider/exoscale.rb
dpl-1.8.9.travis.1204.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1203.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1202.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1201.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1187.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1183.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1179.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1167.4 lib/dpl/provider/exoscale.rb
dpl-1.8.8.travis.1151.4 lib/dpl/provider/exoscale.rb
dpl-1.8.7 lib/dpl/provider/exoscale.rb
dpl-1.8.7.travis.1150.4 lib/dpl/provider/exoscale.rb
dpl-1.8.7.travis.1149.4 lib/dpl/provider/exoscale.rb
dpl-1.8.7.travis.1145.4 lib/dpl/provider/exoscale.rb
dpl-1.8.7.travis.1144.4 lib/dpl/provider/exoscale.rb
dpl-1.8.7.travis.1143.4 lib/dpl/provider/exoscale.rb