const url = 'https://example.com/api/v0/pipeline/update';const options = { method: 'POST', headers: {'X-Tenzir-Token': '<X-Tenzir-Token>', 'Content-Type': 'application/json'}, body: '{"id":"08446737-da9b-4787-8599-97d85c48c3bb","definition":"export | where baz | publish /foo","action":"start","name":"zeek-monitoring-pipeline","labels":[{"text":"zeek","color":"3F1A24"}],"autostart":{"created":false,"completed":false,"failed":false},"autodelete":{"completed":false,"failed":false,"stopped":false},"retry_delay":"500ms","unstoppable":true}'};
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/update \ --header 'Content-Type: application/json' \ --header 'X-Tenzir-Token: <X-Tenzir-Token>' \ --data '{ "id": "08446737-da9b-4787-8599-97d85c48c3bb", "definition": "export | where baz | publish /foo", "action": "start", "name": "zeek-monitoring-pipeline", "labels": [ { "text": "zeek", "color": "3F1A24" } ], "autostart": { "created": false, "completed": false, "failed": false }, "autodelete": { "completed": false, "failed": false, "stopped": false }, "retry_delay": "500ms", "unstoppable": true }'Updates the definition, metadata, or lifecycle state of a pipeline. Tenzir leaves omitted fields unchanged.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Body for the update endpoint
object
The id of the pipeline to be updated.
Example
08446737-da9b-4787-8599-97d85c48c3bbThe updated definition of the pipeline.
Example
export | where baz | publish /fooThe action that will change the pipeline’s running state.
Example
startUpdate the human-readable name of the pipeline to this value.
Example
zeek-monitoring-pipelineThe user-provided labels for this pipeline.
object
The pipeline label text.
Example
zeekThe pipeline label color.
Example
3F1A24Flags that specify on which state to restart the pipeline.
object
Autostart the pipeline upon creation.
Example
trueAutostart the pipeline upon completion.
Example
falseAutostart the pipeline upon failure.
Example
falseFlags that specify on which state to delete the pipeline.
object
Autodelete the pipeline upon completion.
Example
falseAutodelete the pipeline upon failure.
Example
trueAutodelete the pipeline when it stops before completing.
Example
falseA 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.
Example
500msA flag specifying whether this pipeline is unstoppable. Unstoppable pipelines start automatically, fail when they complete, and can not be paused or stopped manually.
Example
trueResponses
Section titled “ Responses ”The pipeline was updated.
The updated pipeline.
object
object
The pipeline id.
The human-readable name of the pipeline.
The pipeline definition.
A flag specifying whether this pipeline is unstoppable. Unstoppable pipelines start automatically, fail when they complete, and can not be paused or stopped manually.
Whether this pipeline is hidden. Hidden pipelines are only available through the show pipelines operator.
The Unix timestamp of the pipeline creation time in nanoseconds.
The Unix timestamp of the last pipeline modification in nanoseconds.
If the pipeline has been started, the ISO 8601 timestamp of the most recent start.
The total amount of runs this pipeline has attempted so far.
The error that the pipeline may have encountered during running.
object
object
A potentially empty label.
A region in the source code, defined by byte offsets.
object
object
The user-provided labels for this pipeline.
object
The pipeline label text.
The pipeline label color.
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.
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.
If a TTL exists for this pipeline, the TTL as a duration string.
If a TTL exists for this pipeline, the remaining TTL as a duration string.
Example
{ "pipeline": { "unstoppable": true, "state": "created", "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" } ], "labels": [ { "text": "zeek", "color": "3F1A24" } ], "retry_delay": "10s", "autostart": { "created": false, "completed": false, "failed": false }, "autodelete": { "completed": false, "failed": false, "stopped": false }, "ttl": "2min", "remaining_ttl": "10s" }}Invalid arguments.
object
The error message.
Example
{ "error": "Invalid arguments"}