Try WSO2 Cloud for Free
Sign in
||
Skip to end of metadata
Go to start of metadata

All API calls are directed through the cloud gateways in the traditional model of API management. This approach has inherent limitations such as the following.

  • Inefficiencies arising if both the API backend and the API consumers are not in cloud
  • Security concerns associated with API calls going through external gateways.

WSO2 API Cloud offers users the hybrid gateway deployment option, to deploy API Gateway(s) on-premise. This enables them to get the best of both worlds.

  • Rapid deployment model and low total cost of ownership: Most of the API management infrastructure including management user interfaces, developer portal and analytics are in the cloud, so they are always accessible to you and your subscribers and do not need any maintenance effort.
  • High performance, security and compliance: You can put the API gateway anywhere including your own network. This cuts down the network overhead, ensures security and compliance, and removes the need for VPN or another network connectivity solution.

Follow the steps below to configure and test an on-premise gateway.

Step 1 - Download your On-Prem Gateway

  1. Log in to WSO2 API Cloud (https://api.cloud.wso2.com) as an Admin User
  2. In the API Publisher, click On-Prem Gateways.

  3. Click Download On-Prem Gateway to begin the download.
  4. You will receive a confirmation of the download as follows, after the download starts.


Step 2 - Configure your On-Prem Gateway

  1. Configure the Gateway by going to <ON-PREM_GATEWAY_HOME>/bin and executing configuration script:
    On Windows: configure-gateway.bat --run
    On Linux/Mac OS: sh configure-gateway.sh
  2. Provide your email address, organization key and password.
    Your organization key will be displayed as shown below.
  3. The status of the On-Prem Gateway will be displayed after you complete the configurations.




Step 3 - Run the on-premise gateway

  1. Start the API Gateway by going to <ON-PREM_GATEWAY_HOME>/bin and executing startup script:
    On Windows: wso2server.bat --run
    On Linux/Mac OS: sh wso2server.sh
  2. The status of the On-Prem Gateway will be updated after you start the gateway


Step 4 - Test your on-premise gateway

  1. Log in to WSO2 API Cloud and create an API.
  2. Subscribe to and invoke the API.
  3. Invoke the API using cURL.
  4. The cURL command to invoke the GET method of the API should be similar to the following:

    curl -k -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’
    'https://gateway.api.cloud.wso2.com:443/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'

    Replace https://gateway.api.cloud.wso2.com:443 in the above cURL command with your on-premise gateway url as indicated below and run it. The response to this cURL should be identical to that received in the previous step.

    curl -k -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’
    'https://on-premise-gateway-ip:8243/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
  5. If your request is successful, your response will be similar to the following.

    <?xml version="1.0" encoding="utf-8"?>
    <PhoneReturn xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <Company>Toll Free</Company>
      <Valid>true</Valid>
      <Use>Assigned to a code holder for normal use.</Use>
      <State>TF</State>
      <RC />
      <OCN />
      <OriginalNumber>18006785432</OriginalNumber>
      <CleanNumber>8006785432</CleanNumber>
      <SwitchName />
      <SwitchType />
      <Country>United States</Country>
      <CLLI />
      <PrefixType>Landline</PrefixType>
      <LATA />
      <sms>Landline</sms>
      <Email />
      <AssignDate>Unknown</AssignDate>
      <TelecomCity />
      <TelecomCounty />
      <TelecomState>TF</TelecomState>
      <TelecomZip />
      <TimeZone />
      <Lat />
      <Long />
      <Wireless>false</Wireless>
      <LRN />
    </PhoneReturn>
    
    
    
    
  • If you create/update an API and publish/re-publish it from API Cloud Publisher, it could take up to a maximum of 10 minutes before your changes become effective in the on-premise gateway.
  • If you create/update a throttling tier from API Cloud, it could take up to a maximum of 15 minutes before your changes become effective in the on-premise gateway.
  • Statistics of API usage in your on-premise gateway are published to API Cloud every 6 - 6.5 hours.

Overriding the default gateway configurations

  1. Go to <API-M_HOME>/repository/conf/

  2. Replace the default configurations in the on-premise-gateway.properties file with the required custom configurations.

    • To customize the synchronization time interval of the API updates:
      Replace the api.update.task.cron experssion with a custom cron expression

    • To customize the synchronization time interval of the Throttling tiers:
      Replace the throttling.synchronization.cron experssion with a custom cron expression

    • To customize the time period it takes for API statistics to get published to API cloud:
      Replace the file.data.upload.task.cron experssion with a custom cron expression

  • No labels