Preview a driver spec's polls through an outpost
const url = 'https://example.com/api/v1/drivers:preview';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"driver":"example","inputs":{"additionalProperty":"example"},"outpost":"edge-hq","polls":["example"],"spec":"example","timeout_seconds":1}'};
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/drivers:preview \ --header 'Content-Type: application/json' \ --data '{ "driver": "example", "inputs": { "additionalProperty": "example" }, "outpost": "edge-hq", "polls": [ "example" ], "spec": "example", "timeout_seconds": 1 }'Runs a driver spec’s polls once through the outpost named, against the target its inputs name, and answers with what each poll read: the samples its emits extracted, each emit that did not locate, and an excerpt of the raw answer, masked of every secret the preview used. Nothing is stored. The spec is a stored driver (driver) or an unsaved one (spec); an invalid spec is a 422 listing its findings, as validate-driver-spec gives them. A preview runs a poll that is its own request (http, https, an snmp get, a tcp line); a poll that rides a held session or a bound socket needs an attached endpoint (run-endpoint-poll). A secret input must be one the caller may bind (secret:bind), since the preview hands it to the target named. A preview whose transport and target name an endpoint the outpost holds runs on that endpoint’s lane, never beside its other requests and ahead of its scheduled polls; when that endpoint’s gate is closed (refused, unreachable, or disrupted by a command), or the probe reads the target’s host unreachable, it is a 409 naming the reason, and nothing is sent. An outpost that is not connected is a 503, one that does not answer in time a 504; too many runs in flight, here or on the outpost’s operator lanes, is a 429. Audited on the outpost and on each secret used. Gated by driver:preview.
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
A URL to the JSON Schema for this object.
A stored driver to preview, by name; or give spec
The inputs an attach would take (host, port, a secret by name); a secret must be one you may bind (secret:bind), since a preview hands it to the target
object
The outpost that runs the preview, by name: the one that reaches the target
The polls to run, by name; absent runs every poll
A driver spec to preview inline, unsaved; or give driver
How long the outpost may take for the whole preview (default 15, at most 30)
Responses
Section titled “ Responses ”OK
object
A URL to the JSON Schema for this object.
The stored driver previewed; absent for an inline spec
The outpost that ran it
One per poll
object
What the fetch answered, before any emit read it, bounded and masked of every secret the preview used
The answer was longer than the excerpt
Each emit that did not locate or type, or the fetch that failed
The poll that ran
What its emits extracted
object
The identity the sample’s record carried (a match key and its value), when its function declares one; the server lands it on the owner the conduit’s binding names
object
The match key, a registered property type
The value the record carried for it
The sample’s labels, its instance among them
object
Event or log for an event or a log line; absent for a metric or a property
The key the emit landed
A property’s value, or an event’s or log line’s message
When the sample was taken
A metric’s number
How long the poll took on the outpost
Always false: a preview stores no sample
Where the polls were sent
Example
{ "$schema": "/api/v1/schemas/PreviewDriverOutputBody.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"}