Planning and Executing Connector Ops
Connector.plan() is where a connector compares "current state" and "desired state" and produces a series of connector ops. Each op is returned in a PlanResponseElement, and the ordered list of ops forms the plan.
The Grafana connector uses small JSON blobs as its op format. The address tells op_exec() which remote object to mutate, so the op itself only needs to describe the action and, when relevant, the desired body.
op_exec() parses the op string and dispatches by address:
That separation is important. plan() should stay about diffing and sequencing, while op_exec() deals with API-specific mechanics. In Grafana, datasource updates need an extra read to discover the numeric datasource ID before issuing the PUT, so that lookup lives in exec_datasource() rather than in plan().
Tips for connector ops:
- Do not duplicate path data inside the op if
addralready identifies the resource. - Use readable
friendly_messagevalues soautoschematic planoutput makes sense to the user.
Reference files:

