Skip to main content
The ResourcePlugin interface is the core contract between your plugin and the formae agent. This page documents all methods, their parameters, return types, and behavioral contracts.

Interface definition


Configuration methods

RateLimit

Returns rate limiting configuration for your plugin.
Returns:
Example:

DiscoveryFilters

Returns filters to exclude resources from discovery.
Returns:
Resources matching all conditions in a filter are excluded from discovery. Example:
Return nil to discover all resources.

LabelConfig

Returns configuration for extracting human-readable labels from discovered resources.
Returns:
Example:

CRUD methods

Create

Provisions a new resource.
Request:
Result:
Contract:
  • On success: Set OperationStatus to Success, provide NativeID and ResourceProperties
  • On async: Set OperationStatus to InProgress, provide RequestID for polling
  • On failure: Set OperationStatus to Failure, provide ErrorCode and StatusMessage
  • Return Go error only for unexpected or unrecoverable errors

Read

Fetches current state of an existing resource.
Request:
Result:
Contract:
  • On success: Provide ResourceProperties with current state
  • If not found: Set ErrorCode to OperationErrorCodeNotFound
  • Never return Go error for “not found”
  • PriorProperties (optional) carries the caller’s last-known model. When set, a Read may tailor which fields it reports to match what the caller manages (for example, embedding a child collection only when the prior model declares it inline). It is empty when the caller has no prior state, such as a create/status read-back or discovery; treat empty as unknown and fall back to default behaviour. Populated by the agent from formae 0.87.1.

Update

Modifies an existing resource.
Request:
Result:
Contract:
  • Use DesiredProperties for full replacement or PatchDocument for partial update
  • On success: Provide updated ResourceProperties
  • On async: Return InProgress with RequestID

Delete

Removes a resource.
Request:
Result:
Contract:
  • Must be idempotent: deleting a non-existent resource should succeed
  • On success: Set OperationStatus to Success
  • On async: Return InProgress with RequestID

Status

Polls for completion of an async operation.
Request:
Result:
Contract:
  • Called when Create/Update/Delete returns InProgress
  • Return InProgress to continue polling
  • Return Success or Failure when complete
  • Provide NativeID and ResourceProperties on success

List

Returns all resource identifiers of a given type for discovery.
Request:
Result:
Contract:
  • Return all native IDs for resources of the given type
  • Use pagination for large result sets
  • Set NextPageToken if more pages available

ProgressResult

Common result structure for operations:

Operation

OperationStatus

OperationErrorCode


See also