neodesk integrations
Als Markdown kopierenWebhooks und Benachrichtigungskanäle: wohin Ereignisse gehen, das Zustellprotokoll.
Die Befehle stehen hier auf Englisch, so wie die Kommandozeile sie mit neodesk integrations --help zeigt. Die Flags, die jeder Befehl kennt, stehen in der Befehlsreferenz.
List the notification channels by name, for picking them in an alert rule or a workflow step.
neodesk integrations channels [flags]Needs server.config or org.manage_devices; only reads. Calls GET /api/integrations/channels.
Add a webhook or notification channel. A webhook without a secret gets one, shown only in this answer.
Give the request body with -f key=value (text), -F key=json (numbers, true or false, lists) or --data JSON (or --data @file.json). The answer to a wrong body names what is missing. Fields: kind, name, url, events (list), scope_type (organization or device_group), scope_id, headers (object), secret, settings (object), secrets (object), enabled. Notification channels have a kind of their own and no url: slack, teams and discord take secrets.webhook_url; ntfy takes settings.topic and optionally settings.server (https://ntfy.sh without), settings.priority (1 to 5) and secrets.token; gotify takes settings.server, secrets.token and optionally settings.priority (0 to 10); pushover takes secrets.user_key, secrets.app_token and optionally settings.priority (-2 to 1). Every channel can set settings.language (a console language) and settings.time_zone (such as Europe/Berlin) for its messages.
neodesk integrations create [flags]Needs server.config; changes something: needs a token with read and write access. Calls POST /api/integrations/targets.
neodesk integrations create -f kind=webhook -f name=Ops -f url=https://hooks.example.com/neodesk -F 'events=["alert.raised","device.offline"]'
neodesk integrations create -f kind=slack -f name=Ops -F 'events=["alert.raised","help_request.opened"]' -F 'secrets={"webhook_url":"https://hooks.slack.com/services/T000/B000/XXXX"}'
neodesk integrations create -f kind=teams -f name=Helpdesk -F 'events=["help_request.opened","chat.waiting"]' -F 'secrets={"webhook_url":"<webhook URL of the workflow>"}' -F 'settings={"language":"de","time_zone":"Europe/Berlin"}'
neodesk integrations create -f kind=discord -f name=Alerts -F 'events=["alert.raised"]' -F 'secrets={"webhook_url":"https://discord.com/api/webhooks/<id>/<token>"}'
neodesk integrations create -f kind=ntfy -f name=Phone -F 'events=["alert.raised"]' -F 'settings={"topic":"neodesk-alerts","priority":4}'
neodesk integrations create -f kind=gotify -f name=Gotify -F 'events=["alert.raised"]' -F 'settings={"server":"https://gotify.example.com"}' -F 'secrets={"token":"<application token>"}'
neodesk integrations create -f kind=pushover -f name=On-call -F 'events=["alert.raised"]' -F 'secrets={"user_key":"<user or group key>","app_token":"<API token>"}'
neodesk integrations create -f kind=syslog -f name=SIEM -f url=tls://siem.example.com:6514 -F 'events=["audit.entry","signin.succeeded","signin.failed","signin.locked_out"]' -F 'settings={"format":"cef"}'Delete a webhook or channel. Deliveries still waiting for it are cancelled.
neodesk integrations delete <id> [flags]| Argument | What it is |
|---|---|
<id> |
The integration's ID (see integrations list) |
Needs server.config; changes something: needs a token with read and write access; deletes or ends something for good, so it asks first unless --yes is given. Calls DELETE /api/integrations/targets/{id}.
List the newest deliveries of a webhook or channel: status, attempts, answer.
neodesk integrations deliveries <id> [flags]| Argument | What it is |
|---|---|
<id> |
The integration's ID (see integrations list) |
| Flag | What it is |
|---|---|
--limit N |
how many, at most 200 (default 50) |
Needs server.config; only reads. Calls GET /api/integrations/targets/{id}/deliveries.
Show one delivery with the event it carried.
neodesk integrations delivery <id> [flags]| Argument | What it is |
|---|---|
<id> |
The delivery's ID (see integrations deliveries) |
Needs server.config; only reads. Calls GET /api/integrations/deliveries/{id}.
List the events webhooks and channels can subscribe to.
neodesk integrations events [flags]Needs server.config; only reads. Calls GET /api/integrations/events.
List the webhooks and notification channels, with secrets masked.
neodesk integrations list [flags]| Flag | What it is |
|---|---|
--kind KIND |
only this kind, or several separated by commas (webhook, slack, ...) |
Needs server.config; only reads. Calls GET /api/integrations/targets.
Send a delivery again.
neodesk integrations redeliver <id> [flags]| Argument | What it is |
|---|---|
<id> |
The delivery's ID (see integrations deliveries) |
Needs server.config; changes something: needs a token with read and write access. Calls POST /api/integrations/deliveries/{id}/redeliver.
Give a webhook a new signing secret. The answer is the only time it is shown.
neodesk integrations rotate-secret <id> [flags]| Argument | What it is |
|---|---|
<id> |
The integration's ID (see integrations list) |
Needs server.config; changes something: needs a token with read and write access; deletes or ends something for good, so it asks first unless --yes is given. Calls POST /api/integrations/targets/{id}/secret.
List the notification channels of every alert rule that has some.
neodesk integrations rule-channels [flags]Needs server.config; only reads. Calls GET /api/integrations/rule-channels.
Show the notification channels an alert rule's alerts go to.
neodesk integrations rule-channels-get <ruleId> [flags]| Argument | What it is |
|---|---|
<ruleId> |
The alert rule's ID (see automation rules) |
Needs server.config; only reads. Calls GET /api/integrations/rule-channels/{ruleId}.
Set the notification channels an alert rule's alerts go to. An empty list removes them.
Give the request body with -f key=value (text), -F key=json (numbers, true or false, lists) or --data JSON (or --data @file.json). The answer to a wrong body names what is missing. The channels' IDs come from integrations channels. An alert of the rule goes to these channels and to every channel that subscribes to alert.raised, once each. Mail addresses are the rule's own field: automation rule-update <id> -f notify_emails=ops@example.com,oncall@example.com.
neodesk integrations rule-channels-set <ruleId> [flags]| Argument | What it is |
|---|---|
<ruleId> |
The alert rule's ID (see automation rules) |
Needs server.config; changes something: needs a token with read and write access. Calls PUT /api/integrations/rule-channels/{ruleId}.
neodesk integrations rule-channels-set 4 -F 'channels=["<channel id>","<channel id>"]'Show one webhook or channel, with secrets masked.
neodesk integrations show <id> [flags]| Argument | What it is |
|---|---|
<id> |
The integration's ID (see integrations list) |
Needs server.config; only reads. Calls GET /api/integrations/targets/{id}.
Send a test event to a webhook or channel now and show the answer.
neodesk integrations test <id> [flags]| Argument | What it is |
|---|---|
<id> |
The integration's ID (see integrations list) |
Needs server.config; changes something: needs a token with read and write access. Calls POST /api/integrations/targets/{id}/test.
Change a webhook or channel. Give the fields to change; a secret sent as ******** stays as it is.
Give the request body with -f key=value (text), -F key=json (numbers, true or false, lists) or --data JSON (or --data @file.json). The answer to a wrong body names what is missing.
neodesk integrations update <id> [flags]| Argument | What it is |
|---|---|
<id> |
The integration's ID (see integrations list) |
Needs server.config; changes something: needs a token with read and write access. Calls PATCH /api/integrations/targets/{id}.
neodesk integrations update <id> -F enabled=false