class Heroku::Kensa::ApiCheck

Public Instance Methods

base_path() click to toggle source
# File lib/heroku/kensa/check.rb, line 263
def base_path
  if data['api'][env].is_a? Hash
    URI.parse(data['api'][env]['base_url']).path
  else
    '/heroku/resources'
  end
end
callback() click to toggle source
# File lib/heroku/kensa/check.rb, line 279
def callback
  "http://localhost:7779/callback/999"
end
create_provision_payload() click to toggle source
# File lib/heroku/kensa/check.rb, line 283
def create_provision_payload
  payload = {
    :heroku_id => heroku_id,
    :plan => data[:plan] || 'test',
    :callback_url => callback,
    :logplex_token => nil,
    :region => "amazon-web-services::us-east-1",
    :options => data[:options] || {},
    :uuid => SecureRandom.uuid
  }

  if api_requires?("syslog_drain")
    payload[:log_drain_token] = SecureRandom.hex
  end
  payload
end
credentials() click to toggle source
# File lib/heroku/kensa/check.rb, line 275
def credentials
  [ data['id'], data['api']['password'] ]
end
heroku_id() click to toggle source
# File lib/heroku/kensa/check.rb, line 271
def heroku_id
  "app#{rand(10000)}@kensa.heroku.com"
end