Welcome to the new DOCS.vastdata.com. We've added new menus and a version selector, plus new persona and resource pages to help customers get started. Looking for a previous article? Use the docs search.

webhook create

Prev Next

This command creates a webhook.

Usage

webhook create --url URL
               [--name TEXT]
               [--method {POST|PUT|PATCH|DELETE|GET}]
               [--data JSON]
               [--headers HEADERS]
               [--enable|--disable]
               [--certificate-id ID]

Required Parameters

--url URL

The URL of the external application.

Options

--name TEXT

A name for the webhook.

--method {POST|PUT|PATCH|DELETE|GET}

The HTTP method to be used when the notification is sent to the external application.

--data JSON

The data to be sent as the webhook message to the external application, in JSON format.  For example:

​​--webhook-data '"event":"$vastdata_event_name"'​

For information about variables that can be used within the JSON data, see Variables in Webhook Data.

--headers HEADERS

Custom HTTP headers to be included into the message sent to the external application. You can add as many custom headers as necessary.

Specify HEADERS as a comma-separated list of key-value pairs (key1=value1,key2=value2) where each key is the name of the header you want to add.

--enable

Enables the webhook.

--disable

Disables the webhook.

--certificate-id ID

The ID of the certificate used to secure the connection to the external application with TLS.

The certificate must be uploaded to the VMS beforehand using the certificate add --cert-type WEBHOOK command.

Example

To create a webhook that sends a POST message to https://callhome-messages.vastdata.com:

webhook create --url https://callhome-messages.vastdata.com --name vast-messages --data {"cluster_name": "$vastdata_cluster_name", "event_name": "$vastdata_event_name", "event_type": "$vastdata_event_type", "event_origin": "$vastdata_event_origin", "severity": "$vastdata_severity", "mapped_severity": "$vastdata_mapped_severity", "object_id": "$vastdata_object_id", "object_type": "$vastdata_object_type", "object_name": "$vastdata_object_name", "property": "$vastdata_property", "timestamp": "$vastdata_timestamp"} --method POST --enable