rest: Draft API for candidate devices.#499
Closed
acolomb wants to merge 15 commits intosyncthing:mainfrom
Closed
Conversation
Add an endpoint GET /rest/system/candidates to serve the collected information from ClusterConfig messages about devices with which we share a folder only indirectly. Needs either a folder or device ID as parameter, listing the candidate devices for the folder, or the candidate folders for an already known device.
Mirror the current draft implementation. Add a new subsection in the Development TOC, with a very short description. Add FIXME about the version when this endpoint was added, TBD.
Provide the information in two different structures, as may be needed by the API user. GET /rest/cluster/candidatedevices shows known and unknown devices which are candidates to share a locally known folder, which may be limited by giving only a specific folder ID. The top level structure enumerates device IDs and associated metadata, including the common folder IDs. The GET /rest/cluster/candidatefolders is basically an inverted view, grouping by common folder IDs on the top level. It mentions only known candidate devices and may be limited to a specific device ID. Also switch to returning objects with the device / folder ID as attribute name instead of flat arrays with the ID as a separate attribute inside.
|
🤖 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. |
Move introducing device ID to a property name within the introducedBy object, instead of a separate deviceID property within each enumerated item. Extend candidate device information for already locally known devices to also include introducing device and timestamp.
Instead of just aggregating the known common folders, include them in the introducedBy listing. This eases the decision whether to trust the suggestion, by explicitly stating who claimed that the candidate device already has each folder. Additionally, include the folder label each introducer gave to the supposedly common folder, as an additional hint about the sharing intention.
Illustrate how the same candidate device / folder combination might be described from different introducing devices.
List each introducing device per candidate device ID. Include time of introduction and the introducer's folder label. Add the extra device as listed in the candidatedevices endpoint example.
Fix syntax and sort through "jq -S".
4 tasks
Taken from updated implementation test data.
|
🤖 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add endpoints GET /rest/system/candidate{devices,folders} to serve the collected
information from ClusterConfig messages about devices with which we
share a folder only indirectly.
As discussed in syncthing/syncthing#5758 and on the forum.
So far this is only an RFC for the API endpoint design, no implementation in the main repository is available yet.