In LISA i need to have different response upon a request ..help needed
What is the scenario? Most of the things can be done without coding.
Getting a response with below flows
1. Response with different http response code like 500,409,200
2. Tweaking response object little bit based on database values
What are the input/request scenarios?
Input would be something like this..http://cerl5124:8001/us/sanitycheck/v1/load/[Dynamic]/stop
here on the Dynamic i will be giving various inputs. so based on input i would like to receive below info..like..
1. passing DYNAMIC =1, get 200 response from VS
2. passing DYNAMIC =2 , get 409 conflict with a message from VS
3. passing DYNAMIC=3 , get 500 exception from VS
The challenge here is that the variable Dynamic is coming in the base URL and not as an argument. If it was an argument, the solution was straightforward.
Find the vsm and vsi attached. Deploy it and use the URLs on a web browser.
Well in that case do we need to create multiple services for every different requests?
No. 1 service with multiple operations. You deploy only the one service which I gave.
One service with a separate operation for each scenario. You always call the url: http://cerl5124:8001/us/sanitycheck/v1/load/[Dynamic]/stop like you wanted.
Thanks Jayant. Ok in that case we have different vsi for each dynamic request?
I can't view the vsm right now . So for each vsi we will have a magic script having a condition for every dynamic request?
One Vsm, one Vsi, one service. Multiple operations corresponding to each scenario as shown in the picture in my post.
Based on the URL, it looks like you are using the REST handler built for Walmart. You should be able to handle all of the requests in a single operation if you include the correct operation name (in this case, it should look something like GET /us/sanitycheck/v1/load/[Dynamic]/stop, and the correct list of arguments. It has been a very long time since I was there, so you would need to compare to an existing service to get the list of arguments correct, but it would be something like url_arg_1, url_arg_2, etc. Finally, make sure you include the REST DPH when you create the service.
Retrieving data ...