There are two ways to connect a data source.

  1. Manually calling the requests
  2. With the help of the portal

In recalot.com, we distinguish between 3 different states of data sources: AVAILABLE, CONNECTING & READY.

  • AVAILABLE data sources are data source builder instances that allows you to connect a data source with different configurations (e.g. different mysql databases).
  • CONNECTING data sources are data sources that are currently connecting a specific data source builder with a configurations
  • READY data sources are connected and can be used.

Manually

You can connect a data source manually by sending a PUT request with all necessary parameters. Each data source configuration differs and ,therefore, we suggest to call first a GET request of the data source you want to connect, in order to get the configuration of the data source.  Go to the Swagger documentation for a full documention of the REST API.

Example: Connect a mysql data source

Get the configuration

GET: HOST/data/sources/data-builder-mysql

Show response data

{  
   "configuration":[  
      {  
         "description":"",
         "key":"sqlDatabase",
         "requirement":"Required",
         "type":"String",
         "value":""
      },
      {  
         "description":"",
         "key":"sqlPassword",
         "requirement":"Required",
         "type":"String",
         "value":""
      },
      {  
         "description":"",
         "key":"data-builder-id",
         "requirement":"Hidden",
         "type":"String",
         "value":"mysql"
      },
      {  
         "description":"",
         "key":"sqlServer",
         "requirement":"Required",
         "type":"String",
         "value":""
      },
      {  
         "description":"",
         "key":"sqlUsername",
         "requirement":"Required",
         "type":"String",
         "value":""
      },
      {  
         "description":"",
         "key":"source-id",
         "requirement":"Required",
         "type":"String",
         "value":"mysql"
      }
   ],
   "description":"",
   "id":"data-builder-mysql",
   "info":"",
   "key":"mysql",
   "state":"AVAILABLE"
}

Connect the data source

PUT: HOST/data/sources

Show example request data

sqlDatabase=loremDatabase
sqlPassword=loremPassword
data-builder-id=mysql
sqlServer=loremServer
sqlUsername=loremUsername
source-id=mysql

Portal

You can connect a data source by using the portal. You can find the portal by following this link. The default configuration contains an API instance to localhost:8080. If your server host or port varies, you have to add your server to the configuration (the configuration is only stored in your localstorage instance). You can achieve this by clicking on the current host on the top right of the navigation and selecting the “+ Add host” link (see image below). change host

To connect a data source with the help of the portal, you have to perform the following steps:

  1. Go to Data -> Available Data Sources
  2. Click on the data source that you want to connect
  3. Click the green “+” Button
  4. Fill the configuration form and submit it
  5. Done