Manage webhooks and events in the HPE GreenLake platform UI
The content in this section describes how HPE GreenLake administrators or operators can use the HPE GreenLake user interface to:
- Register, edit, test, and delete webhooks
- Subscribe to events
- Remove event subscriptions
Registering a webhook
Prerequisites
- You need Create permissions to Automations Webhook. To change your permissions, talk to your HPE GreenLake administrators. Find out more about HPE GreenLake roles and permissions.
- Configure your webhook destination to receive and verify webhook messages. Find out more about the webhook verification process.
About this task
Webhooks are automated HTTP requests used to send real time information (a message) from HPE GreenLake to a destination of your choice.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click Register Webhook.
-
Complete the
Register webhook
form.
-
Name
—Provide a name for the webhook. Webhook names must be unique to your workspace. Webhook names can be alphanumeric with the following special characters also allowed:
-
,.
,@
, and_
. There is a maximum character limit of 50. - Description —Provide a short and insightful description the outlines the purpose of the webhook. There is a maximum character limit of 100.
- Webhook URL —The destination URL to which you want to receive the information contained in the webhook message.
- Webhook secret —A webhook secret, or password, is used to authenticate webhook communications. The webhook secret must contain uppercase and lowercase characters, one number, and be between 8–50 characters long.
-
Name
—Provide a name for the webhook. Webhook names must be unique to your workspace. Webhook names can be alphanumeric with the following special characters also allowed:
- Click Register webhook. A verification challenge is sent to the webhook URL provided. While awaiting a response, the webhook is put in a pending state. After successful verification, the webhook is set to active. You will receive a confirmation email when the webhook is successfully registered. The confirmation email includes the webhook ID.
-
After your webhook is registered, view the webhook details.
- Webhook URL —The URL of the registered webhook.
- State —The state indicates if the webhook is active, disabled, critical, or pending. Find out more about Webhook states.
- Webhook ID —The unique identifier of the webhook.
- Last updated —The date the webhook was last edited.
- Registered —The date the webhook was registered.
- Registered by —The email address of whoever created the webhook.>
- Event subscription —Here, you can subscribe to an event, view event details, and remove events. Find out more about Events or get started Subscribing to an event.
- Failed deliveries —If an event message has failed to deliver, a log entry is kept. If no messages have failed to deliver, this section is empty.
info
The webhook secret is securely stored. After it is created, the secret cannot be retrieved only replaced. It is good practice to change webhook secrets periodically and use unique secrets for every webhook.
Editing a webhook
- You need Edit permissions to Automations Webhook . To change your permissions, talk to your HPE GreenLake administrators. Find out more about HPE GreenLake roles and permissions.
- You must have registered at least one webhook.
About this task
You can edit the details of an already created webhook.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click the webhook that you want to change.
- Click Actions.
- Click Edit.
-
Change as many fields as required. If you do not edit a field, it remains unchanged.
-
Name
—Provide a name for the webhook. Webhook names must be unique to your workspace. Webhook names can be alphanumeric with the following special characters also allowed:
-
,.
,@
, and_
. There is a maximum character limit of 50. - Description —Provide a short and insightful description the outlines the purpose of the webhook. There is a maximum character limit of 100.
- Webhook URL —The destination URL to which you want to receive the information contained in the webhook message.
- Webhook secret —A webhook secret, or password, is used to authenticate webhook communications. The webhook secret must contain uppercase and lowercase characters, one number, and be between 8–50 characters long.
-
Name
—Provide a name for the webhook. Webhook names must be unique to your workspace. Webhook names can be alphanumeric with the following special characters also allowed:
- Click Update Webhook to confirm your changes. A confirmation email is sent to the email address used to create the
info
The webhook secret is securely stored. After it is created, the secret cannot be retrieved only replaced. It is good practice to change webhook secrets periodically and use unique secrets for every webhook.
info
The webhook enters a pending state while HPE GreenLake authenticates the webhook. After it is authenticated, it will enter the active state.
Testing a webhook
Prerequisites
- You need Read permissions to Automations Webhook. To change your permissions, talk to your HPE GreenLake administrators. Find out more about HPE GreenLake roles and permissions.
- You must have registered at least one webhook.
About this task
If a webhook is not working correctly, testing it helps you determine why, view more information, and resolve it. The HPE GreenLake UI indicates that a webhook is not working correctly.
- The webhook State appears as warning, critical, or disabled. To find out more, see Webhook States.
- The Failed delivery log lists recent delivery failures.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click the webhook that you want to test.
-
(Optional) Check under
Failed deliveries
to see if recent
webhook messages have not been sent. If so, click an item to view
more information. The information contained helps you resolve any
delivery failures. The following details are shown.
- Status —The HTTPS status code. See Webhook HTTPS status codes for more information.
- Date —The date and time of the failed delivery.
- ID —The unique identifier of the response.
- Resource URI —Unique identifier for the web resource.
- Request header —Metadata about the request.
- Request body —The data sent to the server during the request.
- Response header —Metadata about the server response.
-
Response body
—The data returned by the server. For 400—499 codes, the response body includes:
- The HTTPS Status Code, for example, 400 Bad Request.
- The error code, which is a machine-friendly identifier of the error.
- A message providing a readable description of the issue.
- The debug ID, which is a unique identifier of the particular error instance.
- Click Actions.
- Click Test. The Test panel appears.
- Click the Test button. An HTTPS status code appears that indicates the results of the test.
- (Optional) To rerun the test, click Retest.
- Click Close.
HTTPS response status code overview
Response type | Code range | Description |
---|---|---|
Successful response | 200—299 | The test was successful. For example, a 200 response indicates that the test was successful and fully complete. |
Client error response | 400—499 | There was an error on the client side. For example, a 401 indicates you are not correctly authenticated. |
Server error response | 500—599 | There was an error on the service or server. For example, a 503 might mean that the server is unavailable. |
info
For more detailed information, see Webhook HTTPS status codes. Use the information provided by the HTTPS status code to help resolve the error.
Enabling or disabling a webhook
Prerequisites
- You need Update permissions to Automations Webhook . To change your permissions, talk to your HPE GreenLake administrators. Find out more about HPE GreenLake roles and permissions.
About this task
If a webhook is active, you can disable it. If the webhook is disabled, you can enable it.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click the webhook that you want to enable or disable.
- Click Action.
-
Choose the appropriate action.
- (Optional) Click Enable to enable the webhook.The webhook appears in a pending state while HPE GreenLakereauthenticates the webhook. After it is authenticated, the webhookenters the active state and all processing and notification activities begin.
- (Optional) Click Disable to disable the webhook. Disabling a webhook stops all processing and notification activities.
- After you click Enable or Disable. you will be returned to the webhook details page.
Unregistering a webhook
Prerequisites
- You need Delete permissions to Automations Webhook. To change your permissions, talk to your HPE GreenLake administrators. Find out more about HPE GreenLake roles and permissions.
- You must have registered at least one webhook.
About this task
Remove a webhook that is no longer required.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click the webhook that you want to remove.
- Click Action.
- Click Unregister Webhook.
- From the Unregister Webhook dialog, click Unregister Webhook to remove the webhook. The webhook is removed, and events are no longer communicated. An automated confirmation email is sent to the email address that created the webhook.
Finding events on HPE GreenLake Developer Portal
About this task
Events are available from the HPE GreenLake Developer Portal alongside the service's API reference and documentation. The following services provide events functionality:
note
HPE GreenLake platform will expand the events offering over time.
Procedure
- Go to HPE GreenLake Developer Portal.
- Click Services.
- In the navigation menu, under Services , select either Audit Logs or Subscriptions. You are brought to the service documentation.
- Click Event catalog.
-
Click an event. The event page opens, and includes:
- The event name and a description of the event.
-
The
Event Type
. The
Event Type
is the code snippet, for example,
com.hpe.greenlake.sample-service.v1.pets.created
. When subscribing to an event on HPE GreenLake platform, you must copy the Event Type. -
A definition of the event context attributes returned by the event, such as
id
,source
,specversion
, andtype
.
- Under Request samples, the page includes an example of the data returned by the event.
- If you want to subscribe to an event, copy the Event Type, and follow the steps in Subscribing to an event.
Subscribing to an event
Prerequisites
- You need Create permissions to Automations Subscription. To change your permissions, talk to your HPE GreenLake platform administrators. Find out more about Roles & Permissions.
- You must have registered at least one webhook.
- Follow the steps in Finding events on HPE GreenLake Developer Portal to browse for events and copy the Event Type.
- Review the event documentation on HPE GreenLake Developer Portal. To successfully subscribe to an event, you need the correct permissions.
About this task
The events that you subscribe to define what information is sent to the webhook URL.
info
There is a maximum of five event subscriptions per webhook.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click the webhook that you want to add the event subscription to.
- Click Subscribe to event. The Subscribe to event panel appears.
- Under Event type, paste the Event Type to trigger the webhook.
- Click Subscribe to event. An automated confirmation email is sent to the email address used to create the webhook.
info
The subscription request goes through an authorization validation check that confirms you have the necessary permissions to subscribe to the event. This process checks user permissions in the workspace, and access controls related to the event type. If successful, the subscription is registered. If the authorization validation is not successful, the request is rejected, and you must adjust your permissions to proceed.
Removing an event subscription
- You need Delete permissions to Automations Subscriptions. To change your permissions, talk to your HPE GreenLake platform administrators. Find out more about Roles & Permissions.
- The webhook needs at least one event subscription.
Procedure
- On the HPE GreenLake platform header, click the workspace menu and then select Manage Workspace.
- On the Manage Workspace page, click Automations and then click Webhooks.
- Click the webhook that has the event you want to remove.
- Under Event subscriptions, click Delete. The Remove event subscription dialog appears.
- Click Remove subscription. The event subscription is removed.