Hi all, We have changed the endpoint config support json elements instead of the json string. Please find the update d endpoint element as below.
"endpoint" :[ { "key": "01234567-0123-0123-0123-012345678901", "inline": { "id": "01234567-0123-0123-0123-012345678901", "name": "Endpoint 1", "endpointConfig": [ { "url": "http://localhost:8280/ep1", "timeout": "1000" }, { "url": "http://localhost:8280/ep2", "timeout": "2000" } ], "endpointSecurity": { "enabled": false, "type": "basic", "username": "basic", "password": "basic" }, "maxTps": 1000, "type": "http" }, "type": "Production" }, { "key": "01234567-0123-0123-0123-012345678902", "inline": { "id": "01234567-0123-0123-0123-012345678902", "name": "Endpoint 2", "endpointConfig": [ { "url": "http://localhost:8280/ep1", "timeout": "1000" }, { "url": "http://localhost:8280/ep2", "timeout": "3000" } ], "endpointSecurity": { "enabled": false, "type": "basic", "username": "basic", "password": "basic" }, "maxTps": 1000, "type": "http" }, "type": "Sandbox" } ] Thanks! Rajith On Wed, Aug 22, 2018 at 9:44 AM Rajith Roshan <raji...@wso2.com> wrote: > Hi all, > > Currently the APIM V3 rest api support following format to declare > endpoint details when creating an API. We can add endpoints with type > "Production" and "Sandbox". > The "*endpointConfig*" parameter is directly saved in database as blob > and used in the UI to show endpoint details of api. > In order to support to declare multiple endpoints for ex as load balanced > or fail over I would like to suggest the following json [3] for > endpointConfig and add an extra parameter(*endpointType*) to endpoint > parameter as in [4] in order to declare the the type as load balanced or > fail over. > Please share your thought on this > > [1] - "endpoint": [ > { > "key": "01234567-0123-0123-0123-012345678901", > "inline": { > "id": "01234567-0123-0123-0123-012345678901", > "name": "Endpoint 1", > "*endpointConfig*": "{url: http://localhost:8280, timeout: 1000}", > "endpointSecurity": { > "enabled": false, > "type": "basic", > "username": "basic", > "password": "basic" > }, > "maxTps": 1000, > "type": "http" > }, > "type": "Production" > } > ], > > [2] - "endpointConfig": "{url: http://localhost:8280, timeout: 1000}" > > [3] - "endpointConfig": "[{\"url\": \"http://localhost:8280/ep1\", > \"timeout\": \"1000\"},{\"url\": \"http://localhost:8280/ep2\", > \"timeout\": \"2000\"}]" > > [4] - > [ > { > "key":"01234567-0123-0123-0123-012345678901", > "inline":{ > "id":"01234567-0123-0123-0123-012345678901", > "name":"Endpoint 1", > "*endpointConfig*":"[{\"url\": \"http://localhost:8280/ep1\", > \"timeout\": \"1000\"},{\"url\": \"http://localhost:8280/ep2\", > \"timeout\": \"2000\"}]", > "endpointSecurity":{ > "enabled":false, > "type":"basic", > "username":"basic", > "password":"basic" > }, > "maxTps":1000, > "type":"http" > }, > "type":"Production", > "endpointType":"failover" > }, > { > "key":"01234567-0123-0123-0123-012345678902", > "inline":{ > "id":"01234567-0123-0123-0123-012345678902", > "name":"Endpoint 2", > "*endpointConfig*":"[{\"url\": \"http://localhost:8280/ep1\", > \"timeout\": \"1000\"},{\"url\": \"http://localhost:8280/ep2\", > \"timeout\": \"3000\"}]", > "endpointSecurity":{ > "enabled":false, > "type":"basic", > "username":"basic", > "password":"basic" > }, > "maxTps":1000, > "type":"http" > }, > "type":"Sandbox", > "endpointType":"failover" > } > ] > > Thanks! > Rajith > > > -- > Rajith Roshan > Senior Software Engineer, WSO2 Inc. > Mobile: +94-717-064-214 > -- Rajith Roshan Senior Software Engineer, WSO2 Inc. Mobile: +94-7 <javascript:void(0);>17-064-214
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev