Passing Parameter to a MicroService dynamically

Hi I have a microservice running in python. I have created a http client data source in denodo for the micro service. the URL is like below request : http://localhost:5000/product/productno the last part of the URL is the parameter /productno I have a base view pointing to a list of products. I want to iterate the list of products one by one and hit the microservice for each product and get the response. Then i want to combine both the information into a derived view. How can this be achieved with denodo ? regards Shafi
user
05-12-2018 07:32:05 -0500

2 Answers

Hi, I was able to achieve your use case by using the interpolation variable in the URL in the place of the productno. I did the following steps. * In the Request url i replaced the parameter with interpolation variable like: * http://localhost:5000/product/@{productno} * Now I will provide a sample value for the productno and create the base view say bv_http_product on top of it. * Next I will create a join condition between this base view bv_http_product and the other base view say bv_product_list which contains the list of the products on the condition **bv_product_list.productno = bv_http_product.productno**. * Now when I execute the dervied view I will have the response for all the product numbers present in bv_product_list. To know more about interpolation variables refer to the section '**[Paths and Other Values with Interpolation Variables](https://community.denodo.com/docs/html/browse/6.0/vdp/administration/creating_views/importing_data_sources_and_creating_base_views/path_types_in_virtual_dataport#paths-and-other-values-with-interpolation-variables)**' of the Virtual DataPort Administration Guide. Hope this helps.
Denodo Team
06-12-2018 06:37:24 -0500
Hi Thanks for the response. I have tried this and its working fine regards Shafi
user
06-12-2018 06:55:20 -0500
You must sign in to add an answer. If you do not have an account, you can register here