Web API

DataAPI.describe — Function
describe(io::IO, x)

For an object x, print descriptive statistics to io.

This generic function is owned by StatsBase.jl, which is the sole provider of the default definition.

source
Cropbox.serve — Function
serve(S::Type{<:System}; host="127.0.0.1", port=8000, config=(), options=(), request_defaults=APIDict(), ui=APIDict(), dashboard=:static, async=false)

Expose existing Cropbox operations for a system through HTTP routes. Metadata routes publish the model description from describe and reusable request schemas. Operation routes parse JSON payloads and dispatch them to Cropbox workflows including simulate, visualize, evaluate, and calibrate.

request_defaults may contain trusted server-side operation defaults that are merged before a JSON request. This supports existing-model presets such as a Julia snap function without serializing executable code to the client. Configuration entries are merged by path so a client entry replaces the corresponding default while other default entries remain.

Routes:

  • GET /api/model
  • GET /api/schema
  • GET /api/openapi
  • GET /api/docs
  • POST /api/simulate
  • POST /api/visualize
  • POST /api/evaluate
  • POST /api/calibrate
  • GET /api/dashboard
  • GET /
  • GET /dashboard

The default call blocks while serving. Set async=true to return the HTTP server object without blocking the calling task. The service has no built-in authentication or transport encryption; bind to loopback unless it is placed behind an appropriate production gateway.

source
Cropbox.dashboard — Function
dashboard(S::Type{<:System}; frontend=:static, kwargs...)

Start the same service as serve, selecting the browser frontend with frontend. The generated client reads the canonical /api/dashboard metadata route and calls the same operation routes as non-browser clients.

Use frontend=:static for the bundled client or frontend=:none to expose only the programming API. A package can subtype Cropbox.DashboardFrontend and implement Cropbox.dashboard_route_response without changing the route contract.

source