Read one simulation
/ sandbox/ simulations/ {simulation_id}It answers
404environment_not_sandboxagainst a live environment.Nothing is simulated there.
Return one simulation whole: what was asked, how far it has got, the chain transaction it put down and every Stridge object it produced. A helper answers before the flow has played out, and this is where a caller learns that it has.
waitblocks, so a test need not poll.wait=observedanswers once Stridge has recorded the first object;wait=completedanswers once the flow has finished. Either one also answers as soon as the simulation stops for any other reason,failedorexpired, since it will never get further. The read waits at mosttimeout_msand then answers with whatever state it reached, never with an error: a timeout is an ordinary200, and a caller that needs the state it waited for checksstate. Omitted, the read answers at once. Awaitother thanobservedorcompleted, or atimeout_msthat is not a whole number of milliseconds, answers422parameter_invalidnaming it.A simulation the environment does not hold answers
404resource_missing, identical to one that exists nowhere, and asimulation_idthat is not a UUID422parameter_invalid. A reset destroys the environment's simulations with the rest of its world, so one read after a reset answers the same. While the sandbox is still being provisioned, before it is ready for its first call, the read answers409environment_provisioning, which clears on its own, so a client retries it shortly. While a reset of the sandbox is running, the read answers409environment_resetting.
Parameters
Path
- simulation_idstring <uuid>required
The simulation, as a test helper's
201named it.
Query
- waitstringoptionalenum observed · completed
The state to wait for before answering:
observedorcompleted. Omitted, the read answers at once. - timeout_msinteger <int32>optionaldefault 10000
How long
waitmay block, in milliseconds. It defaults to10000, and a larger value than30000is capped there rather than refused. Withoutwaitit means nothing.
Headers
- X-Stridge-Environmentstring <uuid>optional
Which environment the request acts inside, on an operation a session and an API key both call. Learn more
Show full descriptionShow less
It is required under a person's session, exactly as
EnvironmentHeaderdescribes: a session request that omits it answers400withenvironment required, and one naming an environment the caller holds no membership of answers404.An API key names its own environment, so a request made with one omits this header. A key request that sends it answers
400withenvironment header not accepted, whatever it names, rather than having the header ignored: a header that is silently ignored hides the integration bug that sent it.
Responses
Resolved, in whatever state the simulation had reached.
- idstring <uuid>required
The simulation's own identifier, the one
GET /sandbox/simulations/{simulation_id}reads it back by and a chain transaction'scaused_by.run_idnames. - objectstringrequiredenum simulation
What this object is, so a payload read on its own says so.
- environment_idstring <uuid>required
The sandbox the simulation ran in.
- livemodebooleanrequiredenum false
Always
false: nothing is simulated in a live environment. It is carried for the reason every environment-scoped object carries it, so a simulation read on its own says which side of the boundary it came from. - kindstringrequired
Which helper was called, one of
SimulationKind's values. The set is open: a helper added later answers its own kind, and a client meeting a kind it does not know shows it as the server names it rather than refusing the simulation. - presetstring | nullrequired
The preset the request named, or
nullwhere it named none.
Show 9 more fieldsShow fewer fields
- requestobjectrequired
The facts and levers the helper was called with, defaults filled in. Its members are the request body of the helper
kindnames; forpayout_releaseandpayout_fail, which take no body, it is{ "payout_id": … }. - statestringrequiredenum running · observed · completed · failed · expired
Where the simulation has got to.
runningis a lever pulled and nothing observed yet;observedis Stridge having recorded the first product object the pull produced;completedis the flow having reached its terminal state.Show full descriptionShow less
The other two are the simulation's own failures rather than the flow's.
A failure the caller chose is
completed, notfailed. A deposit whose settlement was chosen to fail, or a payout chosen to fail, is a simulation that did exactly what it was asked, and it completes when the failure has played out.failedis the simulation itself unable to finish: the simulated world refused the pull, or it did not play out in time, anderrorsays which.expiredis a simulation issued at an olderreset_epochthan the environment's current one. A reset withdraws what a simulation in flight had armed, so one caught by a reset never completes; a read waiting on it across the reset is answeredexpired, and once the reset has destroyed it the simulation answers404like every other object of the emptied world. The transaction the lever put on a simulated chain, or
nullbefore one exists, and for a simulation the world refused before it put one there.- network_idstringrequired
- hashstringrequired
The transaction's hash, which the sandbox explorer shows.
Every Stridge object the flow produced so far, in the order they appeared.
- objectstringrequired
The contract's resource name:
deposit,settlement,routing,payoutortransfer. The set is open: a client meeting a name it does not know renders the id without a link. - idstringrequired
The object's own identifier, in its family's own format.
- statusstring | nullrequired
The object's own
statuswhen the simulation last saw it, ornullfor an object that has none. The object's own read is the authority; this is what the simulation observed. - event_typestring | nullrequired
The most recent webhook event recorded for the object, one of the webhook event types this reference documents, or
nullwhile none has been.
- objectstringrequired
- epochinteger <int32>required
The environment's
reset_epochwhen the simulation was created. A reset that moves the environment past it expires the simulation. - errorstring | nullrequired
Why a
failedsimulation failed,nullin every other state:world refusedwhen the simulated world would not carry the pull out,timed outwhen it did not play out in the time the world allows. A failure the caller chose is never here. - outcomestring | nullrequired
Why a
completedsimulation stopped short of a settlement,nullwhere the flow ran its course and in every state butcompleted.Show full descriptionShow less
asset not acceptedis a UDA deposit in an asset the address does not accept on the network: Stridge records the deposit and settles none of it, and the simulation completes as soon as the deposit is recorded.not settledis a UDA deposit Stridge recorded and settled nothing of for another reason, such as a sender it suppresses or a payment no route carries, once a grace has passed.not recordedis a deposit below its asset's minimum on the network, which Stridge never recorded. The set is open: a client meeting a value it does not know shows it as the server names it. - created_atstring <date-time>required
RFC3339 UTC timestamp,
Zsuffixed. When the helper was called. It is the default sort, newest first. - updated_atstring <date-time>required
RFC3339 UTC timestamp,
Zsuffixed. Whenstate,chainorcausedlast changed.
Errors
The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.
- 400environment_requiredEnvironment required
- 400header_invalidInvalid header
- 400422parameter_invalidInvalid parameter
- 400parameter_unknownUnknown parameter
- 401api_key_not_acceptedAPI key not accepted
- 401authentication_requiredAuthentication required
- 401publishable_key_not_acceptedPublishable key not accepted
- 401token_invalidInvalid or expired token
- 403membership_suspendedMembership suspended
- 404environment_not_foundEnvironment not found
- 404environment_not_sandboxNot a sandbox environment
- 404resource_missingNo such object
- 409environment_provisioningEnvironment provisioning
- 409environment_resettingEnvironment resetting
- 429rate_limitedToo many requests