Read Methods (get() and list())
To read remote resources, a connector provides two methods:
list()enumerates which resource addresses currently exist remotely.get()fetches the current state of one address and returns it as bytes plus optional outputs.
The Grafana connector's list() method does not try to be clever. It asks the API for all datasources and dashboards, then turns those results into addresses:
(Note: this guide omits talking about subpaths(), which is how a connnector can split up its list() calls so they're not so gigantic. TODO!)
get() then dispatches to resource-specific helpers:
If a resource doesn't exist, get() should not throw an error, but simply return GetResponse(exists=false).
Important behavior to preserve:
resource_definitionmust be bytes. The Grafana example usesjson.dumps(body, indent=2).encode().- Missing resources should return
GetResponse(exists=False). list()returns paths only. It should not fetch every full body unless the API gives you no better option.- Keep your read methods deterministic. If an API returns unstable ordering, sort the final address list before returning it, and likewise for fields in a struct returned by get().
Reference files:

