Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Marco_Dorn
Advisor
Advisor
With Event Routing released inside SAP Landscape Management Cloud, we enable you to start your journey into event-driven automation. This means you can react in a standardized way if a certain situation materializes.

If it never happens: great.
If it happens: automatically trigger a script or alert someone.

The big difference to only providing REST APIs is that there is no need to regularly poll an API endpoint. You can setup your fully-automated response to situations in your landscape.

What is “Event-driven”?


Depending on where you are from in the SAP ecosystem, “event-driven architecture” might have crossed your path already when sending business events from e.g. SAP S/4HANA to event receivers because a “Business Partner” was updated. It’s very common in the area of distributed systems. There are many blog posts in the SAP Community tagged with “SAP Event Mesh” and my colleague karsten.strothmann#content:blogposts is an absolute expert in that field.


In the area of system landscape management, event-driven automation is on the rise, too. If you search for it on the internet, you get across sources like blog posts from Red Hat and others.


With SAP Landscape Management Cloud, we now tap into this area as well. As a first step, we just released the option for you to configure SAP Event Mesh as event broker to be connected with SAP Landscape Management Cloud. Afterwards, you can configure SAP Event Mesh to listen to operations being started, finished, or failing from within SAP Landscape Management Cloud. Events will be send in the CloudEvents.io format and the current set of events including the payload are documented in SAP Business Accelerator Hub.


Afterwards, you use SAP Event Mesh to forward the event to a dedicated receiver which could be an automation script. As long as this scrip provides an API endpoint to send events to, you are completely flexible. Use an SAP BTP runtime (CloudFoundry, Kyma, or ABAP) or any other automation engine. As we in parallel launched public REST APIs inside SAP Landscape Management Cloud, you can talk back to your tenant and get more details to the event payload.



How can you setup event-driven automation in combination with SAP Event Mesh


Inside SAP Event Mesh


The prerequisites are that you know the tenantID of your SAP Landscape Management Cloud tenant and that you have an entitlement to SAP Event Mesh in a SAP BTP account, so that you can create an instance of the “default” plan like this.


For this instance of the “default” plan, you create a service binding and download it (or keep it open in a separate window. Within the service binding,  Inside SAP Event Mesh, you create a queue and subscribe it to the events of SAP Landscape Management Could. You can see an example of how the subscription needs to be called inside the SAP Help Page. In the end, you need to combine:



“default/sap.lmc/“ + the tenantID from above + “/ce/sap/lmc/“ + business object + “/” + operation + “/v1”

You can find all you need after the tenantID at SAP Business Accelerator Hub at “Operations”. It might result into “default/sap.lmc/b4e9b9b8-real-tenantId/ce/sap/lmc/Activity/STARTSERVICE/v1“.


Now you prepared SAP Event Mesh to fetch events emitted by SAP Landscape Management Could. To forward the event and its payload to automation script or any other endpoint, open the tab “Webhooks” and create a new one. Here you can enter the API and its authentication method which should be informed about the event which came in via the configured subscription.



Inside SAP Landscape Management Cloud


Now that you prepared SAP Event Mesh, open your tenant of SAP Landscape Management Cloud. On the left side, navigate to "Messaging > Event Routing" and "Create" a new entry. As described here, you now need the data from the created Service Key of SAP Event Mesh. Inside that JSON, you can find a section for the saprestmgw-broker where you get the necessary details to copy-paste into the Event Routing UI:
{
"broker": {
"type": "saprestmgw"
},
"oa2": {
"clientid": "sb-default-***|xbem-service-broker-!*",
"clientsecret": "123456-***=",
"granttype": "client_credentials",
"tokenendpoint": "https://***.authentication.eu10.hana.ondemand.com/oauth/token"
},
"protocol": [
"httprest"
],
"uri": "https://enterprise-messaging-pubsub.cfapps.eu10.hana.ondemand.com"
}

Use the uri for the "API URL" and activate the event routing. Now you are all set and you will see events float into SAP Event Mesh.

Feedback welcome and next steps


As you can see in SAP Business Accelerator Hub, all current events of SAP Landscape Management Cloud are flagged as “BETA”. This is intentional as we just start tapping into this area.




  • We want to learn from you which events you expect from SAP Landscape Management Cloud.

  • Furthermore, we plan to improve the naming of the current set of events and – again hoping for your feedback – update the payload of current events.

  • Lastly, what event brokers are you commonly using?


Please leave a comment to the blog post or use https://messages.sap.com to contact me.


For now, we will continue blogging about this and provide samples inside https://github.com/SAP-samples/landscape-management-sample-scripts. Follow the samples with your existing instances and combine it with your existing SAP Event Mesh instance.