/dashing_api

API for interaction with dashing

Primary LanguageRubyMIT LicenseMIT

Dashing API

Test it locally

Install bundler if you don't already have it (gem install bundler), then run bundle install to pull in dependencies. Then you can:

Build a gem:

bundle exec rake build

Install:

bundle exec rake install

Run unit tests:

bundle exec rake test

Installation

Add this line to your application's Gemfile:

gem 'dashing_api'

And then execute:

bundle

Or install it yourself as:

gem install dashing_api

API endpoints

List the existing widgets:

curl http://$DASHING_HOST/widgets/

List the existing dashboards:

curl http://$DASHING_HOST/dashboards/

Check if a dashboard exists:

curl http://$DASHING_HOST/dashboards/:id

Get the current status of a tile:

curl -i -H "Accept: application/json" http://$DASHING_HOST/tiles/:id.json

Check if a job script exist for data-id:

curl -i http://$DASHING_HOST/jobs/:id

Check if a tile exists on a dashboard:

curl -i http://$DASHING_HOST/tiles/:dashboard/:hosts

Delete a dashboard:

curl -X DELETE -H "Content-type: application/json" -d '{"auth_token": "$DASHING_AUTH_TOKEN"}' http://$DASHING_HOST/dashboards/:dashboard

Rename a dashboard:

curl -i -H 'Accept: application/json' -X PUT -d '{"auth_token": "$DASHING_AUTH_TOKEN", "from": "", "to": ""}' http://$DASHING_HOST/dashboards/

Replace a tile on a dashboard:

curl -i -H 'Accept: application/json' -X PUT -d '{"auth_token": "$DASHING_AUTH_TOKEN", "dashboard": "", "from": "", "to": ""}' http://$DASHING_HOST/tiles/

Create a dashboard

curl -i -H 'Accept: application/json' -X POST -d '{"auth_token": "$DASHING_AUTH_TOKEN", "tiles": {"hosts": [" "," "], "titles": [" ", " "], "widgets": [" ", " "], "urls": [" ", " "]}}' http://$DASHING_HOST/dashboards/:dashboard

Delete a tile/ tiles from a dashboard:

curl -i -H 'Accept: application/json' -X DELETE -d '{"auth_token": "$DASHING_AUTH_TOKEN", "tiles": [" ", " "]}' http://$DASHING_HOST/tiles/:dashboard

Add a tile/tiles to a dashboard

curl -i -H 'Accept: application/json' -X PUT -d '{"auth_token": "$DASHING_AUTH_TOKEN", "tiles": {"hosts": [" "," "], "titles": [" ", " "], "widgets": [" ", " "], "urls": [" ", " "]}}' http://$DASHING_HOST/tiles/:dashboard

Ping hosts and add to/ remove tiles from a dashboard

curl -i -H 'Accept: application/json' -X PUT -d '{"auth_token": "$DASHING_AUTH_TOKEN", "tiles": {"hosts": [" "," "], "titles": [" ", " "], "widgets": [" ", " "], "urls": [" ", " "]}}' http://$DASHING_HOST/ping/:dashboard

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT License