Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign API for respondd #522

Closed
tcatm opened this issue Oct 12, 2015 · 9 comments
Closed

Redesign API for respondd #522

tcatm opened this issue Oct 12, 2015 · 9 comments
Labels
0. type: enhancement The changeset is an enhancement

Comments

@tcatm
Copy link

tcatm commented Oct 12, 2015

No description provided.

@jplitza
Copy link
Member

jplitza commented Oct 16, 2015

I suppose this is the continuation of the discussion we had in #465?

@neocturne neocturne added this to the 2015.2 milestone Oct 16, 2015
@neocturne
Copy link
Member

@jplitza, yes. We'd like to get this done before 2015.2, so we can get rid of the old API as soon as possible.

@neocturne
Copy link
Member

Suggestion: use JSON for the requests. Draft:

{
  "keys": ["nodeinfo"],
  "single": true,
  "compress": true
}
  • keys: lists the keys to get (so multiple types can be requested with a single request, as supported by the current GET API)
  • single: can be set to true if keys contains only a single key to send a reply without the key wrapper (see the current GET nodeinfo vs. nodeinfo requests to see the difference). Defaults to false. Do we even need this? The only users of the old API are the old statuspage (which won't support the new API anyways) and piping the data to alfred.
  • compress: obvious. Defaults to false?

@jplitza
Copy link
Member

jplitza commented Oct 31, 2015

I am getting the impression we are re-inventing (read-only) HTTP over UDP here.

JSON would have the advantage of being forward-compatible: We could add further flags in the future without breaking old applications. But it is also very verbose: What you posted is four times longer than "GETZ nodeinfo". As you mentioned, "single" isn't really required, so what advantage does JSON give us right now?

(also: did you abandon the idea of partitioning the answers?)

@tcatm
Copy link
Author

tcatm commented Nov 2, 2015

Well, let's start by looking at the current state. There are two types of requests:

a) GET id [id...] for requesting a bunch of records as compressed json
b) id for requesting a single record, uncompressed, raw json

These requests are used like this:

b) is used by the old status page just with the id set to "nodeinfo". We'll need to keep this around for backward compatibility a while.
b) is also used locally as a replacement for collect.lua id. This time, other ids like "statistics" and "neighbours" are also queried. This interface can be changed at any time so it shouldn't pose a problem.
a) was introduced in 2015.1 as a stable API. There may be users relying on it so we should keep it for a few releases, too.
a) is used by the new status-page. We could change that before releasing 2015.2.

If we were to introduce a new API in 2015.2, we still must support the old APIs for a while, giving us a total of three public APIs.

Therefore, I'd like to propose not changing anything in 2015.2 but to deprecate the public part of b) now and schedule its removal for 2015.2+1. A few releases later we could replace a) the same way (or transition to NetJSON rightaway).

@neocturne neocturne modified the milestones: next, 2015.2 Nov 3, 2015
@neocturne
Copy link
Member

@tcatm, one thing I forgot in my JSON draft, but deem quite important is the "partitioned query" issue. I'd like to get this sorted out as soon as possible, as I'd like to prevent people from actually starting to use respondd via mesh-wide multicast (packet storms are never a nice thing...).

Is the "neighbour name" feature on the old status page important enough to keep supporting the old API at all?

@tcatm
Copy link
Author

tcatm commented Nov 3, 2015

There is already software relying on the GET-API: https://github.com/dereulenspiegel/node-informant

I'm not sure whether the neighbour name feature is important but it shouldn't do any harm keeping support for it around for at least one release.

@neocturne
Copy link
Member

@dereulenspiegel is working on a redesigned respondd based on CoAP. I guess we can live with the current respondd API until that is done.

@neocturne neocturne changed the title Redesign API for announced Redesign API for respondd Feb 10, 2016
@neocturne neocturne modified the milestones: next, 2016.2 Feb 16, 2016
@rotanid rotanid added 0. type: enhancement The changeset is an enhancement needs work 2. status: rfc request for comments and removed 2. status: rfc request for comments labels Aug 22, 2016
@rotanid rotanid added 9. meta: known issue Known issue which should be mentioned in release notes and removed needs work labels Jun 5, 2018
@CodeFetch
Copy link
Contributor

@dereulenspiegel What's the status? Where can I find your code?

@rotanid rotanid removed the 9. meta: known issue Known issue which should be mentioned in release notes label Aug 25, 2020
@rotanid rotanid removed this from the next milestone Nov 8, 2020
@mweinelt mweinelt closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement
Projects
None yet
Development

No branches or pull requests

6 participants