Repository navigation
rest: API for pending devices and folders. - #498
Conversation
Basically mirror the information that currently lives within the GET /rest/system/config endpoint, using two new endpoints under /rest/system. Note that for pendingFolders, the structure is inverted: In the config, they live underneath the "devices" tree, here the offering devices are listed underneath the pendingFolders entry with the same information. Include some example content (totally made up for now as there is no implementation yet).
|
As discussed in syncthing/syncthing#5758, this is a first step and RFC to agree on the API. |
|
Looks sensible to me, except that wrapping the entire thing into a dict with a single key named after the endpoint feels redundant, I'd just return the contents. |
|
That was inspired by looking at some other endpoint responses. It makes it easier to add other / meta information at a later time, for example a "totals" section like in However, I'm open to changing it in the name of the KISS principle, sacrificing hypothetical extensibility. If that is the preferred consensus... |
|
Connections is a bad example. Dics should not be used for anything else than a single object. We probably also want endpoints to mutate these. |
|
@AudriusButkevicius Good idea actually. Noted on my to-do list, but I'll focus on the database stuff first. In a first step, adding them to the config like the GUI currently will still work and not require any changes that would be moot after moving to a separate endpoint. Do you have a concrete idea what these mutating requests should look like? |
Return the array of objects directly without wrapping in another object.
|
For the In my opinion the |
|
See also #499 for the next evolutionary step concerning suggested candidate devices. |
The |
|
Yes, and some old crufty file exploration endpoints. |
Mirror the current draft implementation. Add a new subsection in the Development TOC, with a very short description. Add FIXME about the version when these endpoints were added, TBD.
Avoid camelCase.
Applies to pendingdevices (by device ID), pendingfolders (by folder ID) and therein to the offeredBy enumeration (by device ID).
|
As suggested by @calmh here, the entries are now returned as object attributes with the device / folder ID as key. The offering devices for a pending folder are still contained in a lone Kindly requesting feedback before implementing the change in the actual code PR. |
Based on what the current draft implementation actually responds.
|
🤖 beep boop I'm going to close this pull request as it has been idle for more than 90 days. This is not a rejection, merely a removal from the list of active pull requests that is periodically reviewed by humans. The pull request can be reopened when there is new activity, and merged once any remaining issues are resolved. |
When the device parameter is given, unrelated pending folders are ommitted completely. For the ones involving the given device, possible other offering devices are ommitted as well, so mention that explicitly.
imsodin
left a comment
There was a problem hiding this comment.
Thanks for also taking care of the docs!
| Cluster Endpoints | ||
| ----------------- | ||
|
|
||
| Concerns the mesh network structure. |
There was a problem hiding this comment.
Does "mesh" add anything to "network structure"? Seems redundant to me. And all the other subtopics don't have an explanation, maybe remove this entirely making this entire section just a plain, compact listing of endpoints.
There was a problem hiding this comment.
I think an explanation for each group would be magnificent, but we can remove this one if it stands out. Do you think the other groups could be explained in a similar manner?
There was a problem hiding this comment.
I think all the other endpoints are more or less self-explanatory. At least adding something like "Query information from database" wouldn't add much to "Database Endpoints". "Cluster Endpoints" is a bit special in that respect, as I don't think it's immediately obvious what is meant by "Cluster". So lets keep the explanation.
There was a problem hiding this comment.
In that case, I find the "mesh network" appropriate. It's a separate class of networks and an established technical term AFAIK.
| instead. Also note that the ``pendingFolders`` and ``pendingDevices`` | ||
| fields have been removed as of v1.FIXME. |
There was a problem hiding this comment.
I wouldn't start documenting individual changes to the config. We didn't do that until now and I don't see us (consequently) doing it in the future. Having just a few mentioned might confuse and/or create wrong assumptions that it is documented. And having them in the config is not an error.
I just wanted to say that there should however be a deprecation note in users/config.rst, however the pending elements were never documented there.
There was a problem hiding this comment.
So what do we do about the examples? Just remove the corresponding lines?
Is there an easy way to browse older versions of the deployed documentation? Like we know it from readthedocs for example.
There was a problem hiding this comment.
I'd just remove them.
Good question. I remember discussing that, probably when talking about alternative ways to organize/edit documentation. I don't think there's any way to select past version currently.
There was a problem hiding this comment.
There are the previews for every checked commit in a PR, but they vanish after some time. Maybe the same mechanism could be used to deploy to a permanent location for each tag?
There was a problem hiding this comment.
I'd just remove them.
Done.
This reverts commit 637ef88.
|
Is this okay to merge, now that the implementation landed in |
* main: (21 commits) Remove dead Badger experiment users/config: Describe QUIC address config (#618) Mention QUIC related port (#617) dev/release-creation: Adjust to changes to grt tool dev/building: Update go version to 1.16 (#614) dev/building: Add Windows and Android prerequisite information (#615) Update versioning.rst (#613) users/config: Add a warning to ignoreDelete (#608) users/versioning: Improve external versioning example script for Windows (#606) gui: Make terms bold in definition lists for better visibility (#609) dev/rest: Update db/browse example dev/release-creation: Create new milestone users/config: Use backslashes for Windows paths (#603) users/config: Improve modTimeWindowS explanation (#584) users/foldertypes: Button wording (#602) events: Add PendingDevicesChanged and PendingFoldersChanged (ref #592) (#597) users/config: Document decoupled database + config (fixes #571) (#600) users/stdiscosrv, users/strelaysrv: Better documentation how to obtain the binaries. (#601) advanced/folder-ignoredelete: Add a warning about using ignoreDelete (#598) rest: API for pending devices and folders. (#498) ...
Basically mirror the information that currently lives within the GET
/rest/system/config endpoint, using two new endpoints under
/rest/system.
Note that for pendingFolders, the structure is inverted: In the
config, they live underneath the "devices" tree, here the offering
devices are listed underneath the pendingFolders entry with the same
information.
Include some example content (totally made up for now
as there is no).implementation yet