Start a whole system from a template
const url = 'https://example.com/api/v1/systems:createFromTemplate';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"attach":{"additionalProperty":[{"additionalProperty":"example"}]},"label":"example","location":"example","name":"example","outpost":"example","standard":"example","template":"mr55-system"}'};
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/systems:createFromTemplate \ --header 'Content-Type: application/json' \ --data '{ "attach": { "additionalProperty": [ { "additionalProperty": "example" } ] }, "label": "example", "location": "example", "name": "example", "outpost": "example", "standard": "example", "template": "mr55-system" }'Creates a system from a system template at a location, built to the standard you name or the template’s own (yours of that name when you hold one, else created from its standard template, with any parent it hangs off, in the same write), with a component for each slot filled to its quorum and assigned, and the declared values. A component whose slot you give an address in attach lands attached; the rest land unattached and are listed in to_attach. One transaction: it lands whole or not at all, every piece in your own scope with its own audit row carrying from_template. Gated by system:create, and also needs system:read, system:update, component:create and component:update; endpoint:create when anything attaches, standard:create when a standard is created from its template. A location outside your location scope is a 404, an unknown template or standard a 404, a standard the template cannot staff a 422 naming the slots.
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
A URL to the JSON Schema for this object.
Driver inputs per slot, one object per component of the slot in order; an object with an address (host) attaches that component, the rest land unattached
object
object
The system’s label
The location the system and its components sit in, by name or dotted path
The system’s name; minted from its type when empty
The outpost the endpoints are placed on; needed when any component attaches
A standard of your own to build to, by name; omitted takes the template’s, created from its template in the same write when you hold none of that name
The system template, by name
Responses
Section titled “ Responses ”Created
object
A URL to the JSON Schema for this object.
A component per slot, filled to quorum and assigned
object
Whether its endpoint attached from the inputs given; false lists it as still to attach
The component’s name
The component’s id, the stable address a link to it uses
Its product
The slot it fills in its system
The standard it is built to
The standards this write created from their templates (parents first); empty when you held them
The system’s name
The system’s id, the stable address a link to it uses
The template it came from; recorded in the audit detail only
The components that landed with no endpoint, still to attach
Example
{ "$schema": "/api/v1/schemas/CreateSystemFromTemplateOutputBody.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"}