All Projects → Tendrl → api

Tendrl / api

Licence: LGPL-2.1 license
Tendrl API

Programming Languages

ruby
36898 projects - #4 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to api

Draftsman
Ruby gem that lets you create draft versions of your database records.
Stars: ✭ 159 (+893.75%)
Mutual labels:  sinatra
jpl-space-calendar
An app for parsing and publishing the JPL Space Calendar in JSON and ICalendar formats.
Stars: ✭ 13 (-18.75%)
Mutual labels:  sinatra
example-ruby-sinatra
A simple Ruby app for Deis, the open source PaaS
Stars: ✭ 18 (+12.5%)
Mutual labels:  sinatra
Sham rack
run Rack applications in-process, without a server
Stars: ✭ 169 (+956.25%)
Mutual labels:  sinatra
minietcd
☁️ Super small and "dumb" read-only client in Go for coreos/etcd (v2).
Stars: ✭ 12 (-25%)
Mutual labels:  etcd
sshproxy
Proxy SSH connections on a gateway
Stars: ✭ 75 (+368.75%)
Mutual labels:  etcd
Timber Ruby
🌲 Great Ruby logging made easy.
Stars: ✭ 154 (+862.5%)
Mutual labels:  sinatra
sickbay
Get the HTTP status of a bunch of URLs in a single JSON response. Ideal for monitoring a lot of services at once.
Stars: ✭ 19 (+18.75%)
Mutual labels:  sinatra
fp-sin
Simple Sinatra shell with all the goodies.
Stars: ✭ 13 (-18.75%)
Mutual labels:  sinatra
cetcd
Cetcd is a C client library for etcd with full features support
Stars: ✭ 66 (+312.5%)
Mutual labels:  etcd
Bugsnag Ruby
Bugsnag error monitoring & reporting software for rails, sinatra, rack and ruby
Stars: ✭ 211 (+1218.75%)
Mutual labels:  sinatra
Rack Reducer
Declaratively filter data via URL params, in any Rack app, with any ORM.
Stars: ✭ 241 (+1406.25%)
Mutual labels:  sinatra
webvalve
Betterment's framework for locally developing and testing service-oriented apps in isolation with WebMock and Sinatra-based fakes
Stars: ✭ 111 (+593.75%)
Mutual labels:  sinatra
Busker
An extremely simple web framework.
Stars: ✭ 161 (+906.25%)
Mutual labels:  sinatra
etcdircd
An ircd backed by etcd
Stars: ✭ 76 (+375%)
Mutual labels:  etcd
Metaflop Www
A free and open source (FOSS) web application for modulating your own METAFONTs
Stars: ✭ 156 (+875%)
Mutual labels:  sinatra
perseus
Perseus is a set of scripts (docker+javascript) to investigate a distributed database's responsiveness when one of its three nodes is isolated from the peers
Stars: ✭ 49 (+206.25%)
Mutual labels:  etcd
rubynepal.github.io
Official website of Ruby Nepal
Stars: ✭ 21 (+31.25%)
Mutual labels:  sinatra
sinatra-bootstrap
My opinionated Sinatra base application
Stars: ✭ 14 (-12.5%)
Mutual labels:  sinatra
0pdd
Puzzle Driven Development (PDD) Chatbot Assistant for Your GitHub Repositories
Stars: ✭ 108 (+575%)
Mutual labels:  sinatra

Tendrl API

Build Status

  • Unit tests: Build Status

  • Functional tests: Build Status

Installation from Source on CentOS 7

Note
All the commands are run as a regular user that has sudo privileges. The commands are all assumed to be run from a single directory, which by default could be the user’s home directory. If different, the required current directory is indicated in [] before the shell prompt $.

Deployment Requirements

Ensure that etcd is running on a node in the network and is reachable from the node you’re about to install tendrl-api on. Note it’s address and port. In most development setups, both etcd and tendrl-api would reside on the same host.

System Setup

  1. Install the build toolchain.

    $ sudo yum groupinstall 'Development Tools'
  2. Install Ruby 2.0.0p598.

    $ sudo yum install ruby ruby-devel rubygem-bundler

Install tendrl-api

  1. Clone tendrl-api.

    $ git clone https://github.com/Tendrl/tendrl-api.git
  2. Install the gem dependencies, either..

    $ cd tendrl-api
    1. everything,

      [tendrl-api] $ bundle install --path vendor/bundle --binstubs vendor/bin
    2. OR development setup only,

      [tendrl-api] $ bundle install --path vendor/bundle --binstubs vendor/bin \
                     --without production
    3. OR production setup only.

      [tendrl-api] $ bundle install --path vendor/bundle --binstubs vendor/bin \
                     --without development test documentation
Note
Using binstubs allows any of the executables to be executed directly from vendor/bin, instead of via bundle exec.

Configuration

To configure the etcd connection information, copy the sample configuration file to the appropriate location and make the necessary changes based on your etcd configuration, as discussed in the Deployment Requirements section.

[tendrl-api] $ cp config/etcd.sample.yml config/etcd.yml

Development Environment

Note
All the commands below are assumed to be run from inside the git checkout directory.
  1. Tendrl Definitions:

    The API needs the proper Tendrl definitions yaml file to generate the attributes and actions. You can either download it or use the one from the fixtures to explore the API.

    [tendrl-api] $ cp spec/fixtures/sds/tendrl_definitions_gluster-3.8.3.yaml \
                   config/sds/tendrl_definitions_gluster-3.8.3.yaml
  2. Seed the etcd instance (optional):

    The script will seed the etcd instance with mock cluster data and print a cluster uuid which can be used to make API requests.

    [tendrl-api] $ vendor/bin/rake etcd:seed # Seed the local store with cluster
  3. Start the development server:

    This server will reload itself when any of the source files are updated.

    [tendrl-api] $ vendor/bin/shotgun
    Note
    This makes the development server to be queryable on localhost:9393 by default. Check vendor/bin/shotgun --help to change the ip:port binding.

Test Environment

The test environment does not need the local etcd instance to run the tests.

[tendrl-api] $ vendor/bin/rspec

Running on Port 80

Binding to port 80 requires root permissions. However, tendrl-api runs as a normal user. In order to make the application available on port 80, apache needs to be installed and configured.

  1. Install apache

    $ sudo yum install httpd
  2. Copy over the sample configuration file and validate it’s syntax.

    Important
    Update the file for your specific host details. The file is commented to point out the suggested changes. The file is configured to connect to the tendrl-api application server on port 9292.
    Important
    Running behind apache makes the API available at http://<hostname>:80/api/. Client applications' (including tendrl frontend’s) configuration needs to be updated to make all API queries behind this endpoint.
    [tendrl-api] $ sudo cp config/apache.vhost.sample \
                   /etc/httpd/conf.d/tendrl.conf
    $ sudo apachectl configtest
  3. Update the SELinux configuration to allow apache to make connections.

    $ sudo setsebool -P httpd_can_network_connect 1
  4. Run the application via the production server puma, daemonised, listening on port 9292.

    [tendrl-api] $ vendor/bin/puma -e development -d
    Note
    It is possible to run both the development and the production servers at the same time, with the production server behind apache. While the production server puma runs, by default, on port 9292; the development server shotgun listens on port 9393.
  5. Start apache.

    $ sudo systemctl start httpd.service
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].