Making a Traffic Call

To make a traffic call:

Procedure

  1. Get the traffic endpoint by running the following command for local Kubernetes. This will print the IP. For newer versions of kubectl, such as 1.11, replace $2 with $3 in the command.
    kubectl get svc | grep "tm-svc" | awk -F' ''{print $2}'
    You can also get the IP from Kubernetes dashboard. Click on the Services tab on the left panel and search for tm-svc. Note down the corresponding Cluster IP. This is the IP you will use to make the Traffic Manager call.

  2. Go to the shell of any container other than tml-tm and do the curl call as shown below. To create API configurations, refer to Setting Service Configuration Data.
    The following is a sample call invocation against the MASTER_HOST_IP URL. Your service endpoint will be according to the configuration you create.
    curl -v -H 'Host:api.example.com' 'http://<IP_FROM_STEP_1>/v1/api/patient/1234?api_key=3bvu8u3p8k5vjxmhrs6tnd6e'
  3. The following sample curl is from AWS deployment and MOM sync mechanism was used. Ideally, the curl in step 2 and 3 should return same output.
    curl -v -H 'Host:chainsproxy.api.momtest.acme.com'  'http://a6c10dbf4ae0b11e886b6063d52d7762-1137774647.us-east-1.elb.amazonaws.com/v1/api/patient/1234/qatest/testRequestInfo.php?api_key=3bvu8u3p8k5vjxmhrs6tnd6e'