Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions downstream/assemblies/eda/assembiy-eda-user-examples.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:_mod-docs-content-type: ASSEMBLY
[id="eda-user-examples"]

= {EDAName} user scenarios

[role="_abstract"]

The following content provides practical, end-to-end scenarios for integrating event streams (such as GitHub, GitLab, ServiceNow, and Dynatrace) with rulebook activations. Through these examples, you can experience how to configure and apply diverse integrations to automate responses to specific environmental events, streamline your workflows, and enhance system responsiveness.

include::eda/con-eda-user-examples-github-event-streams.adoc[leveloffset=+1]

include::eda/proc-eda-example-github-eventstream-cred.adoc[leveloffset=+2]

include::eda/proc-eda-example-eda-github-event-stream.adoc[leveloffset=+2]

include::eda/proc-eda-example-eda-github-project.adoc[leveloffset=+2]

include::eda/proc-eda-example-configure-remote-sys.adoc[leveloffset=+2]

include::eda/proc-eda-example-verify-event-streams-work.adoc[leveloffset=+2]

include::eda/proc-eda-example-replace-sources-attach-event-streams.adoc[leveloffset=+2]

include::eda/proc-eda-example-check-rule-audit-event-stream.adoc[leveloffset=+2]

[role="_additional-resources"]
.Additional resources
* link:https://interact.redhat.com/share/E1HhKjGqhls8JF5NsBNz[Event-Driven Ansible with Event Streams]
* link:https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.5/html/using_automation_decisions/simplified-event-routing[Simplified event routing]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:_mod-docs-content-type: CONCEPT
[id="eda-user-examples-github-event-streams"]

= Simplified Event Routing using GitHub event streams

[role="_abstract"]
You can learn how to achieve end-to-end simplified event routing using GitHub event streams in the the following sections. The goal is to demonstrate how to efficiently capture, process, and route GitHub events for seamless integration with your automation workflows, ensuring your rulebooks react precisely to repository activities.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-check-rule-audit-event-stream"]

= Check the Rule Audit for events on your new event stream

You can check the Rule Audit for events associated with your new event stream, *Repo Event Stream*. This process guides you to locate and view the details of specific events and their actions, allowing you to verify event processing.

.Procedure
. From the {PlatformNameShort} navigation panel, select {MenuADRuleAudit} to see the event and actions.
. Select the name of the event in the list that is associated with the rulebook activation you created. The Details tab is displayed.
. Click the *Events* tab to view the event details.

//[JMSelf]Remove screen shot for now
//image:eda-rule-audit-event-streams.png[Rule audit - Event stream]
23 changes: 23 additions & 0 deletions downstream/modules/eda/proc-eda-example-configure-remote-sys.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-configure-remote-sys"]

= Configuring your remote system to send events

Complete the following procedure to configure your remote system to send events by setting up a webhook in your GitHub repository.

.Procedure

. Go to your GitHub account to configure your event source.
. Click *Your profile name → Your repositories* and select the repository you want to configure.
. Navigate to *Settings* in the tool bar.
. In the left *General* navigation pane, select *Webhooks*, then click btn:[Add webhook] to create a webhook in your GitHub repository that will send events to your event stream.*
. In the *Payload URL* field, paste the event stream URL that is displayed in the details of your event stream.
. In the *Content type* field, change the content type to *application/json* for your payload.
. In the *Secret* field, add your secret from your event stream credential you created earlier.
+
[NOTE]
====
If you are using a test environment or SSL certifications, under SSL verification, select the *Disable* option to ensure your webhook connects successfully.
====
. Click *Add webhook* to save your configuration.
. Now that the webhook has been created, return to {PlatformNameShort}.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-eda-github-event-stream"]

= Creating a GitHub event stream

You can create an event stream and link it to a pre-configured credential, producing a generated URL for webhook configuration.

.Procedure

. From the {PlatformNameShort} navigation, click {MenuADEventStreams}.
. Click *Create event stream*.
. Enter the name for your event stream: `Repo Event Stream`
. Select your organization: *Default*
. Select *GitHub Event Stream* from the Event stream type list.
. Select the credential you created in the previous procedure: `Repo-EventStream`
. Click *Create event stream*.
. Now view the details of your new event stream and note the URL for it. Copy and paste this URL to use when you configure your webhook.
15 changes: 15 additions & 0 deletions downstream/modules/eda/proc-eda-example-eda-github-project.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-eda-github-project"]

= Creating a project for your GitHub event stream

You must first create a project to house the rulebooks used in your activations for GitHub event streams.

.Procedure

. Log in to the {PlatformNameShort} Dashboard.
. From the navigation panel, select {MenuADProjects}.
. Click *Create project*.
. Enter the name for your event stream: `GitOps EventStreams`
. In the *Source control URL* field, enter the example URL for the Git repository containing your rulebooks: https://github.com/ansible/event-driven-ansible
. Click *Create project*.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-github-eventstream-cred"]

= Creating a GitHub event stream credential

Complete the following procedure to create a GitHub event stream credential to enable authentication with your chosen event stream source.


.Procedure

. Log in to the {PlatformNameShort} Dashboard.
. Select {MenuADCredentials}.
. Click btn:[Create credential].
. Enter the following name for your event stream credential: `GitHub EventStream Cred`
. From the required *Organization* list, select *Default*.
. Select the credential type: *GitHub Event Stream*.
. Under *Type Details*, add an HMAC secret of your choosing.
. Click *Create credential* to save your credential.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-replace-sources-attach-event-streams"]

= Replacing sources and attaching event streams to activations

You can create a new rulebook activation, select a project and rulebook for it, and crucially, update its event source to subscribe to a desired event stream (in this case, *Repo Event Stream* that you created earlier).

