Webhook Management

Webhook Management Functions

The functions listed on this page help with managing the creation and utilization of webhooks to be used in batch jobs for inference.


Create Webhook Secret

datature batch webhooksecrets create

Creates a webhook secret from a random secure source.

Sample Output

$ datature batch webhooksecrets create

? Enter the path to the file where the generated Webhook secret key will be saved [leave blank to print to console]: 
✓ Webhook secret key generated successfully:

  FqiwLdiNX7FrTHrY/HiU3E9k+LDoX5AD7YhlB5IqLQs=

Create Webhook

datature batch webhooks create

Creates a new webhook with an endpoint URL that will receive prediction results from the batch job.

Sample Output

$ datature batch webhooks create

? Enter the name of the Webhook: my-webhook
? Enter the Webhook endpoint: https://lambda-url.ap-southeast-1.on.aws/
? Enter the maximum number of retries per request [0-5]: 3
? Enter the maximum delay between retries in milliseconds [0-60000]: 15000
? Select how you want Datature to sign Webhook requests: Generate a new Webhook secret key
? Enter the path to the file where the generated Webhook secret key will be saved [leave blank to print to console]: 
✓ Webhook secret key generated successfully:

  AQrbokk5ifTHLZzwa4HOF2sU4TJrL6oksTwvsJ6nnSw=

✓ Webhook created successfully:

ID:                  webhook_0762be28-090d-4267-b653-c07a54b63913
Name:                my-webhook
Endpoint:            https://lambda-url.ap-southeast-1.on.aws/
Max Retries:         3
Max Retry Delay:     15000

List Webhooks

datature batch webhooks list

Lists all available webhooks in the project.

Sample Output

$ datature batch webhooks list

ID                                            Name                 Endpoint            
webhook_2a38c227-148b-4e1d-bb10-3b31599d4380  my-webhook           https://lambda-ur...
webhook_ed981529-0160-4704-8794-e7702a8de470  my-aws-lambda-web... https://lambda-ur...

Get Webhook

datature batch webhooks get [WEBHOOK_ID]

Gets a webhook by ID, if no ID is provided, a dropdown list will be displayed for the user to choose the webhook.

Sample Output

$ datature batch webhooks get

? Which entry do you want to select? 
❯ my-webhook
  my-aws-lambda-webhook
  
? Which entry do you want to select? my-aws-lambda-webhook

ID:                  webhook_ed981529-0160-4704-8794-e7702a8de470
Name:                my-aws-lambda-webhook
Endpoint:            https://lambda-url.ap-southeast-1.on.aws/
Max Retries:         5
Max Retry Delay:     15000

Update Webhook

datature batch webhooks update [WEBHOOK_ID]

Updates the configuration of a webhook by ID. All fields can be updated, such as the endpoint and retry configuration, with the exception of the webhook secret. To update the webhook secret, use the datature batch webhooks update-secret command instead.

Sample Output

$ datature batch webhooks update

? Which entry do you want to select? 
❯ my-aws-lambda-webhook

? Which entry do you want to select? my-aws-lambda-webhook
? Enter the new Webhook endpoint: 
Leave blank to keep current: https://lambda-url.ap-southeast-1.on.aws/
? Enter the maximum number of retries per request [0-5]: 
? Enter the maximum delay between retries in milliseconds [0-60000]: 15000
● Non-default value for `max_retries` [default: 3] may result in increased load on the server. Note that this may affect the performance of the batch job.

✓ Webhook updated successfully.

ID:                  webhook_ed981529-0160-4704-8794-e7702a8de470
Name:                my-aws-lambda-webhook
Endpoint:            https://lambda-url.ap-southeast-1.on.aws/
Max Retries:         5
Max Retry Delay:     15000

Update Webhook Secret

datature batch webhooks update-secret [WEBHOOK_ID]

Updates the secret of a webhook by ID.

Sample Output

$ datature batch webhooks update-secret

? Which entry do you want to select? localhost
? Select how you want Datature to sign Webhook requests: Generate a new Webhook secret key
? Enter the path to the file where the generated Webhook secret key will be saved [leave blank to print to console]: 
✓ Webhook secret key generated successfully:

  5j7sg+QSKetNgruwBBeljQG2IkTEV8p3N4ugJCSuvn0=

✓ Webhook secret key updated successfully.

Delete Webhook

datature batch webhooks delete [WEBHOOK_ID]

Deletes a webhook by ID, if no ID is provided, a dropdown list will be displayed for the user to choose the webhook.

Sample Output

$ datature batch webhooks delete

? Which entry do you want to select? 
❯ my-webhook
  my-aws-lambda-webhook
  
? Which entry do you want to select? my-webhook
✓ Webhook deleted successfully.