Add a simulated system
const url = 'https://example.com/api/v1/nodes/example/simulation/systems';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"location":"example","name":"example","standard":"example","system_type":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/nodes/example/simulation/systems \ --header 'Content-Type: application/json' \ --data '{ "location": "example", "name": "example", "standard": "example", "system_type": "example" }'Creates a system built to a standard, with a simulated component for each staffed role in the standard’s plan (see plan-simulation-system), each at its own free address in the simulated block with its endpoint placed on the node, and assigned its role, all in one transaction: it lands whole or not at all. Component names are minted as an unnamed create mints them; roles nothing simulated fits are left short and listed. The simulator serves the components from its next pull. Gated by simulation:update, and also needs system:create, system:update, system:read, component:create, endpoint:create and node:read (and location:read when it names a place), each in the caller’s own scope; the components are created without a parent, so component:create must be all-scope. A refused piece is mapped as its own route maps it (a component refused is a 403). A node with no simulator connected is a 409, and a standard nothing simulated can staff a 422.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The node whose simulator serves the system’s components
The node whose simulator serves the system’s components
Request Body required
Section titled “Request Body required ”object
A URL to the JSON Schema for this object.
Where the system and its components sit, by name or dotted path
The system’s name; minted from its type when empty
The standard the system is built to; its roles decide the components
The system’s type, which also mints its name when none is given
Responses
Section titled “ Responses ”Created
object
A URL to the JSON Schema for this object.
object
The loopback address the simulated component answers on.
The new system’s id, the stable address a link to it uses.
The roles nothing simulated could fill, left short.
object
The choice alternate the role belongs to, choice/alternate; empty when unconditional.
How many simulated components the role gets: its quorum, at least one, capped at its capacity.
How many the role stays short when nothing simulated fits.
The simulated product chosen for the role; empty when nothing simulated fits.
Why the role is left unstaffed.
Example
{ "$schema": "/api/v1/schemas/AddSimSystemOutputBody.json"}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"}