Get a calc rule's live state
const url = 'https://example.com/api/v1/calc-rules/example/state?limit=100';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/v1/calc-rules/example/state?limit=100'What a calc rule last did on each owner the caller may read (components by the component read scope, systems by the system read scope), each owner named now: the value it computed, when and at which version, the inputs it found no value of, a system’s members that held none and the instances it left out as stale (named when the caller may read the component, else counted), an error, since when a system has had no members, and whether the owner is pending (with when a deferred mark is due). Ordered on the server, failing owners first, then pending, then those it wrote nothing for, then those holding a value, each by name, and at most limit of them; total and the pending depth count every owner the caller may read, listed or not. Gated by rule:read.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The rule’s name (its uuid is accepted too)
The rule’s name (its uuid is accepted too)
Query Parameters
Section titled “Query Parameters ”The most owners to list, in state order: failing, pending, missing an input (or with no members), valued, each by name
The most owners to list, in state order: failing, pending, missing an input (or with no members), valued, each by name
Responses
Section titled “ Responses ”OK
object
A URL to the JSON Schema for this object.
The rule’s state on the owners the caller may read, at most limit of them: failing first, then pending, then those it wrote nothing for (an input missing, a system with no members), then those holding a value, each by name
object
When the rule last computed on the owner; absent when it has not yet
When a deferred mark (a failed computation backing off) is due
Why the rule could not compute (a run-time failure, a reduce that no longer compiles, a database fault it is backing off from)
The input keys no value was found for (nothing was written)
A system with no role-bound members since then: the rule writes nothing and its last value stands, unsupported
The owner, by name, resolved now
The owner’s uuid
What the owner is
The owner is marked for the next tick
The rule version that computed it
A system rule’s members that held no value of an input, those the caller may read
object
The member component, by name
The member component’s uuid
The input key the member held no value of
How many more skipped members the caller may not read (counted, never named)
The instances an input’s list left out as stale, on components the caller may read
object
The component the instance is on, by name
The component’s uuid
The instance left out as stale
The input key
How many more stale instances are on components the caller may not read
The value the rule last computed on the owner; absent when it could not compute
How many of those owners are pending, listed or not (only owners the caller may read are counted)
How many owners the caller may read the rule has state or a mark on, listed or not
Example
{ "$schema": "/api/v1/schemas/CalcRuleStateOutputBody.json", "owners": [ { "owner_kind": "component" } ]}default
Section titled “default ”Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}