This gem aims to expose most of the 3scale APIs with a Ruby interface.
Add this line to your application's Gemfile:
gem 'ThreeScaleRest', git: 'https://github.com/pestanko/3scale-api'And then execute:
$ bundle
Or install it yourself as:
$ gem install ThreeScaleRest
# Initialization
require 'three_scale_api'
client = ThreeScaleApi::Client.new(endpoint: 'https://foo-admin.3scale.net', provider_key: 'foobar', log_level: 'debug')
# Services
services = client.services.list
service = client.services['my_service']
hits = service.metrics['Hits']
# Accounts
org_account = client.accounts.create({ org_name: 'my_org', username: 'john' })
john = org_account.users['john']
john['email'] = 'john@example.com'
john['name'] = 'John Snow'
john.update
john.deleteDesign decisions:
- 0 runtime dependencies
- thread safety
- tested
To install this gem onto your local machine, run bundle exec rake install.
To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
You need to have set these ENV variables:
ENDPOINT= # Url to admin pages
PROVIDER_KEY= # Provider key
THREESCALE_LOG= # Logging level (debug, warn, error, info)
Bug reports and pull requests are welcome on GitHub.