const url = 'https://example.com/api/v0/pipeline/create';const options = { method: 'POST', headers: {'X-Tenzir-Token': '<X-Tenzir-Token>', 'Content-Type': 'application/json'}, body: '{"definition":"export | where foo | publish /bar","name":"zeek-monitoring-pipeline","hidden":false}'};
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/v0/pipeline/create \ --header 'Content-Type: application/json' \ --header 'X-Tenzir-Token: <X-Tenzir-Token>' \ --data '{ "definition": "export | where foo | publish /bar", "name": "zeek-monitoring-pipeline", "hidden": false }'Creates a pipeline.
If autostart.created is true, Tenzir sends the response after the
pipeline starts successfully. If startup fails, Tenzir discards the
pipeline and returns the observed diagnostics.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Pipeline creation request.
object
The pipeline ID. If omitted, Tenzir generates a random ID.
The pipeline definition.
The human-readable name of the pipeline.
Whether this pipeline is hidden. Hidden pipelines start automatically,
are not persisted, and are omitted from the /pipeline/list response.
A duration string specifying the maximum time for this pipeline to
exist. No value means the pipeline is allowed to exist forever.
This parameter must be defined if the hidden parameter is true.
Flags that specify on which state to restart the pipeline.
object
Autostart the pipeline upon creation.
Autostart the pipeline upon completion.
Autostart the pipeline upon failure.
Flags that specify on which state to delete the pipeline.
object
Autodelete the pipeline upon completion.
Autodelete the pipeline upon failure.
Autodelete the pipeline when it stops before completing.
A duration string specifying the minimum time between automatic restarts of a pipeline when an error occurs. Takes no effect if restarting on failure is disabled.
Whether this pipeline is unstoppable. Unstoppable pipelines start automatically, fail when they complete, and can’t be paused or stopped manually.
Example
{ "definition": "export | where foo | publish /bar", "name": "zeek-monitoring-pipeline", "hidden": false}Responses
Section titled “ Responses ”The pipeline was created.
object
The id of the successfully created pipeline.
Example
{ "id": "4c7f2b11-6169-4d1b-89b4-4fc0a68b3d4a"}Invalid arguments or invalid pipeline.
object
The error message.
object
object
A potentially empty label.
A region in the source code, defined by byte offsets.
object
object
Example
{ "error": "Invalid arguments", "diagnostics": [ { "severity": "error", "message": "unknown option `--frobnify`", "annotation": [ { "text": "this option does not exist", "source": { "begin": 42, "end": 48 } } ], "notes": [ { "kind": "note", "message": "file <path> [-f|--follow] [-m|--mmap] [-t|--timeout <duration>]" } ], "rendered": "\u001b[1m\u001b[31merror\u001b[39m: unknown option `--frobnify`\u001b[0m\n" } ]}