[2.x] Handling load balance and fail over endpoints through api_params.yaml file from APIMCLI 2.x.x #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
When importing an API using APIMCLI, there is a need to support to mention multiple endpoints in the api_params.yaml file to handle the load balancing and failover scenarios, because publisher portal already supports those.
Goals
Add optional parameters to api_params.yaml file to handle multiple endpoints if the user needs to have those.
Approach
Introduced two (2) new fields (which are almost similar to the field “endpoints”) named as loadBalanceEndpoints and failoverEndpoints that should be used for load balancing or failover scenarios.
If you do not want load balancing or fail-over to happen, you can specify the endpoints field as usual.
User stories
The user needs to specify the fields as shown in the below example. (Here production and sandbox fields are yaml arrays) Additionally user can specify sessionManagement (values can be "none", "transport", "soap", "simpleClientSession" and if not specified the default value would be "transport") and sessionTimeout fields.
After the API is imported to the APIM (2.6.0) the endpoints will be shown as below.

The user needs to specify the fields as shown in the below example. (Here production, productionFailovers, sandbox and sandboxFailovers fields are yaml arrays)
After the API is imported to the APIM (2.6.0) the endpoints will be shown as below.

After the API is imported to the APIM (2.6.0) the endpoints will be shown as below.

Release note
Multiple endpoint support from api_params.yaml has been added to WSO2 APIMCLI 2.x.x.
Documentation
Documentation changes need to be done.
Test environment