RESTful API Ruby client for the Network Documentation Tool
Add this line to your application's Gemfile:
gem 'netdot-restclient'
And then execute:
$ bundle
Or install it yourself as:
$ gem install netdot-restclient
require 'netdot/restclient'
require 'pp'
netdot = Netdot::RestClient.new(
:server => 'http://localhost.localdomain/netdot',
:username => 'admin',
:password => 'xxxxx',
)
# Get all devices
devs = netdot.get('/Device');
pp devs
# Get Device id 1
dev = netdot.get('/Device/1');
# Get Device id 1 and foreign objects one level away
dev = netdot.get('/Device/1?depth=1');
# Update Device 1
dev = netdot.post('/Device/1', {community=>'public'});
# Delete Device 1
netdot.delete('/Device/1');
The Netdot user manual at:
http://netdot.uoregon.edu
- Fork it ( https://github.com/cvicente/netdot-restclient/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request