Giter Site home page Giter Site logo

aptible-api-ruby's Introduction

Aptible::Api

Gem Version Build Status Dependency Status

Ruby client for api.aptible.com. Aptible's API server is built on top of HAL+JSON, and so this client is just a thin layer on top of the HyperResource gem.

Installation

Add the following lines to your application's Gemfile.

gem 'aptible-api'

And then run bundle install.

Usage

First, get a token:

token = Aptible::Auth::Token.create(email: '[email protected]', password: 'password')

From here, you can interact with the API however you wish:

accounts = Aptible::Api::Account.all(token: token)
account = accounts.first
account.handle
# => 'aptible'
account.apps.first.handle
# => "foodle"
newapp = account.create_app(handle: 'bardle')
newapp.href
# => "http://localhost:4001/apps/7"

Configuration

Parameter Description Default
root_url Root URL of the API server ENV['APTIBLE_API_ROOT_URL'] or https://api.aptible.com

To point the client at a different API server (e.g., during development), add the following to your application's initializers (or set the APTIBLE_API_ROOT_URL environment variable):

Aptible::Api.configure do |config|
  config.root_url = 'http://some.other.url'
end

Contributing

  1. Fork the project.
  2. Commit your changes, with specs.
  3. Ensure that your code passes specs (rake spec) and meets Aptible's Ruby style guide (rake rubocop).
  4. Create a new pull request on GitHub.

Copyright and License

MIT License, see LICENSE for details.

Copyright (c) 2019 Aptible and contributors.

aptible-api-ruby's People

Contributors

aaw avatar aguilinger avatar almathew avatar blakepettersson avatar evan-007 avatar joshraker avatar krallin avatar madhuravius avatar mattwiese-aptible avatar mdelaossa avatar michaelwang13 avatar neurosnap avatar nicolasleger avatar robertfairhead avatar skylar-anderson avatar steve-mcclellan avatar usernotfound avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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

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.