Technical Articles
React to events and connect 3rd Party systems using Serverless services & Open Connectors (Part 4)
This blog is part of a series which is related to configuring and using SAP Cloud Platform Serverless services along with Open Connectors.
React to events and connect 3rd Party systems using Serverless services & Open Connectors |
Part 1 – Configuring SAP Cloud Platform Open Connectors Part 2 – Setup Queues in Enterprise Messaging service Part 3 – Create Functions & Triggers in Functions service Part 4 – Create a OData/Restful service using Backend service |
This blog post just focuses on how quickly one can build an OData/Restful service by providing a data model as input. This is a great service if you are looking to do PoCs or build simple web/mobile apps quickly with limited investements.
Here is a blog post which describes more about this service and in which scenarios you would use it “Introducing SAP Cloud Platform Backend service (beta)” by Karsten Strothmann
SAP Cloud Platform Backend service is available in the Cloud Foundry Trial environment. Unlike Functions and Enterprise Messaging service, Backend service is available as a subscription at the organization level of your SAP Cloud Platform Cloud Foundry environment. In order to get started, navigate to the subscriptions menu, locate the Backend service and click on the “Subscribe” button to enable it.
Before using the Backend service, we would need to add the required roles. Under Security > Role Collections, create a new role collection.
Select the newly created role collection and click on “Add Role” to add the roles specific to the backend service. I have added both Admin and AllAccess roles.
Once the Role Collection has been updated, navigate to Security >Trust Configuration. This will have SAP ID service as default. Select the SAP ID service and in the email address provide your email address (used to login to SAP CP trial account) and click on “Assign Role Collection” to assign the newly created role collection to your account.
Now that you have provided all the required authorizations, you can navigate to Subscription menu and launch the Backend service. The homepage of the dashboard will provide the statistics of the API usage.
Click on the APIs menu to create your service. Click on the button “Create API”.
For this scenario, I have already created a CDS file with employee model.
context employeeModel {
entity employees {
key EmployeeID: String(10);
EmployeeName: String(255);
Address: String(255);
Department: String(10);
}
};
service manageEmployees {
entity employees as projection on employeeModel.employees;
};
In the “Create API” dialog, provide the service name, version and model type. The Model type could be CDS, openAPI and EDMX. For CDS document, I have provided the CDS file mentioned above.
When the service is created, the status would be “Pending” and in few seconds would change to “Active”.
You can always click on the “Deployment Log” icon in the right hand corner to view the status.
Click on the service to view the API details. This system has created a V4 OData service displaying an. Endpoint with operations against the entity.
I can create new employees and also view them using the APIs provided here.
You can also configure the service to generate events for Create/Update/Delete operations. You can configure a callback URL, to which the auto generated events will send data in a JSON format (containing details of the entity/operation)
This concludes the blog series. I hope you found this useful. Please note that Functions & Banckend services are still in beta phase. If you encounter any issues using them, please post them as questions in the forum.
Hi Murali,
interesting blog !
is it possible to check the corresponding artifacts created in the database ?
Regards,
Michael
hi,
Is there more documentation or blogs on the callback events? i've made one that only works once...
regards,
Jasper