Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/deploy cloud function as webhook #449

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

dat-a-man
Copy link
Collaborator

No description provided.

@netlify
Copy link

netlify bot commented Jun 23, 2023

Deploy Preview for dlt-hub-docs ready!

Name Link
🔨 Latest commit af46140
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/649aa3b338bd490008a6d11d
😎 Deploy Preview https://deploy-preview-449--dlt-hub-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dat-a-man
Copy link
Collaborator Author

Should I change the Heading to "Deploy webhook on GCP Cloud Function", presently its too lengthy. @AstrakhantsevaAA @adrianbr

@@ -0,0 +1,83 @@
# Deploy GCP cloud function as webhook for event ingestion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this part?

---
title: Deploy GCP Cloud Function as a Webhook
description: Deploy GCP Cloud Function as a Webhook for event ingestion
keywords: [how to, deploy, gcp, cloud function, webhook]
---

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy GCP Cloud Function as a Webhook

this is my suggestion for a title

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title is not visible to me and changed the title.


With this `dlt` google cloud event ingestion webhook, you can ingest the data and load it to the destination in real time as soon as a post request is triggered by the webhook. You can use this cloud function as an event ingestion webhook on various platforms such as Slack, Discord, Stripe, PayPal and any other as per your requirement.

You can setup gcp cloud function webhook using `dlt` as follows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abbreviation should be capitalized : GCP

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

8. In the requirements.txt file, specify the necessary packages:

```python

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete please extra line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

pipeline.run(Event, table_name='webhook') #table_name can be customized

return 'Event received and processed successfully.'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete please extra line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


9. Click on "Deploy" to complete the setup.

> You can now use this cloud function as a webhook for event ingestion on various platforms such as Slack, Discord, Stripe, PayPal, and any other as per your requirement. Just remember to use the “Trigger URL” created by the cloud function when setting up the webhook. The Trigger URL can be found in the Trigger tab.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra tabulation (shift+tab)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

print('Message sent successfully.')
else:
print('Failed to send message. Error:', response.text)
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra tabulation (shift+tab), whole code block except import

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


## 2. **Monitor (and manually trigger) the webhook**

1. To manually test the function you have created, you can send a manual POST request as a webhook using the following code:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need numeration. we have only one point

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes done.

@adrianbr adrianbr merged commit 4bf8ab0 into devel Jun 29, 2023
@adrianbr adrianbr deleted the docs/deploy-cloud-function-as-webhook branch June 29, 2023 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants