Thursday, July 16, 2020

Using SAP Cloud Connector for Automation

I recently got a. requirement to dockerize and use SAP Cloud Connector for one of the test rigs we have built up internally. 
The idea was to expose a few REST APIs written in a java application through cloud connector. One of the services we write should be able to call this java application through SAP Cloud Connector. 
For the test rig we had to setup a cloud connector and connect to a subaccount automatically. Turns out Cloud Connector has an API which is documented on here.

There is a nice github repository which allows you to Dockerize the Cloud Connector as well.

The challenge is that SAP Cloud Connector has no APIs to do the first time configuration i.e. to change the password for the first time and to set the Installation Mode. 

So here's the hack we did. We did the changes on the running SAP Cloud Connector and found that 2 files are touched by these APIs. Went ahead and made another image which adds the touched files. and Voila.. we have SAP CC Docker image on which we can directly call the APIs and automate the rig. 

The code is available in a fork of the original repository. You can access the fork here

Happy Coding, 

Abhishek