Overriding Endpoints for deployed APIs¶
The API deployed from the API Manager once deployed in Choreo Connect, it needs to be moved across different environments. When moving from one environment to the other backend service details can be altered. In those cases, we need to override the endpoint details of the API The following section describes how this can be overridden on the APIs that are imported from the WSO2 API Manager.
Overriding endpoints using environment variables¶
You can define endpoint details as the Adapter environment variables at docker-composer.yaml file.
Set the production or sandbox endpoint(s) of an API.
services: adapter: environment: - api_60f7111f-fdc5-4cc7-b497-1cea64c6a97f_prod_endpoint_0="http://wso2.prod.com" - api_60f7111f-fdc5-4cc7-b497-1cea64c6a97f_sand_endpoint_0="http://wso2.sand.com"
api_SHA1(<apiName>:<apiVersion>)ID generated for the imported API. Sample name would be
<endpoint-type>- Use one of the following values based on the type of endpoint.
prod- Use this for a production endpoint.
sand- Use this for a sandbox endpoint.
<endpoint-index>- The endpoint index starts from 0. Therefore, when overriding a single endpoint this value is 0. If there are many URLs (e.g., load-balanced or failover), you can override them using endpoint indexes (e.g., 1, 2, 3).
If the backend is protected by basic authentication, provide username and password as follows.
services: adapter: environment: - api_60f7111f-fdc5-4cc7-b497-1cea64c6a97f_prod_basic_username="admin" - api_60f7111f-fdc5-4cc7-b497-1cea64c6a97f_prod_basic_password="admin"
<basic-auth-username>- Provide the username
<basic-auth-password>- Provide the password