Skip to content
A ruby wrapper for the Scalingo API
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Bump v2.0.1 Dec 11, 2019
test
.gitignore
CHANGELOG.md
Gemfile
Gemfile.lock
LICENSE.txt
README.md Bump v2.0.0 - Compatibility with multi-region and new API tokens Dec 5, 2019
Rakefile base for testing May 23, 2015
scalingo-ruby-api.gemspec

README.md

Scalingo-ruby-api

A ruby wrapper for the Scalingo API

Installation

gem 'scalingo-ruby-api', '~> 2'

And then execute:

bundle

Or install it yourself as:

gem install scalingo-ruby-api

Usage

Global configuration

require 'scalingo'

Scalingo.token = 'tk-your-token'
Scalingo.region = 'osc-fr1'

# Or

Scalingo.configure do |config|
  config.token = 'tk-your-token'
  config.region = 'osc-fr1'
end

client = Scalingo::Client.new

Client configuration

client = Scalingo::Client.new(region: 'osc-fr1', token: 'tk-your-token')

# Or both can be combined

Scalingo.token = 'tk-your-token'

client_region1 = Scalingo::Client.new(region: 'osc-fr1')
client_region2 = Scalingo::Client.new(region: 'agora-fr1')

Examples

# Get all apps
apps = client.apps.all

# Get logs of one app
app = client.apps.find('my-app')
puts app.logs.dump

Notes

Client contains a cache with the regions endpoints and the current valid bearer token used for authentication.

If a lot of calls are done and to avoid making useless requests and slowing down your queries, it is encouraged to re-use your client.

Hacking

Using another authentication endpoint for hacking is possible through

client = Scalingo::Client.new(auth_endpoint: 'http://172.17.0.1:1234/v1', region: 'local')
apps = client.apps.all

Special Thanks

To aki017 who made slack-ruby-gem.

It was used as an inspirational source for this project.

Thanks Aethelflaed for the original implementation of this gem

You can’t perform that action at this time.