Making an API Traffic Call

Procedure

  1. In the Docker Swarm cluster, you can use any machine's IP to make a traffic call. In the current working terminal, you can use the master IP using the command below.

    Note that you can get the host's IP by running docker-machine ls and using any IP to make the traffic call.

    MASTER_HOST_IP=`echo $DOCKER_HOST|cut -d ':' -f 2|cut -d '/' -f 3`
  2. You can make a traffic call from your local terminal. The end point and API key in the below curl call is an example with host header api.example.com for an example domain. Your endpoint will vary according to the service configuration you create using one of the ways described in the "Service Configuration Data" section.
    curl -H 'Host:api.example.com'  'http://MASTER_HOST_IP/hw_path_01?api_key=sra663fmnshjazx5sv2mgtmw'