.Prerequisites
* Ensure that your Projects have been set up properly. For more information, see link:https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.6/html-single/using_automation_decisions/index#eda-set-up-new-project[Setting up a new project].

.Procedure

. From the {PlatformNameShort} navigation panel, select {MenuADRulebookActivations}.
. Click btn:[Create rulebook activation] to create a rulebook for events on an application repository for Linux servers.
. In the *Name* field, enter `Repo Events - RHEL`.
. For your *Organization*, select *Default* from the list.
//. From the *Project* list, select *GitOps EventStream*.
//. Select *gitops-rhel.yml* for your *Rulebook*.
. In the *Event streams* field, click the gear icon to select which event stream the rulebook needs to subscribe to. The Event streams window is displayed.
. Replace an ansible.eda.webhook or compatible custom source with the desired event stream. This modifies the activation only, while leaving your filters intact.
. Select *Repo Event Stream* from the list of event streams that you created.
. Click *Save* to save your event stream.
. Next to the *Credential* field, click the *Search* icon to access {ControllerName} and connect with job templates and workflows. The *Select credential* message is displayed.
//. Select the *AAP* credential and click *Confirm*.
. Select the *Decision Environment* from the list.
. Click *Create rulebook activation*. The activation status is displayed (if successful, the *Running* status displays).
. Repeat the following steps to create an additional rulebook activation using the same process as your first activation:
.. In the *Event streams* field, click the gear icon to select which event stream the rulebook needs to subscribe to.
.. Select the *Repo Event Stream* from the list of event streams that you created.
.. Click *Save* to save your event stream.
.. Click *Create rulebook activation* to save the configuration and start the rulebook.

.Results
Now, there are two rulebook activations running and you can commit some code to one of your repositories. An event has been received and routed to your rulebooks.


Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-resend-webhook-data-event-streams"]

= Resending webhook data from your event stream type

After configuring an event stream (in this case, *Repo Event Stream*), and linking it to rulebook activations, you can verify that events are correctly received and processed. This allows you to confirm your setup and ensure that your rulebook activations are correctly subscribed and responsive.

.Procedure
. Go back to the *GitHub Webhook / Manage webhook* page.
. Click the *Recent Deliveries* tab.
. Click the btn:[ellipsis].
. Click btn:[Redeliver]. A *Redeliver payload?* window is displayed with a delivery message.
. Click *Yes, redeliver this payload*.
. Return to the {PlatformNameShort} to check your rule audit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:_mod-docs-content-type: PROCEDURE
[id="eda-example-verify-event-streams-work"]

= Verifying your event streams work

Verify that you can use your event stream to connect to a remote system and receive data.

. From the navigation panel in {PlatformNameShort}, select {MenuADEventStreams}.
. Select the event stream you created: `Repo Event Stream`
. Toggle the *Forward events to rulebook activation* option in the top right to disable event forwarding. The *Disable forwarding of events* message is displayed.
. In the *Disable forwarding of events* message window, click the *Yes, I confirm I want to disable the forwarding of events* checkbox.
. Click btn:[Disable forwarding of events].A banner is displayed notifying you that events will not be forwarded to the rulebook activation where they are configured.
. In the *Repo Event Stream* that you just created, re-enable the event forwarding capability by toggling the *Forward events to rulebook activation* option on.
3 changes: 2 additions & 1 deletion downstream/modules/eda/proc-eda-set-up-new-project.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can set up projects to manage and store your rulebooks in {EDAcontroller}.

* You are logged in to the {PlatformNameShort} Dashboard as a Content Consumer.
* You have set up a credential, if necessary.
For more information, see the link:https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.5/html/using_automation_decisions/eda-credentials#eda-set-up-credential[Setting up credentials][Setting up credentials] section.
For more information, see the link:https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.5/html/using_automation_decisions/eda-credentials#eda-set-up-credential[Setting up credentials] section.
* You have an existing repository containing rulebooks.

.Procedure
Expand Down Expand Up @@ -44,5 +44,6 @@ You can disable this option if you have a local repository that uses self-signed
.Results
Your project is now created and can be managed in the *Projects* page.

.Next steps
After saving the new project, the project's details page is displayed.
From there or the *Projects* list view, you can edit or delete it.
15 changes: 15 additions & 0 deletions downstream/titles/eda/eda-user-guide/master.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,32 @@ include::attributes/attributes.adoc[]
Developed by Red Hat, this feature is designed for simplicity and flexibility.

include::{Boilerplate}[]

include::eda/assembly-eda-user-guide-overview.adoc[leveloffset=+1]

include::eda/assembly-eda-credentials.adoc[leveloffset=+1]

include::eda/assembly-eda-credential-types.adoc[leveloffset=+1]

include::eda/assembly-eda-projects.adoc[leveloffset=+1]

include::eda/assembly-eda-decision-environments.adoc[leveloffset=+1]

include::eda/assembly-eda-set-up-rhaap-credential.adoc[leveloffset=+1]

//include::eda/assembly-eda-set-up-token.adoc[leveloffset=+1]
include::eda/assembly-eda-rulebook-activations.adoc[leveloffset=+1]

include::eda/assembly-eda-rulebook-troubleshooting.adoc[leveloffset=+1]

include::eda/assembly-eda-rule-audit.adoc[leveloffset=+1]

include::eda/assembly-simplified-event-routing.adoc[leveloffset=+1]

include::eda/assembly-eda-performance-tuning.adoc[leveloffset=+1]

include::eda/assembly-eda-event-filter-plugins.adoc[leveloffset=+1]

include::eda/assembly-eda-logging-strategy.adoc[leveloffset=+1]

include::eda/assembiy-eda-user-examples.adoc[leveloffset=+1]