API additions and updates; minor tidies #291

Merged
merged 18 commits into from Sep 28, 2014

Projects

None yet

2 participants

@paulgear
Member

Updates to API:

  • Add API entry point to get an individual device: /devices/:hostname
  • Use existing functions for getting device id from name and getting device record from id
  • Provide more accurate HTTP status codes for several operations
  • Return the device information when a device is deleted
  • Increase API token length to allow for future hash algorithms
  • Documentation and footer tidying
  • Don't ignore plugins directory
@paulgear paulgear closed this Sep 27, 2014
@paulgear paulgear reopened this Sep 27, 2014
@paulgear paulgear changed the title from Make API docs match current state of API to API additions and updates; minor tidies Sep 27, 2014
@laf
Member
laf commented Sep 27, 2014

All looks good here.

Two comments though.

  1. You've removed html/plugins from gitignore, won't that mean that if anyone creates a plugin and installs it then a git status will show new files.
  2. I can see you've enabled it so that people can pass a hostname or id for functions. I'd thought about that and the only reason I didn't was just in case people had hostnames which were only digits (/etc/hosts/ most likely). I'd be happy to keep it like you've done it as it makes the api simple.
@paulgear
Member

You can't have an all numeric hostname. If you try to use one, it treats it as an integer IP address. Try it: add an /etc/hosts entry for something elsewhere with the hostname 2130706433, then ping it. :-)

@laf
Member
laf commented Sep 27, 2014

Never knew that :)

What about the plugin folder being removed from gitignore?

I also need to add urldecode to the ifname variable and update the docs to say the ifname needs to be urlencoded otherwise interface names with / in them cause issue with route parsing.

@paulgear
Member

I'm keen for many of the plugins to become part of the core distribution. Because they can be enabled/disabled at runtime, the only reason not to have them there is if they need to be private for some reason. Perhaps we should provide another git ignored directory which can also be searched for plugins?

@laf
Member
laf commented Sep 27, 2014

I'd have to check back through the code. It's probably do-able although could we not just add Plugins to be ignored but a sub dir of that directory be included. Never tried that in git before?

@paulgear
Member

That's what we had before; I'll put it back that way for now. Then when we have an official plugin that we want to be included (hopefully I'll have a couple of new ones ready soon), we can add it to the non-ignored list.

@paulgear paulgear merged commit 0852cb3 into librenms:master Sep 28, 2014

1 check passed

ci/scrutinizer Scrutinizer: 4 new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment