Coder Social home page Coder Social logo

3scale-api-ruby's Introduction

ThreeScale::API

This gem aims to expose all 3scale APIs with a Ruby interface.

Installation

Add this line to your application's Gemfile:

gem '3scale-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install 3scale-api

Usage

require '3scale/api'
client = ThreeScale::API.new(endpoint: 'https://foo-admin.3scale.net', provider_key: 'foobar')

services = client.list_services

Get the whole list of methods available from the RDoc site.

Design

Design decisions:

  • 0 runtime dependencies
  • thread safety
  • tested

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

Testing

To run tests run rake or rspec.

There are two kinds of tests: unit (see spec/api) and integration (see spec/integration).

For running the integration tests you will need to have a real 3scale account, you can set the details of the account via environment variables. The easiest way to set everything up is it to have a .env file in the root of the project with the following environment variables (set your own values):

ENDPOINT=https://your-domain-admin.3scale.net
PROVIDER_KEY=abc123
VERIFY_SSL=true (by default true)

Note: for the tests to pass the following requirements need to be met:

  • the field billing_address should be added to the Account model in Settings > Fields Definitions

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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/3scale/3scale-api-ruby.

3scale-api-ruby's People

Contributors

andrewdavidmackenzie avatar brendenowens avatar eguzki avatar macejmic avatar mayorova avatar miguelsorianod avatar mikz avatar pimg avatar unleashed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3scale-api-ruby's Issues

The http_client is missing PUT method

The http_client doesn't have PUT method. In some cases PATCH can e used instead, but there are some calls where only PUT is accepted (for example Application Suspend call).

Release new version

There are some file modifications made them after coming out release 0.1.5 therefore it isn't able to get the last content of this repo when some is installing for instance the 3scale-toolbox.
Perform a sync of bump version maybe tagging in a new release 0.1.6 would be fixed.

Thanks

Methods for creating accounts and applications

A common use case for the support team is batch importing of user accounts and API keys (i.e. applications) and further updates.
For being able to use the client in Ruby scripts these methods for the following endpoints are required:

  • Signup Express
  • Application Create

Other endpoints necessary for further manipulation of the imported data:

  • Application List
  • Application Read
  • Application Update

show_service does not bring back the description attribute

Not sure where the issue is here (client vs 3scale server side), while create service does honor the description attribute as one can see the description in the 3scale admin page for that service, the show_service API does not bring that attribute back.

list_applications method doesn't support pagination

The current implementation of the list_applications doesn't support pagination, so it will always return just the first 500 applications according to the API.

So, I think there are two options:
a) add page and per_page as optional parameters (along with service_id)
b) implement pagination logic in the client (not sure if in the same method, or in a separate one)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.