Part of Stem. This page defines the GetPolicy method of the sync RPC specification. It is how a client renders the inspectable list of what this peer follows, pins, fetches on demand or ignores.
The formal schema is attached as the schemaDefinition of this page: a struct {key, input, output} with key pinned to GetPolicy.
Returns the sync policy in force on this daemon.
Input
field | type | required | meaning |
|---|---|---|---|
| no | The account whose policy to read. Omitted means every local account, merged. |
Output
The output is kinds/policy/value.
Rules
With account set, returns the latest Snapshot value of that account's policy resource as held by this daemon.
Without account, returns the merge of every local account's policy: the union of rules. When two accounts' rules name the same scope, ignore wins over every other mode, then pin over follow, then follow over on-demand. The merge is what the scheduler actually runs.
The default rules written at account creation are part of the value and appear here like any other rule.
Today (HM24)
HM24's Subscriptions.ListSubscriptions lists (account, path, recursive, since) rows that exist only on one device. The policy is a resource, so every device of the account holds the same list.
Example
{"key": "GetPolicy", "input": {"account": {"/": {"bytes": "7QEAq1…"}}}}{"rules": [
{"scope": {"space": {"/": {"bytes": "7QEAq1…"}}, "depth": "subtree"}, "mode": "pin"},
{"scope": {"space": {"/": {"bytes": "7QEBz9…"}}, "depth": "subtree"}, "mode": "follow", "interval": 300},
{"scope": {"space": {"/": {"bytes": "7QEBz9…"}}, "node": "bafyrein6a6wfhym6l3vfz5zfkkibj5j6wjibagi3mnbqnspuq2idw52ijb", "depth": "subtree"}, "mode": "ignore"}
]}See also
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime