I need to achieve following things.
1. 10% Calls should respond with HTTP 404 or HTTP 500
3. One of the services should get failures (HTTP 500) for 15-20 minutes and then it should pass (200 ok) for 15-20 minutes.
I believe your question is related to Virtualize?
With respect to #1, there is a tool extension for Virtualize on Parasoft Marketplace that can accomplish this called the "Responder Randomizer:" https://marketplace.parasoft.com/#query?limit=24&offset=0&keywords=responder randomizer
It allows you to specify what percentage of the time an alternative response should be sent (and you can specify what the HTTP code should be used for the alternate response):
With respect to #2, I believe the correct approach would be to build two different virtual services: one which returns failures (HTTP 500) and one which passes (200 OK).
Point your application under test at a proxy. To start, the proxy will be forwarding traffic to the HTTP 500 virtual service. Then at the 15-20 minute mark make an API call from your test to Environment Manager (or to the Virtualize server directly) to re-point the proxy to the second virtual service.
It's always preferable to build the simplest virtual assets possible and then use proxies to change the flow of traffic in order to achieve different virtual behavior.