Configuring Connectors
You can find the connectors on the Manager’s API Connectors menu:
They are categorized by their type (which represents the protocol to which they allow access), e.g.: Oracle Connector, SQL Server Connector and AWS Lambda Connector.
Connectors are divided by groups, which share characteristics. Regarding the examples above, Oracle and SQL Server belong to the Database group, while AWS Lambda belongs to the Cloud Providers group. These groups make it easier to find the desired connector in the API Manager.
Connectors that are enabled in the API Connectors menu are ready to be linked to an API, serving as a basis for new resources. Enabled connectors have the colour of their group, while disabled ones are greyed out.
When you link a connector to an API, you can define the operations for the resources like you would configure any other regular resource (read more about resources here). Each connector can be linked to multiple APIs and an API can have multiple resources from different connectors.
But, first of all, you need to know how to enable a connector.
Enabling a connector
To enable an existing connector on the Platform, it is necessary to fill in the mandatory information. Once enabled, you can link your connector to an API and create resources from it.
The first step to enable a connector is to configure the environment in which it will run, and you can do so on the Manager’s Environments menu.
Creating connection environment variables
Each connector has specific connection properties. These properties are intrinsic variables for each connector type, and they represent the distinct configurations which are needed for connection to take place.
For instance, a Database connector must contain values informing the database name, user and password to grant access, database schema to be used, address of the database, among others.
The values of these properties must be previously specified as environment variables in the Environment Variables section of an environment, in the Environments menu.
As each connector type has different environment variables, we listed the fields you need to inform for each type. When you access the technical information page, you can select the connector group and find data on the specific connector type you need.
In the example of the image below, we are establishing the environment variables for an Oracle connector.
The variables must have unique names — that is, there can’t be two variables with the same name.
|
Registering a connector
The new connector can now be registered on the API Connectors screen.
To make a new connector available to create resources from, click the + floating button and select the type of the new connector.
In the example above, there are three types of connectors available: MySQL and Oracle (from the Database group) and AWS Lambda (from the Cloud Providers group).
Upon selecting the type, two required pieces of information must be informed: Name and Description.
After filling these out, the data Connector ID and Factor (necessary for the application to start) are generated.
To execute the connector, it is necessary to download it into the machine. For such, you must have Java 8 (or higher) or Docker installed. On the same screen, you see instructions to download the connector from the command line, in which two options can be used: Command JAR (in the case of Java) and Command image (for Docker).
With the application running, it is necessary to fill in the missing information on the Manager screen (endpoint) to register the connector (click on Register Connector), as the image below shows. On this page, the endpoint is the address of the machine where the connector is running.
After the successful registration, the remaining configuration information will be displayed:
It is necessary to point out which environment will be configured, and it is possible to choose one or more environments. In the case of multiple environments, all variables of all environments must have the same name. For example: if we choose "environment 1" and "environment 2", the variable "user" must be registered in both.
When at least one environment is chosen, the variables will be available for selection on the fields. After they are filled, the option Test Connection to validate the information will be enabled.
If there is more than one environment for the same connector, the connection status of each one will be displayed sequentially, with a connection error message if there is any failure. The connector can be saved now and it can be used to create API resources. Read more about it here.
You can also define extra security configurations for the connector, such as Rate Limit, Payload Size and IP Filtering interceptors. The connector will only use these settings if they are correctly filled in — that is, they are not required.
To configure the Rate Limit interceptor, you must inform the number of requests allowed for a given interval in seconds, minutes, hours, days or months. In Payload Size, the information is expected in kB, enabling a request payload that is lighter than the amount configured. IP Filtering obeys both the manual configuration of IPs and the CIDR standard — requests will be answered only if the source IP is configured.
Share your suggestions with us!
Click here and then [+ Submit idea]