IBM Cloud Functions
A Cloud Functions represents a service destination, where an incoming notification can be consumed programmatically to actions.
Deprecation Overview
The IBM Cloud Function service is now deprecated.
Generate IBM Cloud Functions endpoint
To post a Cloud Functions notification, you need to generate an endpoint. To generate the endpoint, follow these steps:
-
Create a IBM Cloud Functions instance. If you already have an Cloud Functions instance, go to step 3.
-
Create a Namespace. For more information, see here.
-
Create an Action. For more information, see here.
-
Select Endpoints from the menu.
Make sure to uncheck
Enable as Web Action
andRaw HTTP handling
options in the Web Action section for an effective usage of Cloud Functions as a destination. -
Copy the URL mentioned and use it in Destination Configuration in Event Notifications instance.
Generate API key for your namespace
-
From your IBM Cloud dashboard, go to Manage > Access (IAM).
-
Select Service IDs.
-
Select your namespace.
-
Select API keys.
-
Unlock if the API key is locked by going to Actions > Unlock.
-
Click Create and provide a Name. This gives you the apikey for the namespace you selected.
-
Copy api_key and use it in Destination Configuration in Event Notifications instance.
IBM Cloud Functions Cloud Foundary based namespace is not supported. Only IAM-based namespace is supported.
Configuring a Cloud Functions destination
You can configure a Cloud Functions destination in the Destinations
tab.
To configure a Cloud Functions destination, do the following steps:
-
From your Event Notifications instance dashboard, click Destinations.
-
Click Add + to add new destination.
-
In the Add a destination side panel, provide the following details.
- Name - Enter a name for your destination.
- Description - Optionally, enter a description for your destination.
- Type - Under Destination, for the Type, select IBM Cloud Functions from the drop-down as your destination type.
- URL - Enter the Cloud Functions incoming webhook URL. This is the URL that you have generated earlier.
- API key - Enter the API key that you have generated earlier.
-
Click Add.
Testing a Cloud Functions destination configuration
You can test a Cloud Functions destination in the options menu provided againts the destination. You can effortlessly test a destination, whether the provided configuration is correct or not with a single click.
For more information on testing a destination, see here.
Cloud Functions retry policy
When calling a webhook, issues such as network errors and application glitches can cause the requests to fail. A retry is used to provide resiliency to external requests. Attempt to retry the requests in such situations by using the following values:
- Limit = 60 seconds: total time that the service retries.
- Step = 5 seconds: after each failure, the service waits 5 seconds before retrying. This delay prevents bombarding of the external services (webhook).
In addition, the following timeout conditions cause the Cloud Functions call to fail:
- A connection timeout of 10 seconds
- A response timeout of 60 seconds
If a call to the Cloud Functions webhook URL fails even after retry attempts, the notification is lost.